/* Cookie-Hinweis, 24.09.2026, Optionen-Panel (Notwendig/Marketing) 24.09.2026.
   Logik: assets/js/dwc-consent.js. Farben/Icon bleiben die urspruengliche
   21st.dev-Vorlage (helle Karte, DWC-Blau) - das dunkle Referenzbild von
   Julian war nur Vorlage fuer die Regler-Mechanik, nicht fuer die Optik
   (Julian, 24.09.2026). Basisgroesse 5% ueber der vorigen Fassung
   (320px -> 336px). */
.dwc-consent {
  position: fixed;
  left: 20px;
  bottom: 20px;
  z-index: 100000;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 336px;
  max-width: calc(100vw - 32px);
  padding: 17px;
  border: 1px solid rgba(107, 114, 128, 0.3);
  border-radius: 8px;
  background: #fff;
  color: #6b7280;
  font-family: inherit;
  font-size: 15px;
  line-height: 21px;
  opacity: 0;
  transform: translateY(12px) scale(0.98);
  /* Ausblenden (Klick auf Akzeptieren/Speichern): kurz und weich; JS wartet 340ms,
     bevor es das Element mit hidden entfernt. */
  transition: opacity 0.32s ease, transform 0.32s cubic-bezier(0.4, 0, 0.6, 1);
}
@media (min-width: 768px) {
  .dwc-consent { padding: 25px; }
}
/* Mobil mittig statt unten links (Leo, 27.09.2026). Zentriert ueber
   inset:0 + margin:auto statt translate(-50%,-50%) - so bleiben die
   Ein-/Ausblend-Transforms unten (und das transform:none bei "Bewegung
   reduzieren") unveraendert gueltig. max-height + overflow: das
   aufgeklappte Optionen-Panel passt auch auf niedrigen Handys. */
@media (max-width: 767px) {
  .dwc-consent {
    inset: 0;
    margin: auto;
    width: min(336px, calc(100vw - 32px));
    height: fit-content;
    max-height: calc(100svh - 32px);
    overflow-y: auto;
    overscroll-behavior: contain;
  }
}
.dwc-consent[hidden] { display: none; }
/* Einblenden: etwas langsamer, mit der Auslaufkurve, die die Seite auch sonst nutzt. */
.dwc-consent.is-visible {
  opacity: 1;
  transform: none;
  transition: opacity 0.45s ease, transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}
.dwc-consent:focus { outline: none; }
.dwc-consent *, .dwc-consent *::before, .dwc-consent *::after { box-sizing: border-box; }

.dwc-consent__head {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding-bottom: 12px;
}
/* Keks-Illustration (.dwc-consent__img) am 27.09.2026 entfernt (Leo). Das
   padding-top hier war nur Platz unter dem darueber haengenden Bild. */
.dwc-consent__title {
  width: 100%;
  margin: 0;
  text-align: left;
  color: #1f2937;
  font-size: 21px;
  line-height: 29px;
  font-weight: 500;
}
.dwc-consent__text { margin: 0; }
.dwc-consent__text a { color: inherit; font-weight: 500; text-decoration: underline; }

/* ── Optionen-Panel: Hoehe per grid-template-rows animiert, kein JS-Messen noetig ── */
.dwc-consent__options {
  display: grid;
  grid-template-rows: 0fr;
  width: 100%;
  transition: grid-template-rows 0.32s ease;
}
.dwc-consent__options.is-open { grid-template-rows: 1fr; }
.dwc-consent__options-inner { overflow: hidden; min-height: 0; }

.dwc-consent__row { padding: 12px 0; border-top: 1px solid rgba(107, 114, 128, 0.2); }
.dwc-consent__row-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.dwc-consent__row-title { font-size: 14px; font-weight: 500; color: #1f2937; }
.dwc-consent__row-desc { margin: 6px 0 0; font-size: 13px; line-height: 18px; color: #6b7280; }

.dwc-consent__switch {
  position: relative;
  flex: none;
  width: 40px;
  height: 22px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #d1d5db;
  cursor: pointer;
  transition: background 0.18s ease;
}
.dwc-consent__switch::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.18s ease;
}
.dwc-consent__switch[aria-checked="true"] { background: #0757F7; }
.dwc-consent__switch[aria-checked="true"]::after { transform: translateX(18px); }
.dwc-consent__switch:disabled { cursor: default; opacity: 0.85; }

.dwc-consent__save {
  width: 100%;
  margin-top: 14px;
  padding: 10px 16px;
  border: 1px solid rgba(107, 114, 128, 0.35);
  border-radius: 4px;
  background: transparent;
  color: #1f2937;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dwc-consent__save:hover { background: rgba(107, 114, 128, 0.08); }

.dwc-consent__quick { display: flex; gap: 10px; width: 100%; margin-top: 16px; }
.dwc-consent__only {
  flex: 1;
  padding: 8px 14px;
  border: 1px solid rgba(107, 114, 128, 0.35);
  border-radius: 4px;
  background: transparent;
  color: #374151;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease;
}
.dwc-consent__only:hover { background: rgba(107, 114, 128, 0.08); }
.dwc-consent__accept {
  flex: 1;
  padding: 8px 14px;
  border: 0;
  border-radius: 4px;
  background: #0757F7;
  color: #fff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.15s ease;
}
.dwc-consent__accept:hover { background: #004CE0; }
.dwc-consent__accept:active { transform: scale(0.95); }

.dwc-consent__toggle-options {
  align-self: center;
  margin-top: 12px;
  padding: 0;
  border: 0;
  background: none;
  color: #6b7280;
  font-family: inherit;
  font-size: 13px;
  text-decoration: underline;
  cursor: pointer;
}
.dwc-consent__toggle-options:hover { color: #1f2937; }

.dwc-consent__text a:focus-visible,
.dwc-consent__switch:focus-visible,
.dwc-consent__save:focus-visible,
.dwc-consent__only:focus-visible,
.dwc-consent__accept:focus-visible,
.dwc-consent__toggle-options:focus-visible {
  outline: 2px solid #0757F7;
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  .dwc-consent,
  .dwc-consent__options,
  .dwc-consent__switch,
  .dwc-consent__switch::after,
  .dwc-consent__accept {
    transition: none;
    transform: none;
  }
}

/* Rechtliche Links im Footer der englischen Startseite (dort fehlte die Zeile
   bisher ganz). Optik wie .footer-bottom__legal auf der deutschen Seite. */
.dwc-consent-legal { display: flex; align-items: center; gap: 20px; }
.dwc-consent-legal a {
  font-size: 13px;
  color: var(--fo-ink-3, rgba(255, 255, 255, 0.55));
  text-decoration: none;
  transition: color 0.18s ease;
}
.dwc-consent-legal a:hover { color: var(--fo-ink, #fff); }
