/* ═══════════════════════════════════════════
   COOKIE BANNER
   Step 1: compact notice · Step 2: preference center
   Adapted from Light the Chain. Uses the brand tokens defined on :root
   by the including page (falls back to the raw values).
═══════════════════════════════════════════ */
.cookie-overlay {
  --ck-green: var(--brand-green, #7CF97A);
  --ck-black: var(--primary, #000000);
  --ck-white: var(--white, #F9F9F9);
  --ck-light-gray: var(--light-gray, #A7A7A7);
  --ck-gray: var(--gray, #646464);
  --ck-dark-gray: var(--dark-gray, #333333);
  --ck-spring: var(--spring, cubic-bezier(.2, .9, .3, 1.2));
  --ck-ease-out: var(--ease-out, cubic-bezier(.16, 1, .3, 1));
  --ck-shadow:
    0 2px 4px rgba(4, 33, 10, .08),
    0 12px 28px rgba(4, 33, 10, .12),
    0 40px 80px rgba(4, 33, 10, .16);

  position: fixed;
  inset: 0;
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(4, 20, 8, .48);
  font-family: var(--font, "Helvetica Neue", Helvetica, Arial, sans-serif);
  opacity: 0;
  transition: opacity .4s ease;
}
.cookie-overlay[hidden] { display: none; }
.cookie-overlay.is-visible { opacity: 1; }

.cookie-box,
.cookie-prefs {
  background: #fff;
  color: var(--ck-black);
  border-radius: 24px;
  box-shadow: var(--ck-shadow);
  /* Glides up from below the viewport */
  transform: translateY(calc(50vh + 60%));
  transition: transform .7s var(--ck-ease-out);
}
.cookie-overlay.is-visible .cookie-box,
.cookie-overlay.is-visible .cookie-prefs { transform: none; }
.cookie-box[hidden],
.cookie-prefs[hidden] { display: none; }

/* ── Step 1 — notice ── */
.cookie-box {
  width: min(520px, 100%);
  padding: 32px;
}
.cookie-box__logo { display: block; height: 22px; width: auto; margin-bottom: 24px; }
.cookie-box__title {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 1.35rem;
  letter-spacing: -0.03em;
  line-height: 1.2;
}
.cookie-box__text,
.cookie-prefs__text {
  margin: 0 0 24px;
  font-size: .88rem;
  line-height: 1.7;
  color: var(--ck-dark-gray);
}
.cookie-box__note {
  margin: 16px 0 0;
  font-size: .76rem;
  line-height: 1.6;
  color: var(--ck-gray);
}
.cookie-link {
  color: var(--ck-black);
  text-decoration: underline;
  text-underline-offset: 2px;
  border-radius: 2px;
}
.cookie-link:hover { text-decoration-thickness: 2px; }
.cookie-link:active { opacity: .7; }
.cookie-link:focus-visible { outline: 2px solid var(--ck-black); outline-offset: 2px; }

.cookie-box__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.cookie-box__actions .cookie-btn--ghost { margin-right: auto; }

/* ── Buttons ── */
.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  font-weight: 600;
  font-size: .86rem;
  line-height: 1;
  cursor: pointer;
  transition: transform .24s var(--ck-spring);
}
.cookie-btn:hover { transform: translateY(-1px); }
.cookie-btn:active { transform: scale(.97); }
.cookie-btn:focus-visible { outline: 2px solid var(--ck-black); outline-offset: 3px; }

/* Branding Green carries black text (never white) */
.cookie-btn--accent { background: var(--ck-green); color: var(--ck-black); }
.cookie-btn--accent:hover { background: #8DFA8B; }
.cookie-btn--dark { background: var(--ck-black); color: var(--ck-white); }
.cookie-btn--dark:hover { background: var(--ck-dark-gray); }
.cookie-btn--ghost { background: transparent; color: var(--ck-black); border-color: #DADADA; }
.cookie-btn--ghost:hover { background: #F2F2F2; }

/* ── Step 2 — preference center ── */
.cookie-prefs {
  width: min(640px, 100%);
  max-height: min(90vh, 760px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.cookie-prefs__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 16px 16px 16px 24px;
  border-bottom: 1px solid #ECECEC;
  flex-shrink: 0;
}
.cookie-prefs__header img { display: block; height: 22px; width: auto; }
.cookie-prefs__close {
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: #fff;
  border: 1px solid #DADADA;
  border-radius: 999px;
  color: var(--ck-black);
  cursor: pointer;
  transition: transform .24s var(--ck-spring);
}
.cookie-prefs__close:hover { background: #F2F2F2; }
.cookie-prefs__close:active { transform: scale(.92); }
.cookie-prefs__close:focus-visible { outline: 2px solid var(--ck-black); outline-offset: 2px; }
.cookie-prefs__close svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.8; fill: none; }

.cookie-prefs__scroll {
  overflow-y: auto;
  padding: 24px;
  scrollbar-width: thin;
  scrollbar-color: var(--ck-light-gray) transparent;
}
.cookie-prefs__title {
  margin: 0 0 12px;
  font-weight: 700;
  font-size: 1.2rem;
  letter-spacing: -0.03em;
  line-height: 1.25;
}
.cookie-prefs__text { margin-bottom: 12px; }
.cookie-prefs__more { display: inline-block; margin-bottom: 24px; font-size: .84rem; font-weight: 500; }
.cookie-prefs__subtitle {
  margin: 0 0 12px;
  font-weight: 600;
  font-size: .72rem;
  letter-spacing: .11em;
  text-transform: uppercase;
  color: var(--ck-gray);
}

.cookie-cat {
  border: 1px solid #E4E4E4;
  border-radius: 16px;
  margin-bottom: 8px;
  background: #fff;
}
.cookie-cat__row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px 8px 8px;
}
.cookie-cat__head {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 44px;
  padding: 4px 8px;
  background: none;
  border: 0;
  border-radius: 10px;
  font: inherit;
  font-weight: 600;
  font-size: .9rem;
  color: var(--ck-black);
  text-align: left;
  cursor: pointer;
  transition: transform .24s var(--ck-spring);
}
.cookie-cat__head:hover { background: #F5F5F5; }
.cookie-cat__head:active { transform: scale(.99); }
.cookie-cat__head:focus-visible { outline: 2px solid var(--ck-black); outline-offset: 2px; }
.cookie-cat__icon {
  position: relative;
  width: 12px;
  height: 12px;
  flex-shrink: 0;
}
.cookie-cat__icon::before,
.cookie-cat__icon::after {
  content: "";
  position: absolute;
  left: 0;
  top: 5px;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: currentColor;
  transition: transform .3s var(--ck-spring);
}
.cookie-cat__icon::after { transform: rotate(90deg); }
.cookie-cat.is-open .cookie-cat__icon::after { transform: rotate(0deg); }
.cookie-cat__always {
  font-weight: 600;
  font-size: .76rem;
  color: var(--ck-gray);
  white-space: nowrap;
}
.cookie-cat__body {
  margin: 0;
  padding: 0 16px 16px 40px;
  font-size: .82rem;
  line-height: 1.7;
  color: var(--ck-dark-gray);
}
.cookie-cat__body[hidden] { display: none; }

/* Toggle switch: colours fade via opacity, knob moves via transform */
.cookie-switch { position: relative; display: inline-block; flex-shrink: 0; cursor: pointer; }
.cookie-switch input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 1;
}
.cookie-switch__track {
  position: relative;
  display: block;
  width: 46px;
  height: 26px;
  border-radius: 999px;
  background: #CFCFCF;
  overflow: hidden;
}
.cookie-switch__track::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--ck-black);
  opacity: 0;
  transition: opacity .2s ease;
}
.cookie-switch__track::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 2px rgba(4, 33, 10, .2), 0 2px 6px rgba(4, 33, 10, .12);
  transition: transform .28s var(--ck-spring);
}
.cookie-switch:hover .cookie-switch__track { background: #BDBDBD; }
.cookie-switch input:checked + .cookie-switch__track::before { opacity: 1; }
.cookie-switch input:checked + .cookie-switch__track::after { transform: translateX(20px); background: var(--ck-green); }
.cookie-switch input:active + .cookie-switch__track::after { transform: scale(.9); }
.cookie-switch input:checked:active + .cookie-switch__track::after { transform: translateX(20px) scale(.9); }
.cookie-switch input:focus-visible + .cookie-switch__track { outline: 2px solid var(--ck-black); outline-offset: 3px; }

.cookie-prefs__footer {
  display: flex;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 8px;
  padding: 16px 24px 24px;
  border-top: 1px solid #ECECEC;
  flex-shrink: 0;
}

@media (max-width: 600px) {
  .cookie-overlay { padding: 12px; align-items: flex-end; }
  /* Compact notice: small type, the three buttons side by side */
  .cookie-box { padding: 18px; border-radius: 20px; }
  .cookie-box__logo { display: none; }
  .cookie-box__title { margin-bottom: 6px; font-size: 1rem; }
  .cookie-box__text { font-size: .76rem; line-height: 1.55; margin-bottom: 14px; }
  .cookie-prefs__text { font-size: .84rem; margin-bottom: 20px; }
  .cookie-box__actions { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .cookie-box__actions .cookie-btn { width: 100%; margin: 0; min-height: 40px; padding: 0 8px; font-size: .76rem; }
  .cookie-box__note { margin-top: 10px; font-size: .68rem; line-height: 1.5; }
  .cookie-prefs { max-height: 88vh; }
  .cookie-prefs__header { padding: 12px 12px 12px 20px; }
  .cookie-prefs__scroll { padding: 20px 16px; }
  .cookie-cat__body { padding-left: 32px; }
  .cookie-prefs__footer { flex-direction: column-reverse; padding: 12px 16px 16px; }
  .cookie-prefs__footer .cookie-btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-overlay,
  .cookie-box,
  .cookie-prefs,
  .cookie-btn,
  .cookie-switch__track::before,
  .cookie-switch__track::after,
  .cookie-cat__icon::after { transition: none; }
}

/* The notice itself takes focus on open so no option looks pre-selected */
.cookie-box:focus { outline: none; }
