/**
 * Responsive global — compacto, elegante, todos los dispositivos.
 * Cargar después de style.css.
 */

html {
    overflow-x: clip;
    -webkit-text-size-adjust: 100%;
}

body {
    overflow-x: clip;
    max-width: 100%;
}

img, video, iframe {
    max-width: 100%;
}

.main-content,
.hero-elegante,
.hero-elegante .container,
section.container {
    max-width: 100%;
}

.hero-elegante-grid,
.hero-elegante-grid > *,
.hero-elegante-content,
.hero-elegante-visual,
.calculadora-elegante,
.video-institucional-container,
.app-aula-hero-card {
    min-width: 0;
    max-width: 100%;
    box-sizing: border-box;
}

/* Espacio inferior para barra conversión + flotantes */
@media (max-width: 768px) {
    body:not(.modal-open):not(.nav-open) {
        padding-bottom: calc(3.75rem + env(safe-area-inset-bottom, 0px));
    }

    .formulario-matricula-dinamica,
    .mp-section,
    .contacto-modern--v2,
    .comparacion-rapida,
    .programas-educativos {
        scroll-padding-bottom: calc(4rem + env(safe-area-inset-bottom, 0px));
    }
}

/* Ocultar flotantes con modal abierto */
body.modal-open .chatbot-container,
body.modal-open .back-to-top,
body.modal-open .guia-video-pip,
body.modal-open .conversion-bar {
    opacity: 0 !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ── Secciones más compactas ── */
@media (max-width: 768px) {
    section[class],
    .por-que-ceba,
    .comparacion-ebr-ceba,
    .programas-educativos,
    .comparacion-rapida,
    .test-modalidad {
        padding-top: 2rem !important;
        padding-bottom: 2rem !important;
    }

    .section-title,
    .section-header-center h2 {
        font-size: clamp(1.15rem, 4vw, 1.45rem) !important;
        line-height: 1.25 !important;
        margin-bottom: 0.65rem !important;
    }

    .section-subtitle {
        font-size: 0.85rem !important;
    }
}

/* ── Tablet ── */
@media (max-width: 1024px) {
    .hero-elegante-grid {
        grid-template-columns: 1fr !important;
        gap: 1.25rem !important;
    }

    .hero-elegante-content,
    .hero-elegante-visual {
        width: 100%;
    }

    /* Programas: 2 columnas en tablet */
    .programas-grid-mejorado {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 1.15rem !important;
    }

    .programa-logo-oficial {
        height: 110px !important;
        padding: 1rem !important;
    }

    .programa-content {
        padding: 1.15rem !important;
    }

    .programa-content h4 {
        font-size: 1.05rem !important;
        margin-bottom: 0.5rem !important;
    }

    .programa-descripcion {
        font-size: 0.82rem !important;
        line-height: 1.45 !important;
        margin-bottom: 0.75rem !important;
    }

    .beneficio-tag {
        font-size: 0.72rem !important;
        padding: 0.28rem 0.55rem !important;
    }
}

/* ── Móvil ── */
@media (max-width: 768px) {
    .container {
        padding-left: 0.9rem;
        padding-right: 0.9rem;
    }

    .hero-top { margin-bottom: 1rem; }

    .hero-lider-beneficios,
    .ceba-lider-beneficios {
        margin-bottom: 0.75rem;
        gap: 0.3rem 0.6rem;
    }

    .hero-lider-beneficios li,
    .ceba-lider-beneficios li {
        font-size: 0.76rem;
    }

    /* Calculadora */
    .calculadora-elegante {
        padding: 0.85rem !important;
        border-radius: 12px;
    }

    .calc-elegante-header {
        font-size: 0.88rem;
        margin-bottom: 0.65rem;
    }

    .calc-elegante-opciones {
        grid-template-columns: 1fr !important;
        gap: 0.5rem;
    }

    .opcion-edad {
        padding: 0.7rem;
        flex-direction: row;
        text-align: left;
        gap: 0.55rem;
    }

    .opcion-icon {
        width: 36px;
        height: 36px;
        font-size: 1rem;
        flex-shrink: 0;
        border-radius: 8px;
    }

    .opcion-label { font-size: 0.8rem; }
    .opcion-tiempo { font-size: 0.74rem; }
    .opcion-check { display: none; }

    .calc-elegante-resultado {
        padding: 0.65rem;
        font-size: 0.8rem;
    }

    .resultado-texto {
        font-size: 0.8rem;
        word-break: break-word;
        line-height: 1.35;
    }

    /* Video institucional */
    .video-wrapper {
        min-height: 0 !important;
        border-radius: 10px;
    }

    .video-institucional-container { margin-bottom: 0.6rem; }

    .video-controls-external {
        flex-wrap: wrap;
        justify-content: center;
        gap: 0.35rem;
        padding: 0.45rem;
        margin-top: 0.5rem;
    }

    .video-play-pause-btn {
        width: 38px !important;
        height: 38px !important;
    }

    .video-nav-btn,
    .video-fullscreen-btn {
        width: 32px !important;
        height: 32px !important;
    }

    .video-indicators {
        flex: 1 1 100%;
        display: flex;
        justify-content: center;
        gap: 0.3rem;
        order: 5;
        margin-top: 0.2rem;
    }

    /* Botones hero */
    .hero-bottom-actions {
        flex-direction: column;
        width: 100%;
        margin-top: 0.65rem;
        gap: 0.45rem;
    }

    .hero-bottom-actions .btn-elegante-primary,
    .hero-bottom-actions .btn-elegante-secondary {
        width: 100% !important;
        padding: 0.72rem 0.9rem !important;
        font-size: 0.85rem !important;
        justify-content: center;
    }

    /* App aula card */
    .app-aula-hero-card {
        grid-template-columns: 1fr !important;
        padding: 1rem 0.85rem !important;
        margin: 0.85rem 0 1rem !important;
        border-radius: 12px;
        gap: 0.65rem;
        text-align: center;
    }

    .app-aula-hero-card h2 { font-size: 1.05rem !important; }
    .app-aula-hero-card p { font-size: 0.82rem; }

    .app-aula-phone-mock {
        width: 72px;
        height: 108px;
        border-radius: 14px;
    }

    .app-aula-hero-card__actions {
        flex-direction: column;
        width: 100%;
    }

    .app-aula-hero-card__actions .app-aula-btn {
        width: 100%;
        justify-content: center;
        padding: 0.52rem 0.65rem;
        font-size: 0.8rem;
    }

    /* Programas — 1 columna móvil */
    .programas-grid-mejorado {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
        margin-bottom: 1.5rem !important;
    }

    .programa-card-mejorado {
        border-radius: 14px !important;
    }

    .programa-logo-oficial {
        height: 90px !important;
        padding: 0.75rem !important;
    }

    .logo-svg { width: 72px !important; height: 72px !important; }
    .logo-img { max-width: 90px !important; max-height: 90px !important; }

    .programa-content { padding: 1rem !important; }

    .programa-content h4 {
        font-size: 0.98rem !important;
        margin-bottom: 0.4rem !important;
    }

    .programa-descripcion {
        font-size: 0.78rem !important;
        margin-bottom: 0.65rem !important;
    }

    .btn-programa-mejorado {
        padding: 0.6rem 0.85rem !important;
        font-size: 0.82rem !important;
    }

    /* Galería — filtros scroll horizontal */
    .galeria-filters {
        padding: 0.75rem 0 !important;
    }

    .filter-buttons {
        flex-wrap: nowrap !important;
        justify-content: flex-start !important;
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        gap: 0.45rem !important;
        padding: 0 0.25rem 0.35rem !important;
        scrollbar-width: none;
    }

    .filter-buttons::-webkit-scrollbar { display: none; }

    .filter-btn {
        flex-shrink: 0 !important;
        padding: 0.48rem 0.85rem !important;
        font-size: 0.78rem !important;
        white-space: nowrap;
    }

    .galeria-grid {
        grid-template-columns: 1fr !important;
        gap: 0.85rem !important;
    }

    .galeria-content { padding: 1.5rem 0 !important; }

    /* Tabla comparación modalidades */
    .tabla-responsive {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
        margin: 0 -0.25rem;
        padding-bottom: 0.35rem;
        border-radius: 10px;
    }

    .tabla-comparacion {
        min-width: 580px;
        font-size: 0.78rem !important;
    }

    .tabla-comparacion th,
    .tabla-comparacion td {
        padding: 0.5rem 0.55rem !important;
    }

    .tabla-comparacion-wrapper {
        overflow-x: auto !important;
        -webkit-overflow-scrolling: touch;
    }

    .tabla-comparacion-mejorada {
        min-width: 560px !important;
        font-size: 0.78rem !important;
    }

    /* Footer compacto */
    .footer-body {
        padding: 1.5rem 0 1rem !important;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr !important;
        gap: 1.15rem !important;
    }

    .footer-subtitle-mt {
        margin-top: 0.85rem !important;
    }

    .footer-subtitle {
        margin-bottom: 0.45rem !important;
        padding-bottom: 0.3rem !important;
    }

    .footer-links { gap: 0.25rem !important; }

    .footer-links a {
        font-size: 0.78rem !important;
    }

    .footer-contact li {
        font-size: 0.78rem !important;
        gap: 0.45rem !important;
    }

    .footer-map {
        margin-top: 0.5rem !important;
    }

    .footer-map iframe {
        height: 130px !important;
    }

    .footer-cta-banner {
        padding: 1.25rem 0 !important;
    }

    .footer-cta-content {
        flex-direction: column !important;
        text-align: center;
        gap: 0.75rem !important;
    }

    .footer-cta-title {
        font-size: 1.15rem !important;
    }

    .footer-cta-desc {
        font-size: 0.82rem !important;
    }

    .footer-cta-actions {
        flex-direction: column !important;
        width: 100%;
        gap: 0.45rem !important;
    }

    .btn-footer-primary,
    .btn-footer-whatsapp {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.65rem 1rem !important;
        font-size: 0.85rem !important;
    }

    /* Banner matrícula */
    .mat-banner { padding: 0.4rem 0; }

    .mat-banner__titulo { font-size: 0.72rem; }
    .mat-banner__inicio-fecha { font-size: 0.88rem; }
    .mat-banner__extra { font-size: 0.62rem; }
    .mat-banner__btn { font-size: 0.66rem; padding: 0.32rem 0.6rem; }

    .alert-banner { padding: 0.4rem 0; }

    .alert-banner .container {
        font-size: 0.72rem;
        gap: 0.3rem;
    }

    .alert-text { font-size: 0.72rem; line-height: 1.3; }
    .alert-link { font-size: 0.72rem; }

    /* Flotantes */
    .back-to-top {
        bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px)) !important;
        right: 0.65rem !important;
        width: 38px !important;
        height: 38px !important;
        font-size: 0.9rem !important;
        z-index: 9991 !important;
    }

    .chatbot-container {
        bottom: calc(4.25rem + env(safe-area-inset-bottom, 0px)) !important;
        right: 0.65rem !important;
    }

    .chatbot-toggle {
        width: 44px !important;
        height: 44px !important;
        font-size: 1rem !important;
    }

    .guia-video-pip {
        bottom: calc(4rem + env(safe-area-inset-bottom, 0px)) !important;
        left: 0.4rem !important;
        width: min(96px, 26vw) !important;
    }

    /* Nav móvil */
    body.nav-open .header { z-index: 10040; }

    .navbar .nav-menu.active {
        background: #fff !important;
        pointer-events: auto !important;
        z-index: 10045 !important;
    }

    .nav-backdrop.is-visible { z-index: 10030; }
    .menu-toggle { display: flex !important; }

    .top-bar { padding: 0.3rem 0; }
    .top-bar-content { gap: 0.35rem; }

    /* Modales */
    .modal-overlay-comparacion {
        align-items: flex-end !important;
        padding: 0 !important;
    }

    #modalMatricula.modal-overlay {
        align-items: center !important;
        padding: 0.6rem !important;
    }

    .modal-container-comparacion {
        width: 100% !important;
        max-width: 100% !important;
        max-height: 92vh !important;
        border-radius: 14px 14px 0 0 !important;
        margin: 0 !important;
    }

    .modal-overlay-comparacion.active .modal-container-comparacion {
        transform: none !important;
    }

    #modalMatricula .modal-container.modal-matricula {
        max-width: min(400px, 100%) !important;
        border-radius: 14px !important;
        max-height: 90vh !important;
        overflow-y: auto !important;
        overflow-x: hidden !important;
        padding: 0 0.9rem 0.9rem !important;
    }

    .modal-matricula__banner {
        margin: 0 -0.9rem 0.7rem !important;
        padding: 2.1rem 0.75rem 0.85rem !important;
    }

    .modal-matricula__headline { font-size: 0.95rem !important; }
    .modal-matricula__brand { font-size: 0.68rem !important; }
    .modal-matricula__minedu { font-size: 0.62rem !important; padding: 0.3rem 0.6rem !important; }

    .modal-matricula__hero {
        margin-bottom: 0.6rem !important;
        gap: 0.55rem !important;
        padding-right: 1.5rem !important;
    }

    .modal-matricula__icon {
        width: 36px !important;
        height: 36px !important;
        font-size: 0.95rem !important;
        border-radius: 10px !important;
    }

    .modal-matricula__title { font-size: 0.92rem !important; }
    .modal-matricula__subtitle { font-size: 0.7rem !important; }

    .modal-matricula__promo {
        padding: 0.4rem 0.55rem !important;
        margin-bottom: 0.6rem !important;
    }

    .modal-matricula__fecha { font-size: 0.76rem !important; }
    .modal-matricula__promo-note { font-size: 0.68rem !important; }

    .modal-matricula__label {
        font-size: 0.68rem !important;
        margin-bottom: 0.35rem !important;
    }

    .modal-matricula__opt {
        padding: 0.5rem 0.6rem !important;
        border-radius: 8px !important;
    }

    .modal-matricula__opt-text strong { font-size: 0.78rem !important; }
    .modal-matricula__opt-text small { font-size: 0.66rem !important; }

    .modal-matricula__chips {
        gap: 0.3rem !important;
        margin-bottom: 0.55rem !important;
    }

    .modal-matricula__chips span {
        font-size: 0.62rem !important;
        padding: 0.18rem 0.4rem !important;
    }

    .modal-matricula__actions {
        grid-template-columns: 1fr 1fr !important;
        gap: 0.35rem !important;
    }

    .modal-matricula__wa {
        font-size: 0.7rem !important;
        padding: 0.42rem 0.35rem !important;
    }

    .modal-matricula__info {
        font-size: 0.72rem !important;
        padding: 0.42rem 0.55rem !important;
    }

    .modal-header-comparacion {
        padding: 0.85rem 0.85rem 0.7rem !important;
        flex-shrink: 0;
    }

    .header-oficial {
        flex-direction: column !important;
        text-align: center;
        gap: 0.4rem !important;
    }

    .titulo-oficial h2 {
        font-size: 0.95rem !important;
        line-height: 1.2 !important;
    }

    .titulo-oficial p { font-size: 0.68rem !important; }

    .logo-minedu-grande {
        height: 32px !important;
        max-height: 32px !important;
    }

    .modal-close-comparacion {
        top: 0.4rem !important;
        right: 0.4rem !important;
        width: 32px !important;
        height: 32px !important;
    }

    .modal-body-comparacion {
        padding: 0.75rem !important;
        max-height: none !important;
    }

    .modal-footer-comparacion {
        flex-direction: column !important;
        padding: 0.75rem 0.85rem calc(0.75rem + env(safe-area-inset-bottom, 0px)) !important;
        gap: 0.5rem !important;
        position: sticky;
        bottom: 0;
        z-index: 2;
        box-shadow: 0 -3px 12px rgba(0, 0, 0, 0.06);
    }

    .btn-cerrar-modal,
    .btn-matricular-modal {
        width: 100% !important;
        justify-content: center !important;
        padding: 0.75rem 0.9rem !important;
        font-size: 0.85rem !important;
    }

    .beneficios-grid-modal {
        grid-template-columns: 1fr !important;
        gap: 0.6rem !important;
    }

    .beneficio-modal-card { padding: 0.75rem !important; }

    .modal-conclusion {
        padding: 0.85rem !important;
        flex-direction: column !important;
        text-align: center;
    }

    /* Video modal */
    .video-modal-content {
        width: 94% !important;
        max-width: 100% !important;
    }

    .video-modal-close {
        top: auto !important;
        bottom: calc(100% + 0.4rem) !important;
        right: 0 !important;
        width: 34px !important;
        height: 34px !important;
    }

    .galeria-modal .modal-image-container {
        max-height: 68vh !important;
    }

    /* Tablas genéricas */
    .table-responsive,
    table {
        max-width: 100%;
    }

    .card, .info-card, .feature-card, .benefit-card {
        min-width: 0;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .container {
        padding-left: 0.8rem !important;
        padding-right: 0.8rem !important;
    }

    .hero-elegante-title { font-size: 1.2rem !important; }
    .hero-elegante-description { font-size: 0.8rem !important; }

    .modal-matricula__actions {
        grid-template-columns: 1fr !important;
    }

    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 1rem !important;
    }

    .footer-map iframe {
        height: 150px !important;
    }

    .eq-cell {
        padding: 0.55rem 0.4rem !important;
        font-size: 0.72rem !important;
    }

    .header-col h3 { font-size: 0.85rem !important; }
    .header-col p { font-size: 0.6rem !important; }

    .titulo-seccion { font-size: 0.9rem !important; }

    .modal-container-comparacion {
        max-height: 94vh !important;
    }

    .tabla-comparacion {
        min-width: 520px;
        font-size: 0.72rem !important;
    }
}

@media (max-width: 360px) {
    .hero-elegante-title { font-size: 1.1rem !important; }

    .menu-toggle {
        width: 30px !important;
        height: 30px !important;
    }

    .logo-ceba { height: 28px !important; }

    .titulo-oficial h2 { font-size: 0.88rem !important; }

    .guia-video-pip {
        width: min(88px, 24vw) !important;
    }
}

/* ═══════════════════════════════════════════════════════════
   UNIVERSAL — todos los dispositivos (móvil, tablet, desktop)
   ═══════════════════════════════════════════════════════════ */

*,
*::before,
*::after {
    box-sizing: border-box;
}

button,
a,
input,
select,
textarea,
[role="button"] {
    touch-action: manipulation;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-shrink: 0;
    margin-left: auto;
}

.header-aula-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.42rem 0.85rem;
    border-radius: 999px;
    background: linear-gradient(135deg, #0047ab 0%, #003380 100%);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    box-shadow: 0 3px 10px rgba(0, 71, 171, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.12);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    min-height: 36px;
}

.header-ingresar-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.42rem 0.8rem;
    border-radius: 999px;
    background: #fff;
    color: #0047ab;
    font-size: 0.78rem;
    font-weight: 700;
    text-decoration: none;
    white-space: nowrap;
    border: 1.5px solid #bfdbfe;
    box-shadow: 0 2px 8px rgba(0, 71, 171, 0.08);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
    min-height: 36px;
}

.header-search-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    padding: 0.42rem 0.75rem;
    border-radius: 999px;
    background: #f8fafc;
    color: #0047ab;
    font-size: 0.78rem;
    font-weight: 700;
    white-space: nowrap;
    border: 1.5px solid #cbd5e1;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.06);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, border-color 0.2s ease;
    min-height: 36px;
    line-height: 1;
}

.header-search-btn:hover,
.header-search-btn:focus-visible {
    background: #eff6ff;
    border-color: #93c5fd;
    box-shadow: 0 4px 12px rgba(0, 71, 171, 0.12);
    transform: translateY(-1px);
    outline: none;
}

.header-search-btn i {
    font-size: 0.85rem;
}

.header-ingresar-btn:hover,
.header-ingresar-btn.active {
    color: #003380;
    background: #eff6ff;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 71, 171, 0.14);
}

.header-ingresar-btn.active {
    outline: 2px solid rgba(0, 71, 171, 0.25);
    outline-offset: 1px;
}

.header-ingresar-btn i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.header-aula-btn i {
    font-size: 0.85rem;
    flex-shrink: 0;
}

.header-aula-btn:hover,
.header-aula-btn.active {
    color: #fff;
    transform: translateY(-1px);
    box-shadow: 0 5px 14px rgba(0, 71, 171, 0.3);
}

.header-aula-btn.active {
    background: linear-gradient(135deg, #003380 0%, #002966 100%);
    outline: 2px solid rgba(0, 71, 171, 0.35);
    outline-offset: 1px;
}

.menu-toggle {
    display: none;
}

.nav-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
}

.logo-section {
    flex-shrink: 0;
}

.nav-menu {
    flex: 1 1 auto;
    min-width: 0;
}

/* Accesos rápidos — eliminados del header (menú lateral en móvil/tablet) */
.nav-quick-links {
    display: none !important;
}

/* Tablet + móvil: menú lateral hasta 991px (hamburguesa solo en móvil/tablet pequeña) */
@media (max-width: 991px) {
    body:not(.modal-open):not(.nav-open) {
        padding-bottom: calc(3.5rem + env(safe-area-inset-bottom, 0px));
    }

    .header-actions {
        order: 2;
        margin-left: auto;
    }

    .nav-menu {
        order: 3;
    }

    .logo-section {
        order: 1;
        flex: 1 1 auto;
        min-width: 0;
        max-width: calc(100% - 168px);
    }

    .menu-toggle {
        display: flex !important;
        flex-shrink: 0;
    }

    .nav-backdrop {
        display: block;
    }

    body.nav-open .header {
        position: relative;
        z-index: 10040;
    }

    .navbar .nav-menu {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        right: auto !important;
        bottom: 0 !important;
        width: min(280px, 86vw) !important;
        max-width: 280px !important;
        z-index: 10045 !important;
        background: #fff !important;
        padding: 0 0 0.75rem !important;
        overflow-x: hidden !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch;
        transform: translateX(-110%) !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transition: transform 0.26s ease, opacity 0.26s ease, visibility 0.26s ease !important;
        gap: 0 !important;
        box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12) !important;
        list-style: none !important;
        margin: 0 !important;
    }

    .navbar .nav-menu::before {
        content: 'Menú' !important;
        display: flex !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 2 !important;
        background: linear-gradient(135deg, #0047AB 0%, #003380 100%) !important;
        color: #fff !important;
        padding: 0.65rem 0.75rem 0.65rem 2.75rem !important;
        font-size: 0.75rem !important;
        font-weight: 700 !important;
        letter-spacing: 0.05em !important;
        text-transform: uppercase !important;
        align-items: center !important;
        min-height: 42px !important;
        flex-shrink: 0 !important;
    }

    .navbar .nav-menu.active {
        transform: translateX(0) !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
    }

    .navbar .nav-menu > li {
        width: 100% !important;
        border-bottom: 1px solid #eef2f7 !important;
    }

    .navbar .nav-menu > li:last-child {
        border-bottom: none !important;
    }

    .navbar .nav-link {
        display: flex !important;
        align-items: center !important;
        justify-content: space-between !important;
        width: 100% !important;
        padding: 0.55rem 0.9rem !important;
        font-size: 0.82rem !important;
        font-weight: 600 !important;
        color: #1e293b !important;
        border-radius: 0 !important;
    }

    .navbar .dropdown-menu {
        position: static !important;
        display: none !important;
        box-shadow: none !important;
        background: #f8fafc !important;
        margin: 0 !important;
        border-radius: 0 !important;
        padding: 0.1rem 0 !important;
        border-top: 1px solid #eef2f7 !important;
        min-width: 0 !important;
    }

    .navbar .nav-dropdown.active .dropdown-menu {
        display: block !important;
    }

    .navbar .dropdown-menu a {
        display: flex !important;
        align-items: center !important;
        gap: 0.4rem !important;
        padding: 0.45rem 0.9rem 0.45rem 1.2rem !important;
        font-size: 0.76rem !important;
    }

    .menu-toggle.active {
        position: fixed !important;
        top: 0.55rem !important;
        left: 0.65rem !important;
        z-index: 10055 !important;
        width: 32px !important;
        height: 32px !important;
        background: rgba(255, 255, 255, 0.2) !important;
        border: none !important;
    }

    .menu-toggle.active span {
        background: #fff !important;
    }

    /* Formularios: evitar zoom iOS en tablet */
    input,
    select,
    textarea {
        font-size: 16px !important;
    }

    .container {
        padding-left: max(0.9rem, env(safe-area-inset-left, 0px));
        padding-right: max(0.9rem, env(safe-area-inset-right, 0px));
    }

    .navbar {
        padding: 0.55rem 0 !important;
    }

    .nav-container {
        flex-wrap: nowrap !important;
        gap: 0.5rem !important;
    }

    .logo-section {
        flex: 0 1 auto;
        min-width: 0;
        max-width: min(38%, 200px);
    }

    .logo-ceba {
        height: 36px !important;
        max-width: 100%;
    }
}

/* Desktop: navegación horizontal */
@media (min-width: 992px) {
    .menu-toggle {
        display: none !important;
    }

    .nav-backdrop,
    .nav-backdrop.is-visible {
        display: none !important;
        visibility: hidden !important;
        pointer-events: none !important;
        opacity: 0 !important;
    }

    body.nav-open {
        overflow: auto !important;
    }

    .nav-container {
        display: flex !important;
        align-items: center !important;
        gap: 0.5rem !important;
    }

    .logo-section {
        flex-shrink: 0 !important;
    }

    .header-actions {
        margin-left: 0.35rem !important;
    }

    .header-aula-btn {
        padding: 0.5rem 1rem !important;
        font-size: 0.82rem !important;
    }

    .header-ingresar-btn {
        padding: 0.5rem 0.85rem !important;
        font-size: 0.82rem !important;
    }

    .navbar .nav-menu {
        display: flex !important;
        flex-direction: row !important;
        flex: 1 1 auto !important;
        justify-content: center !important;
        flex-wrap: nowrap !important;
        position: static !important;
        top: auto !important;
        left: auto !important;
        right: auto !important;
        bottom: auto !important;
        width: auto !important;
        max-width: none !important;
        height: auto !important;
        transform: none !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        overflow: visible !important;
        padding: 0 !important;
        background: transparent !important;
        box-shadow: none !important;
        gap: 0.1rem !important;
        z-index: auto !important;
    }

    .navbar .nav-menu::before {
        display: none !important;
        content: none !important;
    }

    .navbar .nav-menu > li {
        width: auto !important;
        border-bottom: none !important;
    }

    .navbar .nav-link {
        width: auto !important;
        padding: 0.55rem 0.72rem !important;
        font-size: 0.84rem !important;
        justify-content: flex-start !important;
        color: var(--dark) !important;
        white-space: nowrap;
    }

    .navbar .dropdown-menu {
        position: absolute !important;
        top: 100% !important;
        left: 0 !important;
        display: none !important;
        min-width: 220px !important;
        background: #fff !important;
        box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
        border-radius: 8px !important;
        padding: 0.35rem 0 !important;
        border: 1px solid #e5e7eb !important;
        z-index: 10060 !important;
    }

    .navbar .nav-dropdown:hover .dropdown-menu {
        display: block !important;
    }

    .navbar .nav-dropdown.active .dropdown-menu {
        display: none !important;
    }

    .navbar .nav-dropdown:hover.active .dropdown-menu {
        display: block !important;
    }

    .navbar .dropdown-menu a {
        padding: 0.5rem 0.85rem !important;
        font-size: 0.85rem !important;
    }
}

/* Desktop medio — enlaces más compactos para evitar desborde */
@media (min-width: 992px) and (max-width: 1280px) {
    .navbar .nav-link {
        padding: 0.5rem 0.58rem !important;
        font-size: 0.8rem !important;
    }

    .header .logo-ceba {
        height: 44px !important;
        max-width: 150px !important;
    }

    .header-aula-btn {
        padding: 0.45rem 0.75rem !important;
        font-size: 0.76rem !important;
    }
}

/* Landscape móvil — menos altura desperdiciada */
@media (orientation: landscape) and (max-height: 500px) {
    .hero-elegante,
    .contacto-hero,
    .mod-hero {
        padding-top: 1.25rem !important;
        padding-bottom: 1rem !important;
    }

    .navbar .nav-menu {
        max-height: 100vh !important;
        overflow-y: auto !important;
    }

    #modalMatricula .modal-container.modal-matricula {
        max-height: 88vh !important;
    }

    .modal-container-comparacion {
        max-height: 88vh !important;
    }

    .guia-video-pip {
        width: min(80px, 18vw) !important;
    }
}

/* Pantallas muy pequeñas (320px) */
@media (max-width: 639px) {
    .logo-section {
        flex: 1 1 auto;
        max-width: calc(100% - 168px);
    }
}

@media (max-width: 320px) {
    .container {
        padding-left: 0.65rem !important;
        padding-right: 0.65rem !important;
    }

    .header-aula-btn__label {
        display: none;
    }

    .header-ingresar-btn__label {
        display: none;
    }

    .header-search-btn__label {
        display: none;
    }

    .header-aula-btn {
        width: 36px;
        height: 36px;
        padding: 0 !important;
        border-radius: 10px !important;
    }

    .header-ingresar-btn {
        width: 36px;
        height: 36px;
        padding: 0 !important;
        border-radius: 10px !important;
    }

    .header-search-btn {
        width: 36px;
        height: 36px;
        padding: 0 !important;
        border-radius: 10px !important;
    }

    .logo-section {
        max-width: calc(100% - 88px) !important;
    }

    .navbar .nav-menu {
        width: min(260px, 92vw) !important;
    }

    .modal-matricula__wa {
        font-size: 0.65rem !important;
    }
}

/* Desktop grande — contenedor máximo legible */
@media (min-width: 1400px) {
    .container {
        max-width: 1240px;
    }
}
