/*!
 * consent.css v1.2.0 — Cookie-Banner von ausgerichtet.digital. Build 2026-11-29
 *
 * Anpassung an die Kunden-CI NUR über die Variablen unten (im Projekt-CSS überschreiben):
 *   .consent-root, .consent-placeholder, .consent-float { --consent-accent: #b1352f; --consent-radius: 4px; }
 * Nichts an den Klassen ändern — sonst geht das nächste Update verloren.
 */

.consent-root,
.consent-placeholder,
.consent-float {
  --consent-font: inherit;
  --consent-size: 15px;
  --consent-bg: #ffffff;
  --consent-fg: #15181e;
  --consent-muted: #5c6473;
  --consent-line: rgba(21, 24, 30, 0.1);
  --consent-soft: #f1f3f6;
  --consent-accent: #15181e;
  --consent-accent-fg: #ffffff;
  --consent-link: var(--consent-accent);
  --consent-radius: 16px;
  --consent-btn-radius: 10px;
  --consent-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.35), 0 2px 8px rgba(0, 0, 0, 0.08);
  --consent-backdrop: rgba(10, 12, 18, 0.45);
  --consent-switch-off: #c9ced8;
  --consent-switch-on: var(--consent-accent);
  --consent-focus: 0 0 0 3px rgba(21, 24, 30, 0.28);
  --consent-z: 2147483000;
  --consent-max-width: 460px;
  --consent-dialog-width: 720px;
  --consent-ratio: 16 / 9;

  box-sizing: border-box;
  font-family: var(--consent-font);
  font-size: var(--consent-size);
  line-height: 1.5;
  color: var(--consent-fg);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  text-align: left;
}

.consent-root *,
.consent-placeholder *,
.consent-float * { box-sizing: inherit; }

/* Dunkle Fassung: nur Variablen, keine Komponenten */
.consent-root[data-theme="dark"],
.consent-placeholder[data-theme="dark"],
.consent-float[data-theme="dark"] {
  --consent-bg: #171a21;
  --consent-fg: #eef0f4;
  --consent-muted: #a4acba;
  --consent-line: rgba(255, 255, 255, 0.12);
  --consent-soft: #20242d;
  --consent-accent: #eef0f4;
  --consent-accent-fg: #15181e;
  --consent-switch-off: #3a4150;
  --consent-focus: 0 0 0 3px rgba(255, 255, 255, 0.3);
  --consent-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.3);
}
@media (prefers-color-scheme: dark) {
  .consent-root[data-theme="auto"],
  .consent-placeholder[data-theme="auto"],
  .consent-float[data-theme="auto"] {
    --consent-bg: #171a21;
    --consent-fg: #eef0f4;
    --consent-muted: #a4acba;
    --consent-line: rgba(255, 255, 255, 0.12);
    --consent-soft: #20242d;
    --consent-accent: #eef0f4;
    --consent-accent-fg: #15181e;
    --consent-switch-off: #3a4150;
    --consent-focus: 0 0 0 3px rgba(255, 255, 255, 0.3);
    --consent-shadow: 0 24px 60px -24px rgba(0, 0, 0, 0.8), 0 2px 8px rgba(0, 0, 0, 0.3);
  }
}

/* ---------- Wurzel: liegt über allem, lässt Klicks aber durch ---------- */

.consent-root {
  position: fixed;
  inset: 0;
  z-index: var(--consent-z);
  pointer-events: none;
}
.consent-root:empty { display: none; }

.consent-backdrop {
  position: absolute;
  inset: 0;
  background: var(--consent-backdrop);
  pointer-events: auto;
  animation: consent-fade 0.2s ease-out;
}

html.consent-lock { overflow: hidden; }

@keyframes consent-fade { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Erste Ebene ---------- */

.consent-banner {
  pointer-events: auto;
  position: absolute;
  bottom: 16px;
  left: 16px;
  width: calc(100% - 32px);
  max-width: var(--consent-max-width);
  padding: 22px 24px 20px;
  background: var(--consent-bg);
  border-radius: var(--consent-radius);
  box-shadow: var(--consent-shadow);
  outline: none;
  animation: consent-fade 0.25s ease-out;
}
.consent-root[data-position="bottom-right"] .consent-banner { left: auto; right: 16px; }
.consent-root[data-position="bottom-center"] .consent-banner { left: 50%; transform: translateX(-50%); }

.consent-root[data-layout="bar"] .consent-banner {
  left: 0; right: 0; bottom: 0;
  width: 100%;
  max-width: none;
  transform: none;
  border-radius: var(--consent-radius) var(--consent-radius) 0 0;
  padding: 18px 24px 16px;
}
@media (min-width: 900px) {
  .consent-root[data-layout="bar"] .consent-banner {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    column-gap: 32px;
    align-items: center;
    padding: 18px 40px;
  }
  .consent-root[data-layout="bar"] .consent-actions { grid-column: 2; grid-row: 1 / span 3; margin: 0; flex-direction: column; align-items: stretch; justify-content: center; min-width: 240px; }
  .consent-root[data-layout="bar"] .consent-actions .consent-btn { flex: 0 0 auto; }
  .consent-root[data-layout="bar"] .consent-legal { grid-column: 1 / -1; }
}

.consent-root[data-layout="modal"] .consent-banner {
  left: 50%; top: 50%; bottom: auto;
  transform: translate(-50%, -50%);
  max-width: 560px;
  max-height: calc(100% - 32px);
  overflow: auto;
}

@media (max-width: 600px) {
  .consent-root .consent-banner,
  .consent-root[data-layout="modal"] .consent-banner,
  .consent-root[data-position="bottom-center"] .consent-banner {
    left: 0; right: 0; bottom: 0; top: auto;
    width: 100%;
    max-width: none;
    transform: none;
    border-radius: var(--consent-radius) var(--consent-radius) 0 0;
    max-height: 92vh;
    overflow: auto;
    padding: 20px 16px 16px;
  }
}

.consent-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; margin-bottom: 8px; }
.consent-title { margin: 0; font-family: var(--consent-title-font, inherit); font-size: 1.15em; font-weight: 700; line-height: 1.3; color: var(--consent-fg); }
.consent-text { margin: 0 0 8px; font-size: 0.95em; }
.consent-services { margin: 0; font-size: 0.88em; color: var(--consent-muted); }
.consent-services__label { font-weight: 600; }
.consent-note { margin: 8px 0 0; font-size: 0.88em; color: var(--consent-muted); }
.consent-muted { color: var(--consent-muted); }
.consent-legal { margin: 14px 0 0; font-size: 0.88em; color: var(--consent-muted); }
.consent-link { color: var(--consent-link); text-decoration: underline; text-underline-offset: 2px; }
.consent-link:hover { text-decoration-thickness: 2px; }

/* Sprachwahl */
.consent-langs { display: flex; gap: 4px; margin-left: auto; flex: none; }
.consent-lang {
  appearance: none;
  background: none;
  border: 1px solid var(--consent-line);
  border-radius: 999px;
  padding: 3px 9px;
  font: inherit;
  font-size: 0.78em;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--consent-muted);
  cursor: pointer;
}
.consent-lang.is-active { background: var(--consent-accent); color: var(--consent-accent-fg); border-color: var(--consent-accent); }
.consent-lang-select {
  appearance: auto;
  max-width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--consent-line);
  border-radius: 999px;
  background: var(--consent-bg);
  color: var(--consent-fg);
  font: inherit;
  font-size: 0.82em;
  font-weight: 600;
  cursor: pointer;
}

/* Knöpfe */
.consent-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.consent-btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 18px;
  border: 1px solid transparent;
  border-radius: var(--consent-btn-radius);
  font: inherit;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  text-decoration: none;
  transition: filter 0.15s, background-color 0.15s;
}
.consent-btn--primary { background: var(--consent-accent); color: var(--consent-accent-fg); border-color: var(--consent-accent); }
.consent-btn--primary:hover { filter: brightness(1.12); }
.consent-btn--secondary { background: transparent; color: var(--consent-fg); border-color: currentColor; }
.consent-btn--secondary:hover { background: var(--consent-soft); }
.consent-btn--ghost { background: transparent; color: var(--consent-fg); padding-inline: 8px; text-decoration: underline; text-underline-offset: 3px; }
.consent-btn--small { min-height: 36px; padding: 7px 14px; font-size: 0.92em; }
.consent-banner .consent-btn--primary { flex: 1 1 150px; }
.consent-banner .consent-btn--ghost { flex: 1 1 100%; }
@media (min-width: 900px) {
  .consent-root[data-layout="bar"] .consent-banner .consent-btn--ghost { flex-basis: auto; }
}

/* ---------- Zweite Ebene ---------- */

.consent-dialog {
  pointer-events: auto;
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  width: min(var(--consent-dialog-width), calc(100% - 32px));
  max-height: min(90vh, calc(100% - 32px));
  display: flex;
  flex-direction: column;
  background: var(--consent-bg);
  border-radius: var(--consent-radius);
  box-shadow: var(--consent-shadow);
  outline: none;
  animation: consent-fade 0.2s ease-out;
}
.consent-dialog__head { display: flex; align-items: center; gap: 12px; padding: 20px 24px 12px; }
.consent-dialog__body { flex: 1 1 auto; overflow: auto; padding: 0 24px 16px; overscroll-behavior: contain; }
.consent-dialog__foot { padding: 14px 24px 20px; border-top: 1px solid var(--consent-line); }
.consent-dialog__foot .consent-actions { margin-top: 0; }

@media (max-width: 600px) {
  .consent-dialog {
    left: 0; top: auto; bottom: 0;
    transform: none;
    width: 100%;
    max-height: 94vh;
    border-radius: var(--consent-radius) var(--consent-radius) 0 0;
  }
  .consent-dialog__head, .consent-dialog__body, .consent-dialog__foot { padding-left: 16px; padding-right: 16px; }
}

.consent-close {
  appearance: none;
  flex: none;
  width: 40px; height: 40px;
  margin-left: 8px;
  border: 0;
  border-radius: 50%;
  background: none;
  color: var(--consent-fg);
  display: grid;
  place-items: center;
  cursor: pointer;
}
.consent-close:hover { background: var(--consent-soft); }

/* Kategorien */
.consent-cats { margin-top: 8px; }
.consent-cat { padding: 14px 0; border-top: 1px solid var(--consent-line); }
.consent-cat__row, .consent-svc__row { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; }
.consent-cat__name { margin: 0; font-family: var(--consent-title-font, inherit); font-size: 1em; font-weight: 700; line-height: 1.4; }
.consent-cat__desc { margin: 4px 0 0; font-size: 0.92em; color: var(--consent-muted); }
.consent-always { flex: none; font-size: 0.8em; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--consent-muted); padding-top: 4px; white-space: nowrap; }

.consent-cat__more,
.consent-svc__more {
  appearance: none;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 6px;
  padding: 4px 0;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.9em;
  color: var(--consent-link);
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.consent-cat__more[aria-expanded="true"] .consent-icon,
.consent-svc__more[aria-expanded="true"] .consent-icon { transform: rotate(180deg); }

/* Dienste */
.consent-svc-list { list-style: none; margin: 8px 0 0; padding: 0; }
.consent-svc { margin-top: 8px; padding: 12px 14px; border-radius: calc(var(--consent-radius) * 0.6); background: var(--consent-soft); }
.consent-svc__text { display: flex; flex-direction: column; min-width: 0; }
.consent-svc__name { font-weight: 600; }
.consent-svc__provider { font-size: 0.86em; }
.consent-svc__details { margin-top: 8px; font-size: 0.92em; }
.consent-svc__details p { margin: 6px 0; }
.consent-svc__details p:first-child { margin-top: 0; }

/* Schalter */
.consent-switch {
  appearance: none;
  position: relative;
  flex: none;
  width: 46px; height: 26px;
  margin-top: 2px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: var(--consent-switch-off);
  cursor: pointer;
  transition: background-color 0.15s;
}
.consent-switch[aria-checked="true"] { background: var(--consent-switch-on); }
.consent-switch[aria-checked="mixed"] { background: linear-gradient(90deg, var(--consent-switch-on) 50%, var(--consent-switch-off) 50%); }
.consent-switch[disabled] { opacity: 0.5; cursor: default; }
.consent-switch__knob {
  position: absolute;
  top: 3px; left: 3px;
  width: 20px; height: 20px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
  transition: transform 0.15s;
}
.consent-switch[aria-checked="true"] .consent-switch__knob { transform: translateX(20px); }
.consent-switch[aria-checked="mixed"] .consent-switch__knob { transform: translateX(10px); }

/* Cookie-Tabelle */
.consent-cookies { width: 100%; border-collapse: collapse; font-size: 0.9em; margin-top: 4px; }
.consent-cookies th { text-align: left; font-size: 0.78em; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--consent-muted); padding: 4px 0; }
.consent-cookies td { padding: 6px 0; border-top: 1px solid var(--consent-line); vertical-align: top; }
.consent-cookies td:last-child { text-align: right; white-space: nowrap; padding-left: 12px; }
.consent-cookies code, .consent-record code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 0.92em; }
.consent-cookie-purpose { font-size: 0.92em; }

/* Nachweis */
.consent-record { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 16px; margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--consent-line); font-size: 0.9em; }
.consent-record p { margin: 0; }

/* Symbole */
.consent-icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; transition: transform 0.15s; flex: none; }

/* Fokus */
.consent-root :focus-visible,
.consent-placeholder :focus-visible,
.consent-float:focus-visible { outline: none; box-shadow: var(--consent-focus); }

/* ---------- Platzhalter für blockierte Inhalte ---------- */

.consent-placeholder {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: var(--consent-ratio);
  min-height: auto;              /* wächst mit dem Inhalt, wenn das Seitenverhältnis zu flach ist */
  padding: 20px;
  background: var(--consent-soft);
  border-radius: var(--consent-radius);
  overflow: visible;             /* kein Scroll-Container, sonst greift die Mindesthöhe nicht */
  text-align: center;
}
.consent-placeholder__inner { max-width: 440px; }
.consent-placeholder .consent-icon { width: 40px; height: 40px; fill: currentColor; stroke: none; opacity: 0.6; }
.consent-placeholder__title { margin: 8px 0 4px; font-weight: 700; }
.consent-placeholder__text { margin: 0 0 14px; font-size: 0.9em; color: var(--consent-muted); }
.consent-placeholder__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }

/* ---------- Schwebender Keks zum Wiederöffnen (nur Symbol) ---------- */

.consent-float {
  position: fixed;
  left: 16px; bottom: 16px;
  z-index: var(--consent-z);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px; height: 46px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--consent-bg);
  color: var(--consent-accent);
  box-shadow: var(--consent-shadow);
  font: inherit;
  cursor: pointer;
  transition: transform 0.15s;
}
.consent-float:hover { transform: translateY(-2px); }
.consent-float[data-position="bottom-right"] { left: auto; right: 16px; }
.consent-float .consent-icon { width: 26px; height: 26px; stroke-width: 1.7; }

/* Öffner im Text/Menü mit Keks-Symbol (siehe decorateOpeners) */
.consent-opener--icon { display: inline-flex; align-items: center; gap: 0.4em; vertical-align: middle; line-height: 1; }
.consent-opener--icon .consent-icon { width: 1.4em; height: 1.4em; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Nur für Screenreader */
.consent-sr { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

/* ---------- Sonstiges ---------- */

@media (prefers-reduced-motion: reduce) {
  .consent-root *, .consent-placeholder *, .consent-float,
  .consent-banner, .consent-dialog, .consent-backdrop { animation: none !important; transition: none !important; }
}
@media print {
  .consent-root, .consent-float { display: none !important; }
}
