/* Cookie banner + modal */

.cookie-banner {
  position: fixed;
  inset: auto 0 0 0;
  z-index: 40;
  background: color-mix(in oklab, var(--surface) 94%, transparent);
  border-top: 1px solid var(--border);
  box-shadow: 0 -10px 24px rgba(6, 16, 32, 0.08);
  padding: 1rem;
}

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

.cookie-banner .inner {
  width: min(960px, 100%);
  margin: 0 auto;
  display: grid;
  gap: 0.75rem;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
}

.cookie-banner p {
  margin: 0;
  font-size: 0.95rem;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.5rem;
}

.cookie-btn {
  border-radius: 999px;
  border: 1px solid color-mix(in oklab, var(--brand) 25%, transparent);
  background: transparent;
  color: inherit;
  padding: 0.45rem 0.9rem;
  font-weight: 600;
}

.cookie-btn.primary {
  background: var(--brand);
  color: #fff;
  border-color: color-mix(in oklab, var(--brand) 85%, black 12%);
}

.cookie-btn:hover,
.cookie-btn:focus-visible {
  opacity: 0.9;
}

.cookie-modal {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.5rem;
  background: rgba(5, 10, 18, 0.6);
  z-index: 45;
}

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

.cookie-dialog {
  width: min(680px, 100%);
  background: var(--surface);
  color: inherit;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  padding: clamp(20px, 4vw, 30px);
  box-shadow: 0 20px 48px rgba(6, 16, 32, 0.32);
}

.cookie-dialog h2 {
  margin-top: 0;
}

.cookie-grid {
  display: grid;
  gap: 1rem;
}

.cookie-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 0.75rem 1rem;
  background: color-mix(in oklab, var(--surface) 90%, transparent);
}

.cookie-row .label {
  font-weight: 600;
}

.cookie-row .desc {
  font-size: 0.95rem;
  color: var(--muted);
}

.switch {
  position: relative;
  width: 48px;
  height: 26px;
}

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

.slider {
  position: absolute;
  inset: 0;
  background: color-mix(in oklab, var(--surface) 65%, transparent);
  border-radius: 999px;
  transition: background var(--transition);
}

.slider::before {
  content: "";
  position: absolute;
  width: 20px;
  height: 20px;
  top: 3px;
  left: 4px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 4px 10px rgba(6, 16, 32, 0.2);
  transition: transform var(--transition);
}

.switch input:checked + .slider {
  background: var(--brand);
}

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

@media (max-width: 720px) {
  .cookie-banner .inner {
    grid-template-columns: 1fr;
    text-align: left;
  }

  .cookie-actions {
    justify-content: flex-start;
  }
}
