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

.cookie-consent [hidden],
.cookie-dialog:not([open]) {
  display: none !important;
}

.cookie-dialog {
  position: fixed;
  inset: auto 0 0;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  max-height: min(50vh, 520px);
  max-height: min(50dvh, 520px);
  margin: 0 auto;
  padding: clamp(22px, 3vw, 34px) clamp(24px, 5vw, 54px) max(20px, env(safe-area-inset-bottom));
  overflow-y: auto;
  overscroll-behavior: contain;
  color: #29231c;
  background: #fff;
  border: 0;
  border-bottom: 0;
  border-top: 3px solid #bc9453;
  border-radius: 24px 24px 0 0;
  box-shadow: 0 -18px 60px rgb(0 0 0 / 20%);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.6;
  text-align: left;
  color-scheme: light;
}

.cookie-dialog[open] {
  display: grid;
  grid-template-columns: minmax(0, 720px) minmax(280px, 420px);
  column-gap: clamp(30px, 5vw, 64px);
  row-gap: 0;
  align-items: center;
  justify-content: center;
}

.cookie-dialog::backdrop {
  background: rgb(31 30 28 / 48%);
  backdrop-filter: blur(2px);
}

.cookie-consent--fallback {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: grid;
  place-items: end center;
  overflow-y: auto;
  background: rgb(31 30 28 / 48%);
  backdrop-filter: blur(2px);
}

.cookie-consent--fallback .cookie-dialog {
  position: relative;
  inset: auto;
}

.cookie-consent__eyebrow {
  margin: 0 0 12px;
  color: #805817;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cookie-dialog h2 {
  margin: 0 0 12px;
  color: #211d18;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(1.55rem, 3.2vw, 1.95rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.cookie-dialog h2:focus {
  outline: none;
}

.cookie-dialog__intro {
  margin: 0;
  color: #5c5349;
  font-size: 1rem;
  line-height: 1.65;
}

[data-cookie-summary] {
  align-self: center;
}

[data-cookie-summary] .cookie-dialog__actions {
  margin-top: 0;
}

[data-cookie-preferences] {
  grid-column: 1 / -1;
}

.cookie-dialog--preferences .cookie-dialog__copy {
  grid-column: 1 / -1;
  margin-bottom: 10px;
}

.cookie-dialog__actions {
  display: grid;
  gap: 10px;
  margin-top: 20px;
}

.cookie-button {
  box-sizing: border-box;
  display: block;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  border: 1px solid transparent;
  border-radius: 12px;
  font: inherit;
  font-weight: 700;
  line-height: 1.4;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cookie-button--accept {
  min-height: 52px;
  color: #211a0e;
  background: #d7b57b;
  border-color: #c7a264;
  font-size: 1.0625rem;
  font-weight: 800;
}

.cookie-button--accept:hover {
  background: #e2c38f;
  border-color: #a98345;
}

.cookie-button--settings {
  min-height: 44px;
  padding: 8px 12px;
  color: #5c4a32;
  background: transparent;
  font-size: 0.875rem;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.cookie-button--settings:hover {
  background: #f8f5ef;
}

.cookie-button:focus-visible,
.cookie-dialog__reject-link:focus-visible,
.cookie-dialog a:focus-visible,
.footer__cookie-button:focus-visible,
.cookie-switch input:focus-visible + span {
  outline: 3px solid #805817;
  outline-offset: 3px;
}

.cookie-dialog__note {
  grid-column: 1 / -1;
  justify-self: center;
  margin: 22px 0 0;
  padding-top: 16px;
  color: #70665a;
  border-top: 1px solid #e9e2d8;
  font-size: 0.8125rem;
  line-height: 1.6;
}

.cookie-dialog__footer {
  grid-column: 1 / -1;
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-top: 8px;
}

.cookie-dialog__reject-link {
  display: inline;
  min-height: 0;
  padding: 0;
  color: inherit;
  background: transparent;
  border: 0;
  font: inherit;
  font-size: 0.875rem;
  font-weight: 400;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}

.cookie-dialog__reject-link:hover {
  color: #211d18;
}

.cookie-dialog__links {
  margin: 0;
  color: #847561;
  font-size: 0.8125rem;
  line-height: 1.7;
}

.cookie-dialog a {
  color: #705124;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-option {
  display: flex;
  gap: 18px;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  border-top: 1px solid #e9e2d8;
}

.cookie-option h3,
.cookie-option strong {
  display: block;
  margin: 0 0 6px;
  color: #29231c;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.5;
}

.cookie-option p,
.cookie-option small {
  display: block;
  margin: 0;
  color: #665d52;
  font-size: 0.875rem;
  line-height: 1.6;
}

.cookie-option__status {
  flex: 0 0 auto;
  color: #376341;
  font-size: 0.75rem;
  font-weight: 700;
}

.cookie-switch {
  position: relative;
  flex: 0 0 52px;
  width: 52px;
  height: 44px;
}

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

.cookie-switch > span {
  position: absolute;
  inset: 7px 0;
  background: #898176;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease;
}

.cookie-switch > span::after {
  position: absolute;
  top: 4px;
  left: 4px;
  width: 22px;
  height: 22px;
  content: "";
  background: #fff;
  border-radius: 50%;
  transition: transform 0.15s ease;
}

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

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

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

.footer__cookie-button {
  display: inline;
  padding: 0;
  color: inherit;
  background: none;
  border: 0;
  font: inherit;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

@media (max-width: 720px) {
  .cookie-dialog {
    width: 100%;
    max-height: 58vh;
    max-height: 58dvh;
    padding: 22px 20px max(18px, env(safe-area-inset-bottom));
    border-right: 0;
    border-left: 0;
    border-radius: 20px 20px 0 0;
  }

  .cookie-dialog[open] {
    grid-template-columns: 1fr;
  }

  [data-cookie-summary] {
    margin-top: 20px;
  }

  .cookie-dialog__note {
    margin-top: 18px;
  }

  .cookie-dialog__links {
    margin: 0;
  }

  .cookie-dialog__footer {
    gap: 8px 14px;
    flex-wrap: wrap;
  }

  .cookie-option {
    gap: 12px;
    flex-wrap: wrap;
  }

  .cookie-option--toggle {
    flex-wrap: nowrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-button,
  .cookie-dialog__reject-link,
  .cookie-switch > span,
  .cookie-switch > span::after {
    transition: none;
  }
}
