.cookie-consent {
  position: fixed;
  inset: 0;
  z-index: 4000;
  display: grid;
  place-items: end;
  padding: 18px;
  background: transparent;
  color: #223128;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  pointer-events: none;
}

.cookie-consent--settings {
  place-items: center;
  padding: 24px;
  background: rgba(34, 49, 40, 0.42);
  pointer-events: auto;
}

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

.cookie-consent-open {
  overflow: hidden;
}

.cookie-dialog {
  position: relative;
  width: min(460px, calc(100vw - 36px));
  max-height: calc(100dvh - 36px);
  overflow: auto;
  padding: 20px;
  border: 1px solid rgba(34, 49, 40, 0.12);
  border-radius: 16px;
  background: rgba(255, 252, 247, 0.98);
  box-shadow: 0 18px 50px rgba(34, 49, 40, 0.18);
  pointer-events: auto;
}

.cookie-dialog--settings {
  width: min(620px, calc(100vw - 40px));
  padding: 24px;
}

.cookie-dialog h2,
.cookie-dialog h3,
.cookie-dialog p {
  margin: 0;
}

.cookie-dialog h2 {
  color: #223128;
  font-size: 18px;
  line-height: 1.3;
  font-weight: 800;
}

.cookie-dialog p {
  color: #4e6255;
  font-size: 14px;
  line-height: 1.5;
}

.cookie-dialog a {
  color: #447a57;
  font-weight: 700;
  text-underline-offset: 3px;
}

.cookie-dialog--intro h2 {
  margin-bottom: 8px;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 16px;
}

.cookie-actions--stacked,
.cookie-actions--settings {
  align-items: center;
}

.cookie-btn,
.cookie-link-btn {
  font: inherit;
}

.cookie-btn {
  min-height: 42px;
  padding: 0 15px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease, box-shadow 0.16s ease;
}

.cookie-btn--primary {
  border: 1px solid #5e9b73;
  background: #5e9b73;
  color: #fff;
}

.cookie-btn--secondary {
  border: 1px solid rgba(94, 155, 115, 0.35);
  background: #fff;
  color: #447a57;
}

.cookie-btn:hover {
  box-shadow: 0 8px 18px rgba(73, 96, 80, 0.12);
}

.cookie-link-btn {
  padding: 6px 0;
  border: 0;
  background: transparent;
  color: #447a57;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cookie-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 1px solid rgba(34, 49, 40, 0.1);
  border-radius: 50%;
  background: #fff;
  color: #7a887e;
  font: inherit;
  font-size: 26px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
}

.cookie-dialog--settings h2 {
  padding-right: 44px;
  padding-bottom: 14px;
  border-bottom: 1px solid #e9ddcb;
}

.cookie-category-list {
  display: grid;
}

.cookie-category {
  display: grid;
  grid-template-columns: 1fr 72px;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid #e9ddcb;
}

.cookie-category h3 {
  color: #223128;
  font-size: 15px;
  line-height: 1.3;
  font-weight: 800;
}

.cookie-category p {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.45;
}

.cookie-switch {
  justify-self: end;
  cursor: pointer;
}

.cookie-switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.cookie-switch span:not(.sr-only) {
  position: relative;
  display: block;
  width: 58px;
  height: 32px;
  border-radius: 999px;
  background: #d7ded7;
  transition: background 0.18s ease, box-shadow 0.18s ease;
}

.cookie-switch span:not(.sr-only)::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 4px rgba(34, 49, 40, 0.18);
  transition: transform 0.18s ease;
}

.cookie-switch input:checked + span {
  background: #5e9b73;
}

.cookie-switch input:checked + span::after {
  transform: translateX(26px);
}

.cookie-switch input:focus-visible + span,
.cookie-btn:focus-visible,
.cookie-link-btn:focus-visible,
.cookie-close:focus-visible {
  outline: 3px solid rgba(232, 180, 90, 0.7);
  outline-offset: 3px;
}

.cookie-switch input:disabled + span {
  cursor: not-allowed;
  opacity: 0.85;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* Footer "cookie settings" trigger — renders as an inline text link, inheriting the
   footer's own colour/size so it sits inline with the legal links on every page. */
.footer-cookie-settings {
  display: inline;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 640px) {
  .cookie-consent {
    padding: 12px;
  }

  .cookie-consent--settings {
    align-items: start;
    padding: 14px 12px;
  }

  .cookie-dialog,
  .cookie-dialog--settings {
    width: calc(100vw - 24px);
    max-height: calc(100dvh - 24px);
    padding: 18px;
    border-radius: 14px;
  }

  .cookie-dialog h2 {
    font-size: 17px;
  }

  .cookie-actions {
    display: grid;
  }

  .cookie-btn {
    width: 100%;
  }

  .cookie-link-btn {
    justify-self: center;
  }

  .cookie-category {
    grid-template-columns: 1fr 62px;
    gap: 12px;
  }

  .cookie-switch span:not(.sr-only) {
    width: 52px;
    height: 30px;
  }

  .cookie-switch span:not(.sr-only)::after {
    width: 22px;
    height: 22px;
  }

  .cookie-switch input:checked + span::after {
    transform: translateX(22px);
  }
}
