/* Cookie consent + preferences (Consent Mode v2 companion) */
html.cookie-consent-open {
  overflow: hidden;
}

.cookie-consent {
  position: fixed;
  inset: 0;
  z-index: 10050;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  box-sizing: border-box;
}

.cookie-consent[hidden] {
  display: none !important;
}

.cookie-consent__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  backdrop-filter: blur(6px);
}

.cookie-consent__box {
  position: relative;
  width: 100%;
  max-width: 640px;
  margin: auto;
  background: var(--surface);
  border-radius: 26px;
  padding: clamp(22px, 4vw, 32px);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--border, #e2e8f0);
}

.cookie-consent__title {
  margin: 0 0 var(--space-4);
  font-size: clamp(1.15rem, 2.5vw, 1.35rem);
  font-weight: 900;
  line-height: 1.25;
  color: var(--text, #111);
}

.cookie-consent__text {
  margin: 0 0 var(--space-6);
  font-size: 15px;
  line-height: 1.55;
  color: var(--muted, #64748b);
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.cookie-consent__actions .btn {
  border-radius: var(--radius-pill, 999px);
}

/* Dark mode: white pills need dark labels (theme.css may be cached without the rule). */
html.theme-dark .cookie-consent .btn--black,
html.theme-dark .cookie-consent .btn--light,
html.theme-dark .cookie-consent .btn--ghost {
  background: #ffffff !important;
  color: #0b0b0b !important;
  border-color: #ffffff !important;
}
html.theme-dark .cookie-consent .btn--black:hover,
html.theme-dark .cookie-consent .btn--light:hover,
html.theme-dark .cookie-consent .btn--ghost:hover {
  filter: brightness(0.96);
  color: #0b0b0b !important;
}

.cookie-consent__prefs-title {
  margin: 0 0 var(--space-4);
  font-size: 1.05rem;
  font-weight: 800;
}

.cookie-consent__list {
  list-style: none;
  margin: 0 0 var(--space-5);
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}

.cookie-consent__row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: var(--space-4);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border, #e2e8f0);
}

.cookie-consent__row:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.cookie-consent__row-text {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}

.cookie-consent__row-title {
  font-weight: 800;
  font-size: 14px;
}

.cookie-consent__row-desc {
  font-size: 13px;
  color: var(--muted, #64748b);
  line-height: 1.45;
}

.cookie-consent__prefs-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
}

.cookie-consent__switch {
  position: relative;
  flex: 0 0 auto;
  width: 48px;
  height: 28px;
  cursor: pointer;
}

.cookie-consent__switch input {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.cookie-consent__switch-ui {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: var(--border, #e2e8f0);
  transition: background 0.18s ease;
}

.cookie-consent__switch-ui::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  transition: transform 0.18s ease;
}

.cookie-consent__switch input:checked + .cookie-consent__switch-ui {
  background: #111;
}

.cookie-consent__switch input:checked + .cookie-consent__switch-ui::after {
  transform: translateX(20px);
}

.cookie-consent__switch input:disabled + .cookie-consent__switch-ui {
  opacity: 0.55;
  cursor: not-allowed;
}

.cookie-consent__switch input:focus-visible + .cookie-consent__switch-ui {
  outline: 2px solid var(--green, #07dc43);
  outline-offset: 2px;
}

@media (max-width: 520px) {
  .cookie-consent__actions .btn,
  .cookie-consent__prefs-actions .btn {
    width: 100%;
  }
}
