/* ============================================
   HERBEPLAST — MOBILE / iPhone
   mobile.css (Archivo 2 de 3)
   Este archivo contiene ÚNICAMENTE quiebres móviles.
   - Base/desktop vive en styles.css
   - Tablet vive en tablet.css

   Qué corregí vs tu versión:
   1) Eliminé @media anidado (tenías @media (max-width: 360px) dentro de @media (max-width: 767px)).
      -> En CSS plano eso no es válido; puede ignorarse y causar inconsistencias.
   2) Scope de CERTIFICACIONES:
      -> uso #certificaciones delante de todo para evitar que afecte otras secciones.
   3) Mantengo tus decisiones de layout, solo ordeno y corrijo lo estructural.

   Nota:
   - NO agrego estilos “generales” fuera de @media (como pediste).
   ============================================ */


/* ============================================
   MOBILE (max 767px)
   - Ajustes de hero/video, navegación, secciones y carrusel.
   - Certificaciones: 2 columnas (6 items => 2x3)
   ============================================ */

@media (max-width: 767px) {
    :root {
        /* Altura disponible en móvil descontando el header (72px) */
        --vh-available: calc(100dvh - 72px);
    }

    /* ===== HERO (≈70% del alto disponible) ===== */
    section#hero.hero {
        height: calc(var(--vh-available) * 0.7);
        min-height: 0;      /* anula mínimos previos */
        max-height: 420px;
        padding-bottom: 0;  /* evita sumar altura extra en iOS */
    }

    section#hero.hero .hero-content {
        padding-top: 24px;
        padding-bottom: 24px;
    }

    .hero-title {
        font-size: 26px;
        line-height: 1.2;
        text-align: center;
        margin-left: auto;
        margin-right: auto;
        max-width: 360px;
    }

    .hero-subtitle {
        font-size: 15px;
        line-height: 1.5;
        text-align: center;
        max-width: 360px;
        margin-left: auto;
        margin-right: auto;
    }

    .hero-cta { justify-content: center; }
    .hero-scroll-indicator { bottom: 16px; }

    .hero-overlay {
        background: linear-gradient(
                to bottom,
                rgba(0, 130, 194, 0.9) 0%,
                rgba(0, 130, 194, 0.7) 40%,
                rgba(0, 130, 194, 0.4) 70%,
                rgba(0, 155, 168, 0.3) 100%
        );
    }

    .hero-aurora {
        opacity: 0.25 !important;
        filter: blur(60px);
        animation-duration: 20s;
    }

    /* ===== VIDEO (≈30% del alto disponible) ===== */
    .video-section {
        height: calc(var(--vh-available) * 0.3);
        min-height: 0;
        background: var(--color-black);
        overflow: hidden;
    }

    .video-container {
        width: 100%;
        height: 100%;
        aspect-ratio: auto; /* anula el aspect-ratio global si existiera */
    }

    .institutional-video {
        width: 100%;
        height: 100%;
        object-fit: cover;
        background: var(--color-black);
    }

    .video-gradient-overlay { display: block; }

    /* ===== HEADER Y NAV EN MÓVIL ===== */
    .header { height: 64px; }
    .header-content { height: 64px; }
    .header-logo img { height: 40px; }

    .header-nav { display: none; }
    .header-cta { display: none; }
    .menu-toggle { display: flex; }

    /* ===== SECCIONES GENERALES ===== */
    .sectores-section,
    .valor-section,
    .trust-section,
    .cta-final-section {
        padding: 48px 0;
    }

    .section-title {
        font-size: 22px;
        text-align: center;
    }

    .section-subtitle {
        font-size: 15px;
        text-align: center;
    }

    /* ===== CARRUSEL EN MÓVIL ===== */
    .carousel-wrapper { padding: 0 16px; }
    .carousel-track { gap: 16px; }

    .carousel-card {
        flex: 0 0 88%;
        max-width: 88%;
    }

    .carousel-control { display: none; }

    .carousel-dots {
        margin-top: 24px;
        gap: 8px;
    }

    .carousel-dot { width: 6px; height: 6px; }
    .carousel-dot.active { width: 24px; }

    .card-image-wrapper { aspect-ratio: 16 / 10; }

    .card-content { padding: 16px 16px 20px; }

    .card-title {
        font-size: 18px;
        margin-bottom: 8px;
    }

    .card-subtitle {
        font-size: 14px;
        margin-bottom: 12px;
    }

    .card-bullets { margin-bottom: 12px; }
    .card-bullets li { font-size: 13px; }

    .card-cta { font-size: 13px; }

    /* ===== VALOR SECTION EN MÓVIL ===== */
    .valor-grid { gap: 24px; }
    .valor-paragraph { font-size: 15px; }

    .valor-list {
        padding-left: 20px;
        margin-bottom: 20px;
    }

    .valor-list li {
        font-size: 14px;
        margin-bottom: 8px;
    }

    /* ===== CERTIFICACIONES EN MÓVIL =====
       - 2 columnas x 3 filas
       - Sin scroll
       - Selectores scopeados a #certificaciones para evitar efectos colaterales
    */
    #certificaciones .certifications-scroll-wrapper {
        overflow: visible;
        padding-bottom: 0;
    }

    #certificaciones .certifications-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: var(--space-4);
    }

    #certificaciones .certification-item { padding: 16px 12px; }

    #certificaciones .cert-icon { height: 150px; }
    #certificaciones .cert-description { min-height: 0; }

    #certificaciones .cert-icon img {
        max-width: 110px;
        max-height: 170px;
    }

    #certificaciones .cert-title {
        font-size: 13px;
        min-height: 34px;
    }

    #certificaciones .cert-description {
        font-size: 12px;
        min-height: 30px;
    }

    #certificaciones .scroll-indicator { display: none; }

    /* ===== CLIENTES (si activas ese bloque) ===== */
    .clients-logos {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
        margin-bottom: 20px;
    }

    .client-logo {
        padding: 10px;
        min-height: 60px;
    }

    .client-logo img {
        max-width: 80px;
        max-height: 40px;
    }

    /* ===== CTA FINAL EN MÓVIL ===== */
    .cta-final-title { font-size: 22px; }
    .cta-final-subtitle { font-size: 15px; }
    .cta-final-note { font-size: 14px; }

    /* ===== FOOTER EN MÓVIL ===== */
    .footer { padding: 40px 0 24px; }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 24px;
    }

    .footer-title { margin-top: 15px; }
    .footer-bottom { padding-top: 20px; }

    /* ===== WHATSAPP FLOTANTE EN MÓVIL ===== */
    .whatsapp-float {
        width: 52px;
        height: 52px;
        bottom: 16px;
        right: 16px;
    }

    .whatsapp-tooltip { display: none; }

    /* Nota: hover en mobile no siempre aplica, pero no rompe (y a veces aplica con mouse). */
    .carousel-card:hover .card-image { transform: scale(1.03); }

    /* Mobile: siempre color */
    #certificaciones .cert-icon img {
        filter: none !important;
    }

    /* ============================================
   FOOTER — Separadores en MOBILE
   ============================================ */



        /* Espacio visual entre columnas */
        .footer-col {
            position: relative;
            padding-bottom: var(--space-1);
            margin-bottom: var(--space-1);
        }

        /* Línea separadora */
        .footer-col::after {
            content: '';
            display: block;
            width: 40px;              /* 👈 corta */
            height: 2px;              /* 👈 delgada */
            background: rgba(255, 255, 255, 0.5);
            margin-top: var(--space-4);
        }

        /* Quitar separador del último bloque (Legal) */
        .footer-col:last-child::after {
            display: none;
        }

        ul li{
            font-size: 15px !important;
            line-height: 14px !important;
        }

    /* Page Header: permitir que crezca (título + imagen abajo) */
    .page-header{
        height: auto;
        min-height: 0;
        padding: 22px 0 0;
        display: flex;
        flex-direction: column;
        align-items: stretch; /* importante en columna */
    }

    /* Reorden: contenido arriba */
    .page-header .container{ order: 1; }

    /* Decoraciones (opcional: debajo del contenido) */
    .page-header-lines{ order: 2; }

    /* Imagen al final (abajo del hero) */
    .page-header-image{
        order: 3;

        position: relative;   /* mata el absolute de nosotros.css */
        top: auto;
        right: auto;

        width: 100%;
        height: auto;
        overflow: visible;

        display: block;       /* mata el flex-end */
        margin-top: 14px;
        z-index: 4;           /* por encima del aurora si lo necesitas */
    }

    /* Imagen completa (sin recorte) */
    .page-header-image img{
        width: 100%;
        max-width: 100%;
        height: auto;         /* clave: completa */
        object-fit: initial;  /* no recorta */

        margin-right: 0;
        border-radius: 14px;

        /* mata el efecto empotrado en mobile */
        box-shadow: 0 10px 26px rgba(0,0,0,.18);
        border-left: 0;
        border-right: 0;
    }

    /* Opcional: que el aurora NO ensucie la foto */
    .page-header-aurora,
    .page-header-particles{
        z-index: 2;
    }

}


/* ============================================
   MOBILE EXTRA SMALL (max 360px)
   - Antes estaba anidado (error).
   - Aquí se aplica correctamente.
   - Certificaciones: 1 columna para evitar aplastar tarjetas
   ============================================ */
@media (max-width: 360px) {
    #certificaciones .certifications-grid {
        grid-template-columns: 1fr;
    }

}

@media (min-width: 361px) and (max-width: 479px) {

    #certificaciones .certifications-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: var(--space-4);
    }

}

/* (Comentario histórico)
   Antes tenías un bloque sugerido para 420px/9:16.
   Lo mantengo comentado por si lo necesitas luego.

@media (max-width: 420px) {
  .video-container { aspect-ratio: 9 / 16; }
}
*/
