/* ============================================================
   qdcops – Cookie-Consent (DSGVO / TTDSG § 25)

   Bewusst eine eigene Datei statt eines Anhangs an editorial.css:
   Die Komponente ist rechtlich tragend und soll unabhängig vom
   Seitendesign prüf- und austauschbar bleiben.

   Alle Custom Properties mit Fallback, damit die Komponente auch
   auf einer Seite mit abweichendem :root korrekt rendert.
   ============================================================ */

.cc-banner,
.cc-dialog {
  --cc-navy: var(--navy, #0D2132);
  --cc-primary: var(--primary, #00A5DB);
  --cc-line: var(--line, #E3E7EB);
  --cc-grey: var(--light-grey, #F7F7F7);
  --cc-white: var(--white, #fff);
  --cc-font: var(--font, 'Wix Madefor Display', system-ui, sans-serif);
  --cc-ease: var(--ease, cubic-bezier(.22, .61, .36, 1));
  --cc-muted: #51606c;
}

/* Footer kommt frei, solange das Banner steht – der Impressum-Link
   muss nach § 5 DDG ständig erreichbar bleiben. */
html.cc-banner-open body { padding-bottom: var(--cc-banner-h, 0px); }

/* showModal() sperrt das Scrollen nicht. Lock auf <html>, nicht <body>:
   editorial.css setzt dort bereits overflow-x. */
html.cc-modal-open { overflow: hidden; }

/* ---------- Layer 1: Banner (bewusst nicht-modal, keine Cookie-Wall) ---------- */

.cc-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1000; /* .site-header liegt bei 60 */
  background: var(--cc-white);
  border-top: 1px solid var(--cc-line);
  box-shadow: 0 -18px 40px -24px rgba(13, 33, 50, .45);
  font-family: var(--cc-font);
  color: var(--cc-navy);
  animation: cc-rise .32s var(--cc-ease) both;
}

@keyframes cc-rise { from { transform: translateY(100%); } to { transform: none; } }

.cc-banner__inner {
  max-width: var(--container, 1440px);
  margin: 0 auto;
  padding: 22px 28px;
  display: flex;
  align-items: center;
  gap: clamp(20px, 3vw, 48px);
}

.cc-banner__text { flex: 1 1 auto; min-width: 0; }
.cc-banner__title { font-size: 17px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 6px; }
.cc-banner__text p { font-size: 14.5px; line-height: 1.6; color: var(--cc-muted); margin: 0 0 6px; }

.cc-banner__links { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 10px !important; }
.cc-banner__links a {
  font-size: 14px; font-weight: 600; color: var(--cc-navy);
  border-bottom: 1.5px solid var(--cc-primary); padding-bottom: 2px;
}
.cc-banner__links a:hover { color: var(--cc-primary); }

.cc-banner__actions { flex: 0 0 auto; display: flex; gap: 10px; flex-wrap: wrap; }

/* ---------- Buttons ----------
   Gleichwertigkeit ist hier rechtlich tragend: "Alle akzeptieren" und
   "Alle ablehnen" teilen sich EINE Variante. Kein Filled-vs-Outline,
   keine Farbabstufung, kein Degradieren von "Ablehnen" zum Textlink –
   das ist der meistbeanstandete Mangel deutscher Consent-Banner. */

.cc-btn {
  display: inline-flex; align-items: center; justify-content: center;
  font-family: var(--cc-font);
  font-weight: 600; font-size: 14px; line-height: 1;
  padding: 15px 26px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .25s var(--cc-ease), background .25s, color .25s, box-shadow .25s, border-color .25s;
}
.cc-btn--primary { background: var(--cc-navy); color: #fff; }
.cc-btn--primary:hover { transform: translateY(-2px); box-shadow: 0 14px 30px -12px rgba(13, 33, 50, .5); }
.cc-btn--quiet { background: transparent; color: var(--cc-navy); border-color: rgba(13, 33, 50, .25); }
.cc-btn--quiet:hover { border-color: var(--cc-navy); }

.cc-btn:focus-visible,
.cc-banner__links a:focus-visible,
.cc-svc summary:focus-visible,
.cc-switch input:focus-visible + .cc-switch__track {
  outline: 2px solid var(--cc-primary);
  outline-offset: 4px;
  border-radius: 999px;
}

.cc-warn {
  background: rgba(200, 40, 40, .06);
  border-left: 3px solid rgba(200, 40, 40, .45);
  border-radius: 0 8px 8px 0;
  padding: 10px 13px;
  font-size: 13.5px !important;
  color: #7d2020 !important;
  margin: 10px 0 !important;
}

/* ---------- Layer 2: Einstellungen ---------- */

.cc-dialog {
  border: none;
  padding: 0;
  /* editorial.css setzt per *{margin:0} auch auf <dialog> zurueck und kippt
     damit das margin:auto, mit dem der Browser einen modalen Dialog zentriert. */
  margin: auto;
  background: transparent;
  max-width: min(680px, calc(100vw - 40px));
  width: 100%;
  max-height: min(84vh, 860px);
  overflow: visible;
  color: var(--cc-navy);
}
/* ::backdrop erbt historisch nicht vom Dokument – Custom Properties lösen
   sich dort zu leer auf. Deshalb Literalwert. */
.cc-dialog::backdrop { background: rgba(13, 33, 50, .55); }

.cc-panel {
  background: var(--cc-white);
  border-radius: 16px;
  font-family: var(--cc-font);
  display: flex;
  flex-direction: column;
  max-height: min(84vh, 860px);
  overflow: hidden;
}
.cc-panel__head { padding: 26px 28px 18px; border-bottom: 1px solid var(--cc-line); }
.cc-panel__head h2 { font-size: 21px; font-weight: 600; letter-spacing: -.01em; margin-bottom: 8px; }
.cc-panel__head h2:focus,
.cc-panel__head h2:focus-visible { outline: none; }
.cc-panel__head p { font-size: 14.5px; line-height: 1.6; color: var(--cc-muted); margin: 0; }

/* min-height:0 ist Pflicht: ohne das schrumpft ein Flex-Item nicht unter
   seine Inhaltshöhe und der scrollende Bereich läuft über die Fußzeile. */
.cc-panel__head,
.cc-panel__note,
.cc-panel__actions { flex: 0 0 auto; }
.cc-panel__body {
  flex: 1 1 auto;
  min-height: 0;
  padding: 6px 28px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.cc-panel__empty {
  font-size: 14.5px; line-height: 1.6; color: var(--cc-muted);
  background: var(--cc-grey); border-left: 3px solid var(--cc-primary);
  border-radius: 0 10px 10px 0; padding: 14px 16px; margin: 18px 0 4px;
}

.cc-cat { padding: 20px 0; border-bottom: 1px solid var(--cc-line); }
.cc-cat:last-child { border-bottom: none; }
.cc-cat__desc { font-size: 14px; line-height: 1.6; color: var(--cc-muted); margin: 8px 0 12px 62px; }

.cc-switch { display: inline-flex; align-items: center; gap: 14px; cursor: pointer; }
.cc-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.cc-switch__track {
  position: relative; flex: 0 0 auto;
  width: 48px; height: 28px; border-radius: 999px;
  background: #cfd6dd; transition: background .25s var(--cc-ease);
}
.cc-switch__track::after {
  content: ""; position: absolute; top: 3px; left: 3px;
  width: 22px; height: 22px; border-radius: 50%; background: #fff;
  box-shadow: 0 2px 5px rgba(13, 33, 50, .3);
  transition: transform .25s var(--cc-ease);
}
.cc-switch input:checked + .cc-switch__track { background: var(--cc-primary); }
.cc-switch input:checked + .cc-switch__track::after { transform: translateX(20px); }
.cc-switch input:disabled + .cc-switch__track { background: #b7c0c9; cursor: default; }
.cc-switch input:disabled ~ .cc-switch__label { color: var(--cc-muted); }
/* >= 16px verhindert den Focus-Zoom auf iOS. */
.cc-switch__label { font-size: 16px; font-weight: 600; }

.cc-tag {
  display: inline-block; margin-left: 8px; padding: 3px 8px;
  border-radius: 999px; font-size: 11.5px; font-weight: 600; letter-spacing: .02em;
  background: rgba(200, 40, 40, .1); color: #9b1c1c; vertical-align: middle;
}
.cc-tag--muted { background: var(--cc-grey); color: var(--cc-muted); }

.cc-svc { margin: 8px 0 0 62px; border-top: 1px solid var(--cc-line); }
.cc-svc summary {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 0; cursor: pointer; list-style: none;
  font-size: 14px; font-weight: 600;
}
.cc-svc summary::-webkit-details-marker { display: none; }
.cc-svc__chev { margin-left: auto; width: 18px; height: 18px; color: var(--cc-muted); transition: transform .25s var(--cc-ease); }
.cc-svc__chev svg { width: 100%; height: 100%; display: block; }
.cc-svc[open] .cc-svc__chev { transform: rotate(180deg); }

.cc-svc__dl {
  display: grid; grid-template-columns: 140px 1fr; gap: 7px 18px;
  padding: 4px 0 16px; font-size: 13.5px; line-height: 1.55;
}
.cc-svc__dl dt { font-weight: 600; color: var(--cc-muted); }
.cc-svc__dl dd { color: var(--cc-navy); word-break: break-word; }
.cc-svc__dl a { color: var(--cc-navy); border-bottom: 1px solid var(--cc-primary); }

.cc-panel__note {
  padding: 14px 28px 0;
  font-size: 13px; line-height: 1.55; color: var(--cc-muted);
  background: var(--cc-white);
}
.cc-panel__actions {
  display: flex; gap: 10px; flex-wrap: wrap;
  padding: 18px 28px 24px;
  border-top: 1px solid var(--cc-line);
  margin-top: 14px;
  background: var(--cc-white);
}

/* Fallback ohne <dialog>.showModal() (z. B. iOS Safari < 15.4):
   Panel als Sheet am unteren Rand statt stillschweigend nichts. */
.cc-dialog--inline {
  display: block;
  position: fixed;
  inset: auto 0 0 0;
  z-index: 1001;
  margin: 0 auto;
  max-width: min(680px, 100vw);
  max-height: 88vh;
}
.cc-dialog--inline .cc-panel { border-radius: 16px 16px 0 0; max-height: 88vh; }

/* ---------- Responsive (Breakpoints wie editorial.css) ---------- */

@media (max-width: 920px) {
  .cc-banner__inner { flex-direction: column; align-items: stretch; gap: 18px; padding: 20px 24px; }
  .cc-banner__actions { justify-content: flex-start; }
  .cc-btn { flex: 1 1 auto; }
}

@media (max-width: 560px) {
  .cc-banner__inner { padding: 18px 20px; }
  .cc-banner__actions { flex-direction: column; }
  .cc-btn { width: 100%; }
  .cc-panel__head, .cc-panel__body, .cc-panel__note, .cc-panel__actions { padding-left: 20px; padding-right: 20px; }
  .cc-cat__desc, .cc-svc { margin-left: 0; }
  .cc-svc__dl { grid-template-columns: 1fr; gap: 2px; }
  .cc-svc__dl dd { margin-bottom: 9px; }
  .cc-panel__actions { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
  .cc-banner { animation: none; }
  .cc-btn, .cc-switch__track, .cc-switch__track::after, .cc-svc__chev { transition: none; }
  .cc-btn:hover { transform: none; }
}

/* ---------- Widerrufs-Control im Footer ----------
   <button> statt <a href="#">, weil das Element einen Dialog öffnet und
   nicht navigiert. Erbt deshalb nicht von .ft__links a und braucht den
   Reset auf den dunklen Footer. */

.ft__links .cc-footer-link {
  font-family: var(--font-btn, var(--font, 'Wix Madefor Display', system-ui, sans-serif));
  font-weight: 600;
  font-size: 14px;
  color: rgba(255, 255, 255, .8);
  background: none;
  border: none;
  padding: 0;
  line-height: inherit;
  cursor: pointer;
}
.ft__links .cc-footer-link:hover { color: #fff; }
.ft__links .cc-footer-link:focus-visible {
  outline: 2px solid var(--primary, #00A5DB);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Widerrufs-Control im Fließtext der Datenschutzerklärung. */
.cc-inline-link {
  font: inherit;
  color: var(--navy, #0D2132);
  background: none;
  border: none;
  border-bottom: 1px solid var(--primary, #00A5DB);
  padding: 0;
  cursor: pointer;
}
.cc-inline-link:hover { color: var(--primary, #00A5DB); }
.cc-inline-link:focus-visible {
  outline: 2px solid var(--primary, #00A5DB);
  outline-offset: 4px;
  border-radius: 4px;
}

/* Schließen-Control im Dialogkopf. */
.cc-panel__head { position: relative; }
.cc-panel__close {
  position: absolute;
  top: 20px; right: 20px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: none; border-radius: 50%;
  background: var(--cc-grey);
  color: var(--cc-navy);
  cursor: pointer;
  transition: background .2s var(--cc-ease);
}
.cc-panel__close svg { width: 16px; height: 16px; }
.cc-panel__close:hover { background: #e6eaee; }
.cc-panel__close:focus-visible { outline: 2px solid var(--cc-primary); outline-offset: 4px; }
.cc-panel__head h2 { padding-right: 44px; }

@media (prefers-reduced-motion: reduce) { .cc-panel__close { transition: none; } }
