/* ============================================================
 * cookie-banner.css — AITransparant.nl
 * AVG/ePrivacy/Tw-conforme banner v2.0
 * Sluit aan op style.css design-tokens:
 *   --accent:#003366  --bg:#fff  --bg-alt:#f5f7fb
 *   --txt:#111827     --muted:#4b5563  --border:#e5e7eb
 *   --accent-soft:#e1e8f5  --r:6px
 *   --f:"Inter",system-ui,sans-serif
 * ============================================================ */

/* ── Banner: laag 1 ─────────────────────────────────────────── */
.cb-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9000;
  background: #fff;
  border-top: 2px solid var(--accent, #003366);
  box-shadow: 0 -4px 24px rgba(0, 0, 0, .12);
  padding: 18px 24px;
  font-family: var(--f, "Inter", system-ui, sans-serif);
  font-size: .88rem;
  line-height: 1.5;
  transform: translateY(110%);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1);
  /* hidden by default, shown via JS */
  display: none;
}

.cb-banner--visible {
  display: block;
  transform: translateY(0);
  animation: cb-slide-up .35s cubic-bezier(.16, 1, .3, 1) both;
}

@keyframes cb-slide-up {
  from { transform: translateY(110%); opacity: 0; }
  to   { transform: translateY(0);   opacity: 1; }
}

.cb-inner {
  max-width: var(--mw, 1120px);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
  justify-content: space-between;
}

.cb-title {
  font-family: var(--f-display, "Plus Jakarta Sans", "Inter", system-ui, sans-serif);
  font-size: .95rem;
  font-weight: 700;
  color: var(--accent, #003366);
  margin: 0 0 4px;
}

.cb-text {
  flex: 1 1 320px;
}

.cb-text p {
  margin: 0;
  color: var(--muted, #4b5563);
  max-width: 72ch;
}

.cb-link {
  color: var(--accent, #003366);
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* ── Actieknoppen (laag 1) ──────────────────────────────────── */
.cb-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  flex-shrink: 0;
}

/* Gedeelde knopbasis */
.cb-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 20px;
  border-radius: 999px;
  font-family: var(--f, "Inter", system-ui, sans-serif);
  font-size: .88rem;
  font-weight: 600;
  cursor: pointer;
  transition: background .18s, color .18s, border-color .18s, opacity .15s;
  text-decoration: none;
  white-space: nowrap;
}

.cb-btn:focus-visible {
  outline: 2px solid var(--accent, #003366);
  outline-offset: 3px;
  border-radius: 999px;
}

.cb-btn:active {
  transform: scale(.97);
  opacity: .88;
}

/*
 * HARD EIS 1: cb-btn--equal = "Accepteren" én "Weigeren"
 * Identieke achtergrond, kleur en rand — geen visuele hiërarchie
 * die een keuze aantrekkelijker maakt.
 */
.cb-btn--equal {
  background: var(--accent, #003366);
  color: #fff;
  border: 2px solid var(--accent, #003366);
}

.cb-btn--equal:hover,
.cb-btn--equal:focus {
  opacity: .88;
  text-decoration: none;
}

/* "Voorkeuren aanpassen" — neutraal outline-stijl */
.cb-btn--secondary {
  background: #fff;
  color: var(--accent, #003366);
  border: 2px solid var(--accent, #003366);
}

.cb-btn--secondary:hover,
.cb-btn--secondary:focus {
  background: var(--accent-soft, #e1e8f5);
  text-decoration: none;
}

/* Primair (in voorkeuren-paneel) */
.cb-btn--primary {
  background: var(--accent, #003366);
  color: #fff;
  border: 2px solid var(--accent, #003366);
}

.cb-btn--primary:hover,
.cb-btn--primary:focus {
  background: #002244;
  border-color: #002244;
  text-decoration: none;
}

/* ── Overlay ────────────────────────────────────────────────── */
.cb-overlay {
  position: fixed;
  inset: 0;
  background: rgba(2, 6, 23, .45);
  z-index: 9010;
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s;
}

.cb-overlay--visible {
  opacity: 1;
  pointer-events: auto;
}

/* ── Voorkeuren-paneel (laag 2) ─────────────────────────────── */
.cb-prefs {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 9020;
  background: #fff;
  border-top: 2px solid var(--accent, #003366);
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .18);
  border-radius: 12px 12px 0 0;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  font-family: var(--f, "Inter", system-ui, sans-serif);
  font-size: .88rem;
  transform: translateY(110%);
  transition: transform .35s cubic-bezier(.16, 1, .3, 1);
}

.cb-prefs:not([hidden]) {
  transform: translateY(0);
}

/* Toegankelijkheid: verberg [hidden] hard */
[hidden] { display: none !important; }

.cb-prefs-inner {
  max-width: 680px;
  margin: 0 auto;
  padding: 0 24px 24px;
}

/* Paneel-header */
.cb-prefs-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0 12px;
  border-bottom: 1px solid var(--border, #e5e7eb);
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 1;
}

.cb-prefs-title {
  font-family: var(--f-display, "Plus Jakarta Sans", "Inter", system-ui, sans-serif);
  font-size: 1rem;
  font-weight: 700;
  color: var(--txt, #111827);
  margin: 0;
}

.cb-prefs-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 999px;
  border: 1px solid var(--border, #e5e7eb);
  background: #fff;
  color: var(--muted, #4b5563);
  cursor: pointer;
  transition: background .18s, border-color .18s;
  flex-shrink: 0;
}

.cb-prefs-close:hover,
.cb-prefs-close:focus-visible {
  background: var(--accent-soft, #e1e8f5);
  border-color: var(--accent, #003366);
  color: var(--accent, #003366);
}

.cb-prefs-close:focus-visible {
  outline: 2px solid var(--accent, #003366);
  outline-offset: 2px;
}

/* Categorieën */
.cb-prefs-body {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px 0 4px;
}

.cb-cat {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border, #e5e7eb);
  border-radius: var(--r, 6px);
  background: var(--bg-alt, #f5f7fb);
}

.cb-cat-info {
  flex: 1;
  min-width: 0;
}

.cb-cat-label {
  display: inline-block;
  font-weight: 700;
  font-size: .9rem;
  color: var(--txt, #111827);
  margin-bottom: 2px;
  cursor: pointer;
}

/* Noodzakelijk-label heeft geen pointer (schakelaar uitgeschakeld) */
.cb-toggle--locked + .cb-cat-info .cb-cat-label,
.cb-cat-info:has(+ .cb-toggle--locked) .cb-cat-label {
  cursor: default;
}

.cb-cat-badge {
  display: inline-block;
  background: var(--accent-soft, #e1e8f5);
  color: var(--accent, #003366);
  font-size: .72rem;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 999px;
  margin-left: 6px;
  letter-spacing: .03em;
  vertical-align: middle;
}

.cb-cat-desc {
  margin: 4px 0 0;
  font-size: .82rem;
  color: var(--muted, #4b5563);
  line-height: 1.45;
}

/* ── Toggle-schakelaar ──────────────────────────────────────── */
.cb-toggle {
  position: relative;
  width: 42px;
  height: 24px;
  flex-shrink: 0;
  margin-top: 2px;
}

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

.cb-toggle-slider {
  position: absolute;
  inset: 0;
  background: #d1d5db;
  border-radius: 999px;
  cursor: pointer;
  transition: background .2s;
}

.cb-toggle input:checked + .cb-toggle-slider {
  background: var(--accent, #003366);
}

.cb-toggle-slider::before {
  content: "";
  position: absolute;
  height: 18px;
  width: 18px;
  left: 3px;
  top: 3px;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 1px 3px rgba(0,0,0,.18);
  transition: transform .2s;
}

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

.cb-toggle input:disabled + .cb-toggle-slider {
  opacity: .55;
  cursor: not-allowed;
}

/* Focus-ring op de verborgen input (zichtbaar via slider) */
.cb-toggle input:focus-visible + .cb-toggle-slider {
  outline: 2px solid var(--accent, #003366);
  outline-offset: 2px;
}

/* Gelockte toggle (noodzakelijk) */
.cb-toggle--locked .cb-toggle-slider {
  cursor: not-allowed;
}

/* ── Paneel-footer ──────────────────────────────────────────── */
.cb-prefs-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 18px;
  border-top: 1px solid var(--border, #e5e7eb);
  margin-top: 8px;
}

/* ── Footer-link "Cookie-instellingen" ──────────────────────── */
#cb-settings-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--footer-txt, #e5e7eb);
  font-size: .82rem;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: inherit;
  padding: 0;
  min-height: 44px;
}

#cb-settings-link:hover,
#cb-settings-link:focus-visible {
  opacity: .8;
  text-decoration: underline;
}

#cb-settings-link:focus-visible {
  outline: 2px solid #fff;
  outline-offset: 3px;
  border-radius: 3px;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 640px) {
  .cb-banner {
    padding: 16px;
  }

  .cb-inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }

  .cb-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .cb-btn {
    width: 100%;
    justify-content: center;
  }

  .cb-prefs-inner {
    padding: 0 16px 20px;
  }

  .cb-prefs-foot {
    flex-direction: column;
    align-items: stretch;
  }

  .cb-prefs-foot .cb-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── Reduced-motion ─────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  .cb-banner,
  .cb-prefs,
  .cb-overlay {
    animation: none !important;
    transition: none !important;
  }
}
