/* Cabecera de Open Days (#39013): mismo mundo que la portada (propuesta A). Clases propias "od-"
   para que no le afecten los estilos ni el JS de la plantilla antigua (.main-header). */

:root {
    --od-azul: #0a3a9c;
    --od-azul-oscuro: #0a2a6b;
    --od-naranja: #ed731d;
    --od-crema: #f4f2ef;
    --od-texto: #33384a;
    --od-linea: #e6e3de;
}

::selection { background: var(--od-naranja); color: #fff; }

.od-header {
    position: sticky;
    top: 0;
    z-index: 1000;
    background: rgba(255, 255, 255, .97);
    border-bottom: 1px solid var(--od-linea);
    font-family: 'Montserrat', sans-serif;
}

.od-header-in {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 15px;
    height: 84px;
    display: flex;
    align-items: center;
    gap: 32px;
}

.od-logo { flex: none; display: block; line-height: 0; }
.od-logo img { height: 48px; width: auto; }

.od-nav {
    flex: 1;
    display: flex;
    align-items: center;
    gap: 28px;
}

.od-menu {
    display: flex;
    align-items: center;
    gap: 6px;
    margin: 0 0 0 auto;
    padding: 0;
    list-style: none;
}

.od-menu > li { position: relative; }

.od-menu a {
    display: block;
    padding: 10px 14px;
    color: var(--od-texto);
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.01em;
    text-decoration: none;
    transition: color .2s ease-out;
}

.od-menu > li > a { position: relative; }
.od-menu > li > a::after {
    content: '';
    position: absolute;
    left: 14px;
    right: 14px;
    bottom: 2px;
    height: 2px;
    border-radius: 2px;
    background: var(--od-naranja);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .25s cubic-bezier(.16, 1, .3, 1);
}

.od-menu a:hover,
.od-menu a:focus,
.od-menu a[aria-current="page"] { color: var(--od-azul); text-decoration: none; }
.od-menu > li > a:hover::after,
.od-menu > li > a[aria-current="page"]::after { transform: scaleX(1); }

/* Desplegable de los días del programa */
.od-con-sub > a { padding-right: 30px; }
.od-con-sub > a::before {
    content: '';
    position: absolute;
    right: 13px;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -6px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
}
.od-con-sub > a::after { right: 30px; }

.od-sub {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 230px;
    margin: 0;
    padding: 8px;
    list-style: none;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(10, 42, 107, .14);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity .2s ease-out, transform .2s ease-out, visibility .2s;
}
.od-con-sub:hover .od-sub,
.od-con-sub:focus-within .od-sub { opacity: 1; visibility: visible; transform: translateY(0); }
.od-sub a { padding: 10px 12px; border-radius: 8px; font-weight: 500; white-space: nowrap; }
.od-sub a:hover, .od-sub a:focus { background: var(--od-crema); }

/* Acceso: Inscríbete / Mi agenda (botón) y Salir */
.od-acceso { display: flex; align-items: center; gap: 18px; }

.od-boton {
    display: inline-block;
    padding: 12px 22px;
    border-radius: 40px;
    background: var(--od-azul);
    color: #fff !important;
    font-size: 14px;
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 8px 20px rgba(10, 58, 156, .22);
    transition: background-color .2s ease-out, box-shadow .2s ease-out;
}
.od-boton:hover, .od-boton:focus { background: var(--od-naranja); box-shadow: 0 8px 20px rgba(237, 115, 29, .28); }

.od-salir {
    color: var(--od-texto) !important;
    font-size: 14px;
    font-weight: 600;
    text-decoration: underline;
    text-underline-offset: 4px;
    text-decoration-color: var(--od-linea);
}
.od-salir:hover, .od-salir:focus { color: var(--od-azul) !important; text-decoration-color: var(--od-naranja); }

.od-asturex {
    flex: none;
    display: block;
    line-height: 0;
    padding-left: 28px;
    border-left: 1px solid var(--od-linea);
}
.od-asturex img { height: 36px; width: auto; }

.od-header a:focus-visible,
.od-burger:focus-visible { outline: 2px solid var(--od-naranja); outline-offset: 3px; border-radius: 6px; }

/* Hamburguesa */
.od-burger {
    display: none;
    margin-left: auto;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 12px;
    background: var(--od-crema);
    cursor: pointer;
}
.od-burger span {
    display: block;
    width: 20px;
    height: 2px;
    margin: 4px auto;
    border-radius: 2px;
    background: var(--od-azul);
    transition: transform .25s cubic-bezier(.16, 1, .3, 1), opacity .2s;
}
.od-abierta .od-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.od-abierta .od-burger span:nth-child(2) { opacity: 0; }
.od-abierta .od-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

/* Pantallas medianas: menos aire y logo de Asturex más pequeño para que quepa el menú */
@media (max-width: 1199px) {
    .od-header-in { gap: 20px; }
    .od-nav { gap: 18px; }
    .od-asturex { padding-left: 18px; }
    .od-asturex img { height: 30px; }
}

/* Móvil y tableta: menú desplegable a pantalla completa bajo la barra */
@media (max-width: 991px) {
    .od-header-in { height: 72px; }
    .od-logo img { height: 42px; }
    .od-burger { display: block; }

    .od-nav {
        display: none;
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 0;
        padding: 12px 20px 24px;
        background: #fff;
        border-bottom: 1px solid var(--od-linea);
        box-shadow: 0 18px 30px rgba(10, 42, 107, .10);
        max-height: calc(100vh - 72px);
        overflow-y: auto;
    }
    .od-abierta .od-nav { display: flex; }

    .od-menu { flex-direction: column; align-items: stretch; margin: 0; gap: 0; }
    .od-menu > li { border-bottom: 1px solid var(--od-linea); }
    .od-menu a { padding: 15px 4px; font-size: 17px; }
    .od-menu > li > a::after { display: none; }
    .od-menu a[aria-current="page"] { color: var(--od-azul); font-weight: 700; }
    .od-con-sub > a::before { display: none; }

    .od-sub {
        position: static;
        min-width: 0;
        padding: 0 0 10px 14px;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }
    .od-sub a { padding: 9px 4px; font-size: 15px; color: #5d6170; }

    .od-acceso { flex-direction: column; align-items: stretch; gap: 14px; margin-top: 20px; }
    .od-boton { text-align: center; padding: 15px 22px; font-size: 16px; }
    .od-salir { text-align: center; }

    .od-asturex { align-self: center; margin-top: 22px; padding-left: 0; border-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
    .od-header * { transition: none !important; }
}

/* Pie (#39013) */
.od-pie {
    background: var(--od-crema);
    border-top: 1px solid var(--od-linea);
    color: var(--od-texto);
    font-family: 'Droid Sans', sans-serif;
}
.od-pie-in { max-width: 1200px; margin: 0 auto; padding: 72px 15px 0; }
.od-pie-cols {
    display: grid;
    grid-template-columns: 1.3fr 1fr 1fr;
    gap: 48px;
    padding-bottom: 56px;
}
.od-pie-marca img { height: 48px; width: auto; }
.od-pie-marca p { margin: 22px 0 0; max-width: 34ch; font-size: 15px; line-height: 1.7; color: #5d6170; }
.od-pie h2 {
    margin: 0 0 14px;
    font-family: 'Montserrat', sans-serif;
    font-size: 17px;
    font-weight: 700;
    letter-spacing: -0.01em;
    color: var(--od-azul);
}
.od-pie-bloque p { margin: 0 0 14px; font-size: 15px; line-height: 1.75; }
.od-pie-bloque strong { color: var(--od-azul); }
.od-pie a { color: var(--od-texto); text-decoration: none; }
.od-pie-bloque p a:hover, .od-pie-bloque p a:focus { color: var(--od-azul); }
.od-pie-enlace {
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    color: var(--od-azul) !important;
    text-decoration: underline !important;
    text-decoration-color: var(--od-naranja) !important;
    text-decoration-thickness: 2px !important;
    text-underline-offset: 5px;
}
.od-pie-enlace:hover, .od-pie-enlace:focus { color: var(--od-naranja) !important; }
.od-pie-legal {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 12px 32px;
    padding: 22px 0 26px;
    border-top: 1px solid var(--od-linea);
    font-size: 13px;
    color: #5d6170;
}
.od-pie-legal ul { display: flex; flex-wrap: wrap; gap: 8px 28px; margin: 0; padding: 0; list-style: none; }
.od-pie-legal a { color: #5d6170; }
.od-pie-legal a:hover, .od-pie-legal a:focus { color: var(--od-azul); text-decoration: underline; text-underline-offset: 4px; }
.od-pie a:focus-visible { outline: 2px solid var(--od-naranja); outline-offset: 3px; border-radius: 4px; }

@media (max-width: 991px) {
    .od-pie-cols { grid-template-columns: 1fr 1fr; gap: 40px; }
    .od-pie-marca { grid-column: 1 / -1; }
}
@media (max-width: 600px) {
    .od-pie-in { padding-top: 52px; }
    .od-pie-cols { grid-template-columns: 1fr; gap: 34px; padding-bottom: 40px; }
    .od-pie-legal { flex-direction: column; align-items: flex-start; }
}

/* Accesibilidad: salto al contenido, visible solo con el teclado */
.od-saltar {
    position: absolute;
    left: 16px;
    top: -60px;
    z-index: 2000;
    padding: 12px 18px;
    border-radius: 8px;
    background: var(--od-azul);
    color: #fff !important;
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    font-size: 14px;
    transition: top .2s ease-out;
}
.od-saltar:focus { top: 12px; outline: 2px solid var(--od-naranja); outline-offset: 2px; }
main#contenido:focus { outline: none; }

/* Contraste (WCAG AA) en páginas de la plantilla antigua: días del programa y textos de ayuda */
.schedule-box .tab-buttons .tab-btn .day { color: #b04f0b; }
.schedule-box .tab-buttons .tab-btn.active { background-color: #b04f0b; }
.schedule-box .tab-buttons .tab-btn.active .day { color: #fff; }
.schedule-box .tab-buttons .tab-btn .curve:after { border-top-color: #b04f0b; }
.schedule-section .text-center p { color: #4a4f5e; }
.contact-section .text-info, .contact-section .text-info i { color: #2f5d72; }
.schedule-section p, .schedule-box .hour-box .hour { color: #4a4f5e; }
.contact-section .form-label { color: #4a4f5e; }
.contact-section small i { color: #2f5d72; }

/* Botones en espera (odCargando) */
.od-cargando { cursor: progress !important; opacity: .85; }
.od-spinner {
    display: inline-block;
    width: 16px;
    height: 16px;
    margin: 0 10px -3px 0;
    border: 2px solid rgba(255, 255, 255, .45);
    border-top-color: #fff;
    border-radius: 50%;
    animation: od-gira .8s linear infinite;
}
@keyframes od-gira { to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) { .od-spinner { animation-duration: 2.4s; } }

/* Ventanas de aviso (bootbox) con el diseño de la portada */
.bootbox.modal .modal-content { border: 0; border-radius: 16px; box-shadow: 0 30px 60px rgba(10, 42, 107, .25); }
.bootbox.modal .modal-header { border: 0; padding: 14px 18px 0; }
.bootbox.modal .modal-body { padding: 8px 28px 6px; font-size: 17px; line-height: 1.6; color: #1f2533; }
.bootbox.modal .bootbox-close-button { font-size: 28px; color: var(--od-azul); opacity: .7; text-shadow: none; }
.bootbox.modal .bootbox-close-button:hover, .bootbox.modal .bootbox-close-button:focus { opacity: 1; }
.bootbox.modal .modal-footer { border: 0; padding: 14px 28px 24px; }
.bootbox.modal .modal-footer .btn {
    padding: 12px 26px;
    border: 0;
    border-radius: 999px;
    background: var(--od-azul);
    color: #fff;
    font-family: 'Montserrat', sans-serif;
    font-size: 14px;
    font-weight: 700;
    box-shadow: none;
}
.bootbox.modal .modal-footer .btn:hover, .bootbox.modal .modal-footer .btn:focus { background: var(--od-naranja); }
.bootbox.modal .modal-footer .btn:focus-visible { outline: 2px solid var(--od-naranja); outline-offset: 3px; }
.bootbox.modal .modal-footer .btn-default, .bootbox.modal .modal-footer .bootbox-cancel { background: var(--od-crema); color: var(--od-azul); }
.od-boton.od-cargando, .od-boton.od-cargando:hover, .od-boton.od-cargando:focus { background: var(--od-azul) !important; box-shadow: none !important; }
.bootbox.modal .modal-footer .btn:focus { background: var(--od-azul); outline: none; }
.bootbox.modal .modal-footer .btn:hover { background: var(--od-naranja); }
.bootbox.modal .modal-footer .btn:focus-visible { outline: 2px solid var(--od-naranja); outline-offset: 3px; }

/* Ventanas de aviso: la X por encima del contenido (antes flotaba y el cuerpo la tapaba) */
.bootbox.modal .modal-header { display: flex; align-items: center; justify-content: flex-end; min-height: 0; }
.bootbox.modal .modal-header .modal-title:empty { display: none; }
.bootbox.modal .modal-header .modal-title { order: 1; margin-right: auto; font-family: 'Montserrat', sans-serif; font-size: 18px; font-weight: 800; color: var(--od-azul); }
.bootbox.modal .bootbox-close-button {
    order: 2;
    float: none;
    position: relative;
    z-index: 2;
    width: 40px;
    height: 40px;
    margin: 0 -6px 0 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    line-height: 1;
}
.bootbox.modal .bootbox-close-button:hover, .bootbox.modal .bootbox-close-button:focus { background: var(--od-crema); }
.bootbox.modal .bootbox-close-button:focus-visible { outline: 2px solid var(--od-naranja); outline-offset: 2px; }
.bootbox.modal .modal-footer { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; }
.bootbox.modal .modal-footer .btn { margin: 0; }
.bootbox.modal .modal-footer .bootbox-cancel, .bootbox.modal .modal-footer .bootbox-cancel:focus { background: var(--od-crema); color: var(--od-azul); }
.bootbox.modal .modal-footer .bootbox-cancel:hover { background: #e9e5df; color: var(--od-azul); }
/* Versión antigua de bootbox (la carga el calendario): mete la X dentro del cuerpo; arriba a la derecha */
.bootbox.modal .modal-body { position: relative; }
.bootbox.modal .modal-body > .bootbox-close-button { position: absolute; top: 10px; right: 12px; margin: 0; }
.bootbox.modal .modal-body:has(> .bootbox-close-button) { padding-top: 26px; padding-right: 60px; }

/* Naranja de "pasar el ratón" en botones con texto blanco: más oscuro para el contraste AA (#39013) */
.od-boton:hover, .od-boton:focus,
.bootbox.modal .modal-footer .btn:hover { background: #b04f0b !important; box-shadow: 0 8px 20px rgba(176, 79, 11, .25); }
.od-boton.od-boton-borde-claro:hover, .od-boton.od-boton-borde-claro:focus { background: var(--od-azul) !important; }
.od-boton.od-boton-claro:hover, .od-boton.od-boton-claro:focus { background: #b04f0b !important; color: #fff !important; }
.od-boton.od-cargando, .od-boton.od-cargando:hover { background: var(--od-azul) !important; }
