/* TEMA NAVIDAD — todo cuelga de html[data-tema="navidad"]; sin esa marca, la web queda casual.
   Para volver a casual: quita data-tema de <html> en templates/base.html (y, si quieres, el <link> a este archivo).
   Solo CSS: sin JS ni marcado extra. Movimiento sobrio (ease-out, ciclos largos) y todo se apaga con "reducir movimiento". */
html[data-tema="navidad"] {
  --nv-rojo: #b3202a;
  --nv-rojo-osc: #7f1d1d;
  --nv-verde: #14532d;
  --nv-oro: #f5c542;
}

/* 1. Franja de felicitación: primer elemento del <body> (flex en columna), sin tocar plantillas. */
html[data-tema="navidad"] body::before {
  content: "🎄  ¡La Navidad llegó a Los Primos!  ❄️  Estrena con cuotas accesibles · Entrega a domicilio en Tegucigalpa  🎁";
  display: block; text-align: center; font-size: .8rem; font-weight: 800; letter-spacing: .02em;
  padding: .45rem 1rem; color: #fff;
  background: linear-gradient(90deg, var(--nv-rojo-osc), var(--nv-rojo), var(--nv-rojo-osc)) 0 0 / 200% 100%;
  animation: nv-brillo 8s linear infinite;
}

@media (max-width: 639px) { html[data-tema="navidad"] body::before { content: "🎄  ¡La Navidad llegó a Los Primos!  🎁"; } }

/* 2. Cabecera roja y verde con guirnaldas colgantes (SVG en data-URI, 120 px de periodo) que bajan con la cabecera
   y foquitos que pulsan. overflow visible para que la guirnalda cuelgue fuera de la barra. */
html[data-tema="navidad"] header.cabecera {
  background-image: linear-gradient(90deg, var(--nv-verde), #166534 45%, var(--nv-rojo-osc));
  overflow: visible;
}
html[data-tema="navidad"] header.cabecera::after, html[data-tema="navidad"] header.cabecera::before {
  content: ""; position: absolute; left: 0; right: 0; top: 100%; height: 40px; pointer-events: none; transform-origin: 50% 0;
}
html[data-tema="navidad"] header.cabecera::after {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Cpath d='M0 1Q60 36 120 1' fill='none' stroke='%23166534' stroke-width='4.5'/%3E%3Cpath d='M0 1Q60 36 120 1' fill='none' stroke='%23fff' stroke-width='1.4' stroke-dasharray='2 5' opacity='.8'/%3E%3Cg%3E%3Ccircle cx='15' cy='9' r='4.5' fill='%23ef4444'/%3E%3Ccircle cx='40' cy='17' r='4.5' fill='%23f5c542'/%3E%3Ccircle cx='60' cy='19' r='4.5' fill='%2338bdf8'/%3E%3Ccircle cx='80' cy='17' r='4.5' fill='%23ef4444'/%3E%3Ccircle cx='105' cy='9' r='4.5' fill='%23f5c542'/%3E%3C/g%3E%3C/svg%3E") 0 0 / 120px 40px repeat-x;
  animation: nv-balanceo 5s ease-in-out infinite alternate;
}
html[data-tema="navidad"] header.cabecera::before {
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='40'%3E%3Ccircle cx='15' cy='9' r='9' fill='%23ef4444' fill-opacity='.45'/%3E%3Ccircle cx='40' cy='17' r='9' fill='%23f5c542' fill-opacity='.45'/%3E%3Ccircle cx='60' cy='19' r='9' fill='%2338bdf8' fill-opacity='.45'/%3E%3Ccircle cx='80' cy='17' r='9' fill='%23ef4444' fill-opacity='.45'/%3E%3Ccircle cx='105' cy='9' r='9' fill='%23f5c542' fill-opacity='.45'/%3E%3C/svg%3E") 0 0 / 120px 40px repeat-x;
  animation: nv-foquitos 1.4s ease-in-out infinite alternate;
}

/* 3. Nieve: tres capas de copos (periodo común de 600 px) que caen por transform, sin repintar. */
html[data-tema="navidad"]::before {
  content: ""; position: fixed; left: 0; right: 0; top: -600px; height: calc(100% + 600px); z-index: 40;
  pointer-events: none; will-change: transform;
  background-image:
    radial-gradient(circle, rgba(147,197,238,.95) 0 4.5px, transparent 5.2px),
    radial-gradient(circle, rgba(147,197,238,.95) 0 3px, transparent 3.6px),
    radial-gradient(circle, rgba(147,197,238,.8) 0 2.2px, transparent 2.8px),
    radial-gradient(circle, rgba(147,197,238,.65) 0 1.6px, transparent 2.2px);
  background-size: 600px 600px, 300px 300px, 150px 150px, 100px 100px;
  background-position: 120px 60px, 40px 30px, 90px 10px, 15px 55px;
  animation: nv-nieve 24s linear infinite;
}

/* 4. Pie con bastón de caramelo. */
html[data-tema="navidad"] footer { position: relative; }
html[data-tema="navidad"] footer::before {
  content: ""; position: absolute; left: 0; right: 0; top: 0; height: 7px;
  background: repeating-linear-gradient(135deg, var(--nv-rojo) 0 10px, #fff 10px 20px) 0 0 / 28px 7px;
  animation: nv-baston 3s linear infinite;
}

/* 5. Botón de WhatsApp con gorro de Santa que se asoma. */
html[data-tema="navidad"] a[aria-label="Contactar por WhatsApp"]::before {
  content: "🎅"; position: absolute; top: -17px; left: -8px; font-size: 1.5rem; line-height: 1;
  transform-origin: 70% 100%; animation: nv-saludo 3.2s ease-in-out infinite;
}

/* 5b. Mascota CLP con gorro de Santa (render 3D de Blender, WebP animado) saludando abajo a la derecha, junto al botón de WhatsApp.
   Es el ::after del <body> (flex en columna: position fixed la saca del flujo), sin tocar plantillas. */
html[data-tema="navidad"] body::after {
  content: ""; position: fixed; right: 4.6rem; bottom: 4.4rem; width: 88px; height: 88px; z-index: 45; pointer-events: none;
  background: url("/temas/mascota-navidad.webp") center / contain no-repeat;
  filter: drop-shadow(0 6px 8px rgba(15, 23, 42, .25));
}
@media (min-width: 768px) { html[data-tema="navidad"] body::after { right: 5.4rem; bottom: 6px; width: 110px; height: 110px; } }
/* En el teléfono la mascota taparía tarjetas y la barra inferior: no se muestra. */
@media (max-width: 700px) { html[data-tema="navidad"] body::after { display: none; } }

/* 6. Tarjetas: halo navideño al pasar el cursor y reveal al hacer scroll (donde el navegador soporta view()). */
html[data-tema="navidad"] .tarjeta-producto:hover { box-shadow: 0 0 0 2px rgba(179,32,42,.35), 0 14px 28px -10px rgba(20,83,45,.35); }
@supports (animation-timeline: view()) {
  html[data-tema="navidad"] .tarjeta-producto, html[data-tema="navidad"] main section {
    animation: nv-revela linear both; animation-timeline: view(); animation-range: entry 0% entry 45%;
  }
}

@keyframes nv-nieve { to { transform: translateY(600px); } }
@keyframes nv-balanceo { from { transform: rotate(-.35deg); } to { transform: rotate(.35deg); } }
@keyframes nv-brillo { to { background-position: 200% 0; } }
@keyframes nv-foquitos { 0% { opacity: .15; } 100% { opacity: 1; } }
@keyframes nv-baston { to { background-position: 28px 0; } }
@keyframes nv-saludo { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(10deg) translateY(-2px); } }
@keyframes nv-revela { from { opacity: 0; transform: translateY(22px); } to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  html[data-tema="navidad"] body::after { background-image: url("/temas/mascota-navidad.png"); }   /* cuadro fijo: un WebP animado no se detiene con CSS */
  html[data-tema="navidad"]::before, html[data-tema="navidad"] body::before, html[data-tema="navidad"] header.cabecera::after,
  html[data-tema="navidad"] header.cabecera::before, html[data-tema="navidad"] body::after, html[data-tema="navidad"] footer::before, html[data-tema="navidad"] a[aria-label="Contactar por WhatsApp"]::before,
  html[data-tema="navidad"] .tarjeta-producto, html[data-tema="navidad"] main section { animation: none; }
  html[data-tema="navidad"]::before { display: none; }
}
