/* ===== Animaciones de los Santas (js/santas.js) =====
   Lo usan la página (Santa grande) y la galería preview/santas.html.
   Solo se animan los Santas con la clase .santa-anim (las caritas del selector y de la tarjeta quedan quietas,
   salvo detalles chiquitos como el vapor o las lucecitas).
   Las coordenadas de transform-origin son del dibujo (viewBox 240×285): hombro izq. 62,168 · hombro der. 186,160 ·
   cuello 120,160 · pies 120,276. Cada Santa tiene su animación propia (busca .santa--<id>). */

.santa-anim .figure, .santa-anim .shadow, .santa-anim .arm, .santa-anim .head,
.santa-anim .hat, .santa-anim .back, .santa-anim .prop, .santa-anim .rest-prop { transform-box: view-box; }
.santa-anim .figure { transform-origin: 120px 276px; }
.santa-anim .shadow { transform-origin: 120px 278px; }
.santa-anim .head { transform-origin: 120px 160px; }
.santa-anim .hat { transform-origin: 120px 88px; }

/* Por defecto: saluda con la mano y mueve un poquito la otra */
.santa-anim .arm--left { transform-origin: 62px 168px; animation: wave 1.6s ease-in-out infinite; }
.santa-anim .arm--right { transform-origin: 186px 160px; animation: wave-r 2.8s ease-in-out infinite; }

/* Detalles que se mueven en todos los tamaños */
.santa-svg .steam path { animation: steam 2s ease-in-out infinite; }
.santa-svg .steam path:nth-child(2) { animation-delay: -1s; }
.santa-svg .led { animation: led 0.9s ease-in-out infinite; }
.santa-svg .neon { animation: led 1.4s ease-in-out infinite; }
.santa-svg .flame, .santa-svg .glow { transform-box: fill-box; transform-origin: 50% 100%; animation: flicker 0.6s ease-in-out infinite alternate; }
.santa-svg .sparkles { animation: twinkle 1.2s ease-in-out infinite; }
.santa-svg .zzz text { animation: zzz 2.4s ease-in-out infinite; }
.santa-svg .zzz text:nth-child(2) { animation-delay: 0.4s; }
.santa-svg .zzz text:nth-child(3) { animation-delay: 0.8s; }

/* --- Clásico: saluda y se ríe "¡jo, jo, jo!" (tres rebotes de panza) --- */
.santa-anim.santa--clasico .figure { animation: hohoho 3.2s ease-in-out infinite; }

/* --- Rockero: headbanging, mano 🤘 sacudiéndose y rasgueo de guitarra --- */
.santa-anim.santa--rockero .head { animation: headbang 0.6s ease-in-out infinite; }
.santa-anim.santa--rockero .arm--left { animation: shake 0.3s ease-in-out infinite alternate; }
.santa-anim.santa--rockero .arm--right { animation: strum 0.3s ease-in-out infinite alternate; }

/* --- Veraniego: baile hawaiano de lado a lado y brindis con el coco --- */
.santa-anim.santa--veraniego .figure { animation: hula 2.4s ease-in-out infinite; }
.santa-anim.santa--veraniego .arm--left { animation: cheers 4s ease-in-out infinite; }

/* --- Andino: mueve la cabeza contento, los pompones del chullo bailan y levanta su chocolatada --- */
.santa-anim.santa--andino .head { animation: tilt 2.6s ease-in-out infinite; }
.santa-anim.santa--andino .tassel { transform-box: fill-box; transform-origin: 50% 0; animation: swing 1.3s ease-in-out infinite alternate; }
.santa-anim.santa--andino .arm--left { animation: toast 3s ease-in-out infinite; }

/* --- Futbolero: salta celebrando el gol y hace puño --- */
.santa-anim.santa--futbolero .figure { animation: jump 1.6s ease-in-out infinite; }
.santa-anim.santa--futbolero .shadow { animation: shadow-jump 1.6s ease-in-out infinite; }
.santa-anim.santa--futbolero .arm--left { animation: pump 0.4s ease-in-out infinite alternate; }

/* --- DJ: cabecea al ritmo y sube y baja el dedo --- */
.santa-anim.santa--dj .head { animation: nod 0.5s ease-in-out infinite; }
.santa-anim.santa--dj .arm--left { animation: pump 0.5s ease-in-out infinite alternate; }
.santa-anim.santa--dj .figure { animation: beat 0.5s ease-in-out infinite; }

/* --- Mago: hace un hechizo con la varita, el sombrero se tambalea y la capa ondea --- */
.santa-anim.santa--mago .arm--left { animation: spell 2.4s ease-in-out infinite; }
.santa-anim.santa--mago .hat { animation: wobble 3s ease-in-out infinite; }
.santa-anim.santa--mago .back { transform-origin: 120px 130px; animation: cape 2.6s ease-in-out infinite; }

/* --- Pijama: cabecea de sueño y se despierta de golpe --- */
.santa-anim.santa--pijama .head { animation: doze 4.5s ease-in-out infinite; }
.santa-anim.santa--pijama .arm--left { animation: drowsy 4.5s ease-in-out infinite; }

/* --- Chef: revuelve con la cuchara y el panetón da saltitos --- */
.santa-anim.santa--chef .arm--left { animation: stir 1.2s ease-in-out infinite; }
.santa-anim.santa--chef .rest-prop { animation: hop 1.8s ease-in-out infinite; }
.santa-anim.santa--chef .hat { animation: puff 2s ease-in-out infinite; }

/* --- Cuy: saltitos de alegría (como los cuyes de verdad), orejitas y bigotes que se mueven --- */
.santa-anim.santa--cuy .figure { animation: popcorn 2.8s ease-in-out infinite; }
.santa-anim.santa--cuy .shadow { animation: shadow-popcorn 2.8s ease-in-out infinite; }
.santa-anim.santa--cuy .ear { transform-box: fill-box; transform-origin: 50% 90%; animation: ear 2.2s ease-in-out infinite; }
.santa-anim.santa--cuy .ear--r { animation-delay: -0.3s; }
.santa-anim.santa--cuy .whiskers { animation: whisk 0.25s ease-in-out infinite alternate; }

/* --- Agricultor: clava la horquilla en la tierra una y otra vez y asiente contento --- */
.santa-anim.santa--agricultor .arm--left { animation: dig 1.6s ease-in-out infinite; }
.santa-anim.santa--agricultor .figure { animation: dig-body 1.6s ease-in-out infinite; }
.santa-anim.santa--agricultor .head { animation: nod 1.6s ease-in-out infinite; }

/* --- Vampiro: flota en el aire, la capa ondea y el murcielaguito aletea --- */
.santa-anim.santa--vampiro .figure { animation: float 3s ease-in-out infinite; }
.santa-anim.santa--vampiro .shadow { animation: shadow-float 3s ease-in-out infinite; }
.santa-anim.santa--vampiro .back { transform-origin: 120px 130px; animation: cape 2s ease-in-out infinite; }
.santa-anim.santa--vampiro .arm--left { animation: wave-r 2s ease-in-out infinite; }
.santa-anim .wing { transform-box: fill-box; animation: flap 0.25s ease-in-out infinite alternate; }
.santa-anim .wing--l { transform-origin: 100% 60%; }
.santa-anim .wing--r { transform-origin: 0% 60%; animation-name: flap-r; }

/* --- Vaquero: cabalga y hace girar el lazo --- */
.santa-anim.santa--vaquero .figure { animation: gallop 0.7s ease-in-out infinite; }
.santa-anim.santa--vaquero .arm--left { animation: spin-arm 0.9s linear infinite; }
.santa-anim .lasso { transform-box: fill-box; transform-origin: 50% 50%; animation: lasso 0.9s linear infinite; }

/* --- Detective: mira a un lado y al otro buscando pistas con la lupa --- */
.santa-anim.santa--detective .head { animation: search 4s ease-in-out infinite; }
.santa-anim.santa--detective .arm--left { animation: inspect 4s ease-in-out infinite; }

/* --- Vikingo: grito de guerra alzando el hacha y pisotón --- */
.santa-anim.santa--vikingo .arm--left { animation: battle 2.2s ease-in-out infinite; }
.santa-anim.santa--vikingo .figure { animation: stomp-body 2.2s ease-in-out infinite; }

/* --- Payaso: rebota feliz, los globos se mecen y aprieta la bocina --- */
.santa-anim.santa--payaso .figure { animation: bounce 0.9s ease-in-out infinite; }
.santa-anim.santa--payaso .shadow { animation: shadow-bounce 0.9s ease-in-out infinite; }
.santa-anim .balloons { transform-box: view-box; transform-origin: 40px 82px; animation: balloons 2.4s ease-in-out infinite; }
.santa-anim.santa--payaso .rest-prop { transform-origin: 150px 216px; animation: honk 1.8s ease-in-out infinite; }

/* --- Pirata: se balancea como en un barco y el lorito cabecea --- */
.santa-anim.santa--pirata .figure { animation: ship 3.4s ease-in-out infinite; }
.santa-anim .parrot { transform-box: view-box; transform-origin: 192px 162px; animation: parrot 1.2s ease-in-out infinite; }
.santa-anim.santa--pirata .arm--left { animation: wave 2.2s ease-in-out infinite; }

/* --- Motociclista: el motor vibra y el pulgar arriba --- */
.santa-anim.santa--motociclista .figure { animation: rev 0.12s linear infinite; }
.santa-anim.santa--motociclista .arm--left { animation: pump 0.6s ease-in-out infinite alternate; }

/* --- Bombero: apunta con la manguera de un lado a otro y el agua sale a chorritos --- */
.santa-anim.santa--bombero .arm--left { animation: aim 2.4s ease-in-out infinite; }
.santa-anim .water circle { animation: drip 0.8s linear infinite; }
.santa-anim .water circle:nth-child(2) { animation-delay: -0.2s; }
.santa-anim .water circle:nth-child(3) { animation-delay: -0.4s; }
.santa-anim .water circle:nth-child(4) { animation-delay: -0.6s; }

/* --- Doctor: sacude el termómetro y asiente --- */
.santa-anim.santa--doctor .arm--left { animation: shake 0.18s ease-in-out infinite alternate; }
.santa-anim.santa--doctor .head { animation: nod 1.4s ease-in-out infinite; }

/* --- Comunista: marcha y la bandera ondea --- */
.santa-anim.santa--comunista .figure { animation: march 1s ease-in-out infinite; }
.santa-anim .flag { transform-box: fill-box; transform-origin: 0% 50%; animation: flag 1s ease-in-out infinite alternate; }
.santa-anim.santa--comunista .arm--left { animation: none; }

/* --- Gruñón verde: camina de puntitas, a escondidas, con su saco --- */
.santa-anim.santa--grinch .figure { animation: sneak 2s ease-in-out infinite; }
.santa-anim.santa--grinch .head { animation: tilt 2s ease-in-out infinite; }
.santa-anim.santa--grinch .arm--left { animation: wave-r 2s ease-in-out infinite; }

/* --- Boxeador: salta en la punta de los pies y lanza jab con la izquierda y gancho con la derecha --- */
.santa-anim.santa--boxeador .figure { animation: boxer-bob 1.2s ease-in-out infinite; }
.santa-anim.santa--boxeador .shadow { animation: shadow-bounce 0.6s ease-in-out infinite; }
.santa-anim.santa--boxeador .arm--left { animation: jab 1.2s ease-in-out infinite; }
.santa-anim.santa--boxeador .arm--right { animation: hook 1.2s ease-in-out infinite; }

/* --- Hippie: se mece tranquilo, cabeza ladeada, paz y amor y la margarita gira --- */
.santa-anim.santa--hippie .figure { animation: hula 3.6s ease-in-out infinite; }
.santa-anim.santa--hippie .head { animation: tilt 3.6s ease-in-out infinite reverse; }
.santa-anim.santa--hippie .arm--left { animation: wave 1.8s ease-in-out infinite; }
.santa-anim .spin { transform-box: fill-box; transform-origin: 50% 50%; animation: spin 6s linear infinite; }

/* --- Disco: el paso clásico (dedo arriba, dedo abajo), cadera que se mueve y la bola brilla --- */
.santa-anim.santa--disco .figure { animation: disco-hips 1s ease-in-out infinite; }
.santa-anim.santa--disco .arm--left { animation: disco-point 2s ease-in-out infinite; }
.santa-anim.santa--disco .head { animation: nod 0.5s ease-in-out infinite; }
.santa-svg .glints, .santa-svg .facets { animation: twinkle 0.8s ease-in-out infinite; }
.santa-svg .sequins circle { animation: led 1s ease-in-out infinite; }

@keyframes wave { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-12deg); } }
@keyframes wave-r { 0%, 100% { transform: rotate(0); } 50% { transform: rotate(-4deg); } }
@keyframes steam { 0%, 100% { opacity: 0.2; transform: translateY(2px); } 50% { opacity: 0.9; transform: translateY(-3px); } }
@keyframes led { 0%, 100% { opacity: 1; } 50% { opacity: 0.35; } }
@keyframes flicker { from { transform: scale(1, 1); } to { transform: scale(0.9, 1.08); } }
@keyframes twinkle { 0%, 100% { opacity: 1; } 50% { opacity: 0.5; } }
@keyframes zzz { 0%, 100% { opacity: 0.25; transform: translateY(2px); } 50% { opacity: 1; transform: translateY(-3px); } }

@keyframes hohoho {
  0%, 60%, 100% { transform: translateY(0); }
  64%, 72%, 80% { transform: translateY(-5px) scale(1.02, 0.98); }
  68%, 76%, 84% { transform: translateY(0); }
}
@keyframes headbang { 0%, 100% { transform: rotate(0); } 50% { transform: translateY(5px) rotate(6deg); } }
@keyframes shake { from { transform: rotate(2deg); } to { transform: rotate(-6deg); } }
@keyframes strum { from { transform: rotate(0); } to { transform: rotate(-5deg); } }
@keyframes hula { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes cheers { 0%, 50%, 100% { transform: rotate(0); } 62%, 82% { transform: rotate(16deg); } 72% { transform: rotate(10deg); } }
@keyframes tilt { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg); } }
@keyframes swing { from { transform: rotate(-10deg); } to { transform: rotate(10deg); } }
@keyframes toast { 0%, 55%, 100% { transform: rotate(0); } 68%, 82% { transform: rotate(-12deg); } 75% { transform: rotate(-16deg); } }
@keyframes jump {
  0%, 100% { transform: translateY(0) scale(1, 1); }
  15% { transform: translateY(0) scale(1.06, 0.94); }
  40% { transform: translateY(-20px) scale(0.97, 1.04); }
  60% { transform: translateY(0) scale(1.05, 0.95); }
  72% { transform: translateY(0) scale(1, 1); }
}
@keyframes shadow-jump { 0%, 15%, 60%, 100% { transform: scale(1); opacity: 1; } 40% { transform: scale(0.75); opacity: 0.6; } }
@keyframes pump { from { transform: rotate(0); } to { transform: rotate(-10deg); } }
@keyframes nod { 0%, 100% { transform: translateY(0) rotate(0); } 50% { transform: translateY(4px) rotate(3deg); } }
@keyframes beat { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.02, 0.98); } }
@keyframes spell { 0%, 100% { transform: rotate(0); } 25% { transform: rotate(-14deg); } 50% { transform: rotate(-4deg); } 75% { transform: rotate(8deg); } }
@keyframes wobble { 0%, 100% { transform: rotate(-3deg); } 50% { transform: rotate(3deg); } }
@keyframes cape { 0%, 100% { transform: skewX(-2deg); } 50% { transform: skewX(2deg); } }
@keyframes doze {
  0%, 10% { transform: rotate(0); }
  70% { transform: translateY(5px) rotate(8deg); }
  76% { transform: translateY(-2px) rotate(-3deg); }
  84%, 100% { transform: rotate(0); }
}
@keyframes drowsy { 0%, 10% { transform: rotate(0); } 70% { transform: rotate(10deg); } 76% { transform: rotate(-3deg); } 84%, 100% { transform: rotate(0); } }
@keyframes stir { 0%, 100% { transform: rotate(-10deg); } 50% { transform: rotate(8deg); } }
@keyframes hop { 0%, 65%, 100% { transform: translateY(0); } 78% { transform: translateY(-9px) rotate(-3deg); } 90% { transform: translateY(0); } }
@keyframes puff { 0%, 100% { transform: scale(1, 1); } 50% { transform: scale(1.03, 1.06); } }
@keyframes popcorn {
  0%, 48%, 100% { transform: translateY(0) rotate(0); }
  56% { transform: translateY(-18px) rotate(-6deg); }
  64% { transform: translateY(0) rotate(0) scale(1.04, 0.96); }
  72% { transform: translateY(-11px) rotate(5deg); }
  80% { transform: translateY(0) rotate(0); }
}
@keyframes shadow-popcorn { 0%, 48%, 64%, 80%, 100% { transform: scale(1); } 56% { transform: scale(0.75); } 72% { transform: scale(0.85); } }
@keyframes ear { 0%, 70%, 100% { transform: rotate(0); } 78% { transform: rotate(-14deg); } 86% { transform: rotate(9deg); } }
@keyframes whisk { from { transform: translateY(0); } to { transform: translateY(1px); } }
@keyframes dig { 0%, 100% { transform: translateY(0) rotate(0); } 40% { transform: translateY(-10px) rotate(4deg); } 60% { transform: translateY(8px) rotate(-2deg); } }
@keyframes dig-body { 0%, 100% { transform: scale(1, 1); } 60% { transform: scale(1.03, 0.97); } }

@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-10px); } }
@keyframes shadow-float { 0%, 100% { transform: scale(1); opacity: 1; } 50% { transform: scale(0.82); opacity: 0.6; } }
@keyframes flap { from { transform: rotate(0); } to { transform: rotate(-28deg); } }
@keyframes flap-r { from { transform: rotate(0); } to { transform: rotate(28deg); } }
@keyframes gallop { 0%, 100% { transform: translateY(0) rotate(0); } 30% { transform: translateY(-7px) rotate(-2deg); } 60% { transform: translateY(-2px) rotate(1deg); } }
@keyframes spin-arm { 0% { transform: rotate(0); } 25% { transform: rotate(-6deg); } 50% { transform: rotate(0); } 75% { transform: rotate(5deg); } 100% { transform: rotate(0); } }
@keyframes lasso { 0% { transform: scaleX(1); } 25% { transform: scaleX(0.35); } 50% { transform: scaleX(-1); } 75% { transform: scaleX(0.35); } 100% { transform: scaleX(1); } }
@keyframes search { 0%, 15%, 100% { transform: rotate(0); } 25%, 40% { transform: rotate(-7deg) translateX(-3px); } 55%, 75% { transform: rotate(7deg) translateX(3px); } 85% { transform: rotate(0); } }
@keyframes inspect { 0%, 15%, 100% { transform: rotate(0); } 25%, 40% { transform: rotate(-8deg); } 55%, 75% { transform: rotate(14deg); } 85% { transform: rotate(0); } }
@keyframes battle { 0%, 40%, 100% { transform: rotate(0); } 55% { transform: rotate(-18deg); } 65% { transform: rotate(6deg); } 75% { transform: rotate(-4deg); } }
@keyframes stomp-body { 0%, 60%, 100% { transform: translateY(0) scale(1, 1); } 66% { transform: translateY(0) scale(1.05, 0.95); } 74% { transform: translateY(0) scale(1, 1); } }
@keyframes bounce { 0%, 100% { transform: translateY(0) scale(1.04, 0.96); } 50% { transform: translateY(-12px) scale(0.98, 1.02); } }
@keyframes shadow-bounce { 0%, 100% { transform: scale(1); } 50% { transform: scale(0.8); } }
@keyframes balloons { 0%, 100% { transform: rotate(-5deg); } 50% { transform: rotate(5deg); } }
@keyframes honk { 0%, 70%, 100% { transform: scale(1); } 78% { transform: scale(0.8, 1.15); } 86% { transform: scale(1.05, 0.95); } }
@keyframes ship { 0%, 100% { transform: rotate(-4deg); } 50% { transform: rotate(4deg) translateY(-3px); } }
@keyframes parrot { 0%, 60%, 100% { transform: rotate(0); } 70% { transform: rotate(-10deg); } 80% { transform: rotate(4deg); } }
@keyframes rev { 0% { transform: translate(0, 0); } 25% { transform: translate(0.8px, -0.5px); } 50% { transform: translate(0, 0.5px); } 75% { transform: translate(-0.8px, 0); } 100% { transform: translate(0, 0); } }
@keyframes aim { 0%, 100% { transform: rotate(-8deg); } 50% { transform: rotate(8deg); } }
@keyframes drip { 0% { transform: translate(0, 0); opacity: 1; } 100% { transform: translate(-8px, -12px); opacity: 0; } }
@keyframes march { 0%, 50%, 100% { transform: translateY(0) rotate(0); } 25% { transform: translateY(-5px) rotate(-1.5deg); } 75% { transform: translateY(-5px) rotate(1.5deg); } }
@keyframes flag { from { transform: skewY(-6deg) scaleX(1); } to { transform: skewY(5deg) scaleX(0.9); } }
@keyframes sneak { 0%, 100% { transform: translateX(-4px) rotate(-3deg); } 25% { transform: translateX(0) translateY(-5px) rotate(0); } 50% { transform: translateX(4px) rotate(3deg); } 75% { transform: translateX(0) translateY(-5px) rotate(0); } }

@keyframes boxer-bob { 0%, 50%, 100% { transform: translateY(0); } 25%, 75% { transform: translateY(-6px); } }
@keyframes jab { 0%, 40%, 100% { transform: rotate(0); } 15% { transform: rotate(-14deg) translate(-4px, -4px); } }
@keyframes hook { 0%, 45%, 85%, 100% { transform: rotate(0); } 65% { transform: rotate(24deg); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes disco-hips { 0%, 100% { transform: translateX(-3px) rotate(-2deg); } 50% { transform: translateX(3px) rotate(2deg); } }
@keyframes disco-point { 0%, 40%, 100% { transform: rotate(0); } 50%, 90% { transform: rotate(-60deg); } }

@media (prefers-reduced-motion: reduce) {
  .santa-svg, .santa-svg * { animation: none !important; }
}
