.cookie-banner {
  position: fixed;
  z-index: 10020;
  right: auto;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 1.25rem 2rem;
  width: min(48rem, calc(100vw - 2.5rem));
  padding: 1.5rem;
  border: 1px solid rgba(23, 23, 22, 0.12);
  border-radius: 1.25rem;
  background: #fff;
  color: #222;
  box-shadow: 0 18px 50px rgba(23, 23, 22, 0.18);
  font-family: Poppins, sans-serif;
}

.cookie-banner[hidden],
.cookie-modal-backdrop[hidden] {
  display: none;
}

.cookie-banner-copy h2,
.cookie-modal h2 {
  margin: 0.2rem 0 0.45rem;
  color: #171716;
  font-family: "Playfair Display", Georgia, serif;
  font-size: 1.35rem;
  font-weight: 600;
  line-height: 1.2;
}

.cookie-banner-copy h2 {
  margin-top: 0;
}

.cookie-banner-copy > p:not(.cookie-eyebrow) {
  margin: 0;
  color: #55514d;
  font-size: 0.76rem;
  line-height: 1.65;
}

.cookie-banner-copy > a {
  display: inline-block;
  margin-top: 0.45rem;
  color: #765f4d;
  font-size: 0.7rem;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-eyebrow {
  margin: 0;
  color: #8d715c;
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.cookie-banner-actions {
  display: flex;
  min-width: 10rem;
  flex-direction: column;
  gap: 0.5rem;
}

.cookie-button {
  display: inline-flex;
  min-height: 2.7rem;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 0.75rem;
  padding: 0.65rem 1rem;
  font: 600 0.72rem/1.25 Poppins, sans-serif;
  text-align: center;
  transition: background-color 0.18s ease, border-color 0.18s ease, color 0.18s ease;
  cursor: pointer;
}

.cookie-button-primary {
  border-color: #171716;
  background: #171716;
  color: #fff;
}

.cookie-button-primary:hover {
  border-color: #8d715c;
  background: #8d715c;
}

.cookie-button-secondary {
  border-color: #d8d2ca;
  background: #fff;
  color: #292724;
}

.cookie-button-secondary:hover {
  border-color: #b8977e;
  background: #f7f5f1;
}

.cookie-button-link {
  min-height: 2.35rem;
  background: transparent;
  color: #765f4d;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.cookie-button-link:hover {
  color: #171716;
}

.cookie-button:focus-visible,
.cookie-close:focus-visible,
.cookie-switch input:focus-visible + span,
.cookie-footer-link:focus-visible {
  outline: 3px solid #8d715c;
  outline-offset: 3px;
}

.cookie-status {
  grid-column: 1 / -1;
  margin: 0;
  color: #8c332a;
  font-size: 0.72rem;
}

.cookie-status:empty {
  display: none;
}

.cookie-modal-backdrop {
  position: fixed;
  z-index: 10030;
  inset: 0;
  display: grid;
  place-items: center;
  overflow-y: auto;
  padding: 1rem;
  background: rgba(23, 23, 22, 0.58);
}

.cookie-modal {
  width: min(34rem, 100%);
  max-height: min(90vh, 48rem);
  overflow-y: auto;
  border: 1px solid rgba(23, 23, 22, 0.1);
  border-radius: 1.5rem;
  padding: 1.5rem;
  background: #fdfcfb;
  color: #222;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.28);
}

.cookie-modal:focus {
  outline: none;
}

.cookie-modal-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.cookie-modal h2 {
  margin-top: 0.35rem;
  font-size: 1.65rem;
}

.cookie-close {
  display: inline-grid;
  width: 2.5rem;
  height: 2.5rem;
  flex: 0 0 auto;
  place-items: center;
  border: 1px solid #e6e2dc;
  border-radius: 50%;
  background: #fff;
  color: #37332f;
  font-size: 1.5rem;
  cursor: pointer;
}

.cookie-modal-intro {
  margin: 0.5rem 0 1.15rem;
  color: #5b5650;
  font-size: 0.78rem;
  line-height: 1.65;
}

.cookie-category-list {
  border-top: 1px solid #e7e2dc;
}

.cookie-category {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-bottom: 1px solid #e7e2dc;
  padding: 1rem 0;
}

.cookie-category h3 {
  margin: 0;
  color: #25221f;
  font-family: Poppins, sans-serif;
  font-size: 0.82rem;
  font-weight: 600;
}

.cookie-category p {
  max-width: 25rem;
  margin: 0.3rem 0 0;
  color: #625d57;
  font-size: 0.7rem;
  line-height: 1.55;
}

.cookie-switch {
  position: relative;
  display: inline-flex;
  width: 2.9rem;
  height: 1.65rem;
  flex: 0 0 auto;
  cursor: pointer;
}

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

.cookie-switch > span {
  position: absolute;
  inset: 0;
  border: 1px solid #bbb4ac;
  border-radius: 999px;
  background: #e4e0dc;
  transition: background-color 0.18s ease;
}

.cookie-switch > span::after {
  position: absolute;
  top: 0.19rem;
  left: 0.2rem;
  width: 1.15rem;
  height: 1.15rem;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1px 3px rgba(23, 23, 22, 0.24);
  content: "";
  transition: transform 0.18s ease;
}

.cookie-switch input:checked + span {
  border-color: #8d715c;
  background: #8d715c;
}

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

.cookie-switch input:disabled + span {
  border-color: #8d715c;
  background: #8d715c;
  cursor: not-allowed;
}

.cookie-switch input:disabled + span::after {
  transform: translateX(1.25rem);
}

.cookie-modal-actions {
  display: flex;
  justify-content: flex-end;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.cookie-footer-link {
  border: 0;
  padding: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
}

.cookie-footer-link:hover {
  color: #fff;
}

@media (max-width: 640px) {
  .cookie-banner {
    right: auto;
    left: 50%;
    bottom: 0.75rem;
    grid-template-columns: 1fr;
    gap: 0.8rem;
    width: calc(100vw - 2.5rem);
    max-height: min(80vh, 38rem);
    overflow-y: auto;
    padding: 1.1rem;
    border-radius: 1.1rem;
  }

  .cookie-banner-copy h2 {
    font-size: 1.2rem;
  }

  .cookie-banner-actions {
    display: grid;
    min-width: 0;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
  }

  .cookie-banner-actions .cookie-button-link {
    grid-column: 1 / -1;
  }

  .cookie-button {
    min-height: 2.85rem;
  }

  .cookie-modal-backdrop {
    align-items: end;
    padding: 0.5rem;
  }

  .cookie-modal {
    max-height: min(88vh, 42rem);
    border-radius: 1.25rem;
    padding: 1.15rem;
  }

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

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