/* ═══════════ CAPA NAVIDEÑA (propuesta: navidad.css) ═══════════
   <html data-xmas="full|lite" data-scene="…">. Sin data-xmas, la web queda como siempre.
   full = portada (todo) · lite = resto de páginas (gorro, guirnalda y copos).
   eve 1–23 dic · noche 24–25 dic · belen 26–30 dic y 2–4 ene · nye 31 dic–1 ene · reyes 5–6 ene. */
:root{
  --xm-red:#d6343f; --xm-green:#2fa36b; --xm-gold:#E8B93A; --xm-navy:#0F2F5C;
  --xm-snow:#ffffff; --xm-snowsh:rgba(160,200,235,.55); --xm-flake:255,255,255; --xm-ground:#e9f1fa;
}
[data-theme="light"]{--xm-snow:#d9e8f6; --xm-snowsh:rgba(15,47,92,.35); --xm-flake:110,160,210; --xm-ground:#d4e4f3}

#xm-snow{position:fixed;inset:0;width:100%;height:100%;pointer-events:none;z-index:150}

/* Gorro sobre el monograma */
[data-xmas] .logo{position:relative}
.xm-hat{position:absolute;left:-9px;top:-15px;width:34px;height:28px;transform:rotate(-16deg);pointer-events:none;filter:drop-shadow(0 1px 1px rgba(0,0,0,.35))}
@media(max-width:480px){.xm-hat{width:28px;height:23px;left:-7px;top:-12px}}

/* Nieve sobre tarjetas */
[data-xmas="full"] .card::before,[data-xmas="full"] .meteo::before{
  content:'';position:absolute;left:-2px;right:-2px;top:-1px;height:11px;z-index:2;pointer-events:none;background:var(--xm-snow);
  -webkit-mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 11'%3E%3Cpath d='M0 0H120V5C112 5 110 9 104 9S97 4 90 4 82 10 74 10 67 5 60 5 53 8 46 8 40 3 32 3 25 10 17 10 10 5 0 6Z'/%3E%3C/svg%3E") 0 0/120px 11px repeat-x;
          mask:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 11'%3E%3Cpath d='M0 0H120V5C112 5 110 9 104 9S97 4 90 4 82 10 74 10 67 5 60 5 53 8 46 8 40 3 32 3 25 10 17 10 10 5 0 6Z'/%3E%3C/svg%3E") 0 0/120px 11px repeat-x;
  filter:drop-shadow(0 1px 0 var(--xm-snowsh))}
[data-xmas="full"] .meteo{position:relative;overflow:hidden}
[data-xmas="full"] .card .c-icon{margin-top:.2rem}

/* Saludo */
.xm-greet{display:flex;align-items:center;gap:.45rem;margin:0 auto .9rem;width:max-content;max-width:100%;
  font-family:var(--fd,'Rajdhani',sans-serif);font-weight:700;font-size:.95rem;letter-spacing:.12em;text-transform:uppercase;
  color:var(--xm-navy);background:var(--xm-gold);border-radius:999px;padding:.22rem .9rem .18rem}
.xm-greet svg{width:15px;height:15px;flex-shrink:0}

/* Guirnalda */
.xm-garland{position:absolute;left:0;right:0;bottom:-15px;height:18px;pointer-events:none;overflow:hidden}
.xm-garland svg.wire{position:absolute;inset:0;width:100%;height:100%}
.xm-garland .wire path{fill:none;stroke:var(--tlo,#3d6a80);stroke-width:1.2}
.xm-bulb{position:absolute;top:0;width:7px;height:10px;border-radius:50% 50% 45% 45%;animation:xm-tw 2.4s ease-in-out infinite}
.xm-bulb::before{content:'';position:absolute;left:1.5px;top:-2px;width:4px;height:3px;background:var(--tlo,#3d6a80);border-radius:1px}
@keyframes xm-tw{0%,100%{opacity:1;filter:brightness(1.15)}50%{opacity:.45;filter:brightness(.7)}}

/* Trineo con 4 renos (Rudolph delante) */
.xm-sleigh{position:absolute;top:7%;left:0;width:290px;z-index:1;pointer-events:none;animation:xm-fly 26s linear infinite}
@keyframes xm-fly{0%{transform:translate(-320px,34px) rotate(-4deg)}38%{transform:translate(calc(100vw + 60px),-30px) rotate(-6deg)}100%{transform:translate(calc(100vw + 60px),-30px)}}
.xm-sleigh .bob,.xm-bob{animation:xm-bob 1.1s ease-in-out infinite alternate}
.xm-sleigh .d2{animation-delay:-.3s}.xm-sleigh .d3{animation-delay:-.6s}.xm-sleigh .d4{animation-delay:-.9s}
@keyframes xm-bob{to{transform:translateY(3px)}}

/* ── Franja de escena al pie del hero ── */
[data-xmas="full"] .hero{padding-bottom:168px}
[data-xmas="full"] .hero-layout{position:relative;z-index:2}
.xm-fw{position:absolute;inset:0;width:100%;height:100%;pointer-events:none;z-index:0}
.xm-banner{width:150px}
.xm-banner .bb{animation:xm-bob 1s ease-in-out infinite alternate}
.xm-strip{position:absolute;left:0;right:0;bottom:0;height:150px;pointer-events:none;z-index:1;--bw:250px}
.xm-ground{position:absolute;left:0;right:0;bottom:0;width:100%;height:34px}
.xm-ground path{fill:var(--xm-ground)}
.xm-ground path.hi{fill:var(--xm-snow);opacity:.9}
.xm-strip > *:not(.xm-ground){position:absolute;bottom:14px;display:block;height:auto}
.xm-strip svg{overflow:visible}

.xm-tree{width:58px}
.xm-tree .lt{animation:xm-tw 1.8s ease-in-out infinite}.xm-tree .lt:nth-child(2n){animation-delay:-.9s}.xm-tree .lt:nth-child(3n){animation-delay:-.4s}
.xm-gifts{width:84px}
.xm-deer{width:72px}
.xm-deer .head{transform-box:fill-box;transform-origin:85% 85%;animation:xm-graze 7s ease-in-out infinite}
@keyframes xm-graze{0%,55%,100%{transform:rotate(0)}65%,90%{transform:rotate(-38deg)}}
.xm-belen{width:var(--bw)}
.xm-belen .glow{animation:xm-glow 4s ease-in-out infinite}
@keyframes xm-glow{50%{opacity:.6}}
.xm-belen .star{transform-box:fill-box;transform-origin:center;animation:xm-pulse 3s ease-in-out infinite}
@keyframes xm-pulse{50%{transform:scale(1.12)}}
.xm-flock{width:104px}
.xm-flock .sh{animation:xm-bob 1.6s ease-in-out infinite alternate}

/* Elfos cargando regalos */
.xm-walk{width:30px;animation:xm-walk 22s linear infinite}
.xm-walk.e2{animation-delay:-3.2s}.xm-walk.e3{animation-delay:-6.4s}
@keyframes xm-walk{from{left:-40px}to{left:calc(100% + 40px)}}
.xm-walk .lg,.xm-camel .lg{transform-box:fill-box;transform-origin:50% 0;animation:xm-step .5s ease-in-out infinite alternate}
.xm-walk .lg.b,.xm-camel .lg.b{animation-delay:-.5s}
@keyframes xm-step{from{transform:rotate(16deg)}to{transform:rotate(-16deg)}}
.xm-walk .bodyb{animation:xm-bob .25s ease-in-out infinite alternate}

/* Defender verde bosque */
.xm-def{width:226px;z-index:2}
.xm-def .wh{transform-box:fill-box;transform-origin:center;animation:xm-roll .7s linear infinite}
@keyframes xm-roll{to{transform:rotate(360deg)}}
.xm-def.drive{animation:xm-drive 30s linear infinite}
@keyframes xm-drive{0%{left:-240px}48%{left:calc(100% + 20px)}100%{left:calc(100% + 20px)}}
.xm-def.parked .wh,.xm-def.parked .puff{animation:none;opacity:0}
.xm-def.parked .wh{opacity:1}
.xm-def .puff{animation:xm-puff 1.2s ease-out infinite;transform-box:fill-box;transform-origin:center}
.xm-def .puff:nth-of-type(2){animation-delay:-.6s}
@keyframes xm-puff{from{opacity:.7;transform:translate(0,0) scale(.6)}to{opacity:0;transform:translate(-16px,-8px) scale(1.6)}}
.xm-def .beam{animation:xm-glow 3s ease-in-out infinite}
/* Reyes: el Defender sigue a los camellos y aparca junto al portal */
.xm-def.follow{animation:xm-follow 36s ease-in-out infinite}
@keyframes xm-follow{0%,12%{left:-230px}72%,94%{left:calc(97% - var(--bw) - 498px);opacity:1}100%{left:calc(97% - var(--bw) - 498px);opacity:0}}
.xm-def.follow .wh{animation-play-state:running}

/* Camellos con los Reyes */
.xm-camel{width:80px}
.xm-caravan{display:flex;gap:6px;align-items:flex-end;animation:xm-arrive 36s ease-in-out infinite}
@keyframes xm-arrive{0%{left:-280px;opacity:1}62%,94%{left:calc(97% - var(--bw) - 262px);opacity:1}100%{left:calc(97% - var(--bw) - 262px);opacity:0}}
.xm-caravan .c2 .bob{animation-delay:-.4s}.xm-caravan .c3 .bob{animation-delay:-.8s}

/* Elfo que se asoma por encima de una tarjeta (a veces con regalo) */
[data-xmas="full"] .grid{position:relative}
.xm-elf-slot{position:absolute;width:58px;height:52px;overflow:hidden;z-index:3;pointer-events:none}
.xm-elf-slot svg{width:58px;height:52px;display:block;transform:translateY(100%);animation:xm-peek 9s ease-in-out infinite}
.xm-elf-slot .gift{display:none}.xm-elf-slot.g .gift{display:inline}
@keyframes xm-peek{0%,8%{transform:translateY(100%)}18%,62%{transform:translateY(0)}24%,30%,36%{transform:translateY(0) rotate(-5deg)}27%,33%{transform:translateY(0) rotate(5deg)}72%,100%{transform:translateY(100%)}}

/* Móvil: franja más baja y figuras más pequeñas */
@media(max-width:640px){
  [data-xmas="full"] .hero{padding-bottom:118px}
  .xm-strip{height:104px;--bw:160px}
  .xm-strip > *:not(.xm-ground){bottom:10px}
  .xm-ground{height:24px}
  .xm-sleigh{width:190px}
  .xm-tree{width:40px}.xm-gifts{width:56px}.xm-deer{width:50px}.xm-flock{width:70px}
  .xm-def{width:134px}.xm-banner{width:100px}.xm-camel{width:52px}.xm-walk{width:22px}
  .xm-strip .m-hide{display:none}
  @keyframes xm-arrive{0%{left:-180px;opacity:1}62%,94%{left:calc(97% - var(--bw) - 176px);opacity:1}100%{left:calc(97% - var(--bw) - 176px);opacity:0}}
  @keyframes xm-follow{0%,12%{left:-150px}72%,94%{left:calc(97% - var(--bw) - 320px);opacity:1}100%{left:calc(97% - var(--bw) - 320px);opacity:0}}
  .xm-strip .p-belen{left:3%!important}
  .xm-strip .p-def{left:auto!important;right:-4px!important}
}

/* Sin animaciones: escena quieta, con cada figura en su sitio final */
/* Escenas con movimiento (pista de esquí y montaje del belén) */
[data-scene="ski"] .hero{padding-bottom:214px}
[data-scene="ski"] .xm-strip{height:198px}
.xm-strip > .xm-dyn{position:absolute;inset:0;bottom:0;z-index:1}
.xm-dyn .xm-a{position:absolute;left:0;top:0;pointer-events:none;will-change:transform}
.xm-dyn .xm-a > svg{width:100%!important;height:100%!important;display:block;overflow:visible;animation:none!important}
.xm-mtn{position:absolute;left:0;top:0;z-index:2;overflow:visible}
.xm-def.eng .wh{animation:none}
.xm-a.roll .wh{transform-box:fill-box;transform-origin:center;animation:xm-roll .7s linear infinite}
.xm-def.eng .puff{display:none}.xm-a.roll .xm-def.eng .puff{display:inline}
.xm-w2 .lg{transform-box:fill-box;transform-origin:50% 0;animation:xm-step .45s ease-in-out infinite alternate}.xm-w2 .lg.b{animation-delay:-.45s}
.xm-w2 .bodyb{animation:xm-bob .22s ease-in-out infinite alternate}
.still .lg,.still .bodyb{animation:none!important}
.xm-build .pc{transition:opacity .5s}
.xm-build .pc.pop{transform-box:fill-box;transform-origin:50% 100%;animation:xm-popin .6s ease-out}
@keyframes xm-popin{from{transform:translateY(-10px) scale(.9)}to{transform:none}}
.xm-a .zz text{font:700 10px Rajdhani,sans-serif;fill:var(--tmid,#7aa8c0);animation:xm-z 2.4s ease-in-out infinite}
.xm-a .zz text:nth-child(2){animation-delay:-.8s}.xm-a .zz text:nth-child(3){animation-delay:-1.6s}
@keyframes xm-z{0%{opacity:0;transform:translateY(4px)}50%{opacity:1}100%{opacity:0;transform:translateY(-8px)}}
.xm-a .br{animation:xm-bob 1.6s ease-in-out infinite alternate}
.xm-a .hm{transform-box:fill-box;transform-origin:10% 90%;animation:xm-ham .25s ease-in-out infinite alternate}
@keyframes xm-ham{from{transform:rotate(-35deg)}to{transform:rotate(20deg)}}
.xm-a .sp{animation:xm-tw .5s infinite}
@media(max-width:640px){[data-scene="ski"] .hero{padding-bottom:152px}[data-scene="ski"] .xm-strip{height:138px}}

@media(prefers-reduced-motion:reduce){
  #xm-snow,.xm-sleigh,.xm-elf-slot,.xm-walk{display:none!important}
  .xm-caravan{left:calc(97% - var(--bw) - 262px)}
  .xm-def.drive{left:46%}
  .xm-def.follow{left:calc(97% - var(--bw) - 498px)}
}
