/*
 * Decoración navideña (includes/navidad_widget.php + assets/navidad.js).
 * Todo con prefijo xmas-. Nada de esto recibe clics (pointer-events: none).
 * Capas: luces dentro del header (z-40), trineo en z-55 (sobre header/sidebar, bajo los modales),
 * gorro dentro de #gerald-widget (z-70).
 */

/* ---------- Gorro de Papá Noel sobre Gerald ---------- */
.xmas-gorro {
  position: absolute;
  top: -16px;
  left: 4px;
  width: 46px;
  height: 42px;
  z-index: 2;
  pointer-events: none;
  transform: rotate(-20deg);
  transform-origin: 20% 90%;
  transition: transform .15s ease-out;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .25));
}
.xmas-gorro svg { display: block; width: 100%; height: 100%; }
/* Sigue el hover del lanzador (que escala 1.05 en Tailwind). */
#gerald-widget:has(#gerald-launcher:hover) .xmas-gorro { transform: rotate(-20deg) scale(1.05); }
#gerald-widget:has(#gerald-launcher:active) .xmas-gorro { transform: rotate(-20deg) scale(.95); }
/* En móvil el panel es pantalla completa: el gorro no debe flotar encima. */
@media (max-width: 767px) {
  #gerald-widget:has(#gerald-panel.flex) .xmas-gorro { display: none; }
}

/* ---------- Luces bajo el header ---------- */
.xmas-luces {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  height: 22px;
  pointer-events: none;
  z-index: 1;
}
.xmas-luces-cable {
  position: absolute;
  left: 0;
  top: 0;
  display: block;
  height: 22px;
}
.xmas-luces-cable path { fill: none; stroke: #1b5e20; stroke-width: 1.6; stroke-linecap: round; }
.xmas-foco {
  position: absolute;
  top: 6px;
  width: 8px;
  height: 12px;
  margin-left: -4px;
  border-radius: 50% 50% 50% 50% / 38% 38% 62% 62%;
  background: var(--xmas-c, #e53935);
  box-shadow: 0 0 8px 2px var(--xmas-c, #e53935);
  animation: xmas-brillo 1.6s ease-in-out infinite alternate;
}
/* Casquillo del foco. */
.xmas-foco::before {
  content: "";
  position: absolute;
  top: -3px;
  left: 1px;
  width: 6px;
  height: 4px;
  border-radius: 1px;
  background: #37474f;
}
/* Reflejo del cristal. */
.xmas-foco::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 2px;
  width: 2px;
  height: 3px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .55);
}
.xmas-foco-r { --xmas-c: #e53935; }
.xmas-foco-v { --xmas-c: #2e7d32; }
.xmas-foco-d { --xmas-c: #f9a825; }
.xmas-foco-a { --xmas-c: #1e88e5; }
@keyframes xmas-brillo {
  from { opacity: .4; }
  to   { opacity: 1; }
}

/* ---------- Trineo volador ---------- */
.xmas-trineo {
  position: fixed;
  left: 0;
  top: 20%;
  z-index: 55;
  display: none;
  pointer-events: none;
  will-change: transform;
}
.xmas-trineo.xmas-vuela {
  display: block;
  animation: xmas-cruce 10s linear forwards;
}
.xmas-trineo-aire {
  animation: xmas-ola 1.8s ease-in-out infinite alternate;
}
.xmas-trineo svg { display: block; width: 260px; height: auto; overflow: visible; }
@media (max-width: 767px) {
  .xmas-trineo svg { width: 170px; }
}
@keyframes xmas-cruce {
  from { transform: translate3d(-300px, 0, 0); }
  to   { transform: translate3d(calc(100vw + 300px), -8vh, 0); }
}
@keyframes xmas-ola {
  from { transform: translate3d(0, -7px, 0) rotate(-1.5deg); }
  to   { transform: translate3d(0, 7px, 0) rotate(1.5deg); }
}
/* Galope de los renos: patas alternas. */
.xmas-pata {
  transform-box: fill-box;
  transform-origin: 50% 0%;
  animation: xmas-galope .32s ease-in-out infinite alternate;
}
.xmas-pata-b { animation-direction: alternate-reverse; }
@keyframes xmas-galope {
  from { transform: rotate(-26deg); }
  to   { transform: rotate(26deg); }
}
/* Destellos de la estela y brillo de la nariz de Rudolph. */
.xmas-chispa {
  transform-box: fill-box;
  transform-origin: 50% 50%;
  animation: xmas-chispa 0.9s ease-in-out infinite alternate;
}
@keyframes xmas-chispa {
  from { transform: scale(.4); opacity: .3; }
  to   { transform: scale(1.1); opacity: 1; }
}
.xmas-nariz-brillo { animation: xmas-nariz 0.8s ease-in-out infinite alternate; }
@keyframes xmas-nariz {
  from { opacity: .15; }
  to   { opacity: .55; }
}

/* ---------- Movimiento reducido: sin trineo, luces fijas, el gorro se queda ---------- */
@media (prefers-reduced-motion: reduce) {
  .xmas-trineo { display: none !important; animation: none !important; }
  .xmas-foco { animation: none; opacity: 1; }
  .xmas-gorro { transition: none; }
}

/* ======================================================================
   Tema Equilibrio · Pine grove
   Rojo acebo #AD1010, dorado #D1A33C y verde pino #174D1A. Los colores de
   marca de Tailwind se repintan en includes/navidad_widget.php; aquí van los
   adornos. Nada nuevo captura clics (todo pointer-events:none salvo enlaces).
   ====================================================================== */

/* ---------- Menú lateral: pino con guirnalda de luces ---------- */
#appSidebar {
  background: url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20width%3D%22112%22%20height%3D%2222%22%3E%3Cpath%20d%3D%22M0%204q14%2010%2028%200t28%200t28%200t28%200%22%20stroke%3D%22%238b97b3%22%20stroke-width%3D%221.3%22%20fill%3D%22none%22%2F%3E%3Cg%20fill%3D%22%238b97b3%22%3E%3Crect%20x%3D%2212.4%22%20y%3D%227.6%22%20width%3D%223.2%22%20height%3D%223%22%20rx%3D%22.8%22%2F%3E%3Crect%20x%3D%2240.4%22%20y%3D%227.6%22%20width%3D%223.2%22%20height%3D%223%22%20rx%3D%22.8%22%2F%3E%3Crect%20x%3D%2268.4%22%20y%3D%227.6%22%20width%3D%223.2%22%20height%3D%223%22%20rx%3D%22.8%22%2F%3E%3Crect%20x%3D%2296.4%22%20y%3D%227.6%22%20width%3D%223.2%22%20height%3D%223%22%20rx%3D%22.8%22%2F%3E%3C%2Fg%3E%3Cellipse%20cx%3D%2214%22%20cy%3D%2214%22%20rx%3D%223.6%22%20ry%3D%225%22%20fill%3D%22%23e2233f%22%2F%3E%3Cellipse%20cx%3D%2242%22%20cy%3D%2214%22%20rx%3D%223.6%22%20ry%3D%225%22%20fill%3D%22%23D1A33C%22%2F%3E%3Cellipse%20cx%3D%2270%22%20cy%3D%2214%22%20rx%3D%223.6%22%20ry%3D%225%22%20fill%3D%22%23e6efe5%22%2F%3E%3Cellipse%20cx%3D%2298%22%20cy%3D%2214%22%20rx%3D%223.6%22%20ry%3D%225%22%20fill%3D%22%237fc47f%22%2F%3E%3C%2Fsvg%3E") repeat-x 0 0 / 112px 22px, linear-gradient(180deg, #0e3311, #174D1A);
  border-right: 4px solid;
  border-image: linear-gradient(180deg, #fffdf6, #D1A33C) 1;
  padding-top: 26px;
}
#appSidebar h1 { color: #fff; }
#appSidebar h1 + p,
#appSidebar .flex-1 > p { color: #b6cdb3; }
#appSidebar .w-10.h-10.rounded-full.bg-primary {
  background: linear-gradient(135deg, #fffdf6 0%, #f3e2b0 35%, #D1A33C 100%);
}
#appSidebar .fs-nav-item { color: #dbe8d9; }
#appSidebar .fs-nav-item:not(.fs-eco-nuevo):hover { background: rgba(255, 255, 255, .08) !important; }
#appSidebar .fs-nav-item.bg-secondary-container,
#appSidebar .fs-nav-item.bg-secondary-container:hover {
  background: linear-gradient(135deg, #AD1010, #7e0b0b) !important;
  color: #fff !important;
  box-shadow: inset 4px 0 0 #D1A33C, 0 6px 14px rgba(173, 16, 16, .35);
}
#appSidebar .fs-nav-item.bg-secondary-container .material-symbols-outlined { color: #f6e3a8; }
#appSidebar .fs-nav-item span.bg-primary.rounded-full { background: #D1A33C; color: #0e3311; }
/* Pie del menú: Nueva Venta y Cerrar Sesión */
#appSidebar a.bg-primary {
  background: linear-gradient(135deg, #fffdf6 0%, #f3e2b0 35%, #D1A33C 100%);
  color: #0e3311;
}
#appSidebar .fs-nav-item.text-error { color: #ffb4ab; }
#appSidebar button[aria-label="Cerrar menú"] { color: #fff; }

/* ---------- Barra superior: franja tricolor abajo (las luces cuelgan debajo) ---------- */
header.sticky.top-0 {
  background-image: linear-gradient(90deg, #AD1010 0 33.3%, #D1A33C 33.3% 66.6%, #174D1A 66.6%);
  background-size: 100% 4px;
  background-position: bottom;
  background-repeat: no-repeat;
}
header.sticky.top-0 div.bg-surface-container-high.rounded-full {
  background: linear-gradient(135deg, #fffdf6 0%, #f3e2b0 35%, #D1A33C 100%);
  color: #0e3311;
}

/* ---------- Tarjetas de indicadores: franja roja y dorada alternada ---------- */
.xmas-kpis > * { border-top: 4px solid #AD1010; }
.xmas-kpis > *:nth-child(even) { border-top-color: #D1A33C; }

/* ---------- Cintillo del dashboard ---------- */
.xmas-cintillo {
  position: relative; overflow: hidden; display: flex; align-items: center; gap: 16px;
  padding: 16px 24px; border-radius: 8px; color: #fff; border: 2px solid #D1A33C;
  background: linear-gradient(120deg, #7e0b0b, #AD1010 60%, #c42020);
}
.xmas-cintillo > * { position: relative; z-index: 2; }
.xmas-cintillo > .xmas-cinta, .xmas-cintillo > .xmas-mono { position: absolute; z-index: 1; }
.xmas-cinta {
  top: 0; bottom: 0; right: 160px; width: 20px;
  background: linear-gradient(90deg, #a9832b, #fff3cf 50%, #a9832b);
}
.xmas-mono {
  right: 137px; top: -5px; width: 66px; height: 44px;
  background: no-repeat center / contain url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2060%2040%22%3E%3Cpath%20fill%3D%22%23D1A33C%22%20d%3D%22M27%2021l-8%2018%205-2%203%203%203-19zM33%2021l8%2018-5-2-3%203-3-19z%22%2F%3E%3Cpath%20fill%3D%22%23D1A33C%22%20d%3D%22M30%2019C22%204%205%201%204%2012s15%2013%2026%207zM30%2019C38%204%2055%201%2056%2012s-15%2013-26%207z%22%2F%3E%3Cpath%20d%3D%22M30%2019C24%209%2013%206%2010%2011M30%2019C36%209%2047%206%2050%2011%22%20stroke%3D%22%23000%22%20stroke-opacity%3D%22.18%22%20stroke-width%3D%221.5%22%20fill%3D%22none%22%2F%3E%3Ccircle%20cx%3D%2230%22%20cy%3D%2219%22%20r%3D%225.5%22%20fill%3D%22%23a9832b%22%2F%3E%3C%2Fsvg%3E");
}
.xmas-arbolito { width: 44px; height: 44px; flex-shrink: 0; background: no-repeat center / contain url("data:image/svg+xml,%3Csvg%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%20viewBox%3D%220%200%2024%2024%22%3E%3Cpath%20fill%3D%22%23D1A33C%22%20d%3D%22M12%201.2l1.1%202.3%202.5.3-1.8%201.7.5%202.5L12%206.8%209.7%208l.5-2.5-1.8-1.7%202.5-.3z%22%2F%3E%3Cpath%20fill%3D%22%23fff%22%20d%3D%22M12%207.5l4.2%205h-2l3.3%204.3h-2.3L19%2021H5l3.8-4.2H6.5l3.3-4.3h-2z%22%2F%3E%3Ccircle%20cx%3D%2210.4%22%20cy%3D%2214.6%22%20r%3D%22.9%22%20fill%3D%22%23c8102e%22%2F%3E%3Ccircle%20cx%3D%2213.8%22%20cy%3D%2218.6%22%20r%3D%22.9%22%20fill%3D%22%23c8102e%22%2F%3E%3Ccircle%20cx%3D%2212.6%22%20cy%3D%2211.2%22%20r%3D%22.8%22%20fill%3D%22%23D1A33C%22%2F%3E%3C%2Fsvg%3E"); }
.xmas-cintillo-txt b { display: block; font-family: 'Hanken Grotesk', sans-serif; font-size: 20px; font-weight: 800; }
.xmas-cintillo-txt small { display: block; font-family: 'Hanken Grotesk', sans-serif; font-size: 15px; font-weight: 800; color: #f6e3a8; }
.xmas-cuenta { margin-left: auto; text-align: right; line-height: 1; }
.xmas-cuenta strong { font-family: 'Hanken Grotesk', sans-serif; font-size: 34px; font-weight: 900; color: #f6e3a8; }
.xmas-cuenta span { display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; opacity: .9; margin-top: 4px; }
@media (max-width: 640px) { .xmas-cinta, .xmas-mono { display: none; } }

/* ---------- Nieve sobre el contenido (la pone assets/navidad_tema.js) ---------- */
.xmas-conwrap { position: relative; }
.xmas-conwrap > :not(.xmas-nieve):not(header):not(.sticky) { position: relative; z-index: 1; }
.xmas-nieve { position: absolute; left: 0; right: 0; top: 0; height: 320px; overflow: hidden; pointer-events: none; z-index: 0; }
.xmas-nieve i {
  position: absolute; top: -10px; border-radius: 50%; background: #cfe6d6; opacity: .9;
  animation: xmas-copo linear infinite;
}
@keyframes xmas-copo { to { transform: translate(var(--x, 0), var(--h, 330px)); } }

/* ---------- Login: bosque de noche ---------- */
.xmas-login {
  background: radial-gradient(1100px 500px at 50% 115%, #2b6a2f 0%, transparent 60%), linear-gradient(180deg, #071c09, #0e3311 55%, #174D1A) !important;
}
.xmas-login [class*="blur-["] { display: none; }
.xmas-login div.max-w-md { border: 3px solid #D1A33C; border-top: 8px solid #AD1010; position: relative; }
.xmas-login > .xmas-nieve { height: 100%; --h: 100vh; }
.xmas-login > .xmas-nieve i { background: #fff; }
.xmas-lema {
  display: inline-flex; align-items: center; gap: 6px; border-radius: 12px; padding: 7px 14px;
  font-family: 'Hanken Grotesk', sans-serif; font-size: 17px; font-weight: 800; line-height: 1.2;
  background: #AD1010; color: #f6e3a8; border: 1.5px solid #D1A33C; margin-bottom: 12px;
}
.xmas-colinas { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 170px; pointer-events: none; }
.xmas-arbol {
  position: absolute; bottom: 38px; left: calc(50% - 224px - 280px); width: 270px; height: 380px;
  pointer-events: none; filter: drop-shadow(0 18px 20px rgba(0, 0, 0, .25));
}
.xmas-arbol.der { left: auto; right: calc(50% - 224px - 230px); width: 180px; height: 255px; bottom: 52px; }
.xmas-regalos { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 120px; pointer-events: none; }
.xmas-arbol .glow { animation: xmas-titileo 1.6s ease-in-out infinite alternate; }
.xmas-arbol .glow:nth-of-type(3n) { animation-delay: .5s; }
@keyframes xmas-titileo { from { opacity: .35; } to { opacity: 1; } }
@media (max-width: 1100px) { .xmas-arbol { left: -70px; width: 210px; height: 300px; } .xmas-arbol.der { display: none; } }
@media (max-width: 1000px) { .xmas-arbol { display: none; } }

/* ---------- Movimiento reducido: copos quietos, sin titileo ---------- */
@media (prefers-reduced-motion: reduce) {
  .xmas-nieve i, .xmas-arbol .glow { animation: none !important; }
}
