:root {
  --cookie-z-index: 140;
}

body.cookie-preferences-open {
  overflow: hidden;
}

.cookie-link-button {
  appearance: none;
  border: 0;
  padding: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.footer-legal-links .cookie-link-button,
.legal-footer__links .cookie-link-button {
  font-weight: 600;
}

.footer-legal-links .cookie-link-button {
  color: rgba(255, 255, 255, 0.92);
}

.legal-footer__links .cookie-link-button {
  color: #1d3038;
}

.footer-legal-links .cookie-link-button:hover,
.legal-footer__links .cookie-link-button:hover {
  text-decoration: underline;
}

.cookie-banner[hidden],
.cookie-preferences[hidden] {
  display: none !important;
}

.cookie-banner {
  position: fixed;
  left: 16px;
  right: 16px;
  bottom: 16px;
  z-index: var(--cookie-z-index);
}

.cookie-banner__card,
.cookie-preferences__panel {
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(47, 71, 82, 0.16);
  border-radius: 24px;
  box-shadow: 0 24px 60px rgba(29, 48, 56, 0.18);
  backdrop-filter: blur(16px);
}

.cookie-banner__card {
  position: relative;
  overflow: hidden;
  width: min(100%, 980px);
  margin-left: auto;
  padding: 22px 22px 20px;
}

.cookie-banner__card::before,
.cookie-preferences__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at top left, rgba(122, 149, 136, 0.14), transparent 34%),
    radial-gradient(circle at bottom right, rgba(201, 166, 107, 0.16), transparent 38%);
  pointer-events: none;
}

.cookie-banner__content,
.cookie-preferences__content {
  position: relative;
  z-index: 1;
}

.cookie-banner__eyebrow,
.cookie-preferences__eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 10px;
  color: #7a9588;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.cookie-banner__title,
.cookie-preferences__title {
  margin: 0 0 10px;
  color: #1d3038;
  font-family: "Cormorant Garamond", Georgia, serif;
  font-size: clamp(1.65rem, 3vw, 2.2rem);
  line-height: 1;
}

.cookie-banner__text,
.cookie-preferences__text,
.cookie-toggle__copy p {
  margin: 0;
  color: #5f6d72;
  line-height: 1.65;
}

.cookie-banner__text a,
.cookie-preferences__text a {
  color: #2f4752;
  font-weight: 600;
}

.cookie-banner__actions,
.cookie-preferences__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.cookie-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 600;
  transition:
    transform 220ms ease,
    background-color 220ms ease,
    border-color 220ms ease,
    color 220ms ease,
    box-shadow 220ms ease;
  cursor: pointer;
}

.cookie-btn:hover {
  transform: translateY(-1px);
}

.cookie-btn--primary {
  background: #2f4752;
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(47, 71, 82, 0.18);
}

.cookie-btn--primary:hover {
  background: #1d3038;
}

.cookie-btn--secondary {
  background: rgba(255, 255, 255, 0.8);
  border-color: rgba(47, 71, 82, 0.16);
  color: #1d3038;
}

.cookie-btn--secondary:hover,
.cookie-btn--ghost:hover {
  border-color: rgba(47, 71, 82, 0.28);
}

.cookie-btn--ghost {
  background: transparent;
  border-color: rgba(47, 71, 82, 0.16);
  color: #2f4752;
}

.cookie-preferences {
  position: fixed;
  inset: 0;
  z-index: calc(var(--cookie-z-index) + 1);
}

.cookie-preferences__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 30, 36, 0.48);
}

.cookie-preferences__dialog {
  position: relative;
  display: grid;
  place-items: end center;
  min-height: 100%;
  padding: 16px;
}

.cookie-preferences__panel {
  position: relative;
  overflow: hidden;
  width: min(100%, 760px);
  max-height: min(88vh, 760px);
  padding: 26px 24px 24px;
}

.cookie-preferences__header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 18px;
}

.cookie-preferences__close {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 1px solid rgba(47, 71, 82, 0.16);
  background: rgba(255, 255, 255, 0.82);
  color: #1d3038;
  font-size: 1.35rem;
  line-height: 1;
  cursor: pointer;
}

.cookie-preferences__body {
  display: grid;
  gap: 14px;
  overflow: auto;
  max-height: calc(88vh - 190px);
  padding-right: 4px;
}

.cookie-toggle {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 18px 18px 16px;
  border-radius: 18px;
  border: 1px solid rgba(47, 71, 82, 0.12);
  background: rgba(247, 243, 234, 0.72);
}

.cookie-toggle__copy strong {
  display: block;
  margin-bottom: 6px;
  color: #1d3038;
  font-size: 1rem;
}

.cookie-toggle__input {
  position: relative;
  display: inline-flex;
  width: 58px;
  height: 34px;
  cursor: pointer;
}

.cookie-toggle__input input {
  position: absolute;
  opacity: 0;
  inset: 0;
  cursor: pointer;
}

.cookie-toggle__slider {
  width: 100%;
  height: 100%;
  border-radius: 999px;
  background: rgba(47, 71, 82, 0.16);
  border: 1px solid rgba(47, 71, 82, 0.14);
  transition:
    background-color 220ms ease,
    border-color 220ms ease;
}

.cookie-toggle__slider::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 5px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  box-shadow: 0 4px 10px rgba(29, 48, 56, 0.12);
  transition: transform 220ms ease;
}

.cookie-toggle__input input:checked + .cookie-toggle__slider {
  background: rgba(122, 149, 136, 0.92);
  border-color: rgba(122, 149, 136, 0.92);
}

.cookie-toggle__input input:checked + .cookie-toggle__slider::after {
  transform: translateX(24px);
}

.cookie-toggle__input input:focus-visible + .cookie-toggle__slider {
  outline: 3px solid rgba(201, 166, 107, 0.85);
  outline-offset: 3px;
}

.cookie-toggle.is-required .cookie-toggle__slider {
  background: rgba(122, 149, 136, 0.92);
  border-color: rgba(122, 149, 136, 0.92);
}

.cookie-toggle.is-required .cookie-toggle__slider::after {
  transform: translateX(24px);
}

.cookie-toggle.is-required .cookie-toggle__input {
  cursor: not-allowed;
}

.cookie-preferences__note {
  margin-top: 6px;
  color: #5f6d72;
  font-size: 0.92rem;
}

@media (min-width: 768px) {
  .cookie-banner__card {
    padding: 24px 26px 22px;
  }

  .cookie-preferences__dialog {
    place-items: center;
    padding: 24px;
  }

  .cookie-preferences__panel {
    padding: 30px 28px 28px;
  }
}

@media (max-width: 640px) {
  .cookie-banner__actions,
  .cookie-preferences__actions {
    flex-direction: column;
  }

  .cookie-btn {
    width: 100%;
  }

  .cookie-toggle {
    grid-template-columns: 1fr;
  }

  .cookie-toggle__input {
    justify-self: start;
  }
}
