/* Weihnachtsmodus (Schalter: Shop-Verwaltung › Infobalken). Dieselbe Datei liegt in shop/public/assets und website/assets.
   Alles hängt an der Klasse .weihnachten auf <html>. Ohne die Klasse greift keine Zeile.
   Gilt für Website und Shop gleich (beide haben .ansage und .kopf). */

html.weihnachten {
  --x-rot: #b3261e;
  --x-rot-tief: #8c1d17;
  --x-gold: #c9a227;
  --x-tanne: #2f6b47;
  --x-tanne-tief: #1f4d33;
}

/* 1. Infobalken: tiefes Rot mit feinen Sternen */
html.weihnachten .ansage {
  background-color: var(--x-rot);
  background-image:
    radial-gradient(circle at 20% 30%, rgb(255 255 255 / .35) 0 1px, transparent 1.6px),
    radial-gradient(circle at 70% 70%, rgb(255 255 255 / .25) 0 1px, transparent 1.6px),
    radial-gradient(circle at 45% 55%, rgb(255 230 170 / .35) 0 .8px, transparent 1.4px);
  background-size: 46px 46px, 63px 63px, 37px 37px;
}
html.weihnachten .ansage strong { color: #ffe3a6; }

/* 2. Schleife mittig an der Girlande, wandert mit dem Kopf */
.x-schleife {
  will-change: transform;
  position: absolute; z-index: 2; bottom: -58px; left: 50%; margin-left: -26px;
  width: 52px; height: 75px; pointer-events: none;
  filter: drop-shadow(0 3px 4px rgb(80 10 10 / .25));
  transform-origin: 50% 12%;
  animation: x-wippen 6s ease-in-out infinite;
  transition: transform .6s cubic-bezier(.16,1,.3,1), opacity .3s;
}
@keyframes x-wippen { 0%,100% { rotate: -2deg; } 50% { rotate: 2deg; } }

/* 3. Tannengirlande unter dem Kopf */
html.weihnachten .kopf::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -14px; height: 22px; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='22' viewBox='0 0 120 22'%3E%3Cpath d='M0 6 Q30 16 60 6 T120 6' fill='none' stroke='%231f4d33' stroke-width='5' stroke-linecap='round'/%3E%3Cpath d='M0 6 Q30 16 60 6 T120 6' fill='none' stroke='%232f6b47' stroke-width='3' stroke-dasharray='2 3' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x;
  background-size: 120px 22px;
  opacity: .95;
}
html.weihnachten .kopf.ist-gescrollt::after { opacity: .8; }

/* 4. Schneefall-Ebene */
.x-schnee { position: fixed; inset: 0; z-index: 55; pointer-events: none; }

/* 5. Kleiner Gruß unten rechts, schließbar */
.x-gruss {
  position: fixed; z-index: 70; left: clamp(.8rem, 2vw, 1.6rem); bottom: clamp(.8rem, 2vw, 1.6rem);
  display: flex; align-items: center; gap: .7rem;
  background: #fff; color: #0e1330; border-radius: 14px; padding: .7rem .9rem .7rem .8rem;
  box-shadow: 0 10px 30px rgb(14 19 48 / .14), 0 0 0 1px rgb(14 19 48 / .06);
  font: 500 .92rem/1.3 "Geist", system-ui, sans-serif;
  transform: translateY(140%); opacity: 0; transition: transform .8s cubic-bezier(.16,1,.3,1), opacity .5s;
}
.x-gruss.ist-da { transform: none; opacity: 1; }
.x-gruss em { font-family: "Source Serif", Georgia, serif; font-style: italic; color: var(--x-rot, #b3261e); font-size: 1.12rem; display: block; }
.x-gruss small { color: #4b516b; }
.x-gruss button { border: 0; background: none; color: #4b516b; font-size: 1.2rem; line-height: 1; cursor: pointer; padding: .2rem .3rem; align-self: flex-start; }
.x-gruss svg { flex: none; }

/* 6. Hauptknöpfe in Weihnachtsrot */
html.weihnachten .knopf--primaer,
html.weihnachten .btn-primaer { background: var(--x-rot); border-color: var(--x-rot); }

@media (max-width: 640px) {
  .x-schleife { width: 42px; height: 60px; margin-left: -21px; bottom: -46px; }
  .x-gruss { left: .8rem; right: .8rem; }
}
@media (prefers-reduced-motion: reduce) {
  .x-schleife { animation: none; }
}

/* 7. Lichterkette auf der Girlande */
.x-lichter { position: absolute; left: 0; right: 0; bottom: -12px; height: 16px; pointer-events: none; z-index: 1; }
.x-lichter i {
  position: absolute; top: 0; width: 7px; height: 10px; margin-left: -3.5px; border-radius: 50% 50% 45% 45%;
  background: var(--f); box-shadow: 0 0 7px 2px var(--f);
  animation: x-funkeln var(--d) ease-in-out var(--v) infinite alternate;
  will-change: opacity;
}
.x-lichter i::before { content: ""; position: absolute; left: 1.5px; top: -3px; width: 4px; height: 4px; border-radius: 1px; background: #1f4d33; }
/* nur die Deckkraft animieren: das rechnet die Grafikkarte, ohne Kopf und Milchglas neu zu malen */
@keyframes x-funkeln { 0% { opacity: .3; } 100% { opacity: 1; } }

/* 8. Hängender Schmuck unter dem Kopf (verschwindet beim Scrollen) */
.x-haenger { position: absolute; top: 100%; pointer-events: none; z-index: 1; transform-origin: 50% 0; will-change: transform;
  animation: x-pendel var(--d) ease-in-out var(--v) infinite alternate; transition: opacity .5s, translate .6s cubic-bezier(.16,1,.3,1); }
.x-haenger::before { content: ""; display: block; width: 1px; height: var(--l); margin: 0 auto; background: linear-gradient(#c9a227, #9b7c1c); }
.x-haenger svg { display: block; filter: drop-shadow(0 4px 6px rgb(14 19 48 / .25)); }
html.x-gescrollt .x-haenger { opacity: 0; translate: 0 -30px; }
@keyframes x-pendel { from { rotate: -4deg; } to { rotate: 4deg; } }

/* 9. Schneehauben auf Bildern und Kacheln */
.x-mit-haube { position: relative; }
.x-haube { position: absolute; left: -2px; right: -2px; top: -1px; height: 18px; z-index: 3; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='90' height='18' viewBox='0 0 90 18' preserveAspectRatio='none'%3E%3Cpath d='M0 0H90V7C84 7 83 15 78 15C73 15 74 8 67 8C61 8 62 12 56 12C50 12 52 6 45 6C38 6 40 16 33 16C27 16 28 9 22 9C16 9 17 13 11 13C6 13 6 7 0 7Z' fill='%23ffffff'/%3E%3C/svg%3E") repeat-x;
  background-size: 90px 18px; filter: drop-shadow(0 2px 1.5px rgb(14 19 48 / .18)); }

/* 10. Winterlandschaft oben im Fuß, Sterne im dunklen Teil */
.x-mit-winter { position: relative; }
.x-winter { position: absolute; left: 0; right: 0; bottom: 0; height: clamp(90px, 11.6vw, 170px); pointer-events: none; z-index: 1; }
.x-haube--fuss { height: 26px; background-size: 130px 26px; top: -2px; }
html.weihnachten .fuss { padding-bottom: clamp(70px, 9vw, 140px); }
.x-winter svg { width: 100%; height: 100%; display: block; }
.x-sterne { position: absolute; inset: 0; pointer-events: none; z-index: 0; }
.x-sterne i { position: absolute; width: 2px; height: 2px; border-radius: 50%; background: #fff; box-shadow: 0 0 5px 1px rgb(255 240 200 / .7);
  animation: x-funkeln-stern var(--d) ease-in-out var(--v) infinite alternate; will-change: opacity; }
@keyframes x-funkeln-stern { from { opacity: .15; } to { opacity: .9; } }
html.weihnachten .fuss > *:not(.x-winter):not(.x-sterne):not(.x-haube) { position: relative; z-index: 2; }

/* 11. Glitzerspur hinter der Maus */
.x-glitzer { position: fixed; z-index: 90; pointer-events: none; width: 10px; height: 10px; margin: -5px 0 0 -5px;
  background: var(--f); clip-path: polygon(50% 0, 62% 38%, 100% 50%, 62% 62%, 50% 100%, 38% 62%, 0 50%, 38% 38%);
  animation: x-glitzer .9s ease-out forwards; }
@keyframes x-glitzer { from { opacity: 1; transform: scale(1) rotate(0); } to { opacity: 0; transform: translate(var(--x), 26px) scale(.2) rotate(140deg); } }

@media (max-width: 640px) {
  .x-haenger.nur-breit { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .x-lichter i, .x-haenger, .x-sterne i { animation: none; }
}
