/* ═══════════════════════════════════════════════════════════════════════════
   kiwiki – Consent Banner
   DSGVO-konformes Banner: gleich große "Alle akzeptieren" / "Alle ablehnen"
   Buttons, granulare Kategorien, keine vorausgewählten Häkchen.
   ═══════════════════════════════════════════════════════════════════════════ */

.consent-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 200;
  background: var(--color-bg-subtle);
  border-top: 1px solid var(--color-border);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.4);
  padding: var(--space-md) 0;
  animation: consent-slide-up 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes consent-slide-up {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.consent-banner-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-lg);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-lg);
  align-items: center;
  justify-content: space-between;
}

.consent-text {
  flex: 1 1 320px;
  min-width: 0;
}

.consent-title {
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: var(--space-xs);
  color: var(--color-text);
}

.consent-desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.5;
  margin-bottom: var(--space-xs);
}

.consent-link {
  font-size: 0.8125rem;
  color: var(--color-primary);
}

.consent-actions {
  display: flex;
  gap: var(--space-sm);
  flex-wrap: wrap;
}

.consent-btn {
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: var(--radius-md);
  border: 1px solid transparent;
  cursor: pointer;
  transition: background var(--t-fast), color var(--t-fast), border-color var(--t-fast);
  white-space: nowrap;
}

.consent-btn--primary {
  background: var(--color-primary);
  color: var(--color-primary-ink);
  border-color: var(--color-primary);
}
.consent-btn--primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
}

.consent-btn--secondary {
  background: transparent;
  color: var(--color-text);
  border-color: var(--color-border-light);
}
.consent-btn--secondary:hover {
  border-color: var(--color-primary-border);
  color: var(--color-primary);
}

.consent-btn--ghost {
  background: transparent;
  color: var(--color-text-secondary);
  border-color: transparent;
}
.consent-btn--ghost:hover {
  color: var(--color-primary);
}

.consent-btn:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* ── Settings Modal ─────────────────────────────────────────────────── */
.consent-settings {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-lg);
}

.consent-settings[hidden] { display: none; }

.consent-settings-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

.consent-settings-card {
  position: relative;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-xl);
  max-width: 520px;
  width: 100%;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: var(--shadow-lg);
}

.consent-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-md);
}

.consent-settings-header h2 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--color-text);
}

.consent-close {
  background: none;
  border: none;
  color: var(--color-text-secondary);
  font-size: 1.75rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 8px;
  border-radius: var(--radius-sm);
}
.consent-close:hover { color: var(--color-primary); }
.consent-close:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

.consent-settings-desc {
  font-size: 0.875rem;
  color: var(--color-text-secondary);
  line-height: 1.55;
  margin-bottom: var(--space-lg);
}

.consent-category {
  padding: var(--space-md) 0;
  border-bottom: 1px solid var(--color-border);
}

.consent-category:last-of-type {
  border-bottom: none;
}

.consent-category-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--space-xs);
}

.consent-category-head h3 {
  font-family: var(--font-body);
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--color-text);
}

.consent-category-desc {
  font-size: 0.8125rem;
  color: var(--color-text-muted);
  line-height: 1.5;
  padding-right: var(--space-2xl);
}

/* ── Toggle Switch ──────────────────────────────────────────────────── */
.consent-switch {
  position: relative;
  display: inline-block;
  width: 40px;
  height: 22px;
  flex-shrink: 0;
}

.consent-switch input {
  opacity: 0;
  width: 0;
  height: 0;
}

.consent-switch-slider {
  position: absolute;
  cursor: pointer;
  inset: 0;
  background: var(--color-border);
  border-radius: 22px;
  transition: background var(--t-fast);
}

.consent-switch-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 16px;
  height: 16px;
  background: white;
  border-radius: 50%;
  transition: transform var(--t-fast);
}

.consent-switch input:checked + .consent-switch-slider {
  background: var(--color-primary);
}

.consent-switch input:checked + .consent-switch-slider::before {
  transform: translateX(18px);
}

.consent-switch input:focus-visible + .consent-switch-slider {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.consent-switch--disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.consent-switch--disabled .consent-switch-slider {
  background: var(--color-primary);
}

.consent-switch--disabled .consent-switch-slider::before {
  transform: translateX(18px);
}

.consent-settings-actions {
  display: flex;
  gap: var(--space-sm);
  justify-content: flex-end;
  margin-top: var(--space-xl);
  flex-wrap: wrap;
}

/* ── Mobile ─────────────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .consent-banner {
    padding: var(--space-md) 0;
  }
  .consent-banner-inner {
    flex-direction: column;
    align-items: stretch;
  }
  .consent-actions {
    flex-direction: column;
  }
  .consent-btn {
    width: 100%;
  }
}

/* ── Reduced motion ─────────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .consent-banner {
    animation: none;
  }
  .consent-switch-slider,
  .consent-switch-slider::before {
    transition: none;
  }
}
