/* ============================================================
   Cookie-Einwilligung — Gestaltung
   Gehört zu consent.js. Die Farbwerte entsprechen den Tokens
   der Startseite (#site-root), sind hier aber eigenständig
   gesetzt, weil Banner und Dialog außerhalb von #site-root liegen.
   ============================================================ */

#cc-banner,
#cc-dialog,
#cc-hintergrund {
  --cc-bg: #ffffff;
  --cc-fg: #18160f;
  --cc-muted: #6f6a5c;
  --cc-border: #e1dccf;
  --cc-flaeche: #f4f2ee;
  --cc-akzent: #b8911f;
  --cc-akzent-fg: #ffffff;
  font-family: 'Manrope', -apple-system, BlinkMacSystemFont, sans-serif;
  -webkit-font-smoothing: antialiased;
}

#cc-banner *,
#cc-dialog * { box-sizing: border-box; }

#cc-banner[hidden],
#cc-dialog[hidden],
#cc-hintergrund[hidden] { display: none; }

/* ---------- Banner (erste Ebene) ---------- */

#cc-banner {
  position: fixed;
  z-index: 400;
  left: 50%;
  bottom: clamp(12px, 2.4vw, 26px);
  width: min(1020px, calc(100vw - clamp(16px, 4vw, 44px)));
  box-sizing: border-box;
  padding: clamp(22px, 3vw, 30px);
  background: var(--cc-bg);
  color: var(--cc-fg);
  border: 1px solid var(--cc-border);
  border-radius: 16px;
  box-shadow: 0 18px 54px rgba(24, 22, 15, .19);
  /* Sichtbar ist der Grundzustand. Die Einblendung ist reine Zugabe —
     fällt sie aus, ist das Banner trotzdem da. */
  transform: translate(-50%, 0);
  opacity: 1;
}

#cc-banner.cc-sichtbar {
  animation: cc-einblenden .34s cubic-bezier(.22, .68, .34, 1) both;
}

@keyframes cc-einblenden {
  from { opacity: 0; transform: translate(-50%, 18px); }
  to   { opacity: 1; transform: translate(-50%, 0); }
}

.cc-titel {
  font: 600 20px/1.25 'Space Grotesk', 'Manrope', sans-serif;
  letter-spacing: -.015em;
  margin: 0 0 10px;
}

.cc-text {
  font: 400 14.5px/1.65 'Manrope', sans-serif;
  color: var(--cc-muted);
  margin: 0 0 20px;
  max-width: 72ch;
}

/* ---------- Schaltflächen ---------- */

.cc-aktionen {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.cc-btn {
  font: 700 13px/1 'Manrope', sans-serif;
  letter-spacing: .07em;
  text-transform: uppercase;
  padding: 0 24px;
  min-height: 52px;
  min-width: 210px;
  flex: 0 1 auto;
  border-radius: 999px;
  border: 1px solid transparent;
  cursor: pointer;
  text-align: center;
  transition: opacity .18s ease, background-color .18s ease, border-color .18s ease;
}

/* „Alle ablehnen“ und „Alle akzeptieren“ sind bewusst identisch:
   gleiche Größe, gleiche Farbe, gleiche Position im Fluss (§ 25 TDDDG). */
.cc-btn--gleichrangig {
  background: var(--cc-akzent);
  color: var(--cc-akzent-fg);
  border-color: var(--cc-akzent);
}

.cc-btn--gleichrangig:hover { opacity: .87; }

.cc-btn--zweitrangig {
  background: transparent;
  color: var(--cc-fg);
  border-color: var(--cc-border);
  min-width: 160px;
}

.cc-btn--zweitrangig:hover {
  border-color: var(--cc-akzent);
  color: var(--cc-akzent);
}

.cc-btn:focus-visible,
.cc-links a:focus-visible,
.cc-schalter:focus-visible,
.cc-zu:focus-visible {
  outline: 2px solid var(--cc-akzent);
  outline-offset: 3px;
}

/* ---------- Rechtslinks im Banner ---------- */

.cc-links {
  font: 400 13px/1.6 'Manrope', sans-serif;
  color: var(--cc-muted);
  margin: 18px 0 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.cc-links a {
  color: var(--cc-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cc-links a:hover { color: var(--cc-akzent); }

/* ---------- Zweite Ebene: Einstellungen ---------- */

#cc-hintergrund {
  position: fixed;
  inset: 0;
  z-index: 410;
  background: rgba(13, 14, 17, .55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

#cc-dialog {
  position: fixed;
  z-index: 420;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: min(660px, calc(100vw - 32px));
  max-height: min(88vh, 780px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  box-sizing: border-box;
  padding: clamp(26px, 4vw, 40px);
  background: var(--cc-bg);
  color: var(--cc-fg);
  border-radius: 18px;
  box-shadow: 0 26px 70px rgba(13, 14, 17, .38);
}

#cc-dialog:focus { outline: none; }

.cc-zu {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid var(--cc-border);
  background: var(--cc-flaeche);
  color: var(--cc-fg);
  font: 400 22px/1 'Manrope', sans-serif;
  cursor: pointer;
}

.cc-zu:hover { border-color: var(--cc-akzent); color: var(--cc-akzent); }

.cc-dialog-titel {
  font: 600 clamp(24px, 3.4vw, 32px)/1.15 'Space Grotesk', 'Manrope', sans-serif;
  letter-spacing: -.02em;
  margin: 0 0 12px;
  padding-right: 46px;
}

/* ---------- Kategorien ---------- */

.cc-kat {
  border: 1px solid var(--cc-border);
  border-radius: 12px;
  padding: 18px 20px;
  margin: 0 0 14px;
  background: var(--cc-flaeche);
}

.cc-kat-kopf {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 8px;
}

.cc-kat-name {
  font: 600 16.5px/1.3 'Space Grotesk', 'Manrope', sans-serif;
  margin: 0;
}

.cc-kat-text {
  font: 400 13.5px/1.6 'Manrope', sans-serif;
  color: var(--cc-muted);
  margin: 0;
}

.cc-kat-detail {
  font: 400 12.5px/1.6 'Manrope', sans-serif;
  color: var(--cc-muted);
  margin: 10px 0 0;
  padding-top: 10px;
  border-top: 1px solid var(--cc-border);
}

/* ---------- Schalter ---------- */

.cc-schalter {
  appearance: none;
  -webkit-appearance: none;
  position: relative;
  flex: none;
  width: 54px;
  height: 31px;
  margin: 0;
  border-radius: 999px;
  border: 1px solid var(--cc-border);
  background: #ffffff;
  cursor: pointer;
  transition: background-color .2s ease, border-color .2s ease;
}

.cc-schalter::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 23px;
  height: 23px;
  border-radius: 50%;
  background: #cfc9bb;
  transition: transform .2s ease, background-color .2s ease;
}

.cc-schalter:checked {
  background: var(--cc-akzent);
  border-color: var(--cc-akzent);
}

.cc-schalter:checked::after {
  transform: translateX(23px);
  background: #ffffff;
}

.cc-schalter:disabled {
  cursor: not-allowed;
  opacity: .6;
}

/* ---------- Mobil ---------- */

@media (max-width: 700px) {
  #cc-banner {
    bottom: 10px;
    width: calc(100vw - 20px);
    padding: 22px 20px;
    border-radius: 14px;
    max-height: 86vh;
    overflow: auto;
  }
  .cc-titel { font-size: 18.5px; }
  .cc-text { font-size: 14px; margin-bottom: 18px; }
  .cc-aktionen { flex-direction: column; align-items: stretch; }
  .cc-btn { width: 100%; min-width: 0; }
  .cc-links { justify-content: center; }
  .cc-kat { padding: 16px; }
}

@media (prefers-reduced-motion: reduce) {
  #cc-banner.cc-sichtbar { animation: none; }
  .cc-schalter, .cc-schalter::after, .cc-btn { transition: none; }
}
