/* =========================================================================
   Habillage de NOËL (autonome, saisonnier). Activé par xmas.js uniquement en
   décembre / début janvier -> ajoute .xmas sur <html> et injecte #xmasLayer.
   100 % décoratif : pointer-events:none, z-index sous les modales (70) -> ne
   gêne ni les clics ni les fenêtres. NE TOUCHE PAS au hero ni à l'image SUV.
   ========================================================================= */
#xmasLayer { position: fixed; inset: 0; z-index: 41; pointer-events: none; overflow: hidden; }
#xmasLayer * { pointer-events: none; }

/* Décors = IMAGES fournies (/hopv2/assets/Noel/). */
.xmasImg { width: 100%; height: auto; display: block; }
.xmasCorner img, .xmasTree img { filter: drop-shadow(0 6px 14px rgba(20, 30, 50, .22)); }

/* --- Neige qui tombe --- */
.xmasSnow { position: absolute; inset: 0; }
.xmasSnow i { position: absolute; top: -28px; color: #fff; line-height: 1; font-style: normal;
  text-shadow: 0 1px 5px rgba(120, 150, 185, .55); animation: xmasFall var(--d, 9s) linear infinite; will-change: transform; }
@keyframes xmasFall {
  0%   { transform: translate(0, -28px) rotate(0deg); }
  100% { transform: translate(var(--x, 0), 106vh) rotate(360deg); }
}

/* --- Congère de neige dessinée (SVG), fin bandeau en bas, pleine largeur --- */
.xmasDrift { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(34px, 4.5vw, 66px); }
.xmasDrift svg { width: 100%; height: 100%; display: block; filter: drop-shadow(0 -2px 6px rgba(150, 175, 205, .35)); }

/* --- Sapin (coin bas-gauche) + décors de coin (bonhomme, cadeaux) --- */
.xmasTree { position: absolute; bottom: 0; left: clamp(2px, 1vw, 22px); width: clamp(84px, 10vw, 148px); }
.xmasTree svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 14px rgba(20, 30, 50, .18)); }
.xmasCorner { position: absolute; bottom: clamp(6px, 1vw, 16px); }
.xmasCorner svg { width: 100%; height: auto; display: block; filter: drop-shadow(0 6px 14px rgba(20, 30, 50, .18)); }
.xmasCorner--snowman { right: clamp(10px, 2vw, 34px); width: clamp(68px, 9vw, 128px); }
.xmasCorner--gifts   { left: clamp(88px, 11vw, 168px); width: clamp(80px, 10vw, 140px); }   /* à droite du sapin */

/* --- Bonnet du Père Noël sur le logo HOP (dans l'en-tête) --- */
.hdr__logo { position: relative; display: inline-flex; }
.xmasHat { position: absolute; left: -6px; top: -16px; width: 34px; --rot: -8deg; transform: rotate(var(--rot));
  transform-origin: bottom center; pointer-events: none; z-index: 3; filter: drop-shadow(0 2px 3px rgba(0, 0, 0, .18));
  animation: xmasSway 3.4s ease-in-out infinite; }
.xmasHat svg { width: 100%; height: auto; display: block; }
/* Bonnet sur le grand titre du hero « Où allez-vous… » (posé sur le 1er mot). */
.h2hero__title { position: relative; }
.xmasHat--hero { left: -4px; top: -10px; width: 54px; --rot: -14deg; z-index: 2; animation-duration: 3.9s; }

/* Écran de bienvenue (1re visite) : sa propre neige + bonnet sur « HOP! ». */
.xmasWelSnow { position: absolute; inset: 0; z-index: 2; pointer-events: none; overflow: hidden; }
.xmasWelSnow i { position: absolute; top: -28px; color: #fff; line-height: 1; font-style: normal;
  text-shadow: 0 1px 6px rgba(120, 150, 185, .55); animation: xmasFall var(--d, 9s) linear infinite; will-change: transform; }
.wel__big b { position: relative; }
.xmasHat--wel { left: -0.04em; top: -0.5em; width: 0.72em; --rot: -14deg; z-index: 3; }

/* Fond festif du hero : léger halo chaud + grands flocons en filigrane, DERRIÈRE le contenu. */
.h2hero { position: relative; }
.h2hero__in { position: relative; z-index: 1; }
.xmasHeroDeco { position: absolute; inset: 0; z-index: 0; pointer-events: none; overflow: hidden;
  background: radial-gradient(130% 110% at 12% -12%, rgba(255, 223, 223, .4), transparent 55%); }
.xmasFlake { position: absolute; color: #ecb4ba; line-height: 0; }
.xmasFlake svg { width: 100%; height: auto; display: block; }
:root[data-theme="dark"] .xmasHeroDeco { background: radial-gradient(130% 110% at 12% -12%, rgba(238, 75, 69, .14), transparent 55%); }
:root[data-theme="dark"] .xmasFlake { color: rgba(255, 255, 255, .18); }

/* --- Animations des décors --- */
@keyframes xmasSway { 0%, 100% { transform: rotate(var(--rot)); } 50% { transform: rotate(calc(var(--rot) + 7deg)); } }
@keyframes xmasFloat { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-7px); } }
@keyframes xmasSwayT { 0%, 100% { transform: rotate(-1.6deg); } 50% { transform: rotate(1.6deg); } }
@keyframes xmasSpin { to { transform: rotate(360deg); } }
@keyframes xmasTwinkle { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
.xmasCorner--snowman { animation: xmasFloat 4s ease-in-out infinite; }
.xmasCorner--gifts { animation: xmasFloat 4.6s ease-in-out .4s infinite; }
.xmasTree { transform-origin: bottom center; animation: xmasSwayT 5s ease-in-out infinite; }
.xmasFlake { animation: xmasSpin 26s linear infinite; }
.xmasTwinkle circle { animation: xmasTwinkle 1.7s ease-in-out infinite; }
.xmasTwinkle circle:nth-child(2) { animation-delay: .35s; }
.xmasTwinkle circle:nth-child(3) { animation-delay: .7s; }
.xmasTwinkle circle:nth-child(4) { animation-delay: 1.05s; }
.xmasTwinkle circle:nth-child(5) { animation-delay: 1.4s; }

/* Écrans étroits : décors plus discrets. */
@media (max-width: 640px) {
  .xmasTree { width: 74px; }
  .xmasCorner--gifts { left: 80px; width: 72px; }
  .xmasCorner--snowman { width: 60px; }
  .xmasHat { width: 28px; left: -4px; top: -12px; }
  .xmasHat--hero { width: 40px; left: -2px; top: -6px; }
}
/* Respecte « réduire les animations » : on fige tout. */
@media (prefers-reduced-motion: reduce) {
  .xmasSnow i, .xmasWelSnow i { display: none; }
  .xmasHat, .xmasCorner--snowman, .xmasCorner--gifts, .xmasTree, .xmasFlake, .xmasTwinkle circle { animation: none !important; }
}
