/* ========================================
   Mobile Enhancements - Alvas Consultores
   Optimizaciones adicionales para móviles
   ======================================== */

/* Mejoras específicas para el Hero en móviles */
@media (max-width: 768px) {
    /* Asegurar que el hero ocupe toda la pantalla correctamente */
    .hero {
        display: flex;
        align-items: center;
        justify-content: center;
        position: relative;
        padding-top: max(3rem, 6vh);
        padding-bottom: max(3rem, 6vh);
    }
    
    /* Mejorar contenedor del hero */
    .hero .container {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 100%;
        padding: 0 2rem;
    }
    
    /* Optimizar contenido del hero */
    .hero-content {
        width: 100%;
        max-width: 100%;
        padding: 0 1.5rem;
    }
    
    /* Título más legible con mejor espaciado */
    .hero-title {
        font-size: clamp(2rem, 6vw, 2.5rem);
        line-height: 1.3;
        margin-bottom: 1.75rem;
        word-wrap: break-word;
        hyphens: auto;
    }
    
    /* Subtítulo optimizado */
    .hero-subtitle {
        font-size: clamp(1rem, 3.5vw, 1.15rem);
        line-height: 1.75;
        margin-bottom: 2.5rem;
        max-width: 100%;
    }
    
    /* Botón más prominente y accesible */
    .hero .btn-primary {
        font-size: 1.05rem;
        padding: 1.125rem 2.5rem;
        box-shadow: 0 8px 20px rgba(255, 107, 53, 0.4);
        letter-spacing: 0.3px;
        font-weight: 600;
    }
    
    .hero .btn-primary:active {
        transform: translateY(-1px) scale(0.98);
    }
    
    /* Círculos decorativos más sutiles */
    .hero-decorations {
        opacity: 0.8;
    }
    
    /* Animación más suave para círculos en móviles */
    .circle {
        animation-duration: 8s;
    }
    
    /* Gradiente adicional para mejor legibilidad */
    .hero::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: radial-gradient(
            ellipse at top right,
            transparent 0%,
            rgba(30, 58, 82, 0.3) 60%
        );
        pointer-events: none;
        z-index: 0;
    }
    
    .hero .container {
        position: relative;
        z-index: 1;
    }
}

/* Optimizaciones para móviles pequeños */
@media (max-width: 480px) {
    .hero-content {
        padding: 0 1.25rem;
        text-align: left;
    }
    
    .hero-title {
        font-size: clamp(1.875rem, 5.5vw, 2.125rem);
        margin-bottom: 1.5rem;
        letter-spacing: -0.3px;
    }
    
    .hero-subtitle {
        font-size: clamp(0.975rem, 3.2vw, 1.075rem);
        margin-bottom: 2.25rem;
        max-width: 100%;
        line-height: 1.7;
    }
    
    .hero .btn-primary {
        width: 100%;
        padding: 1.25rem 1.5rem;
        font-size: 1.05rem;
        text-align: center;
        justify-content: center;
    }
    
    /* Ajustar círculos para no interferir con texto */
    .circle-1 {
        right: -120px !important;
        opacity: 0.4 !important;
    }
    
    .circle-2 {
        right: -60px !important;
        opacity: 0.35 !important;
    }
    
    .circle-3 {
        left: -40px !important;
        bottom: 10% !important;
        opacity: 0.3 !important;
    }
}

/* Móviles muy pequeños */
@media (max-width: 360px) {
    .hero {
        padding-top: 4vh;
        padding-bottom: 4vh;
    }
    
    .hero-content {
        padding: 0 0.875rem;
    }
    
    .hero-title {
        font-size: 1.625rem;
        line-height: 1.3;
        margin-bottom: 0.875rem;
    }
    
    .hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.6;
        margin-bottom: 1.5rem;
    }
    
    .hero .btn-primary {
        padding: 1rem 1.25rem;
        font-size: 0.95rem;
    }
}

/* iPhone SE y dispositivos similares */
@media (max-width: 375px) and (max-height: 670px) {
    .hero {
        min-height: 100vh;
        padding-top: 3vh;
        padding-bottom: 3vh;
    }
    
    .hero-content {
        display: flex;
        flex-direction: column;
        justify-content: center;
        min-height: calc(100vh - 120px);
    }
}

/* Landscape en móviles - Optimización especial */
@media (max-width: 900px) and (max-height: 500px) and (orientation: landscape) {
    .hero {
        min-height: 100vh;
        padding: 2rem 0;
    }
    
    .hero-content {
        min-height: auto;
        display: grid;
        grid-template-columns: 1fr;
        gap: 1rem;
        padding: 1rem;
    }
    
    .hero-title {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }
    
    .hero-subtitle {
        font-size: 0.875rem;
        margin-bottom: 0.75rem;
        line-height: 1.5;
    }
    
    .hero .btn-primary {
        padding: 0.75rem 1.5rem;
        font-size: 0.9rem;
        width: auto;
        align-self: flex-start;
    }
    
    /* Círculos casi invisibles en landscape */
    .circle {
        opacity: 0.2;
        animation: none;
    }
    
    .hero::before {
        opacity: 0.5;
    }
}

/* Mejoras de rendimiento para animaciones en móviles */
@media (max-width: 768px) {
    .circle {
        transform: translateZ(0);
        backface-visibility: hidden;
        perspective: 1000px;
    }
    
    .hero-title,
    .hero-subtitle,
    .btn-primary {
        transform: translateZ(0);
        backface-visibility: hidden;
    }
}

/* Soporte para notch de iPhone X y superiores */
@supports (padding: max(0px)) {
    @media (max-width: 768px) {
        .hero-content {
            padding-left: max(1rem, env(safe-area-inset-left));
            padding-right: max(1rem, env(safe-area-inset-right));
        }
    }
}

/* Dark mode improvements para móviles */
@media (prefers-color-scheme: dark) and (max-width: 768px) {
    .hero-title {
        text-shadow: 2px 2px 12px rgba(0, 0, 0, 0.5);
    }
    
    .hero-subtitle {
        text-shadow: 1px 1px 6px rgba(0, 0, 0, 0.5);
    }
}

/* Optimización para pantallas con alta densidad de píxeles */
@media (-webkit-min-device-pixel-ratio: 2) and (max-width: 768px),
       (min-resolution: 192dpi) and (max-width: 768px) {
    .hero-title {
        font-weight: 700;
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
    
    .hero-subtitle {
        -webkit-font-smoothing: antialiased;
        -moz-osx-font-smoothing: grayscale;
    }
}

/* Mejoras de accesibilidad táctil */
@media (hover: none) and (pointer: coarse) {
    .hero .btn-primary {
        min-height: 56px;
        min-width: 200px;
        font-size: 1.05rem;
    }
    
    /* Aumentar área táctil del botón */
    .hero .btn-primary::before {
        content: '';
        position: absolute;
        top: -10px;
        left: -10px;
        right: -10px;
        bottom: -10px;
    }
}

/* Animación de entrada suave para hero en móviles */
@media (max-width: 768px) {
    @keyframes fadeInUp {
        from {
            opacity: 0;
            transform: translateY(30px);
        }
        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
    
    .hero-title {
        animation: fadeInUp 0.6s ease-out 0.2s both;
    }
    
    .hero-subtitle {
        animation: fadeInUp 0.6s ease-out 0.4s both;
    }
    
    .hero .btn-primary {
        animation: fadeInUp 0.6s ease-out 0.6s both;
        position: relative;
    }
}

/* Prevenir problemas con teclados virtuales */
@media (max-width: 768px) {
    .hero {
        min-height: 100dvh; /* dvh = dynamic viewport height */
    }
}

/* Soporte para plegables y pantallas ultra anchas */
@media (min-width: 768px) and (max-width: 1024px) and (min-aspect-ratio: 3/2) {
    .hero-content {
        max-width: 600px;
        margin: 0 auto;
    }
    
    .hero-title {
        font-size: 2.75rem;
    }
    
    .hero-subtitle {
        font-size: 1.2rem;
    }
}