/* =========================================================
   HUNDEWETTER – Effekt „Die Seite hat Wetter“ (fx-wetter.css / fx-wetter.js)
   Das gewählte Wetter gilt für die GANZE Seite (Startseite + Produktseite).

   1. Wetter-Schalter in der Kopfzeile            .fxw-sw
   2. Himmel: eine feste Zeichenfläche (Canvas)   .fxw-sky   – Regentropfen auf der Scheibe, Schneeflocken
   3. Sonne: Lichtschein, Linsenflecken, Streiflicht  .fxw-sun
   4. Dekor an Karten/Knöpfen/Kopfzeile           .fxw-deco  – Schneehauben, Tropfen an der Kante, Sonnenschatten
   5. Bewegung reduzieren

   Wetter steht als Klasse am <html>: fxw-w-regen | fxw-w-schnee | fxw-w-sonne.
   Alles liegt mit pointer-events: none über dem Inhalt (z-index 40) und unter Kopfzeile (50),
   Produktfenster (80) und Größenberater (90). Bewegt werden nur transform und opacity.
   ========================================================= */

/* ---------- 1. Wetter-Schalter in der Kopfzeile ---------- */
.fxw-sw { position: relative; display: flex; align-items: center; margin-right: 6px; }
.fxw-sw__toggle { display: none; }
.fxw-sw__group { position: relative; display: flex; align-items: center; }
.fxw-sw__group button {
  position: relative; z-index: 1; display: inline-flex; align-items: center; justify-content: center; gap: 12px;
  width: 34px; height: 34px; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer;
  color: var(--muted); font-size: 15px; letter-spacing: .01em; line-height: 1;
  transition: color .3s;
}
.fxw-sw__group button span { display: none; }
.fxw-sw__group button:hover { color: var(--ink); }
.fxw-sw__group button[aria-checked="true"] { color: var(--red); }
.fxw-sw svg {
  width: 17px; height: 17px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.5;
  stroke-linecap: round; stroke-linejoin: round;
}
/* Markierung: ein Ring, der zum gewählten Wetter gleitet (reine CSS-Verschiebung, nichts wird gemessen) */
.fxw-sw__ind {
  position: absolute; z-index: 0; left: 0; top: 0; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--ink); pointer-events: none;
  transition: transform .6s cubic-bezier(.16, 1, .3, 1);
}
.fxw-sw[data-w="schnee"] .fxw-sw__ind { transform: translate3d(34px, 0, 0); }
.fxw-sw[data-w="sonne"] .fxw-sw__ind { transform: translate3d(68px, 0, 0); }
.fxw-sw__live { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

/* Handy / Hochkant: ein Knopf mit dem aktuellen Zeichen, darunter klappt die Auswahl auf */
@media (max-width: 760px), (max-aspect-ratio: 1/1) {
  .fxw-sw { margin-right: 0; }
  .fxw-sw__toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; padding: 0; border: 0; background: none; cursor: pointer; color: var(--red);
  }
  .fxw-sw__toggle svg { width: 20px; height: 20px; }
  .fxw-sw__toggle::after {   /* feiner Ring wie am Desktop */
    content: ""; position: absolute; left: 50%; top: 50%; width: 34px; height: 34px; margin: -17px 0 0 -17px;
    border-radius: 50%; border: 1px solid var(--line-strong); transition: border-color .3s;
  }
  .fxw-sw.is-open .fxw-sw__toggle::after { border-color: var(--ink); }
  .fxw-sw__group {
    position: absolute; top: calc(100% + 2px); right: -4px; z-index: 2;
    flex-direction: column; align-items: stretch; min-width: 148px; padding: 4px;
    background: #fff; border: 1px solid var(--line-strong); border-radius: 4px;
    box-shadow: 0 14px 34px -14px rgba(27, 27, 27, .28);
    opacity: 0; visibility: hidden; transform: translate3d(0, -6px, 0);
    transition: opacity .2s ease, transform .3s cubic-bezier(.2, .8, .2, 1), visibility 0s .3s;
  }
  .fxw-sw.is-open .fxw-sw__group { opacity: 1; visibility: visible; transform: none; transition-delay: 0s; }
  .fxw-sw__group button { width: auto; height: 44px; justify-content: flex-start; padding: 0 14px; border-radius: 2px; color: var(--ink); }
  .fxw-sw__group button span { display: inline; }
  .fxw-sw__group button[aria-checked="true"] { color: var(--red); background: var(--panel); }
  .fxw-sw__ind { display: none; }
}

/* ---------- 2. Himmel (Canvas) ---------- */
.fxw-sky {
  position: fixed; left: 0; top: 0; width: 100%; height: 100%; z-index: 40;
  pointer-events: none; display: block;
}
.fxw-sky[hidden] { display: none; }

/* ---------- 3. Sonne ----------
   Der Lichtschein wird MULTIPLIZIERT (mix-blend-mode): Weiß bekommt einen warmen Ton,
   dunkle Schrift bleibt dunkel – nichts wird ausgewaschen. */
.fxw-sun {
  position: fixed; inset: 0; z-index: 40; overflow: hidden; pointer-events: none; mix-blend-mode: multiply;
  opacity: 0; visibility: hidden; transition: opacity 1.1s ease, visibility 0s 1.1s;
}
html.fxw-w-sonne .fxw-sun { opacity: 1; visibility: visible; transition-delay: 0s; }
html.fxw-w-sonne .fxw-sun.is-dim { opacity: .28; }     /* über dem hellblauen Abschnitt: Orange × Blau würde grau – dort nur ein Hauch */
.fxw-sun i { position: absolute; left: 0; top: 0; display: block; border-radius: 50%; will-change: transform; transition: transform .7s linear; }
/* warmer Schein rund um die (knapp außerhalb stehende) Sonne */
.fxw-sun__glow {
  width: 170vmax; height: 170vmax; margin: -85vmax 0 0 -85vmax;
  background: radial-gradient(closest-side, rgba(255, 172, 64, .52) 0%, rgba(255, 184, 88, .36) 12%, rgba(255, 198, 120, .2) 30%, rgba(255, 210, 150, .08) 52%, rgba(255, 214, 160, 0) 74%);
}
/* Linsenflecken auf der Linie Sonne → Bildmitte */
.fxw-sun__ghost { width: var(--s); height: var(--s); margin: calc(var(--s) / -2) 0 0 calc(var(--s) / -2); }
.fxw-sun__ghost--a { --s: 15vmin; background: radial-gradient(closest-side, rgba(255, 150, 60, 0) 54%, rgba(255, 150, 60, .3) 78%, rgba(255, 150, 60, 0) 100%); }
.fxw-sun__ghost--b { --s: 7vmin; background: radial-gradient(closest-side, rgba(255, 110, 90, .28), rgba(255, 110, 90, .14) 70%, rgba(255, 110, 90, 0)); }
.fxw-sun__ghost--c { --s: 26vmin; background: radial-gradient(closest-side, rgba(110, 180, 240, 0) 64%, rgba(110, 180, 240, .16) 85%, rgba(110, 180, 240, 0) 100%); }
.fxw-sun__ghost--d { --s: 11vmin; background: radial-gradient(closest-side, rgba(255, 196, 90, .36), rgba(255, 196, 90, .14) 72%, rgba(255, 196, 90, 0)); }
/* langsamer, warmer Lichtstreif, der ab und zu schräg durchs Bild zieht */
.fxw-sun__sweep {
  position: absolute; top: -20%; left: 0; display: block; width: 38vw; height: 140%;
  background: linear-gradient(90deg, rgba(255, 196, 112, 0), rgba(255, 196, 112, .16) 36%, rgba(255, 186, 96, .26) 50%, rgba(255, 196, 112, .16) 64%, rgba(255, 196, 112, 0));
  transform: translate3d(-70vw, 0, 0) skewX(-18deg); opacity: 0;
  animation: fxw-sweep 19s linear 3s infinite paused;
}
html.fxw-w-sonne .fxw-sun__sweep { animation-play-state: running; }
@keyframes fxw-sweep {
  0% { transform: translate3d(-70vw, 0, 0) skewX(-18deg); opacity: 0; }
  4% { opacity: 1; }
  34% { opacity: 1; }
  38%, 100% { transform: translate3d(130vw, 0, 0) skewX(-18deg); opacity: 0; }
}

/* Schatten, deren Richtung der Sonne folgt. --fxw-sx / --fxw-sy setzt fx-wetter.js am <html>
   (nur wenn sich der Wert um mindestens einen halben Pixel ändert). */
html { --fxw-sx: 22px; --fxw-sy: 20px; }
.pp__shot { box-shadow: var(--fxw-sx) var(--fxw-sy) 44px -6px rgba(128, 86, 30, 0); transition: box-shadow .9s ease; }
html.fxw-w-sonne .pp__shot { box-shadow: var(--fxw-sx) var(--fxw-sy) 44px -6px rgba(128, 86, 30, .3); }
@media (min-width: 761px) and (min-aspect-ratio: 1/1) {
  .pp__cta, .pdp__cta, .btn--primary { box-shadow: var(--fxw-sx) var(--fxw-sy) 22px -6px rgba(140, 50, 20, 0); transition: background .25s, color .25s, border-color .25s, box-shadow .9s ease; }
  html.fxw-w-sonne :is(.pp__cta, .pdp__cta, .btn--primary) { box-shadow: var(--fxw-sx) var(--fxw-sy) 22px -6px rgba(140, 50, 20, .32); }
}

/* ---------- 4. Dekor an Karten, Knöpfen, Kopfzeile ---------- */
.fxw-t { position: relative; isolation: isolate; }     /* Karte: Bezugsrahmen für das Dekor */
.fxw-rel { position: relative; }                       /* Knopf / Bild ohne eigene Position */
.fxw-deco { position: absolute; left: 0; top: 0; width: 100%; height: 100%; pointer-events: none; display: block; }
.fxw-deco > * { pointer-events: none; }

/* Sonnenschatten hinter dem Foto */
.fxw-shade {
  position: absolute; inset: 20% 16% 16% 16%; z-index: -1; display: block; border-radius: 30%;
  background: rgba(126, 84, 30, .26); box-shadow: 0 0 46px 34px rgba(126, 84, 30, .26);
  opacity: 0; visibility: hidden;
  transform: translate3d(var(--fxw-sx), var(--fxw-sy), 0);
  transition: opacity 1.1s ease, visibility 0s 1.1s, transform .7s linear;
}
html.fxw-w-sonne .fxw-live > .fxw-shade { opacity: 1; visibility: visible; transition-delay: 0s; }

/* Schneehaube: zwei Lagen, die nacheinander anwachsen (unten eine flache Decke, darauf die Hügel) */
.fxw-cap { position: absolute; left: 0; right: 0; bottom: 100%; z-index: 3; display: block; height: var(--h, 16px); margin-bottom: -2px; }
.fxw-cap--eave { bottom: auto; top: 0; margin: 0; }                 /* hängt als Schneekante nach unten (Kopfzeile, beschnittene Reihen) */
.fxw-cap__l {
  position: absolute; left: 0; bottom: 0; display: block; width: 100%; height: 100%;
  transform-origin: 50% 100%; transform: translate3d(0, 7px, 0) scaleY(.05); opacity: 0;
  filter: drop-shadow(0 2px 2.2px rgba(70, 104, 160, .36)) drop-shadow(0 -.5px .8px rgba(70, 104, 160, .26));
  transition: transform 1.1s cubic-bezier(.5, 0, .9, .5), opacity .9s ease .2s;   /* Wetterwechsel: rutscht ab und schmilzt */
}
.fxw-cap--eave .fxw-cap__l { transform-origin: 50% 0; transform: translate3d(0, 5px, 0) scaleY(.05); }
.fxw-cap__l svg { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; display: block; }
html.fxw-w-schnee .fxw-snowed .fxw-cap__l {
  transform: none; opacity: 1;
  transition: transform var(--fxw-grow, 11s) cubic-bezier(.12, .55, .3, 1) var(--gd, 0s), opacity 1.4s ease var(--gd, 0s);
}
html.fxw-w-schnee .fxw-snowed .fxw-cap__l + .fxw-cap__l { --gd: calc(var(--fxw-grow, 11s) * .22); }
html.fxw-fast { --fxw-grow: 1.2s; }

/* Regen: Tropfen sammeln sich an der Oberkante, einzelne lösen sich und laufen ein Stück herunter */
.fxw-beads {
  position: absolute; left: 0; right: 0; top: 0; height: 0; z-index: 3; display: block;
  opacity: 0; visibility: hidden; transition: opacity 1s ease, visibility 0s 1s;
}
html.fxw-w-regen .fxw-live > .fxw-beads { opacity: 1; visibility: visible; transition-delay: 0s; }
.fxw-beads i {
  position: absolute; left: var(--x); top: -1px; display: block; width: var(--s); height: calc(var(--s) * 1.14);
  margin-left: calc(var(--s) / -2);
  border-radius: 50% 50% 50% 50% / 42% 42% 58% 58%;
  background:
    radial-gradient(ellipse 22% 15% at 32% 26%, rgba(255, 255, 255, .98) 0 60%, rgba(255, 255, 255, 0) 100%),
    radial-gradient(ellipse 60% 44% at 50% 84%, rgba(255, 255, 255, .95), rgba(255, 255, 255, 0) 100%),
    radial-gradient(closest-side, rgba(30, 50, 85, 0) 62%, rgba(30, 50, 85, .34) 100%),
    linear-gradient(rgba(35, 55, 90, .5), rgba(35, 55, 90, .1) 46%, rgba(215, 226, 240, .4) 100%);
  box-shadow: 1px 2.5px 3px rgba(22, 36, 62, .26);
  transform-origin: 50% 0;
  animation: fxw-swell var(--t) ease-in-out var(--d) infinite alternate paused;
}
.fxw-beads i.fxw-drip { animation: fxw-drip var(--t) linear var(--d) infinite paused; }
html.fxw-w-regen .fxw-live > .fxw-beads i { animation-play-state: running; }
@keyframes fxw-swell { from { transform: scale(.72); } to { transform: scale(1.06); } }
@keyframes fxw-drip {
  0% { transform: translate3d(0, 0, 0) scale(.2); opacity: 0; }
  6% { opacity: 1; }
  52% { transform: translate3d(0, 0, 0) scale(1); animation-timing-function: ease-in; }
  62% { transform: translate3d(0, 3px, 0) scale(.92, 1.32); animation-timing-function: cubic-bezier(.5, 0, .9, .6); }
  86% { opacity: 1; }
  92%, 100% { transform: translate3d(0, var(--fall), 0) scale(.7, 1.05); opacity: 0; }
}

/* Kopfzeile: Schneekante bzw. Tropfen an der Unterkante */
.fxw-eave { position: absolute; left: 0; right: 0; top: 100%; height: 0; pointer-events: none; display: block; transition: opacity .2s; }
.header.is-open .fxw-eave { opacity: 0; }
.fxw-eave .fxw-beads { top: 1px; }

/* ---------- 5. Bewegung reduzieren: kein Fallen, kein Wachsen – nur der ruhige Zustand ---------- */
@media (prefers-reduced-motion: reduce) {
  .fxw-sun, .fxw-sun i, .fxw-shade, .fxw-sw__ind, .fxw-sw__group, .fxw-beads, .pp__shot { transition: none; }
  .fxw-sun__sweep { animation: none; }
  .fxw-cap__l, html.fxw-w-schnee .fxw-snowed .fxw-cap__l { transition: none; }
  .fxw-beads i, .fxw-beads i.fxw-drip { animation: none; }
  .fxw-beads i.fxw-drip { display: none; }
}

/* Nur Schnee wirkt auf der ganzen Seite – Sonnen-Schatten aus */
html.fxw-w-sonne .pp__shot { box-shadow: none; }
html.fxw-w-sonne :is(.pp__cta, .pdp__cta, .btn--primary) { box-shadow: none; }
