/* ============================================
   COOKIE-CONSENT – isolierte Styles (cc-Namespace)
   Designsprache der Website: Praxis-Blau #033C98,
   scharfe Kanten (2px), Uppercase-Labels, Inter.
   Kein Selektor wirkt außerhalb von #cc-root,
   .cc-revoke und .cc-embed.
============================================ */

/* cc-Präfix hält die Variablen kollisionsfrei; :root nötig,
   damit auch .cc-embed/.cc-revoke außerhalb von #cc-root sie sehen */
:root {
  --cc-primary: #033C98;
  --cc-primary-dark: #022b70;
  --cc-primary-light: #e8eef8;
  --cc-gray-900: #111827;
  --cc-gray-700: #374151;
  --cc-gray-500: #6b7280;
  --cc-gray-300: #d1d5db;
  --cc-gray-100: #f3f4f6;
}

/* Reset bewusst OHNE ID-Selektor (gleiche Spezifität wie die
   cc-Klassen darunter, damit deren Padding/Margins gewinnen) */
.cc-card,
.cc-card *,
.cc-revoke,
.cc-embed-note,
.cc-embed-note * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ── Karte (Banner + Einstellungen), rechts unten ── */
.cc-card {
  position: fixed;
  right: 1.5rem;
  bottom: 1.5rem;
  z-index: 800;
  background: #ffffff;
  border-radius: 2px;
  box-shadow: 0 2px 8px rgba(2, 20, 51, 0.08), 0 24px 64px rgba(2, 20, 51, 0.22);
  padding: 2rem 2.25rem;
  font-family: 'Inter', sans-serif;
  color: var(--cc-gray-900);
  font-size: 16px;
  line-height: 1.6;
}

/* Banner: breite, horizontale Karte – Text links, Aktionen rechts */
.cc-card--banner {
  width: min(880px, calc(100vw - 3rem));
  display: flex;
  align-items: center;
  gap: 2.75rem;
}

.cc-card--banner.cc-hidden { display: none !important; }

.cc-banner-main { flex: 1; min-width: 0; }
.cc-banner-main .cc-text { margin-bottom: 0; }
.cc-banner-main .cc-legal-links { margin-top: 1.1rem; padding-top: 0.85rem; }

.cc-banner-side {
  width: 230px;
  flex: none;
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}
.cc-banner-side .cc-link-btn {
  margin-top: 0.35rem;
  text-align: center;
}

/* Einstellungen: kompaktere, vertikale Karte */
.cc-card--settings {
  width: min(560px, calc(100vw - 3rem));
}

.cc-hidden { display: none !important; }

/* Programmatischer Fokus auf der Karte selbst braucht keinen Ring –
   interaktive Elemente behalten ihren :focus-visible-Ring */
.cc-card:focus { outline: none; }

/* Kopf im Stil der Section-Header der Website */
.cc-label {
  font-size: 0.65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--cc-primary);
  margin-bottom: 0.4rem;
}

.cc-title {
  font-size: 1.15rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--cc-gray-900);
}

.cc-divider {
  width: 2.5rem;
  height: 3px;
  background: var(--cc-primary);
  margin: 0.75rem 0 1rem;
}

.cc-text {
  font-size: 0.85rem;
  color: var(--cc-gray-700);
  margin-bottom: 1.5rem;
}

.cc-text a,
.cc-legal-links a {
  color: var(--cc-primary);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Buttons ── */
.cc-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.cc-btn {
  appearance: none;
  padding: 0.85rem 1rem;
  font-family: inherit;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 2px;
  border: 1px solid transparent;
  transition: background 0.2s ease, border-color 0.2s ease;
  white-space: nowrap;
}

.cc-btn-primary {
  background: var(--cc-primary);
  color: #ffffff;
}
.cc-btn-primary:hover { background: var(--cc-primary-dark); }

.cc-btn-secondary {
  background: #ffffff;
  border-color: var(--cc-gray-300);
  color: var(--cc-gray-900);
}
.cc-btn-secondary:hover { border-color: var(--cc-gray-900); }

.cc-btn-block { grid-column: 1 / -1; }

.cc-link-btn {
  appearance: none;
  background: none;
  border: none;
  color: var(--cc-gray-500);
  text-decoration: underline;
  text-underline-offset: 2px;
  font-family: inherit;
  font-size: 0.78rem;
  cursor: pointer;
  padding: 0;
  margin-top: 1rem;
}
.cc-link-btn:hover { color: var(--cc-primary); }

/* ── Fußzeile der Karte ── */
.cc-legal-links {
  margin-top: 1.25rem;
  padding-top: 1rem;
  border-top: 1px solid #e5e7eb;
  font-size: 0.72rem;
  color: var(--cc-gray-500);
  display: flex;
  gap: 1.25rem;
}
.cc-legal-links a { color: var(--cc-gray-500); }
.cc-legal-links a:hover { color: var(--cc-primary); }

/* ── Einstellungen (zweite Ebene) ── */
.cc-settings-body {
  max-height: min(48vh, 420px);
  overflow-y: auto;
  margin-bottom: 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.cc-cat {
  background: #f8fafc;
  border: 1px solid #e9edf3;
  border-radius: 2px;
  padding: 0.9rem 1rem;
}

.cc-cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.cc-cat-label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--cc-gray-900);
  cursor: pointer;
}

.cc-cat-desc {
  font-size: 0.74rem;
  color: var(--cc-gray-500);
  line-height: 1.55;
  margin-top: 0.45rem;
}

/* Schalter */
.cc-switch {
  position: relative;
  display: inline-block;
  width: 42px;
  height: 24px;
  flex: none;
}

.cc-switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.cc-switch-track {
  position: absolute;
  inset: 0;
  background: var(--cc-gray-300);
  border-radius: 999px;
  transition: background 0.2s ease;
  pointer-events: none;
}

.cc-switch-track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  background: #ffffff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  transition: transform 0.2s ease;
}

.cc-switch input:checked + .cc-switch-track { background: var(--cc-primary); }
.cc-switch input:checked + .cc-switch-track::after { transform: translateX(18px); }
.cc-switch input:disabled { cursor: not-allowed; }
.cc-switch input:disabled + .cc-switch-track { opacity: 0.55; }

/* ── Widerrufs-Icon unten rechts ── */
.cc-revoke {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  z-index: 700;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: #ffffff;
  border: 1px solid #d1d5db;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #033C98;
  padding: 0;
  transition: background 0.2s ease;
}
.cc-revoke:hover { background: #e8eef8; }
.cc-revoke svg { width: 21px; height: 21px; display: block; }

/* ── Fokus-Sichtbarkeit (Barrierefreiheit) ── */
#cc-root .cc-btn:focus-visible,
#cc-root .cc-link-btn:focus-visible,
#cc-root input:focus-visible,
#cc-root a:focus-visible,
.cc-revoke:focus-visible,
.cc-embed-note .cc-btn:focus-visible {
  outline: 2px solid #033C98;
  outline-offset: 2px;
}

#cc-root .cc-switch input:focus-visible + .cc-switch-track {
  outline: 2px solid #033C98;
  outline-offset: 2px;
}

/* ── Blockierte Embeds (z. B. Google Maps) ── */
.cc-embed { position: relative; }
.cc-embed iframe[data-cc-src]:not([src]) { display: none; }

.cc-embed-note {
  width: 100%;
  aspect-ratio: 4/3;
  background: var(--cc-gray-100, #f3f4f6);
  border: 1px dashed #d1d5db;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  text-align: center;
  padding: 2rem;
  font-family: 'Inter', sans-serif;
}

.cc-embed-note p {
  font-size: 0.85rem;
  color: #374151;
  line-height: 1.6;
  max-width: 420px;
}

.cc-embed-note a { color: var(--cc-primary); }

/* ── Mobil / Tablet ── */
@media (max-width: 768px) {
  /* Banner bricht auf schmalen Screens in die vertikale Anordnung um */
  .cc-card--banner {
    flex-direction: column;
    align-items: stretch;
    gap: 1.25rem;
  }
  .cc-banner-side { width: 100%; }
}

@media (max-width: 480px) {
  .cc-card {
    left: 0.75rem;
    right: 0.75rem;
    bottom: 0.75rem;
    width: auto;
    padding: 1.5rem 1.25rem;
  }
  .cc-card--banner,
  .cc-card--settings { width: auto; }
  .cc-actions { grid-template-columns: 1fr; }
  .cc-embed-note { aspect-ratio: 1/1; padding: 1.25rem; }
}
