/* DECORACION_NAVIDAD_v1 (usuario, 26/11/2026): decoración navideña. layout.php carga este archivo y navidad.js, y pone la
   clase «tema-navidad» en <body>, solo del 1/12 al 6/1 (src/Temporada/Servicios/TemaNavidad.php; .env TEMA_NAVIDAD).
   Todos los roles: guirnaldas de focos (barra superior y borde del menú), gorro y arbolito junto al logo, nieve acumulada en
   las tarjetas y barra de carga de bastón de caramelo. Solo alumnas: fondo de copos, nieve que cae, acebo y arbolito en el saludo, lazos de regalo
   en los cursos, trineo, mascota con gorro y confeti de Año Nuevo. Dibujos propios en assets/img/navidad/.
   Nada de esto se imprime. */

/* ═════════════ Guirnaldas de focos (navidad.js arma los focos) ═════════════ */
.nav-luces {
  position: absolute; left: 0; right: 0; bottom: -25px; height: 30px;
  overflow: hidden; pointer-events: none; z-index: 3;
  /* Cable caído en arcos: uno cada 44 px, el foco cuelga del punto más bajo */
  background: url(../img/navidad/cable.svg) 0 0 / 44px 12px repeat-x;
}
.nav-foco {
  position: absolute; top: 4px; width: 12px; height: 23px;
  transform-origin: 6px 1px;
}
.nav-foco:nth-child(odd) { transform: rotate(-9deg); }
.nav-foco:nth-child(even) { transform: rotate(8deg); }
/* Casquillo */
.nav-foco::before {
  content: ""; position: absolute; left: 3.5px; top: 0; width: 5px; height: 6px;
  border-radius: 1.5px; background: linear-gradient(90deg, #26331f, #5b6e4f 50%, #26331f);
}
/* Vidrio con reflejo y resplandor */
.nav-foco::after {
  content: ""; position: absolute; left: 0; top: 5px; width: 12px; height: 17px;
  border-radius: 50% 50% 50% 50% / 40% 40% 60% 60%;
  background: radial-gradient(circle at 34% 28%, rgba(255, 255, 255, .95) 0 1.6px, var(--c) 3.6px, var(--c2) 100%);
  box-shadow: 0 0 5px 1px var(--c), 0 0 14px 5px var(--g);
  animation: navFoco var(--t, 1.9s) ease-in-out var(--d, 0s) infinite;
}
@keyframes navFoco { 0%, 100% { opacity: 1; } 50% { opacity: .3; } }
.nav-foco--rojo     { --c: #ff5252; --c2: #b71c1c; --g: rgba(255, 60, 60, .55); }
.nav-foco--amarillo { --c: #ffe066; --c2: #f9a825; --g: rgba(255, 205, 50, .6); }
.nav-foco--verde    { --c: #69f0ae; --c2: #1b8a3c; --g: rgba(60, 230, 120, .5); }
.nav-foco--azul     { --c: #82cfff; --c2: #16A34A; --g: rgba(80, 170, 255, .55); }
.nav-foco--naranja  { --c: #ffab70; --c2: #e65100; --g: rgba(255, 140, 60, .55); }

/* Guirnalda vertical por el borde derecho del menú (solo escritorio) */
.nav-luces--vertical {
  position: fixed; left: var(--nav-x, 248px); right: auto; top: 64px; bottom: 0; width: 34px; height: auto;
  z-index: 350;
  background: url(../img/navidad/cable-vertical.svg) 0 0 / 12px 44px repeat-y;
}
/* left: 0 → el punto de giro (6 px) cae sobre lo más salido del cable */
.nav-luces--vertical .nav-foco { left: 0; transform: rotate(-80deg); }
.nav-luces--vertical .nav-foco:nth-child(even) { transform: rotate(-100deg); }
@media (max-width: 768px) { .nav-luces--vertical { display: none; } }

/* ═════════════ Gorro de Papá Noel sobre el logo (menú lateral y cargador) ═════════════ */
/* El gorro queda apoyado en la esquina superior izquierda del logo, sin taparle letras (pedido del usuario, 26/11).
   En el menú el encabezado recorta lo que sobresale: en vez de subir el gorro, el logo se corre a la derecha. */
.nav-gorro { position: relative; }
.tema-navidad a.nav-gorro { padding-left: 24px; }
.tema-navidad .nav-gorro::after {
  content: "";
  position: absolute; left: -14px; top: -14px; z-index: 2;
  width: 44px; height: 37px;
  background: url(../img/navidad/gorro.svg) no-repeat center / contain;
  transform: rotate(-22deg);
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .3));
  pointer-events: none;
}
.tema-navidad .nav-gorro--grande::after { left: -58px; top: -42px; width: 72px; height: 61px; }

/* ═════════════ Barra del cargador: bastón de caramelo ═════════════ */
.tema-navidad #page-loader .pl-bar { height: 7px !important; box-shadow: inset 0 0 0 1px rgba(211, 47, 47, .25); }
.tema-navidad #page-loader .pl-bar-fill {
  background: repeating-linear-gradient(-45deg, #d32f2f 0 5px, #fff 5px 10px) !important;
}

/* ═════════════ Nieve acumulada sobre tarjetas (navidad.js la pone) ═════════════ */
.nav-tapa {
  position: absolute; left: 10px; right: 10px; top: -11px; height: 22px;
  /* A escala exacta (80×22): escalado deja costuras de medio píxel entre repeticiones */
  background: url(../img/navidad/nieve-tapa.svg) repeat-x 0 0 / 80px 22px;
  filter: drop-shadow(0 1px 1.5px rgba(70, 100, 140, .3));
  pointer-events: none; z-index: 4;
}
/* En tarjetas que recortan lo que sobresale: la nieve va por dentro del borde */
.nav-tapa--dentro { top: -3px; left: 14px; right: 14px; }

/* ═════════════ Solo alumnas ═════════════ */
/* Fondo con copos tenues */
.tema-navidad.role-estudiante {
  background-image: url(../img/navidad/copos-fondo.svg) !important;
  background-size: 240px 240px !important;
  background-attachment: fixed !important;
}

/* Acebo y arbolito en el recuadro del saludo */
.nav-acebo {
  position: absolute; top: -10px; right: -8px; width: 104px; height: 78px; z-index: 2;
  background: url(../img/navidad/acebo.svg) no-repeat center / contain;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .25));
  transform: rotate(8deg); pointer-events: none;
}
.nav-arbol-hero { position: absolute; right: 18px; bottom: 4px; width: 74px; height: 98px; z-index: 2; pointer-events: none; }
@media (max-width: 768px) {
  .nav-acebo { width: 70px; height: 52px; top: -6px; right: -6px; }
  .nav-arbol-hero { display: none; }
}
/* Arbolito junto al logo del menú (todos los roles, aunque esté en esta sección) */
.nav-arbol-menu { position: absolute; right: 10px; top: 7px; width: 36px; height: 48px; z-index: 2; pointer-events: none; }

/* Arbolito (dibujo en navidad.js): luces que titilan */
.nav-arbol__luz { animation: navLuzArbol 1.6s ease-in-out infinite; }
.nav-arbol__luz:nth-of-type(2n) { animation-delay: -.5s; }
.nav-arbol__luz:nth-of-type(3n) { animation-delay: -1.1s; animation-duration: 2.1s; }
@keyframes navLuzArbol { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.nav-arbol__estrella { transform-origin: 30px 9px; animation: navEstrella 2.4s ease-in-out infinite; }
@keyframes navEstrella { 0%, 100% { transform: scale(1); filter: drop-shadow(0 0 2px #ffd54f); } 50% { transform: scale(1.15); filter: drop-shadow(0 0 5px #ffd54f); } }

/* Lazo de regalo en la cabecera de cada curso del inicio */
.tema-navidad .nav-regalo::before {
  content: ""; position: absolute; top: 0; bottom: 0; left: 18px; width: 44px; z-index: 2; pointer-events: none;
  background:
    url(../img/navidad/lazo.svg) no-repeat center 0 / 44px 30px,
    linear-gradient(90deg, transparent 17px, #c62828 17px, #ef5350 22px, #c62828 27px, transparent 27px);
}
.tema-navidad .nav-regalo::after {
  content: ""; position: absolute; left: 0; right: 0; top: 9px; height: 10px; z-index: 1; pointer-events: none;
  background: linear-gradient(#c62828, #ef5350 50%, #c62828);
}

/* Nieve que cae (lienzo de navidad.js) */
#nav-nieve { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 95; }

.nav-btn-nieve {
  display: flex; align-items: center; justify-content: center;
  width: 34px; height: 34px; flex-shrink: 0;
  border: 1.5px solid var(--border, #e2e8f0); border-radius: 50%;
  background: var(--off-white, #F0F2F5); cursor: pointer;
  font-size: 1rem; line-height: 1; padding: 0;
  transition: border-color .2s, opacity .2s;
}
.nav-btn-nieve:hover { border-color: var(--accent, #16A34A); }
.nav-btn-nieve[aria-pressed="false"] { opacity: .5; }

/* Trineo que cruza arriba una vez por sesión */
.nav-trineo {
  position: fixed; top: 74px; left: 0; width: 250px; height: 75px; z-index: 380; pointer-events: none;
  animation: navTrineo 15s linear forwards;
}
.nav-trineo > span {
  display: block; width: 100%; height: 100%;
  background: url(../img/navidad/trineo.svg) no-repeat center / contain;
  filter: drop-shadow(0 4px 4px rgba(0, 0, 0, .15));
  animation: navTrineoVuelo 2.2s ease-in-out infinite;
}
@keyframes navTrineo { from { transform: translateX(-270px); } to { transform: translateX(calc(100vw + 20px)); } }
@keyframes navTrineoVuelo { 0%, 100% { transform: translateY(0) rotate(-2deg); } 50% { transform: translateY(-10px) rotate(1deg); } }

/* Línea de cuenta regresiva: va dentro del recuadro azul del saludo (estudiante/dashboard.php), texto blanco siempre */
.nav-cuenta {
  display: block; width: fit-content; margin: 6px 0 8px;
  padding: 3px 12px; border-radius: 100px;
  background: rgba(255, 255, 255, .18); color: #fff;
  font-size: .8rem; font-weight: 700; letter-spacing: .2px;
}

/* Mascota con gorro */
.nav-mascota {
  /* Bajo las ventanas (.modal 500, anuncio 600) y el fondo del menú en celular (399) */
  position: fixed; right: 18px; bottom: 18px; z-index: 390;
  width: 96px; height: 60px;
}
.nav-mascota__anim { width: 100%; height: 100%; cursor: pointer; }
.nav-mascota__anim svg { display: block; }
/* El gorro va sobre la cabeza del zorro (mascota_zorro.json, 774×476) */
.nav-mascota::before {
  content: "";
  position: absolute; z-index: 1;
  left: 50%; top: -15px;
  width: 38px; height: 32px;
  background: url(../img/navidad/gorro.svg) no-repeat center / contain;
  transform: rotate(14deg);
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, .25));
  pointer-events: none;
}
.nav-mascota__cerrar {
  position: absolute; top: -10px; left: -6px; z-index: 2;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(15, 23, 42, .55); color: #fff;
  font-size: 11px; line-height: 20px; text-align: center; padding: 0; cursor: pointer;
  opacity: 0; transition: opacity .2s;
}
.nav-mascota:hover .nav-mascota__cerrar,
.nav-mascota:focus-within .nav-mascota__cerrar { opacity: 1; }
.nav-mascota__globo {
  position: absolute; right: 8px; bottom: calc(100% + 18px);
  width: max-content; max-width: 220px;
  padding: 9px 13px; border-radius: 14px 14px 4px 14px;
  background: #fff; color: #0f172a;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .14);
  font-size: .8rem; font-weight: 600; line-height: 1.35;
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.nav-mascota__globo.visible { opacity: 1; transform: none; }
body.dark .nav-mascota__globo { background: #1e293b; color: #f1f5f9; }

/* En celular: chica, sobre la barra inferior y sin globito */
@media (max-width: 768px) {
  .nav-mascota { right: 8px; bottom: 74px; width: 64px; height: 40px; opacity: .9; }
  .nav-mascota::before { top: -11px; width: 27px; height: 23px; }
  .nav-mascota__globo { display: none; }
  /* El aula da 38 px mínimos a todo botón en celular: aquí taparía al zorro */
  .nav-mascota__cerrar {
    opacity: 1; top: -14px; left: -10px;
    width: 24px !important; height: 24px !important; min-width: 0 !important; min-height: 0 !important;
    line-height: 24px; font-size: 12px;
  }
  .nav-trineo { top: 64px; width: 170px; height: 51px; }
}

/* ═════════════ Pantalla de ingreso (index.php; navidad.js en modo «login») ═════════════ */
/* Como en el menú: el logo se corre y el gorro se apoya en su esquina sin taparle letras */
.tema-navidad .nav-gorro--login { padding-left: 28px; }
.tema-navidad .nav-gorro--login::after { left: -14px; top: -30px; width: 56px; height: 47px; }
/* Guirnalda colgando por dentro del borde de arriba de la tarjeta (la tarjeta recorta lo que sobresale) */
.nav-luces--arriba { top: -3px; bottom: auto; z-index: 5; }
/* Más chico que en el aula: así no tapa la etiqueta «ICEPP» de la esquina del formulario */
.authbox > .nav-acebo { z-index: 6; top: -12px; right: -10px; width: 80px; height: 60px; }
.nav-cuenta--login { margin: 14px 0 0; font-size: .82rem; }
/* Arbolito más alto, no más ancho (usuario, 01/12/2026): dibujo ARBOL_ALTO de navidad.js (60×112), con un piso más de
   ramas; en pantallas medianas, más bajo para no tapar los textos. Va detrás del contenido de .brand (index.php le da
   z-index 1 a cada hijo): si se cruzara con un texto, el texto queda encima (revisión de Codex del #613). */
.brand > .nav-arbol-login { position: absolute; right: 20px; bottom: 10px; width: 110px; height: 205px; z-index: 0; pointer-events: none; }
@media (max-width: 1100px) { .brand > .nav-arbol-login { right: 24px; bottom: 14px; width: 90px; height: 168px; } }
/* Entre 861 y 960 px la columna es angosta: más chico, para que no llegue al renglón de «Certificación con respaldo…» */
@media (max-width: 960px) { .brand > .nav-arbol-login { right: 14px; bottom: 14px; width: 66px; height: 123px; } }
@media (max-width: 860px) {
  .brand > .nav-arbol-login { display: none; }
  /* En celular la tarjeta tiene menos margen arriba: gorro más chico y logo un poco más abajo */
  .tema-navidad .nav-gorro--login { padding-left: 22px; margin-top: 10px; }
  .tema-navidad .nav-gorro--login::after { left: -12px; top: -22px; width: 42px; height: 36px; }
}

/* ═════════════ Ventas: regalos (NAVIDAD_VENTAS_v1, usuario 27/11/2026) ═════════════ */
/* Saludo del inicio de Ventas (.asesor-hero, que recorta lo que sobresale): cinta dorada vertical con su lazo arriba.
   Va bajo el texto del saludo (z-index 1 en asesor/dashboard.php). */
.nav-cinta {
  position: absolute; top: 0; bottom: 0; right: 15%; width: 26px; z-index: 0; pointer-events: none;
  background: linear-gradient(90deg, #f9a825 0%, #ffe082 45%, #f9a825 100%);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .18), 0 0 12px rgba(0, 0, 0, .12);
  opacity: .92;
}
.nav-lazo-hero {
  position: absolute; top: -4px; right: calc(15% - 37px); width: 100px; height: 68px; z-index: 0; pointer-events: none;
  background: url(../img/navidad/lazo.svg) no-repeat center / contain;
  filter: hue-rotate(38deg) saturate(1.6) brightness(1.15) drop-shadow(0 3px 4px rgba(0, 0, 0, .2));
}
/* Lazo chico en la esquina de cada tarjeta y paso del embudo */
.nav-lazo-tarjeta {
  position: absolute; top: -2px; right: 8px; width: 34px; height: 24px; z-index: 3; pointer-events: none;
  background: url(../img/navidad/lazo.svg) no-repeat center / contain;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, .2));
}

/* Pila de regalos en la esquina (bajo las ventanas: .modal 500, anuncio 600) */
.nav-pila { position: fixed; right: 18px; bottom: 18px; z-index: 390; width: 92px; height: 84px; }
.nav-pila--alta { bottom: 86px; } /* hay botón flotante (#fab-main) en la esquina */
.nav-pila__regalos {
  display: block; width: 100%; height: 100%; padding: 0; border: none; cursor: pointer;
  background: url(../img/navidad/regalos.svg) no-repeat center bottom / contain;
  filter: drop-shadow(0 4px 6px rgba(0, 0, 0, .18));
  transform-origin: 50% 100%; transition: transform .2s;
}
.nav-pila__regalos:hover { transform: scale(1.06) rotate(-2deg); }
.nav-pila__regalos:focus-visible { outline: 3px solid #F2660C; outline-offset: 4px; border-radius: 12px; }
.nav-pila__regalos.salta { animation: navPilaSalta .6s ease-out; }
@keyframes navPilaSalta {
  0% { transform: scale(1); } 25% { transform: scale(1.12, .9); } 50% { transform: translateY(-14px) scale(.96, 1.06); }
  75% { transform: translateY(0) scale(1.04, .96); } 100% { transform: scale(1); }
}
.nav-pila__cerrar {
  position: absolute; top: -8px; left: -6px; z-index: 2;
  width: 20px; height: 20px; border-radius: 50%;
  border: none; background: rgba(15, 23, 42, .55); color: #fff;
  font-size: 11px; line-height: 20px; text-align: center; padding: 0; cursor: pointer;
  opacity: 0; transition: opacity .2s;
}
.nav-pila:hover .nav-pila__cerrar, .nav-pila:focus-within .nav-pila__cerrar { opacity: 1; }
.nav-pila__globo {
  position: absolute; right: 6px; bottom: calc(100% + 10px);
  width: max-content; max-width: 230px;
  padding: 9px 13px; border-radius: 14px 14px 4px 14px;
  background: #fff; color: #0f172a;
  box-shadow: 0 6px 24px rgba(0, 0, 0, .14);
  font-size: .8rem; font-weight: 600; line-height: 1.35;
  opacity: 0; transform: translateY(6px); transition: opacity .3s, transform .3s;
  pointer-events: none;
}
.nav-pila__globo.visible { opacity: 1; transform: none; }
body.dark .nav-pila__globo { background: #1e293b; color: #f1f5f9; }

/* Lluvia de regalos al entrar (una vez por sesión) */
.nav-lluvia { position: fixed; inset: 0; z-index: 385; pointer-events: none; overflow: hidden; }
.nav-lluvia > span {
  position: absolute; top: -60px; display: block;
  animation: navLluvia var(--t, 3s) cubic-bezier(.35, .1, .7, 1) var(--d, 0s) forwards;
  filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .15));
  opacity: 0;
}
.nav-lluvia > span > svg { display: block; width: 100%; height: 100%; }
@keyframes navLluvia {
  0% { transform: translateY(0) rotate(0); opacity: 1; }
  85% { opacity: 1; }
  100% { transform: translateY(calc(100vh + 80px)) rotate(var(--g, 40deg)); opacity: 0; }
}

@media (max-width: 768px) {
  /* En celular: chica, sobre la barra inferior y sin globito */
  .nav-pila { right: 8px; bottom: 74px; width: 62px; height: 56px; }
  .nav-pila--alta { bottom: 140px; }
  .nav-pila__globo { display: none; }
  .nav-pila__cerrar {
    opacity: 1; top: -12px; left: -10px;
    width: 24px !important; height: 24px !important; min-width: 0 !important; min-height: 0 !important;
    line-height: 24px; font-size: 12px;
  }
  .nav-pila__regalos { width: 100% !important; height: 100% !important; min-width: 0 !important; min-height: 0 !important; }
  .nav-cinta { width: 18px; right: 10%; }
  .nav-lazo-hero { width: 70px; height: 48px; right: calc(10% - 26px); }
}

/* Confeti de Año Nuevo */
/* Sobre la mascota y la pila de regalos (390) pero bajo las ventanas (.modal 500, anuncio 600): revisión de Codex del #599 */
#nav-confeti { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 395; }

/* Sin movimiento para quien lo pidió en su equipo (navidad.js tampoco arranca nieve, trineo ni confeti) */
@media (prefers-reduced-motion: reduce) {
  .nav-foco::after, .nav-arbol__luz, .nav-arbol__estrella, .nav-trineo, .nav-trineo > span, .nav-pila__regalos.salta { animation: none; }
  .nav-pila__regalos:hover { transform: none; }
}

/* Nada de la decoración sale en papel */
@media print {
  .nav-luces, .nav-tapa, .nav-acebo, .nav-arbol-hero, .nav-arbol-menu, .nav-arbol-login, .nav-trineo, .tema-navidad .nav-gorro::after,
  .tema-navidad .nav-regalo::before, .tema-navidad .nav-regalo::after,
  #nav-nieve, #nav-confeti, .nav-mascota, .nav-btn-nieve, .nav-cuenta,
  .nav-cinta, .nav-lazo-hero, .nav-lazo-tarjeta, .nav-pila, .nav-lluvia { display: none !important; }
  .tema-navidad.role-estudiante { background-image: none !important; }
}
