/* ==========================================================================
   Cookie consent
   ========================================================================== */
.cookie-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 250;
  display: flex;
  justify-content: center;
  padding: clamp(0.75rem, 2vw, 1.25rem);
  pointer-events: none;
}

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

.cookie-consent__panel {
  pointer-events: auto;
  width: min(560px, 100%);
  padding: clamp(1.1rem, 2.5vw, 1.5rem);
  background-color: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 16px;
  box-shadow: 0 20px 50px -20px rgba(0, 0, 0, 0.4);
}

.cookie-consent__title {
  font-family: var(--font-heading);
  font-size: 1.35rem;
  line-height: 1.1;
  margin-bottom: 0.35rem;
  color: var(--colour-text);
}

.cookie-consent__text {
  color: var(--colour-muted);
  font-size: 0.92rem;
  line-height: 1.5;
}

.cookie-consent__text a {
  color: var(--colour-accent);
  font-weight: 600;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1rem;
}

.cookie-consent__actions .btn {
  flex: 1;
  min-width: fit-content;
}

/* Preferences categories */
.cookie-consent__categories {
  list-style: none;
  display: grid;
  gap: 0.75rem;
  margin-top: 1rem;
}

.cookie-consent__category {
  padding: 0.85rem 0.95rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.015);
}

.cookie-consent__cat-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 0.35rem;
}

.cookie-consent__cat-name {
  font-weight: 700;
  color: var(--colour-text);
}

.cookie-consent__cat-always {
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--colour-accent);
}

.cookie-consent__cat-desc {
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--colour-muted);
}

.cookie-consent__cat-desc code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 0.82em;
  padding: 0.05em 0.35em;
  border-radius: 5px;
  background: rgba(0, 0, 0, 0.06);
}

/* Toggle switch */
.cookie-consent__switch {
  position: relative;
  flex: 0 0 auto;
  width: 42px;
  height: 24px;
  cursor: pointer;
}

.cookie-consent__switch input {
  position: absolute;
  opacity: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  cursor: pointer;
}

.cookie-consent__slider {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.22);
  transition: background 0.2s ease;
}

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

.cookie-consent__switch input:checked + .cookie-consent__slider {
  background: var(--colour-accent);
}

.cookie-consent__switch input:checked + .cookie-consent__slider::before {
  transform: translateX(18px);
}

.cookie-consent__switch input:focus-visible + .cookie-consent__slider {
  outline: 3px solid rgba(30, 122, 84, 0.4);
  outline-offset: 2px;
}

/* Reopen trigger */
.cookie-consent__reopen {
  position: fixed;
  left: clamp(0.75rem, 2vw, 1.25rem);
  bottom: clamp(0.75rem, 2vw, 1.25rem);
  z-index: 240;
  padding: 0.5rem 0.85rem;
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--colour-muted);
  background: var(--card);
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 999px;
  box-shadow: 0 6px 18px -10px rgba(0, 0, 0, 0.4);
  cursor: pointer;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}

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

.cookie-consent__reopen:hover {
  opacity: 1;
}

@media (max-width: 480px) {
  .cookie-consent__reopen {
    font-size: 0.72rem;
    padding: 0.4rem 0.7rem;
  }
}
