/* =======================================================
   MENÚ HAMBURGUESA Y HEADER MÓVIL (TIPO ONES ASESORES)
   ======================================================= */

/* Ocultar botón por defecto en escritorio */
.menu-toggle {
    display: none !important;
}

@media (max-width: 992px) {
    /* 1. Header: Diseño flexible */
    .layout-header {
        height: 75px !important;
        top: 30px !important;
    }

    body {
        padding-top: 105px !important;
    }

    .layout-header-container {
        display: flex !important;
        flex-direction: row !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 0 15px !important;
        width: 100% !important;
    }

    /* 2. Ajuste Logo */
    .layout-logo img {
        max-height: 42px !important;
        width: auto !important;
    }

    /* 3. Botón Hamburguesa visible */
    .menu-toggle {
        display: flex !important;
        align-items: center;
        justify-content: center;
        background-color: transparent;
        color: #ffffff;
        border: 2px solid rgba(255, 255, 255, 0.4);
        border-radius: 6px;
        width: 40px;
        height: 40px;
        font-size: 1.3rem;
        cursor: pointer;
    }

    /* 4. Menú Desplegable (Capa oscura) */
    .layout-nav {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100% !important;
        background-color: #1a1a1a !important;
        max-height: 0;
        overflow: hidden;
        transition: max-height 0.4s ease-in-out;
        box-shadow: 0 15px 25px rgba(0,0,0,0.5);
    }

    .layout-nav.active {
        max-height: 450px !important;
    }

    /* 5. Enlaces en lista vertical alineados a la izquierda */
    .layout-nav ul {
        display: flex !important;
        flex-direction: column !important;
        align-items: flex-start !important;
        padding: 15px 25px 25px 25px !important;
        gap: 0 !important;
        width: 100% !important;
    }

    .layout-nav li {
        width: 100% !important;
    }

    .layout-nav a {
        display: block !important;
        font-size: 1.1rem !important;
        font-weight: 500 !important;
        padding: 14px 0 !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.08);
        text-align: left !important;
        color: #f1f5f9 !important;
    }

    /* 6. Barra superior */
    .layout-topbar { height: 30px !important; }
    .layout-topbar-container { justify-content: center !important; }
    .topbar-info { font-size: 0.75rem !important; gap: 10px !important; }
}

/* =======================================================
   AJUSTES PARA CONTENIDO MÓVIL (Tipografía, Textos y Carruseles)
   ======================================================= */
@media (max-width: 768px) {
    /* 1. Tablas responsivas */
    .admin-table-wrapper, 
    .gestion-table-responsive {
        width: 100% !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .dashboard-stats-grid, 
    .corp-about-grid, 
    .form-row-grid, 
    .corp-pillars-row {
        grid-template-columns: 1fr !important;
        gap: 20px !important;
    }

    /* 2. Reducción de títulos principales y subtítulos en teléfonos */
    h1 {
        font-size: 1.6rem !important;
    }

    h2, 
    .servicios-title, 
    .nosotros-valores-title, 
    .home-why-title, 
    .home-video-title, 
    .home-services-main-title, 
    .home-recursos-main-title, 
    .home-aliados-main-title,
    .contacto-title {
        font-size: 1.5rem !important;
        line-height: 1.3 !important;
    }

    .servicios-hero h1,
    .nosotros-hero h1,
    .home-hero-content h1,
    .contacto-hero h1,
    .recursos-hero h1,
    .blog-hero h1 {
        font-size: 1.7rem !important;
        line-height: 1.15 !important;
        margin-bottom: 10px !important;
    }

    /* 3. Corrección de textos en móviles */
    p, 
    .home-why-lead, 
    .home-video-desc, 
    .home-recursos-lead, 
    .home-contacto-desc, 
    .nosotros-intro-lead,
    .nosotros-mvv-text p,
    .nosotros-valor-content p,
    .servicio-desc {
        text-align: left !important; 
        font-size: 0.95rem !important; 
        line-height: 1.5 !important;
        letter-spacing: normal !important;
        word-spacing: normal !important;
    }

    .home-hero-content p {
        font-size: 0.95rem !important;
        margin-bottom: 15px !important;
    }

    /* 4. Carruseles fijos en el mismo lugar (Sin empujar contenido hacia abajo) */
    .home-hero-section,
    .servicios-hero,
    .nosotros-hero,
    .contacto-hero, 
    .hero-section,
    .recursos-hero, 
    .blog-hero {
        height: 380px !important; /* Altura fija controlada para celulares */
        min-height: unset !important;
        max-height: unset !important;
        position: relative !important;
        overflow: hidden !important;
    }

    .home-hero-carousel,
    .servicios-hero-carousel,
    .nosotros-hero-carousel,
    .contacto-hero-carousel {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    .home-hero-overlay,
    .servicios-hero-overlay,
    .nosotros-hero-overlay,
    .contacto-hero-overlay,
    .hero-overlay {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        padding: 20px 15px !important;
        display: flex !important;
        align-items: center !important;
        z-index: 2 !important;
    }

    .home-hero-slide,
    .servicios-hero-slide,
    .nosotros-hero-slide,
    .contacto-hero-slide,
    .hero-slide,
    .recursos-hero-slide,
    .blog-hero-slide {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        background-size: cover !important;
        background-position: center center !important;
        background-repeat: no-repeat !important;
        z-index: 1 !important;
    }

    .home-hero-content,
    .servicios-hero-content,
    .nosotros-hero-content,
    .contacto-hero-content,
    .recursos-hero-content,
    .blog-hero-content {
        padding: 0 !important;
        width: 100% !important;
        z-index: 3 !important;
    }

    .home-hero-badge {
        margin-bottom: 6px !important;
        font-size: 0.8rem !important;
    }

    .home-hero-btn-carousel {
        padding: 8px 20px !important;
        font-size: 0.9rem !important;
    }
}

/* =======================================================
   CORRECCIÓN DE DESBORDAMIENTO HORIZONTAL Y ESPACIO BLANCO
   ======================================================= */
@media (max-width: 992px) {
    html, body {
        width: 100% !important;
        max-width: 100% !important;
        overflow-x: hidden !important;
    }

    .layout-header,
    .layout-topbar {
        width: 100% !important;
        max-width: 100% !important;
        left: 0 !important;
        right: 0 !important;
    }

    .layout-header-container,
    .layout-topbar-container {
        width: 100% !important;
        max-width: 100% !important;
        padding-left: 15px !important;
        padding-right: 15px !important;
        margin: 0 !important;
    }
}