/* Menu de las paginas publicas (templates/layout_base.html), con la linea de la
   portada: colores del contrato (docs/TEMA_MOVIL_ETAPA2.md, seccion 2).

   El marcado lleva clases propias (mn-*) porque las viejas (.navainicio,
   .logo-imagen, .menu-hamburguesa-btn) traen reglas con !important en
   layout_base.css que no se pueden pisar limpiamente. Se conservan
   .header-sitio, .navinicio > ul, #menu-hamburguesa y la clase .menu-visible:
   de ellos dependen el script del layout y tests/test_publico_movil.
   La barra baja de 64 a 52 px al bajar la pagina: lo marca js/menu_publico.js. */

.header-sitio.mn {
    position: sticky;
    top: 0;
    z-index: 900;
    display: block;
    width: 100%;
    height: auto;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid #e3e7ec;
    box-shadow: none;
    font-family: 'Martel Sans', sans-serif;
    transition: box-shadow .3s ease;
}
.mn * { box-sizing: border-box; }
.mn .mn-in {
    display: flex;
    align-items: center;
    gap: 18px;
    max-width: 1180px;
    height: 64px;
    margin: 0 auto;
    padding: 0 28px;
    transition: height .3s ease;
}
.header-sitio.mn.mn--bajada { box-shadow: 0 10px 26px -16px rgba(11, 37, 69, .55); }
.mn.mn--bajada .mn-in { height: 52px; }
.mn.mn--bajada .mn-logo-img { height: 38px; }

.mn .mn-logo { display: flex; align-items: center; flex: none; min-height: 44px; text-decoration: none; }
.mn .mn-logo-img { display: block; width: auto; height: 45px; transition: height .3s ease; }

/* un solo <ul>: los enlaces quedan al centro y los dos accesos a la derecha
   porque el primer enlace y el primer acceso se reparten el espacio libre */
.mn .navinicio { flex: 1; min-width: 0; height: auto; }
.mn .navinicio ul { display: flex; align-items: center; gap: 4px; width: 100%; margin: 0; padding: 0; list-style: none; }
.mn .navinicio li { margin: 0; padding: 0; list-style: none; }
.mn .navinicio li:first-child,
.mn .navinicio .mn-acc-li { margin-left: auto; }
.mn .navinicio .mn-acc-li + .mn-acc-li { margin-left: 6px; }

.mn .mn-l {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 9px;
    color: #16202b;
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    transition: color .25s, background .25s;
}
.mn .mn-l::after {
    content: "";
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 6px;
    height: 2px;
    background: #3498db;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.mn .mn-l:hover { color: #0b2545; background: #eef4fb; }
.mn .mn-l:hover::after,
.mn .mn-l.es-activo::after { transform: scaleX(1); }
.mn .mn-l.es-activo { color: #0b2545; }
.mn .mn-l:focus-visible,
.mn .mn-b:focus-visible,
.mn .mn-boton:focus-visible,
.mn .mn-logo:focus-visible { outline: 2px solid #3498db; outline-offset: 2px; }

.mn .mn-nuevo {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 2px 9px;
    border-radius: 999px;
    background: #e6f0e8;
    color: #16202b;
    font-size: 11px;
    font-weight: 800;
    letter-spacing: .08em;
    text-transform: uppercase;
}
.mn .mn-nuevo::before {
    content: "";
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #27ae60;
    box-shadow: 0 0 0 0 rgba(39, 174, 96, .6);
    animation: mn-pulso 2.6s ease-out infinite;
}
@keyframes mn-pulso {
    0% { box-shadow: 0 0 0 0 rgba(39, 174, 96, .6); }
    70%, 100% { box-shadow: 0 0 0 8px rgba(39, 174, 96, 0); }
}

.mn .mn-b {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 0 20px;
    border: 1.5px solid transparent;
    border-radius: 9px;
    font-size: 16px;
    font-weight: 800;
    line-height: 1.2;
    white-space: nowrap;
    text-decoration: none;
    transition: transform .25s, box-shadow .25s, background .25s;
}
.mn .mn-b:hover { transform: translateY(-2px); }
.mn .mn-b--g { color: #16202b; border-color: #16202b; background: transparent; }
.mn .mn-b--g:hover { background: #eef4fb; }
.mn .mn-b--p { color: #fff; background: #3498db; border-color: #3498db; font-size: 19px; box-shadow: 0 10px 24px -12px rgba(52, 152, 219, .95); }
.mn .mn-b.es-activo { box-shadow: inset 0 -3px 0 #0b2545; }

/* solo existen por debajo de 1160 px */
/* el boton lleva su id en el selector: layout_base.css lo oculta y lo muestra
   por id (#menu-hamburguesa), y un id le gana a cualquier clase */
.mn .mn-b--fuera,
.mn #menu-hamburguesa.mn-boton { display: none; }

/* ---------- tableta y telefono: los enlaces pasan al boton Menu ---------- */
@media (max-width: 1160px) {
    /* Para que la barra acompane al bajar. La hoja movil pone overflow-x:hidden
       en <html>; con eso el overflow del <body> deja de pasar a la ventana y el
       body se vuelve su propia caja de scroll, que no se mueve: nada queda fijo.
       `clip` sigue cortando lo que se sale de lado pero no crea esa caja. */
    /* `html body` y no `body` a secas: registro e ingreso cargan despues
       formularios.css, que vuelve a poner hidden con el selector `html, body`. */
    html body { overflow-x: clip; }
    .header-sitio.mn { height: auto; padding: 0; }
    .mn .mn-in { height: 60px; padding: 0 20px; gap: 10px; }
    .mn.mn--bajada .mn-in { height: 52px; }
    .mn .mn-logo { margin-right: auto; }
    .mn .navinicio { flex: none; }

    .mn .mn-b--fuera { display: inline-flex; }
    .mn #menu-hamburguesa.mn-boton {
        display: inline-flex;
        align-items: center;
        gap: 9px;
        min-width: 44px;
        min-height: 44px;
        margin: 0;
        padding: 0 14px;
        border: 1.5px solid #16202b;
        border-radius: 9px;
        /* el relleno va con sombra interior y no con background: layout_base.css
           trae `#menu-hamburguesa { background: transparent !important }` */
        box-shadow: inset 0 0 0 60px #fff;
        color: #16202b;
        font-family: 'Martel Sans', sans-serif;
        font-size: 15px;
        font-weight: 800;
        cursor: pointer;
    }
    .mn .mn-raya { position: relative; width: 18px; height: 2px; background: #16202b; transition: background .2s; }
    .mn .mn-raya::before,
    .mn .mn-raya::after { content: ""; position: absolute; left: 0; width: 18px; height: 2px; background: #16202b; transition: transform .3s cubic-bezier(.2, .8, .2, 1); }
    .mn .mn-raya::before { transform: translateY(-6px); }
    .mn .mn-raya::after { transform: translateY(6px); }
    .mn #menu-hamburguesa.mn-boton[aria-expanded="true"] { box-shadow: inset 0 0 0 60px #0b2545; border-color: #0b2545; color: #fff; }
    .mn #menu-hamburguesa.mn-boton[aria-expanded="true"] .mn-raya { background: transparent; }
    .mn #menu-hamburguesa.mn-boton[aria-expanded="true"] .mn-raya::before { background: #fff; transform: rotate(45deg); }
    .mn #menu-hamburguesa.mn-boton[aria-expanded="true"] .mn-raya::after { background: #fff; transform: rotate(-45deg); }

    /* el panel se monta SOBRE la pagina; no la empuja */
    .mn .navinicio ul {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        width: auto;
        grid-template-columns: 1fr 1fr;
        gap: 0 20px;
        padding: 10px 20px 20px;
        background: #fff;
        border-bottom: 1px solid #e3e7ec;
        box-shadow: 0 26px 44px -22px rgba(11, 37, 69, .5);
    }
    .mn .navinicio ul.menu-visible { display: grid; animation: mn-abre .3s cubic-bezier(.2, .8, .2, 1); }
    .mn .navinicio li:first-child,
    .mn .navinicio .mn-acc-li,
    .mn .navinicio .mn-acc-li + .mn-acc-li { margin-left: 0; }
    .mn .mn-l { display: flex; justify-content: space-between; min-height: 50px; padding: 0 4px; border-radius: 0; border-bottom: 1px solid #e3e7ec; font-size: 17px; }
    .mn .mn-l::after { display: none; }
    .mn .mn-l.es-activo { padding-left: 12px; background: #eef4fb; box-shadow: inset 3px 0 0 #3498db; }
    .mn .navinicio .mn-acc-li { margin-top: 14px; }
    .mn .navinicio .mn-b { display: flex; min-height: 50px; }
    .mn .navinicio .mn-b:hover { transform: none; }
}
@media (max-width: 520px) {
    .mn .mn-in { padding: 0 14px; }
    .mn .mn-logo-img { height: 40px; }
    .mn .mn-b--fuera { display: none; }
    .mn .navinicio ul { grid-template-columns: 1fr; padding: 6px 16px 18px; }
    .mn .navinicio .mn-acc-li { margin-top: 12px; }
}
@keyframes mn-abre {
    from { opacity: 0; transform: translateY(-8px); }
    to { opacity: 1; transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
    .header-sitio.mn,
    .mn .mn-in,
    .mn .mn-logo-img,
    .mn .mn-l,
    .mn .mn-l::after,
    .mn .mn-b,
    .mn .mn-raya,
    .mn .mn-raya::before,
    .mn .mn-raya::after { transition: none; }
    .mn .mn-nuevo::before,
    .mn .navinicio ul.menu-visible { animation: none; }
}
