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

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

.cookie-consent {
  position: fixed;
  z-index: 2100;
  bottom: 24px;
  left: 24px;
  width: min(440px, calc(100vw - 48px));
  background: #fff;
  border: 1px solid #eee;
  border-radius: 6px;
  box-shadow: 0 2px 18px rgb(18 32 58 / 13%);
  color: var(--ink, #12203a);
}

.cookie-consent__inner {
  position: relative;
  padding: 20px 24px;
}

.cookie-consent__close {
  display: none;
  position: absolute;
  top: 8px;
  right: 10px;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  color: #647084;
  background: transparent;
  cursor: pointer;
  font-size: 24px;
  line-height: 1;
}

.cookie-consent h2,
.cookie-preferences h2 {
  margin: 0 0 8px;
  color: var(--ink, #12203a);
  font-family: var(--display, Georgia, serif);
  font-size: 19px;
  font-weight: 700;
  line-height: 1.25;
}

.cookie-consent__inner > p {
  margin: 0 0 16px;
  color: #343434;
  font-size: 14px;
  line-height: 1.7;
}

.cookie-consent__inner > .cookie-consent__traffic-note {
  margin-top: -8px;
  color: #647084;
  font-size: 12px;
}

.cookie-consent a {
  color: inherit;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent__actions,
.cookie-preferences__actions {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.cookie-consent__button {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  justify-content: center;
  padding: 8px 10px;
  border: 1px solid #d54a00;
  border-radius: 2px;
  color: #c94300;
  background: #fff;
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 600;
  text-align: center;
}

.cookie-consent__button:hover,
.cookie-consent__button:focus-visible {
  outline: 2px solid #c94300;
  outline-offset: 2px;
}

.cookie-consent__button--primary {
  border-color: #c94300;
  color: #fff;
  background: #c94300;
}

.cookie-consent__button--primary:hover,
.cookie-consent__button--primary:focus-visible {
  outline-color: #c94300;
}

.cookie-consent-launcher {
  display: none;
  position: fixed;
  z-index: 2100;
  bottom: calc(max(env(safe-area-inset-bottom, 0px), var(--visual-viewport-bottom-inset, 0px)) + 18px);
  left: calc(max(env(safe-area-inset-left, 0px), var(--visual-viewport-left-inset, 0px)) + 18px);
  width: 48px;
  height: 48px;
  align-items: center;
  justify-content: center;
  padding: 10px;
  border: 1px solid #e6e6e6;
  border-radius: 50%;
  color: #c94300;
  background: #fff;
  box-shadow: 0 2px 12px rgb(18 32 58 / 20%);
  cursor: pointer;
}

.cookie-consent-launcher svg {
  display: block;
  width: 26px;
  height: 26px;
  fill: currentColor;
}

.cookie-consent-launcher:hover,
.cookie-consent-launcher:focus-visible {
  outline: 2px solid #c94300;
  outline-offset: 2px;
}

.cookie-preferences {
  position: fixed;
  z-index: 2200;
  inset: 0;
  display: grid;
  align-items: center;
  justify-items: center;
  padding: 20px;
}

.cookie-preferences__backdrop {
  position: absolute;
  inset: 0;
  background: rgb(18 32 58 / 58%);
}

.cookie-preferences__panel {
  position: relative;
  width: min(100%, 820px);
  max-height: min(90vh, 760px);
  overflow: auto;
  padding: 22px 26px 24px;
  border-top: 4px solid var(--stamp, #c4432b);
  background: #fff;
  box-shadow: 0 18px 55px rgb(18 32 58 / 28%);
}

.cookie-preferences__panel h2 {
  margin-bottom: 16px;
}

.cookie-preferences__category {
  display: flex;
  min-height: 70px;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 13px 0;
  border-top: 1px solid #e5dfd4;
}

.cookie-preferences__category h3 {
  margin: 0 0 3px;
  color: var(--ink, #12203a);
  font-family: var(--display, Georgia, serif);
  font-size: 14px;
  font-weight: 700;
}

.cookie-preferences__category p {
  margin: 0;
  color: var(--ink-soft, #2e4165);
  font-size: 12px;
  line-height: 1.5;
}

.cookie-preferences__switch {
  position: relative;
  display: inline-flex;
  width: 46px;
  min-width: 46px;
  height: 27px;
  align-items: center;
  cursor: pointer;
}

.cookie-preferences__switch input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.cookie-preferences__switch > span[aria-hidden="true"] {
  position: relative;
  width: 46px;
  height: 27px;
  border-radius: 20px;
  background: #bcc3cf;
  transition: background-color .15s ease;
}

.cookie-preferences__switch > span[aria-hidden="true"]::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  content: "";
  transition: transform .15s ease;
}

.cookie-preferences__switch input:checked + span[aria-hidden="true"] {
  background: #7e899b;
}

.cookie-preferences__switch input:checked + span[aria-hidden="true"]::after {
  transform: translateX(19px);
}

.cookie-preferences__switch input:focus-visible + span[aria-hidden="true"] {
  outline: 2px solid var(--stamp, #c4432b);
  outline-offset: 3px;
}

.cookie-preferences__switch input:disabled {
  cursor: not-allowed;
}

.cookie-preferences__switch input:disabled + span[aria-hidden="true"] {
  opacity: .8;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  clip-path: inset(50%);
}

.cookie-consent-footer {
  padding-top: 12px;
  text-align: right;
}

.cookie-consent-footer__button {
  padding: 0;
  border: 0;
  color: inherit;
  background: transparent;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  text-decoration: underline;
  text-underline-offset: 2px;
}

@media (max-width: 600px) {
  .cookie-consent {
    bottom: max(78px, calc(env(safe-area-inset-bottom) + 70px));
    left: max(12px, env(safe-area-inset-left));
    width: min(440px, calc(100vw - 24px));
  }

  .cookie-consent__inner {
    padding: 18px 16px 16px;
  }

  .cookie-consent__close {
    display: block;
  }

  .cookie-consent h2,
  .cookie-preferences h2 {
    padding-right: 26px;
    font-size: 19px;
  }

  .cookie-consent__inner > p {
    margin-bottom: 12px;
    font-size: 13px;
    line-height: 1.55;
  }

  .cookie-consent__actions {
    grid-template-columns: 1fr;
    gap: 7px;
  }

  .cookie-consent__button {
    min-height: 42px;
  }

  .cookie-consent-launcher {
    display: inline-flex;
  }

  .cookie-preferences {
    padding: 12px;
  }

  .cookie-preferences__panel {
    max-height: 94vh;
    padding: 18px 18px 20px;
  }

  .cookie-preferences__category {
    gap: 12px;
    padding: 12px 0;
  }

  .cookie-preferences__actions {
    gap: 8px;
  }
}

@media (max-width: 380px) {
  .cookie-preferences__actions {
    grid-template-columns: 1fr;
  }

  .cookie-consent__inner {
    padding-right: 14px;
    padding-left: 14px;
  }
}
