/* ═══════════════════════════════════════════════════════════════════════
   SATEC · Temática navideña — 15/11/2026
   GUBOS Developer Costa Rica · BCom A.i Xpert

   Se carga SOLO cuando la temporada está activa (`navidad` en app.py: del
   NAVIDAD_DESDE al 31/12, apagado solo el 1 de enero). Va encima del v4
   «Vitrina» sin tocarlo: si se quita este archivo, el sitio queda idéntico.

   Criterio: festiva pero liviana. Los productos siguen siendo lo principal;
   la Navidad va en los bordes —una guirnalda bajo el encabezado, un destello
   en el logo, un saludo en la vitrina, nieve suave y el bastón en el pie—.
   Ningún adorno recibe clics ni tapa contenido, y con «reducir movimiento»
   todo queda quieto.
   ═══════════════════════════════════════════════════════════════════════ */

:root {
  --nv-red:   #C8102E;
  --nv-red-2: #A00D24;
  --nv-gold:  #B8860B;           /* oro oscuro: se lee sobre blanco */
  --nv-gold-l:#F2C14E;
  --nv-green: var(--s4-green);
  --nv-snow:  #7FA6C6;           /* sobre el gris claro la nieve blanca no se ve */
  --nv-cream: #FFF8EC;
}
html[data-tema="oscuro"] {
  --nv-red:   #FF5A6A;
  --nv-red-2: #E5484D;
  --nv-gold:  #F2C14E;
  --nv-snow:  #FFFFFF;
  --nv-cream: #1A2433;
}

/* ═══ Guirnalda de luces bajo el encabezado ════════════════════════════
   Dos capas con las luces alternas: mientras una brilla la otra baja, y se
   ve el titileo de una guirnalda de verdad. Son SVG en línea (la CSP admite
   `data:`) y se repiten a todo el ancho. */
header.s4-hdr::before,
header.s4-hdr::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -17px; height: 20px;
  pointer-events: none; background-repeat: repeat-x; background-size: 120px 20px;
  z-index: 1;
}
header.s4-hdr::after {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='20'%3E%3Cpath d='M0 2 Q30 10 60 2 Q90 10 120 2' fill='none' stroke='%23315A3E' stroke-width='1.3'/%3E%3Crect x='13.4' y='5' width='3.2' height='3' rx='.6' fill='%23556070'/%3E%3Cellipse cx='15' cy='12' rx='3.7' ry='5' fill='%23E0243F'/%3E%3Crect x='73.4' y='5' width='3.2' height='3' rx='.6' fill='%23556070'/%3E%3Cellipse cx='75' cy='12' rx='3.7' ry='5' fill='%2322A456'/%3E%3C/svg%3E");
  animation: nv-titila 1.7s ease-in-out infinite alternate;
}
header.s4-hdr::before {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='20'%3E%3Crect x='43.4' y='5' width='3.2' height='3' rx='.6' fill='%23556070'/%3E%3Cellipse cx='45' cy='12' rx='3.7' ry='5' fill='%23F5B82E'/%3E%3Crect x='103.4' y='5' width='3.2' height='3' rx='.6' fill='%23556070'/%3E%3Cellipse cx='105' cy='12' rx='3.7' ry='5' fill='%233AA0E8'/%3E%3C/svg%3E");
  animation: nv-titila 1.7s ease-in-out infinite alternate-reverse;
}
/* Titileo marcado (Tavo, 15/11): la luz se APAGA de verdad —brillo bajo,
   sin halo— y al encender brilla por encima de su color con un halo cálido
   doble. Se anima el brillo y no la opacidad: así el cable de la guirnalda
   no se desvanece con las luces. Cada estado se sostiene un momento antes
   de cambiar, como una serie de luces y no como un desvanecido. */
@keyframes nv-titila {
  0%, 30%   { filter: brightness(.38) saturate(.55); }
  60%, 100% { filter: brightness(1.25) saturate(1.15)
                      drop-shadow(0 0 3px rgba(255, 226, 140, 1))
                      drop-shadow(0 0 8px rgba(255, 196, 80, .75)); }
}

/* ═══ El destello del logo ═══════════════════════════════════════════ */
.s4-bar .logo { position: relative; }
.s4-bar .logo::after {
  content: ""; position: absolute; top: -4px; right: -10px; width: 16px; height: 16px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 0 C13 8 16 11 24 12 C16 13 13 16 12 24 C11 16 8 13 0 12 C8 11 11 8 12 0Z' fill='%23E2A622'/%3E%3C/svg%3E") center / contain no-repeat;
  animation: nv-destello 3.2s ease-in-out infinite;
}
@keyframes nv-destello {
  0%, 100% { transform: scale(.55) rotate(0deg);  opacity: .5; }
  50%      { transform: scale(1)   rotate(45deg); opacity: 1; }
}

/* El número del carrito, en rojo de temporada */
.s4-cart .cart-count { background: var(--nv-red); }

/* ═══ El saludo de la vitrina ═════════════════════════════════════════
   Una sola línea, sobre la vitrina. Borde con el degradado rojo-oro-verde y
   fondo de la superficie: se lee como parte del sitio, no como un anuncio. */
.nv-saludo {
  position: relative; display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  margin: 0 0 16px; padding: 12px 18px 12px 14px; border-radius: 999px;
  background:
    linear-gradient(var(--s4-surface), var(--s4-surface)) padding-box,
    linear-gradient(90deg, var(--nv-red), var(--nv-gold-l), var(--nv-green)) border-box;
  border: 2px solid transparent; box-shadow: var(--s4-sh-1);
}
.nv-saludo .nv-ico {
  flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center;
  background: var(--nv-red); color: #fff;
}
.nv-saludo .nv-ico svg { width: 20px; height: 20px; }
.nv-saludo .nv-txt { flex: 1 1 260px; min-width: 0; line-height: 1.35; }
.nv-saludo .nv-txt b { display: block; font-size: 16px; letter-spacing: -.02em; color: var(--s4-ink); }
.nv-saludo .nv-txt span { font-size: 13.5px; color: var(--s4-muted); }
.nv-saludo .nv-cta {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 6px; padding: 9px 16px; border-radius: 999px;
  background: var(--nv-green); color: #fff; font-weight: 700; font-size: 14px; text-decoration: none;
  transition: background .2s var(--s4-ease), transform .2s var(--s4-ease);
}
.nv-saludo .nv-cta:hover { background: var(--s4-green-2); transform: translateX(2px); }
.nv-saludo .nv-cta svg { width: 16px; height: 16px; }
@media (max-width: 640px) {
  .nv-saludo { border-radius: 20px; padding: 12px; gap: 10px; }
  .nv-saludo .nv-cta { width: 100%; justify-content: center; }
}

/* ═══ Los títulos de sección llevan una estrella dorada ═══════════════ */
.s4-sec .s4-head h2::before {
  content: "✦"; display: inline-block; margin-right: 10px; color: var(--nv-gold);
  font-size: .62em; vertical-align: .28em;
}

/* ═══ El pie: la franja de bastón de caramelo ═════════════════════════ */
footer.s4-foot { position: relative; }
footer.s4-foot::before {
  content: ""; position: absolute; top: 0; left: 0; right: 0; height: 6px; pointer-events: none;
  background: repeating-linear-gradient(135deg,
    var(--nv-red) 0 12px, #FFFFFF 12px 20px, var(--nv-green) 20px 32px, #FFFFFF 32px 40px);
}
.nv-foot-saludo { display: inline-flex; align-items: center; gap: 6px; color: var(--nv-red); font-weight: 700; }
.nv-foot-saludo svg { width: 15px; height: 15px; }

/* ═══ La nieve ═════════════════════════════════════════════════════════
   Pocos copos, lentos y semitransparentes, en una capa fija que no recibe
   clics. La arma navidad.js; el visitante la apaga con el copo del
   encabezado. */
.nv-nieve { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.nv-nieve i {
  position: absolute; top: -24px; display: block; color: var(--nv-snow); font-style: normal; line-height: 1;
  text-shadow: 0 0 6px rgba(255, 255, 255, .6);
  animation: nv-cae linear infinite, nv-vaiven ease-in-out infinite alternate;
}
@keyframes nv-cae    { to { transform: translateY(calc(100vh + 48px)); } }
@keyframes nv-vaiven { from { margin-left: -14px; } to { margin-left: 14px; } }

/* El copo que apaga y enciende la nieve, junto al sol/luna */
.nv-copo { position: relative; width: 44px; height: 44px; flex: 0 0 44px; border-radius: 12px; border: 0;
  background: transparent; color: var(--s4-ink); display: grid; place-items: center; cursor: pointer; }
.nv-copo:hover { background: var(--s4-bg); }
html[data-tema="oscuro"] .nv-copo:hover { background: var(--s4-surface); }
.nv-copo svg { width: 20px; height: 20px; }
.nv-copo[aria-pressed="true"] { color: #2F7FC1; }
html[data-tema="oscuro"] .nv-copo[aria-pressed="true"] { color: #8CCBFF; }

/* ═══ Detalles sutiles (Tavo, 15/11: «algunos elementos más») ════════ */

/* El gorro navideño sobre el carrito, ladeado como si se le hubiera caído
   encima. No tapa el número: ese va abajo a la derecha del gorro. */
.s4-cart::before {
  content: ""; position: absolute; left: 4px; top: -1px; width: 26px; height: 21px; pointer-events: none; z-index: 2;
  transform: rotate(-20deg);
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 44 36'%3E%3Cpath d='M6 27 C9 13 19 4 31 5 C36 6 40 11 39 17 C35 13 31 13 29 16 C32 20 34 24 34 27 Z' fill='%23D21F3C'/%3E%3Cpath d='M29 16 C31 13 35 13 39 17' fill='none' stroke='%23A00D24' stroke-width='1.2'/%3E%3Crect x='3' y='25' width='34' height='8' rx='4' fill='%23FFFFFF' stroke='%23DDE3EA' stroke-width='1'/%3E%3Ccircle cx='39' cy='19' r='4.5' fill='%23FFFFFF' stroke='%23DDE3EA' stroke-width='1'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Nieve acumulada en el borde de arriba de las tarjetas de la vitrina. */
.s4-bento > .s4-tile::after {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 15px; z-index: 4; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='15' preserveAspectRatio='none'%3E%3Cpath d='M0 0 H160 V5 C150 5 147 12 138 11 C130 10 128 5 118 6 C108 7 106 13 96 12 C86 11 85 5 74 6 C64 7 62 12 52 11 C43 10 40 5 30 6 C20 7 18 13 9 12 C4 11 2 7 0 7 Z' fill='%23FFFFFF'/%3E%3C/svg%3E") repeat-x top / 160px 15px;
  filter: drop-shadow(0 2px 2px rgba(11, 18, 32, .10));
}
html[data-tema="oscuro"] .s4-bento > .s4-tile::after { filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .35)) brightness(.95); }

/* Una ramita de acebo sobre el ícono del saludo. */
.nv-saludo::after {
  content: ""; position: absolute; left: 20px; top: -16px; width: 42px; height: 31px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 44'%3E%3Cpath d='M30 30 C22 28 14 30 4 24 C10 22 9 17 14 15 C15 20 20 19 21 15 C24 20 28 22 30 30Z' fill='%231B793D'/%3E%3Cpath d='M30 30 C38 28 46 30 56 24 C50 22 51 17 46 15 C45 20 40 19 39 15 C36 20 32 22 30 30Z' fill='%23156131'/%3E%3Ccircle cx='26' cy='31' r='4.2' fill='%23D21F3C'/%3E%3Ccircle cx='34' cy='31' r='4.2' fill='%23D21F3C'/%3E%3Ccircle cx='30' cy='36' r='4.2' fill='%23B5172F'/%3E%3Ccircle cx='24.8' cy='29.8' r='1.2' fill='%23FFFFFF' opacity='.7'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* Una fila de pinos tenue al pie de la página, con alguna estrella. */
footer.s4-foot { padding-bottom: 36px; }
footer.s4-foot::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 32px; pointer-events: none; opacity: .3;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='32'%3E%3Cpath d='M20 4.0 L15.2 16.6 L24.8 16.6 Z' fill='%231B793D'/%3E%3Cpath d='M20 11.8 L13.1 24.2 L26.9 24.2 Z' fill='%231B793D'/%3E%3Cpath d='M20 19.4 L11.3 30.3 L28.7 30.3 Z' fill='%231B793D'/%3E%3Crect x='18.4' y='30.0' width='3.2' height='2.5' fill='%236B4F2A'/%3E%3Cpath d='M74 13.0 L70.8 21.5 L77.2 21.5 Z' fill='%23156131'/%3E%3Cpath d='M74 18.3 L69.3 26.7 L78.7 26.7 Z' fill='%23156131'/%3E%3Cpath d='M74 23.4 L68.1 30.9 L79.9 30.9 Z' fill='%23156131'/%3E%3Crect x='72.4' y='30.7' width='3.2' height='1.8' fill='%236B4F2A'/%3E%3Cpath d='M132 1.0 L126.7 14.9 L137.3 14.9 Z' fill='%231B793D'/%3E%3Cpath d='M132 9.7 L124.3 23.3 L139.7 23.3 Z' fill='%231B793D'/%3E%3Cpath d='M132 18.0 L122.4 30.1 L141.6 30.1 Z' fill='%231B793D'/%3E%3Crect x='130.4' y='29.8' width='3.2' height='2.7' fill='%236B4F2A'/%3E%3Cpath d='M178 16.0 L175.3 23.2 L180.7 23.2 Z' fill='%23156131'/%3E%3Cpath d='M178 20.5 L174.0 27.5 L182.0 27.5 Z' fill='%23156131'/%3E%3Cpath d='M178 24.8 L173.0 31.0 L183.0 31.0 Z' fill='%23156131'/%3E%3Crect x='176.4' y='30.9' width='3.2' height='1.6' fill='%236B4F2A'/%3E%3Ccircle cx='48' cy='9' r='1.4' fill='%23B8860B'/%3E%3Ccircle cx='104' cy='5' r='1.7' fill='%23B8860B'/%3E%3Ccircle cx='158' cy='12' r='1.2' fill='%23B8860B'/%3E%3C/svg%3E") repeat-x bottom / 200px 32px;
}
html[data-tema="oscuro"] footer.s4-foot::after { opacity: .4; }

/* El enlace «Regalos» del menú, en rojo de temporada */
.s4-links .nv-nav-regalos { display: inline-flex; align-items: center; gap: 6px; color: var(--nv-red) !important; font-weight: 700; }
.s4-links .nv-nav-regalos svg { width: 16px; height: 16px; }

/* ═══ Movimiento reducido: los adornos se quedan, sin animación ═══════ */
@media (prefers-reduced-motion: reduce) {
  header.s4-hdr::before, header.s4-hdr::after, .s4-bar .logo::after { animation: none; opacity: 1; }
  .nv-nieve, .nv-copo { display: none; }
}
