/* ============================================================
   COOKIE CONSENT — components/cookie-consent.css
   Banner + preferences centre (CMP).
   Requires components/base.css to be loaded BEFORE.
   ============================================================ */

:root {
  --cc-bg:          #211A14;
  --cc-raise:       rgba(255, 255, 255, 0.04);
  --cc-border:      rgba(255, 255, 255, 0.10);
  --cc-border-soft: rgba(255, 255, 255, 0.07);
  --cc-text:        var(--text-on-dark, #F2F0ED);
  --cc-body:        var(--text-muted-on-dark, rgba(242, 240, 237, 0.7));
  --cc-body-strong: rgba(242, 240, 237, 0.86);
  --cc-accent:      #FF5A1F;
  --cc-mint:        #00D4AA;
  --cc-ease:        var(--ease-out);
  --cc-z:           2000;
}

/* Dark context: the solid orange ring drops below 3:1 here */
.cc-banner,
.cc-modal,
.cc-toast { --focus-ring: var(--primary-on-dark, #FFA98A); }

/* ============================================================
   BANNER — floating card, bottom-left
   Sits beside the page instead of across it, so centred hero
   CTAs stay visible.
   ============================================================ */
.cc-banner {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: var(--cc-z);
  width: min(400px, calc(100vw - 48px));
}

.cc-banner[hidden] { display: none; }

/* While the banner is visible, space is reserved at the end of the page
   (in the footer if there is one) so it doesn't cover content or CTAs. */
.cc-offset { padding-bottom: var(--cc-banner-h, 0px) !important; }

.cc-banner-inner {
  padding: 20px 20px 0;
  border: 1px solid var(--cc-border);
  border-radius: var(--radius-lg, 16px);
  background: var(--cc-bg);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.05) inset,
    0 24px 64px -12px rgba(0, 0, 0, 0.6),
    0 4px 16px rgba(0, 0, 0, 0.3);
  overflow: hidden;
  transform: translateY(0);
  opacity: 1;
  transition: transform 0.5s var(--cc-ease), opacity 0.35s ease;
}

.cc-banner[data-state="entering"] .cc-banner-inner,
.cc-banner[data-state="leaving"] .cc-banner-inner {
  transform: translateY(16px);
  opacity: 0;
}

.cc-banner-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 10px;
}

.cc-banner-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border-radius: 10px;
  background: rgba(255, 90, 31, 0.14);
  color: var(--primary-on-dark, #FFA98A);
}

.cc-banner-title {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: var(--fw-bold, 600);
  letter-spacing: 0;
  line-height: 1.25;
  color: var(--cc-text);
  margin: 0;
}

.cc-banner-text {
  font-size: var(--fs-small, 14px);
  line-height: 1.55;
  color: var(--cc-body);
  margin: 0;
  text-wrap: pretty;
}

.cc-banner-links {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 8px 0 0;
  font-size: var(--fs-meta, 13px);
  color: var(--cc-body);
}

.cc-banner-links a,
.cc-modal-desc a,
.cc-modal-legal a {
  color: var(--cc-body-strong);
  text-decoration: underline;
  text-decoration-color: rgba(242, 240, 237, 0.35);
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition);
}

.cc-banner-links a:hover,
.cc-modal-desc a:hover,
.cc-modal-legal a:hover {
  color: var(--primary-on-dark, #FFA98A);
  text-decoration-color: currentColor;
}

/* Equal prominence: same width, same height, both filled */
.cc-banner-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 18px;
}

.cc-banner-customize {
  display: flex;
  align-items: center;
  gap: 10px;
  width: calc(100% + 40px);
  min-height: 48px;
  margin: 14px -20px 0;
  padding: 0 20px;
  border-top: 1px solid var(--cc-border-soft);
  font: inherit;
  font-size: var(--fs-small, 14px);
  font-weight: var(--fw-medium, 500);
  color: var(--cc-body-strong);
  text-align: left;
  transition: background-color var(--transition), color var(--transition);
}

.cc-banner-customize span { flex: 1; }
.cc-banner-customize svg:last-child { transition: transform var(--transition); }

.cc-banner-customize:hover {
  background: var(--cc-raise);
  color: var(--cc-text);
}

@media (hover: hover) and (pointer: fine) { .cc-banner-customize:hover svg:last-child { transform: translateX(2px); } }

.cc-banner-customize:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: -4px;
  border-radius: 0 0 var(--radius-lg, 16px) var(--radius-lg, 16px);
}

/* ============================================================
   BUTTONS
   ============================================================ */
.cc-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;           /* minimum touch target */
  padding: 0 20px;
  border-radius: var(--radius-pill, 99px);
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 15px;
  font-weight: var(--fw-medium, 500);
  line-height: 1.2;
  white-space: nowrap;
  transition: background-color var(--transition), border-color var(--transition), color var(--transition), transform 0.12s ease;
}

.cc-btn:active { transform: scale(0.98); }

.cc-btn:focus-visible {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

.cc-btn--primary {
  background: var(--primary-solid, #D14000);
  color: #fff;
}

.cc-btn--primary:hover { background: var(--primary-solid-hover, #B83800); }

/* Reject in the banner: as visible as Accept, not a faded ghost */
.cc-btn--light {
  background: var(--cc-text);
  color: var(--text-primary, #211A14);
}

.cc-btn--light:hover { background: #fff; }

.cc-btn--secondary {
  background: rgba(255, 255, 255, 0.07);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--cc-text);
}

.cc-btn--secondary:hover {
  background: rgba(255, 255, 255, 0.13);
  border-color: rgba(255, 255, 255, 0.24);
}

/* ============================================================
   PREFERENCES MODAL
   ============================================================ */
.cc-modal {
  position: fixed;
  inset: 0;
  z-index: calc(var(--cc-z) + 10);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.cc-modal[hidden] { display: none; }

.cc-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(12, 9, 6, 0.7);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 1;
  transition: opacity 0.3s ease;
}

.cc-modal-dialog {
  position: relative;
  width: 100%;
  max-width: 600px;
  max-height: min(88vh, 760px);
  max-height: min(88dvh, 760px);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--cc-border);
  border-radius: 20px;
  background: var(--cc-bg);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset, 0 40px 100px -20px rgba(0, 0, 0, 0.7);
  overflow: hidden;
  transform: none;
  opacity: 1;
  transition: transform 0.4s var(--cc-ease), opacity 0.25s ease;
}

.cc-modal[data-state="entering"] .cc-modal-dialog,
.cc-modal[data-state="leaving"] .cc-modal-dialog {
  transform: translateY(12px) scale(0.98);
  opacity: 0;
}

.cc-modal[data-state="entering"] .cc-modal-backdrop,
.cc-modal[data-state="leaving"] .cc-modal-backdrop { opacity: 0; }

.cc-modal-header {
  position: relative;
  flex-shrink: 0;
  padding: 28px 76px 20px 28px;
}

.cc-modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--fw-bold, 600);
  letter-spacing: var(--tr-h3, -0.015em);
  line-height: 1.2;
  color: var(--cc-text);
  margin: 0 0 8px;
}

.cc-modal-desc {
  font-size: var(--fs-small, 14px);
  line-height: 1.55;
  color: var(--cc-body);
  margin: 0;
  max-width: 52ch;
  text-wrap: pretty;
}

.cc-modal-desc a { white-space: nowrap; }

.cc-modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--cc-body);
  transition: color var(--transition), background-color var(--transition);
}

.cc-modal-close:hover { color: var(--cc-text); background: rgba(255, 255, 255, 0.08); }
.cc-modal-close:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: -2px; }

.cc-modal-body {
  flex: 1;
  min-height: 0;
  padding: 0 28px 8px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.16) transparent;
}

/* ── GPC notice ── */
.cc-notice {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin: 0 0 16px;
  padding: 12px 14px;
  border: 1px solid rgba(0, 212, 170, 0.22);
  border-radius: var(--radius-md, 12px);
  background: rgba(0, 212, 170, 0.07);
  font-size: var(--fs-small, 14px);
  line-height: 1.5;
  color: var(--cc-body-strong);
}

.cc-notice svg { flex-shrink: 0; margin-top: 1px; color: var(--mint-on-dark, #00D7AC); }
.cc-notice strong { color: var(--cc-text); font-weight: var(--fw-strong, 550); }

/* ── Categories ── */
.cc-cats {
  list-style: none;
  margin: 0;
  padding: 0;
}

.cc-cat {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: start;
  padding: 18px 0;
  border-top: 1px solid var(--cc-border-soft);
}

.cc-cat-title {
  font-size: 16px;
  font-weight: var(--fw-bold, 600);
  line-height: 1.3;
  color: var(--cc-text);
  margin: 0;
}

.cc-cat-desc {
  font-size: var(--fs-small, 14px);
  line-height: 1.55;
  color: var(--cc-body);
  margin: 4px 0 0;
  max-width: 54ch;
  text-wrap: pretty;
}

/* Inline flow, so a long provider list wraps like prose and the
   separator never ends up alone at the start of a line */
.cc-cat-meta {
  margin: 8px 0 0;
  font-size: var(--fs-meta, 13px);
  line-height: 1.5;
  color: var(--cc-body);
}

.cc-cat-meta span + span::before {
  content: '·';
  margin: 0 8px;
}

/* "Always on" is a statement, not a disabled control */
.cc-always {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 26px;
  font-size: var(--fs-meta, 13px);
  font-weight: var(--fw-medium, 500);
  color: var(--mint-on-dark, #00D7AC);
  white-space: nowrap;
}

/* ── Switch: state is spelled out ("On"/"Off"), not colour-only ── */
.cc-switch {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: -9px;          /* centres the 26px track on the title line */
  cursor: pointer;
}

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

.cc-switch-state {
  order: -1;
  min-width: 24px;
  text-align: right;
  font-size: var(--fs-meta, 13px);
  font-weight: var(--fw-medium, 500);
  color: var(--cc-body);
  transition: color var(--transition);
}

.cc-switch-state::before { content: 'Off'; }

.cc-switch-track {
  position: relative;
  width: 44px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  transition: background-color 0.2s ease, box-shadow 0.2s ease;
  pointer-events: none;
}

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

.cc-switch:hover .cc-switch-track { box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36); }

.cc-switch input:checked ~ .cc-switch-track {
  background: var(--primary-solid, #D14000);
  box-shadow: inset 0 0 0 1px var(--primary-solid, #D14000);
}

.cc-switch input:checked ~ .cc-switch-track::after {
  transform: translateX(18px);
  background: #fff;
}

.cc-switch input:checked ~ .cc-switch-state { color: var(--cc-text); }
.cc-switch input:checked ~ .cc-switch-state::before { content: 'On'; }

.cc-switch input:focus-visible ~ .cc-switch-track {
  outline: 2px solid var(--focus-ring);
  outline-offset: 2px;
}

/* ── Modal footer ── */
.cc-modal-footer {
  flex-shrink: 0;
  padding: 16px 28px 20px;
  border-top: 1px solid var(--cc-border-soft);
  background: rgba(0, 0, 0, 0.16);
}

.cc-modal-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.cc-btn--save { margin-left: auto; }

.cc-modal-legal {
  margin: 12px 0 0;
  font-size: var(--fs-meta, 13px);
  line-height: 1.5;
  color: var(--cc-body);
}

.cc-mono {
  font-family: var(--font-mono);
  font-size: var(--fs-meta, 13px);
  color: var(--cc-body-strong);
}

/* ============================================================
   CONFIRMATION TOAST
   ============================================================ */
.cc-toast {
  position: fixed;
  left: 24px;
  bottom: 24px;
  z-index: var(--cc-z);
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: calc(100vw - 48px);
  padding: 12px 18px 12px 12px;
  border: 1px solid var(--cc-border);
  border-radius: var(--radius-md, 12px);
  background: var(--cc-bg);
  box-shadow: 0 16px 40px -8px rgba(0, 0, 0, 0.55);
  font-size: var(--fs-small, 14px);
  line-height: 1.4;
  color: var(--cc-body);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.3s ease, transform 0.4s var(--cc-ease), visibility 0s linear 0.4s;
}

.cc-toast[data-state="open"] {
  opacity: 1;
  visibility: visible;
  transform: none;
  transition: opacity 0.3s ease, transform 0.4s var(--cc-ease), visibility 0s;
}

.cc-toast strong { color: var(--cc-text); font-weight: var(--fw-strong, 550); }

.cc-toast-icon {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--mint-solid, #00866C);
  color: #fff;
}

/* ============================================================
   CONSENT STATUS — used in cookies.html
   ============================================================ */
.cc-status {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 20px;
  padding: 20px 22px;
  border: 1px solid var(--cc-border);
  border-radius: var(--radius-md, 12px);
  background: linear-gradient(180deg, rgba(255, 90, 31, 0.08), rgba(255, 90, 31, 0.02));
}

.cc-status-body { flex: 1; min-width: 220px; }

.cc-status-title {
  display: block;
  font-size: 14px;
  font-weight: 550;
  color: #fff;
  margin-bottom: 5px;
}

.cc-status-detail {
  font-size: 13px;
  line-height: 1.6;
  color: var(--cc-body);
  margin: 0;
}

.cc-status-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.cc-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 11.5px;
  font-weight: 500;
  padding: 4px 10px;
  border-radius: 99px;
  border: 1px solid var(--cc-border);
  background: rgba(255, 255, 255, 0.04);
  color: var(--cc-muted);
}

.cc-pill::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
}

.cc-pill--on { color: rgba(255, 255, 255, 0.82); border-color: rgba(0, 212, 170, 0.3); }
.cc-pill--on::before { background: var(--cc-mint); }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 560px) {
  /* Banner: full width, hugging the bottom edge */
  .cc-banner,
  .cc-toast {
    left: 8px;
    right: 8px;
    bottom: calc(8px + env(safe-area-inset-bottom, 0px));
    width: auto;
    max-width: none;
  }
  /* Compact: the banner must leave the hero's main CTA in view */
  .cc-banner-inner { padding: 16px 16px 0; font-size: var(--fs-small, 14px); line-height: 1.5; }
  .cc-banner-head { margin-bottom: 6px; }
  .cc-banner-icon { display: none; }
  .cc-banner-title { font-size: 16px; }
  /* Policy links flow on as the end of the sentence instead of their own row */
  .cc-banner-text,
  .cc-banner-links { display: inline; }
  .cc-banner-links { margin-left: 4px; }
  .cc-banner-links span { margin: 0 4px; }
  .cc-banner-actions { margin-top: 14px; }
  .cc-banner-customize { width: calc(100% + 32px); margin: 8px -16px 0; padding: 0 16px; min-height: 44px; }
  .cc-btn { padding: 0 14px; }

  /* Preferences: bottom sheet with the decision pinned to the thumb */
  .cc-modal { padding: 0; align-items: flex-end; }
  .cc-modal-dialog {
    max-width: none;
    max-height: 92vh;
    max-height: 92dvh;
    border-radius: 20px 20px 0 0;
    border-bottom: none;
  }
  .cc-modal[data-state="entering"] .cc-modal-dialog,
  .cc-modal[data-state="leaving"] .cc-modal-dialog { transform: translateY(40px); }
  .cc-modal-header { padding: 22px 64px 16px 20px; }
  .cc-modal-title { font-size: 22px; }
  .cc-modal-close { top: 10px; right: 10px; }
  .cc-modal-body { padding: 0 20px 4px; }
  .cc-cat { gap: 16px; padding: 16px 0; }
  .cc-modal-footer { padding: 12px 20px calc(16px + env(safe-area-inset-bottom, 0px)); }
  .cc-modal-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
  }
  .cc-btn--save { grid-column: 1 / -1; order: -1; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
  /* Banner, dialog and toast keep a short fade, never movement */
  .cc-banner-inner,
  .cc-modal-dialog,
  .cc-modal-backdrop { transition: opacity 0.15s ease !important; }
  .cc-toast { transition: opacity 0.15s ease, visibility 0s linear 0.15s !important; }
  .cc-toast[data-state="open"] { transition: opacity 0.15s ease, visibility 0s !important; }
  .cc-switch-track,
  .cc-switch-track::after,
  .cc-btn,
  .cc-banner-customize svg { transition: none !important; }
  .cc-banner[data-state] .cc-banner-inner,
  .cc-modal[data-state] .cc-modal-dialog,
  .cc-toast { transform: none !important; }
}
