/* =====================================================
   MOVIL.CSS - NEWTON SCHOOL
   Tablet (hasta 900px) y celular (hasta 600px) de toda la página.
   Debe cargarse al final, después de estilos.css y niveles.css
===================================================== */


/* ---------- TABLET ---------- */

@media (max-width: 900px) {
    .hero-grid,
    .detalle-grid,
    .detalle-grid.reverse {
        grid-template-columns: 1fr;
        gap: 32px;
    }

    .detalle-grid .detalle-imagen {
        order: -1;
    } /* la foto siempre arriba */

    .niveles-grid {
        grid-template-columns: 1fr;
        max-width: 560px;
        margin-inline: auto;
    }

    .hero-niveles {
        padding: 40px 0 60px;
    }

    .detalle-nivel {
        padding: 55px 0;
    }

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

    /* Menú hamburguesa */
    .header-contenido {
        position: relative;
        display: flex;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
        min-height: 70px;
        padding-top: 0;
        padding-bottom: 0;
        gap: 12px;
    }

    .header-contenido .logo {
        justify-content: flex-start;
    }

    .menu-toggle {
        display: flex;
        flex-shrink: 0;
        align-items: center;
        justify-content: center;
        width: 40px;
        height: 40px;
        gap: 5px;
        border: none;
        border-radius: 10px;
        background: #0878d1;
        cursor: pointer;
    }

    .menu-toggle span {
        display: block;
        width: 23px;
        height: 3px;
        border-radius: 3px;
        background: #ffffff;
    }

    .menu {
        display: none;
        position: absolute;
        z-index: 1001;
        top: calc(100% + 10px);
        left: 0;
        right: 0;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        padding: 14px;
        background: #ffffff;
        border: 1px solid #e2ebf5;
        border-radius: 16px;
        box-shadow: 0 12px 28px rgba(16, 38, 77, 0.12);
    }

    .menu.abierto {
        display: flex;
    }

    .menu a {
        display: flex;
        align-items: center;
        justify-content: flex-start;
        width: 100%;
        padding: 13px 15px;
        color: #10264d;
        background: #f1f7fc;
        border-radius: 10px;
        font-size: 14px;
        font-weight: 700;
        text-align: left;
        box-shadow: none;
        transform: none;
    }

    .menu a.activo {
        color: #0878d1 !important;
        background: #ffffff !important;
    }

    .menu a:hover {
        color: #0878d1;
        background: #edf8ff;
        transform: none;
        box-shadow: none;
    }
}

@media (min-width: 901px) {
    .header {
        border-top: 0 !important;
        outline: 0 !important;
    }

    .header .header-contenido {
        width: 90%;
        max-width: none;
        min-height: 85px;
        margin-inline: auto;
        gap: 20px;
    }

    .header .menu {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        margin-left: auto;
        flex-shrink: 0;
        gap: 8px;
    }

    .header .menu a,
    .header .menu a:hover,
    .header .menu a.activo,
    .header .menu a.activo:hover {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 12px 15px;
        border: 0;
        border-radius: 999px;
        background: transparent !important;
        box-shadow: none !important;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
        transform: none;
        font-size: 14px;
        font-weight: 700;
        white-space: nowrap;
    }
}

/* ---------- CELULAR ---------- */

@media (max-width: 600px) {
    .logo-imagen {
        width: 44px;
        height: 44px;
    }

    .logo-nombre h2 {
        font-size: 22px;
    }

    .logo-nombre span {
        font-size: 10px;
        letter-spacing: 5px;
    }

    .subtitulo-manuscrito {
        font-size: 40px;
    }

    .hero-texto h1 {
        font-size: 28px;
    }

    .texto-verde {
        font-size: 44px;
    }

    .hero-texto p {
        font-size: 15px;
    }

    .hero-imagen img {
        box-shadow: 8px 8px 0 #4caf2a, 0 14px 28px rgba(11,47,134,.2);
    }

    .niveles {
        padding-top: 36px;
    }

    .nivel-card {
        padding: 24px 22px 20px;
    }

    .nivel-card h2 {
        font-size: 21px;
    }

    .detalle-texto h2 {
        font-size: 28px;
    }

    .lista-pildoras {
        grid-template-columns: 1fr;
    }

    .marco-verde {
        box-shadow: 8px 8px 0 #4caf2a, 0 14px 28px rgba(0,0,0,.18);
    }

    .marco-azul {
        box-shadow: 8px 8px 0 #0f2a56, 0 14px 28px rgba(0,0,0,.18);
    }

    .footer {
        padding-top: 80px;
    }

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

    .whatsapp-flotante {
        width: 52px;
        height: 52px;
        font-size: 29px;
        right: 16px;
        bottom: 16px;
    }
}

/* =========================================
   MENÚ MÓVIL - CORRECCIÓN PARA CONTACTO
========================================= */

@media (max-width: 900px) {

    .header .header-contenido {
        position: relative;
    }

    /* Botón hamburguesa */
    .pagina-contacto .header .menu-toggle {
        display: flex !important;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;

        width: 44px;
        height: 44px;
        min-width: 44px;
        flex-shrink: 0;

        padding: 9px;
        border: none;
        border-radius: 10px;

        background: #edf8ff !important;
        cursor: pointer;

        position: relative;
        z-index: 1002;
    }

    /* Las tres rayas */
    .pagina-contacto .header .menu-toggle span {
        display: block !important;
        width: 22px;
        height: 2px;
        flex: 0 0 2px;

        background: #10264d !important;
        border-radius: 3px;

        transform: none;
        opacity: 1;
    }

    /* Menú cerrado */
    .pagina-contacto .header .header-contenido .menu {
        display: none !important;

        position: absolute;
        top: calc(100% + 10px);
        left: 0;
        right: 0;

        flex-direction: column;
        align-items: stretch;
        gap: 8px;

        padding: 15px;
        background: #ffffff;
        border: 1px solid #e6edf4;
        border-radius: 14px;

        box-shadow: 0 10px 30px rgba(16, 38, 77, 0.15);
        z-index: 1001;
    }

    /* Menú abierto al pulsar el botón */
    .pagina-contacto .header .header-contenido .menu.abierto {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
    }

    /* Enlaces */
    .pagina-contacto .header .header-contenido .menu.abierto a {
        display: flex;
        justify-content: flex-start;

        padding: 13px 15px;
        border-radius: 10px;

        background: #f4f9fd;
        color: #10264d;

        font-size: 14px;
        box-shadow: none;
        transform: none;
    }

    .pagina-contacto .header .header-contenido .menu.abierto a.activo {
        background: #0878d1 !important;
        color: #ffffff !important;
    }
}
