/* ── Cookie Consent Banner ─────────────────────────────── */
.cg-consent-wrap {
  position: fixed;
  inset: auto 0 20px 0;
  z-index: 9999;
  display: flex;
  justify-content: center;
  padding: 0 16px;
  pointer-events: none;
}

.cg-consent {
  width: 100%;
  max-width: 1100px;
  pointer-events: auto;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: 16px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.06);
  padding: 12px 16px;
}

.theme-deep .cg-consent {
  background: rgba(15, 23, 42, 0.88);
  border-color: rgba(255, 255, 255, 0.08);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
}

/* Main row */
.cg-consent__main {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

/* Text block */
.cg-consent__text {
  flex: 1 1 240px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.cg-consent__title {
  font-size: 13px;
  font-weight: 700;
  color: #0f172a;
  letter-spacing: -0.01em;
  white-space: nowrap;
}

.theme-deep .cg-consent__title { color: #f1f5f9; }

.cg-consent__desc {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
}

.theme-deep .cg-consent__desc { color: #94a3b8; }

.cg-consent__desc a {
  color: var(--accent, #2563eb);
  text-decoration: none;
  font-weight: 500;
}

.cg-consent__desc a:hover { text-decoration: underline; }

/* Textlink (Einstellungen) im Beschreibungstext */
.cg-consent__link {
  appearance: none;
  background: none;
  border: none;
  padding: 0;
  margin-left: 8px;
  font: inherit;
  font-weight: 500;
  color: var(--accent, #2563eb);
  text-decoration: underline;
  cursor: pointer;
}

/* Granulare Auswahl: nur sichtbar, wenn ausgeklappt */
.cg-consent__settings {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(0, 0, 0, 0.07);
}

.theme-deep .cg-consent__settings { border-top-color: rgba(255, 255, 255, 0.1); }

/* Toggle switches */
.cg-consent__toggles {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-shrink: 0;
}

.cg-toggle {
  display: flex;
  align-items: center;
  gap: 6px;
  cursor: pointer;
}

.cg-toggle input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cg-toggle__track {
  position: relative;
  width: 34px;
  height: 20px;
  border-radius: 999px;
  background: #cbd5e1;
  transition: background 0.2s ease;
  flex-shrink: 0;
}

.cg-toggle__track::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0,0,0,0.2);
  transition: transform 0.2s ease;
}

.cg-toggle input:checked ~ .cg-toggle__track {
  background: var(--accent, #2563eb);
}

.cg-toggle input:disabled ~ .cg-toggle__track {
  background: var(--accent, #2563eb);
  opacity: 0.6;
}

.cg-toggle input:checked ~ .cg-toggle__track::after {
  transform: translateX(14px);
}

.cg-toggle input:disabled ~ .cg-toggle__track::after {
  transform: translateX(14px);
}

.cg-toggle__label {
  font-size: 12px;
  font-weight: 500;
  color: #475569;
  white-space: nowrap;
}

.theme-deep .cg-toggle__label { color: #94a3b8; }

.cg-toggle input:focus-visible ~ .cg-toggle__track {
  outline: 2px solid var(--accent, #2563eb);
  outline-offset: 2px;
}

/* Action buttons: beide Aktionen gleich gross und gleich prominent */
.cg-consent__actions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

.cg-consent__actions .cg-btn {
  min-width: 150px;
  min-height: 44px;
}

.cg-btn {
  appearance: none;
  border: none;
  border-radius: 10px;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease, transform 0.05s ease, opacity 0.15s ease;
  line-height: 1;
}

.cg-btn:active { transform: translateY(1px); }

.cg-btn--ghost {
  background: transparent;
  color: #64748b;
  border: 1px solid transparent;
}

.cg-btn--ghost:hover {
  color: #1e293b;
  background: #e9eef5;
}

.theme-deep .cg-btn--ghost { color: #94a3b8; }
.theme-deep .cg-btn--ghost:hover { color: #e2e8f0; background: #1e293b; }

.cg-btn--outline {
  background: transparent;
  color: var(--accent, #2563eb);
  border: 1.5px solid var(--accent, #2563eb);
}

.cg-btn--outline:hover {
  background: var(--accent, #2563eb);
  color: #fff;
}

.cg-btn--primary {
  background: var(--accent, #2563eb);
  color: #fff;
  border: 1.5px solid transparent;
}

.cg-btn--primary:hover { opacity: 0.88; }

.cg-hide { display: none !important; }

/* ── Mobile ──────────────────────────────────────────────── */
@media (max-width: 699px) {
  .cg-consent-wrap {
    inset: auto 0 10px 0;
    padding: 0 10px;
  }

  .cg-consent {
    padding: 14px 14px 12px;
    border-radius: 16px;
  }

  .cg-consent__main {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .cg-consent__text {
    flex: 0 0 auto;
  }

  .cg-consent__toggles {
    justify-content: flex-start;
    gap: 16px;
    padding: 8px 10px;
    background: rgba(0,0,0,0.03);
    border-radius: 10px;
  }

  .theme-deep .cg-consent__toggles {
    background: rgba(255,255,255,0.04);
  }

  /* Beide Aktionen nebeneinander, gleiche Breite, Daumen-taugliche Hoehe */
  .cg-consent__actions {
    display: flex;
    flex-direction: row;
    gap: 8px;
  }

  .cg-consent__actions .cg-btn {
    flex: 1 1 0;
    min-width: 0;
  }

  .cg-btn {
    padding: 10px 12px;
    font-size: 13px;
    text-align: center;
  }

  .cg-consent__settings {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
  }

  .cg-consent__settings .cg-btn {
    width: 100%;
    min-height: 44px;
    border: 1px solid #e2e8f0;
  }

  .theme-deep .cg-consent__settings .cg-btn { border-color: #334155; }
}
