/* ============================================================
   ProzessWerk — Cookie-/Einwilligungsbanner
   Lädt zusätzlich zu styles.css (Tokens und .btn werden wiederverwendet).
   Das Markup erzeugt consent.js zur Laufzeit — ist der Banner
   abgeschaltet, entsteht hier gar nichts.
   ============================================================ */

.cc {
  position: fixed;
  z-index: 9000;
  left: var(--gutter);
  right: var(--gutter);
  bottom: var(--gutter);
  display: flex;
  justify-content: flex-start;
  pointer-events: none;
}

.cc__card {
  pointer-events: auto;
  width: min(100%, 33rem);
  max-height: calc(100vh - 2 * var(--gutter));
  overflow-y: auto;
  overscroll-behavior: contain;
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  padding: clamp(1.25rem, 1rem + 1.2vw, 1.75rem);
  font-family: var(--font-body);
  color: var(--text);
}

@media (prefers-reduced-motion: no-preference) {
  .cc__card { animation: ccIn 0.5s var(--ease) both; }
  @keyframes ccIn {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: none; }
  }
}

/* Ausblenden nach der Auswahl */
.cc.is-closing { opacity: 0; transition: opacity 0.3s var(--ease); }

/* ---------- Kopf ---------- */
.cc__title {
  font-family: var(--font-display);
  font-size: var(--step-1);
  font-weight: 600;
  line-height: 1.2;
  color: var(--ink);
  margin-bottom: 0.5rem;
  letter-spacing: -0.01em;
}
.cc__text {
  font-size: var(--step--1);
  line-height: 1.6;
  margin-bottom: 1.1rem;
}
.cc__text a { color: var(--orange); font-weight: 600; }

/* ---------- Buttons ---------- */
.cc__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}
/* Beide Hauptoptionen sind gleich prominent — Ablehnen darf nicht
   schwerer zu finden sein als Zustimmen. */
.cc__actions .btn {
  flex: 1 1 12rem;
  font-size: var(--step--1);
  padding: 0.85em 1.2em;
}
.cc__link {
  display: inline-block;
  margin-top: 0.9rem;
  background: none;
  border: 0;
  padding: 0;
  font: inherit;
  font-size: var(--step--1);
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}
.cc__link:hover { color: var(--ink); }

/* ---------- Detail-Ebene (Kategorien) ---------- */
.cc__details { margin: 0.2rem 0 1.1rem; }
.cc__group {
  display: flex;
  align-items: flex-start;
  gap: 0.85rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--line);
}
.cc__group:last-child { border-bottom: 1px solid var(--line); }
.cc__group-name {
  display: block;
  font-weight: 600;
  color: var(--ink);
  font-size: var(--step-0);
  line-height: 1.3;
}
.cc__group-desc {
  display: block;
  font-size: var(--step--1);
  line-height: 1.55;
  margin-top: 0.2rem;
}
.cc__group-body { flex: 1; }

/* Schalter */
.cc__switch { flex: 0 0 auto; margin-top: 0.15rem; }
.cc__switch input {
  position: absolute;
  opacity: 0;
  width: 44px;
  height: 26px;
  margin: 0;
  cursor: pointer;
}
.cc__track {
  display: block;
  width: 44px;
  height: 26px;
  border-radius: 999px;
  background: var(--taupe-soft);
  position: relative;
  transition: background-color 0.25s var(--ease);
}
.cc__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: var(--white);
  box-shadow: 0 1px 3px rgba(28, 42, 77, 0.25);
  transition: transform 0.25s var(--ease);
}
.cc__switch input:checked + .cc__track { background: var(--orange); }
.cc__switch input:checked + .cc__track::after { transform: translateX(18px); }
.cc__switch input:focus-visible + .cc__track {
  outline: 2px solid var(--navy);
  outline-offset: 3px;
}
.cc__switch input:disabled + .cc__track { background: var(--navy); opacity: 0.35; }
.cc__switch input:disabled { cursor: default; }

@media (prefers-reduced-motion: reduce) {
  .cc__track, .cc__track::after { transition: none; }
}

/* ---------- Mobil ---------- */
@media (max-width: 640px) {
  .cc { left: 0; right: 0; bottom: 0; }
  .cc__card {
    width: 100%;
    max-height: 85vh;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding-bottom: max(1.25rem, env(safe-area-inset-bottom));
  }
  .cc__actions .btn { flex: 1 1 100%; }
}
