/* ===== KwK Cookie Consent V2 — DSGVO-konform, Value-Exchange =====
   Stand: 2026-04-21
   Design-Prinzipien:
   - 3 gleich große Buttons (Ablehnen · Einstellungen · Akzeptieren)
   - Visuelle Hierarchie auf Accept erlaubt — aber Ablehnen gleich groß & klickbar
   - Echte Toggles, Single-Step-Modal
   - X-Button schließt ohne Consent (Banner kommt wieder)
   - Legal-Links navigieren direkt
   - Value-Exchange-Microcopy
*/

/* Backdrop */
.kwk-cb-backdrop {
  position: fixed;
  inset: 0;
  z-index: 9998;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(13px);
  -webkit-backdrop-filter: blur(13px);
  animation: kwkCbFadeIn 0.4s ease-out;
}

/* Banner */
.kwk-cb {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  pointer-events: none;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}
.kwk-cb-inner {
  position: relative;
  max-width: 460px;
  width: 100%;
  max-height: 94vh;
  overflow-y: auto;
  background: rgba(18, 18, 18, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  padding: 24px 26px;
  pointer-events: auto;
  text-align: center;
  animation: kwkCbScaleIn 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes kwkCbFadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes kwkCbScaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to { opacity: 1; transform: scale(1); }
}

/* X-Button (schließt neutral — kein Consent) */
.kwk-cb-x-wrap { position: absolute; top: 14px; right: 14px; z-index: 1; }
.kwk-cb-x {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 50%;
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  font-size: 20px; font-weight: 300; line-height: 1;
  color: rgba(255, 255, 255, 0.3);
  transition: color 0.2s, border-color 0.2s, background 0.2s;
  padding: 0 0 3px 0;
  font-family: inherit;
}
.kwk-cb-x:hover {
  color: rgba(255, 255, 255, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
  background: rgba(255, 255, 255, 0.04);
}

/* Text */
.kwk-cb-text { text-align: left; }
.kwk-cb-text strong {
  font-size: 20px; font-weight: 700; color: #fff;
  display: block; margin-bottom: 8px;
}
.kwk-cb-text p {
  font-size: 13px; line-height: 1.6;
  color: rgba(255, 255, 255, 0.7);
  margin: 0;
}

/* Benefits-Liste mit grünen Häkchen */
.kwk-cb-benefits {
  list-style: none;
  margin: 12px 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.kwk-cb-benefits li {
  position: relative;
  padding-left: 30px;
  font-size: 13px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.72);
}
.kwk-cb-benefits li strong {
  display: inline;
  font-size: inherit;
  margin: 0;
  color: #fff;
  font-weight: 600;
}
/* Grüner Kreis mit Unicode-Häkchen, optisch leicht nach unten verschoben */
.kwk-cb-benefits li::before {
  content: '✓';
  position: absolute;
  left: 0;
  top: 1px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: rgba(120, 200, 100, 0.15);
  border: 1px solid rgba(120, 200, 100, 0.5);
  color: #8fd97e;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  padding-top: 2px;
  box-sizing: border-box;
}
/* Erste Kategorie (Technische Cookies) in Grau — dezent, weil "immer aktiv"
   keine User-Entscheidung braucht und keinen visuellen Fokus verdient */
.kwk-cb-benefits li:first-child::before {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.55);
}
.kwk-cb-benefits .kwk-cb-always {
  display: inline-block;
  margin-left: 6px;
  padding: 1px 8px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  vertical-align: middle;
  white-space: nowrap;
}
.kwk-cb-benefits .kwk-cb-provider {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
  font-size: 12px;
}


.kwk-cb-smiley {
  display: inline-block;
  margin-left: 4px;
  font-size: 14px;
  vertical-align: -1px;
}

/* ===== Assurance-Kachel (Trust + Danke + Social Proof) ===== */
.kwk-cb-assurance {
  margin: 14px 0 0;
  padding: 14px 18px 12px;
  background: linear-gradient(135deg,
    rgba(245, 196, 138, 0.06) 0%,
    rgba(141, 90, 59, 0.16) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  text-align: left;
  position: relative;
  overflow: hidden;
}
/* Horizontal-Layout: Icon links mittig, Text rechts */
.kwk-cb-assurance-main {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-bottom: 10px;
}
.kwk-cb-assurance-text {
  flex: 1;
  min-width: 0;
}
/* Schloss-Icon — CSS-gezeichnet, kompakt, vertikal zentriert */
.kwk-cb-assurance-icon {
  display: block;
  width: 26px;
  height: 28px;
  flex-shrink: 0;
  position: relative;
}
.kwk-cb-assurance-icon::before {
  content: '';
  position: absolute;
  top: 0;
  left: 6px;
  width: 14px;
  height: 12px;
  border: 2px solid #8fd97e;
  border-bottom: none;
  border-radius: 7px 7px 0 0;
  box-sizing: border-box;
}
.kwk-cb-assurance-icon::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 26px;
  height: 17px;
  background: #8fd97e;
  border-radius: 4px;
  box-shadow: 0 2px 10px rgba(143, 217, 126, 0.3);
}
/* Überschrift der Kachel */
.kwk-cb-assurance-heading {
  margin: 0 0 4px;
  font-size: 15.5px;
  font-weight: 700;
  line-height: 1.25;
  color: #fff;
  letter-spacing: 0.2px;
}
/* Kombinierter Body-Text (Versprechen + Danke in einem Paragraph) — Blocksatz */
.kwk-cb-assurance-body {
  margin: 0;
  font-size: 12.5px;
  font-weight: 400;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.92);
  text-align: justify;
  hyphens: none;
  -webkit-hyphens: none;
}
/* CI-Kupfer-Highlight für "garantiert nicht" — aus moodboard-v2: Kupfer Soft */
.kwk-cb-assurance-highlight {
  color: #A06B4A;
  font-weight: 600;
}
.kwk-cb-assurance-proof {
  display: flex;
  flex-wrap: wrap;
  gap: 3px 10px;
  justify-content: center;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
}
.kwk-cb-assurance-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
  transition: color 0.2s;
}
.kwk-cb-assurance-link:hover {
  color: #fff;
  text-decoration: underline;
}
.kwk-cb-assurance-star {
  color: #f5c48a;
  font-size: 13px;
  line-height: 1;
}
.kwk-cb-assurance-count {
  color: rgba(255, 255, 255, 0.6);
  font-size: 10.5px;
}
.kwk-cb-assurance-guests {
  color: rgba(255, 255, 255, 0.85);
}

/* Actions — 3 Buttons gleicher Größe, nebeneinander */
.kwk-cb-actions {
  margin-top: 16px;
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 8px;
}
.kwk-cb-btn {
  padding: 11px 10px;
  border-radius: 11px;
  font-size: 13px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.2s;
  line-height: 1.2;
  border: 1px solid transparent;
  white-space: nowrap;
}
/* Ablehnen: dezent, kein Hover-Effekt, Schrift gedämpft */
.kwk-cb-btn-decline {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.45);
}
/* Einstellungen: hellgrau, etwas mehr visual weight als Ablehnen (lenkt
   Unentschlossene auf den Einstellungs-Pfad statt auf Ablehnen).
   Schrift ebenfalls dezent gedämpft. */
.kwk-cb-btn-settings {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.2);
  color: rgba(255, 255, 255, 0.6);
}
.kwk-cb-btn-accept {
  background: linear-gradient(135deg, #6B422C, #8D5A3B);
  color: #fff !important;
  border-color: rgba(255, 180, 120, 0.3);
  box-shadow: 0 4px 14px rgba(107, 66, 44, 0.25);
  position: relative;
  overflow: hidden;
  isolation: isolate;
}
/* Shimmer — matched mit KwK-CI aus startseite-v2.html .kwk-btn-primary */
.kwk-cb-btn-accept::after {
  content: '';
  position: absolute;
  top: 0;
  left: -80%;
  width: 80%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.06), transparent);
  animation: kwkCbBtnShimmer 3.5s ease-in-out infinite;
  will-change: left;
  pointer-events: none;
  z-index: 1;
}
@keyframes kwkCbBtnShimmer {
  0%, 100% { left: -80%; }
  50% { left: 100%; }
}
.kwk-cb-btn-accept:hover {
  background: linear-gradient(135deg, #8D5A3B, #a07050);
  transform: translateY(-2px) scale(1.025);
  box-shadow: 0 14px 36px rgba(141, 90, 59, 0.65),
              0 0 0 1px rgba(255, 180, 120, 0.3),
              0 0 24px rgba(160, 112, 80, 0.35);
}

/* Legal links — nur Links, kein Consent-Trigger */
.kwk-cb-legal {
  margin-top: 14px;
  display: flex; align-items: center; justify-content: center;
  gap: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}
.kwk-cb-legal a, .kwk-cb-legal a:visited {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.35);
  text-decoration: none;
  transition: color 0.2s;
}
.kwk-cb-legal a:hover { color: rgba(255, 255, 255, 0.7); text-decoration: underline; }
.kwk-cb-legal .kwk-cb-sep {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.18);
}

/* ===== Settings Modal ===== */
.kwk-cm {
  position: fixed;
  inset: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
}
.kwk-cm-backdrop {
  position: absolute; inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.kwk-cm-dialog {
  position: relative;
  width: 90%; max-width: 460px; max-height: 90vh;
  overflow-y: auto;
  background: rgba(18, 18, 18, 0.98);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 20px;
  animation: kwkCbScaleIn 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.kwk-cm-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 24px 14px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
}
.kwk-cm-header strong {
  font-size: 20px;
  font-weight: 700;
  color: #fff;
}
.kwk-cm-header-buttons { display: flex; gap: 6px; align-items: center; }
.kwk-cm-header-buttons .kwk-cb-x { position: static; }

.kwk-cm-body { padding: 4px 24px 14px; }
.kwk-cm-intro {
  font-size: 12.5px;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.7);
  margin: 10px 0 4px;
}

.kwk-cm-category {
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.kwk-cm-category:last-child { border-bottom: none; }
.kwk-cm-cat-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 14px;
}
.kwk-cm-cat-title {
  font-size: 13.5px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 4px;
  line-height: 1.35;
}
.kwk-cm-cat-provider {
  color: rgba(255, 255, 255, 0.45);
  font-weight: 400;
  font-size: 12px;
}
.kwk-cm-cat-desc {
  font-size: 12px;
  font-weight: 300;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.65);
  max-width: 320px;
}
.kwk-cm-cat-desc code {
  background: rgba(255, 255, 255, 0.06);
  padding: 1px 5px;
  border-radius: 4px;
  font-size: 10.5px;
  color: rgba(255, 255, 255, 0.8);
}

/* Toggle */
.kwk-cm-toggle { flex-shrink: 0; display: flex; align-items: center; gap: 8px; }
.kwk-cm-toggle-locked {
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.5);
}
.kwk-cm-toggle-locked span {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  white-space: nowrap;
}
.kwk-cm-toggle-locked input { display: none; }
.kwk-cm-switch {
  position: relative;
  width: 42px; height: 24px;
  display: inline-block;
  cursor: pointer;
}
.kwk-cm-switch input { display: none; }
.kwk-cm-slider {
  position: absolute; inset: 0;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 12px;
  cursor: pointer;
  transition: background 0.3s;
}
.kwk-cm-slider::before {
  content: '';
  position: absolute;
  left: 3px; top: 3px;
  width: 18px; height: 18px;
  background: rgba(255, 255, 255, 0.55);
  border-radius: 50%;
  transition: transform 0.3s, background 0.3s;
}
/* Aktiv-Zustand: dezent hellgrau (nicht invasiv-bunt) */
.kwk-cm-switch input:checked + .kwk-cm-slider {
  background: rgba(255, 255, 255, 0.22);
}
.kwk-cm-switch input:checked + .kwk-cm-slider::before {
  transform: translateX(18px);
  background: #fff;
}

/* ===== Quickaction-Row oben im Modal ===== */
.kwk-cm-quickaction {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 12px 0 4px;
  padding: 12px 14px;
  background: linear-gradient(135deg, rgba(107, 66, 44, 0.22), rgba(141, 90, 59, 0.14));
  border: 1px solid rgba(141, 90, 59, 0.38);
  border-radius: 10px;
}
.kwk-cm-quickaction-text {
  flex: 1;
  font-size: 11.5px;
  line-height: 1.4;
}
.kwk-cm-quickaction-text strong {
  display: block;
  color: #fff;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 2px;
}
.kwk-cm-quickaction-text span {
  color: rgba(255, 255, 255, 0.65);
}
.kwk-cm-quickaction-btn {
  flex-shrink: 0;
  padding: 9px 14px !important;
  font-size: 12.5px !important;
  white-space: nowrap;
}

/* Footer: normaler Flow (nicht sticky) — damit Save/Accept erst per Scroll sichtbar
   sind. Quickaction-Row oben bleibt der Primary-Accept-Pfad. */
.kwk-cm-footer {
  padding: 14px 24px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.07);
}
.kwk-cm-footer-main {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.kwk-cm-footer-legal {
  text-align: center;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255, 255, 255, 0.05);
  font-size: 11px;
  color: rgba(255, 255, 255, 0.4);
}
.kwk-cm-footer-legal a {
  color: rgba(255, 255, 255, 0.5);
  text-decoration: none;
  transition: color 0.2s;
}
.kwk-cm-footer-legal a:hover { color: #fff; text-decoration: underline; }

/* Mobile */
@media (max-width: 540px) {
  /* Banner top-aligned + entzerrte Paddings/Gaps — Content überschreitet
     Viewport-Höhe auch auf iPhone 17 Pro, sodass Ablehnen unten raus läuft.
     Per Scroll innerhalb des Banners erreichbar (DSGVO-konform). */
  .kwk-cb {
    align-items: flex-start;
    padding: 14px 14px 0;
  }
  .kwk-cb-inner {
    padding: 26px 22px;
    max-width: 360px;
    max-height: calc(100vh - 28px);
  }
  .kwk-cb-text strong { font-size: 17px; margin-bottom: 10px; }
  .kwk-cb-text p { font-size: 12.5px; line-height: 1.7; }
  .kwk-cb-benefits { margin-top: 22px; gap: 13px; }
  .kwk-cb-benefits li { font-size: 12.5px; line-height: 1.6; }
  .kwk-cb-assurance { padding: 18px 16px 14px; margin-top: 22px; }
  .kwk-cb-assurance-body { font-size: 12.5px; line-height: 1.6; }
  .kwk-cb-assurance-proof { font-size: 11px; padding-top: 10px; gap: 5px 10px; }
  .kwk-cb-actions {
    margin-top: 22px;
    grid-template-columns: 1fr;
    gap: 10px;
  }
  .kwk-cb-btn { padding: 15px 16px; font-size: 14px; }
  /* Button-Reihenfolge auf Mobile: Accept (oben) → Einstellungen (mitte) → Ablehnen (unten) */
  .kwk-cb-btn-accept { order: -3; }
  .kwk-cb-btn-settings { order: -2; }
  .kwk-cb-btn-decline { order: -1; }
  .kwk-cb-legal { margin-top: 16px; padding-top: 10px; }
  .kwk-cm-dialog { width: 95%; border-radius: 16px; max-height: calc(100vh - 28px); }
  .kwk-cm-header { padding: 18px 20px 14px; }
  .kwk-cm-header strong { font-size: 18px; }
  .kwk-cm-body { padding: 8px 20px 14px; }
  .kwk-cm-intro { font-size: 12.5px; line-height: 1.65; margin: 14px 0 8px; }
  /* Modal Content bewusst gestreckt auf Mobile — Save/Accept im Footer laufen
     unten raus, nur Quickaction oben ist primary sichtbar */
  .kwk-cm-category { padding: 20px 0; }
  .kwk-cm-cat-header { flex-direction: row; align-items: flex-start; gap: 12px; }
  .kwk-cm-cat-title { font-size: 13.5px; margin-bottom: 6px; }
  .kwk-cm-cat-desc { max-width: 100%; font-size: 12px; line-height: 1.65; }
  .kwk-cm-footer { padding: 16px 20px 20px; }
  /* Mobile: Accept oben, Speichern unten — expliziter Grid-Row-Placement
     (column-reverse verhielt sich auf einigen Browsern inkonsistent) */
  .kwk-cm-footer-main {
    display: grid !important;
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto !important;
    gap: 10px;
  }
  #kwkCmAcceptAll { grid-row: 1 !important; }
  #kwkCmSaveSelection { grid-row: 2 !important; }
  /* Quickaction auf Mobile kompakter */
  .kwk-cm-quickaction {
    padding: 10px 12px;
    gap: 10px;
  }
  .kwk-cm-quickaction-text strong { font-size: 12.5px; }
  .kwk-cm-quickaction-text span { font-size: 11px; }
  .kwk-cm-quickaction-btn { padding: 8px 12px !important; font-size: 12px !important; }
}
