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

body.cookie-banner-visible {
  padding-bottom: var(--cookie-banner-focus-space, 0px);
}

.cookie-consent-banner {
  position: fixed;
  z-index: 90;
  right: auto;
  bottom: 16px;
  left: 16px;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 14px;
  width: min(calc(100% - 32px), 420px);
  margin: 0;
  padding: 18px 20px;
  color: var(--graphite);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  box-shadow: 0 18px 54px rgb(28 25 25 / 18%);
  animation: cookie-banner-enter 300ms var(--ease-ui) both;
}

.cookie-consent-copy h2,
.cookie-dialog-heading h2 {
  margin: 0;
  color: var(--graphite);
  font-size: 19px;
  font-weight: var(--font-weight-bold);
  letter-spacing: -0.025em;
  line-height: 1.25;
}

.cookie-consent-copy > p:last-child,
.cookie-preferences-form > p,
.cookie-category p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.cookie-consent-eyebrow {
  margin: 0 0 6px;
  color: var(--red);
  font-size: 10px;
  font-weight: var(--font-weight-heavy);
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.cookie-consent-banner a {
  color: var(--wine);
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cookie-consent-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.cookie-action {
  min-height: 44px;
  padding: 9px 14px;
  color: var(--graphite);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  cursor: pointer;
  font: inherit;
  font-size: 12px;
  font-weight: var(--font-weight-semibold);
  line-height: 1.25;
  transition: border-color 180ms var(--ease-ui), background-color 180ms var(--ease-ui), color 180ms var(--ease-ui), transform 180ms var(--ease-ui);
}

.cookie-action:hover {
  border-color: var(--red);
  transform: translateY(-1px);
}

.cookie-action-primary {
  color: var(--white);
  background: var(--red);
  border-color: var(--red);
}

.cookie-action-primary:hover {
  color: var(--white);
  background: #ad2e32;
  border-color: #ad2e32;
}

.cookie-action:focus-visible,
.cookie-dialog-close:focus-visible,
.cookie-consent-banner a:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.cookie-action-link {
  grid-column: 1 / -1;
  min-height: 44px;
  padding-block: 8px;
  color: var(--muted);
  background: transparent;
  border-color: transparent;
}

.cookie-preferences-dialog {
  width: min(560px, calc(100% - 32px));
  max-width: none;
  max-height: min(88vh, 760px);
  padding: 0;
  overflow-y: auto;
  color: var(--graphite);
  background: var(--white);
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  box-shadow: 0 22px 70px rgb(28 25 25 / 24%);
}

.cookie-preferences-dialog[open] {
  animation: cookie-dialog-enter 220ms var(--ease-ui) both;
}

.cookie-preferences-dialog.is-fallback-modal {
  position: fixed;
  z-index: 100;
  inset: 50% auto auto 50%;
  margin: 0;
  transform: translate(-50%, -50%);
}

body.cookie-dialog-open::before {
  position: fixed;
  z-index: 99;
  inset: 0;
  background: rgb(30 25 25 / 48%);
  content: "";
}

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

.cookie-preferences-dialog::backdrop {
  background: rgb(30 25 25 / 48%);
  backdrop-filter: blur(3px);
  animation: cookie-backdrop-enter 220ms ease-out both;
}

.cookie-preferences-form {
  display: grid;
  gap: 16px;
  padding: clamp(20px, 5vw, 30px);
}

.cookie-dialog-heading,
.cookie-category-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.cookie-dialog-close {
  display: grid;
  width: 44px;
  height: 44px;
  flex: 0 0 auto;
  place-items: center;
  color: var(--graphite);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  font: inherit;
  font-size: 25px;
  line-height: 1;
}

.cookie-category {
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}

.cookie-category-heading strong,
.cookie-category-heading label {
  color: var(--graphite);
  font-size: 14px;
  font-weight: var(--font-weight-semibold);
}

.cookie-category-heading span {
  color: var(--muted);
  font-size: 11px;
  font-weight: var(--font-weight-semibold);
}

.cookie-category-heading input {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--red);
  cursor: pointer;
}

.cookie-category-heading input:focus-visible {
  outline: 3px solid var(--red);
  outline-offset: 3px;
}

.cookie-dialog-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  margin-top: 2px;
}

@keyframes cookie-banner-enter {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes cookie-dialog-enter {
  from { opacity: 0; scale: 0.985; }
  to { opacity: 1; scale: 1; }
}

@keyframes cookie-backdrop-enter {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent-banner,
  .cookie-preferences-dialog[open],
  .cookie-preferences-dialog::backdrop {
    animation-duration: 0.01ms;
  }

  .cookie-action {
    transition-duration: 0.01ms;
  }
}

@media (max-width: 760px) {
  .cookie-consent-banner {
    padding: 16px 18px;
  }
}

@media (max-width: 480px) {
  .cookie-consent-banner {
    right: auto;
    bottom: max(10px, env(safe-area-inset-bottom));
    left: 10px;
    width: min(calc(100% - 20px), 420px);
    max-height: min(84vh, 560px);
    overflow-y: auto;
    padding: 16px;
  }

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

  .cookie-consent-copy > p:last-child {
    font-size: 12px;
  }

  .cookie-consent-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .cookie-consent-actions .cookie-action,
  .cookie-dialog-actions .cookie-action {
    width: 100%;
  }

  .cookie-action-link {
    grid-column: 1 / -1;
  }

  .cookie-dialog-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .cookie-preferences-dialog {
    width: calc(100% - 24px);
    max-height: min(88vh, 760px);
    max-height: min(88dvh, 760px);
  }
}
