/* Cookie consent banner */

.dh-consent {
  position: fixed;
  inset: auto 0 0;
  z-index: 10050;
  pointer-events: none;
  font-family: var(--dh-font);
}

.dh-consent.is-open {
  pointer-events: auto;
}

.dh-consent__backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.42);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.dh-consent.is-prefs .dh-consent__backdrop {
  opacity: 1;
}

.dh-consent__panel {
  position: relative;
  z-index: 1;
  width: min(100% - 24px, 560px);
  margin: 0 auto 16px;
  padding: 22px 22px 18px;
  background: var(--dh-white);
  color: var(--dh-ink);
  border: 1px solid var(--dh-line);
  border-radius: var(--dh-r-lg);
  box-shadow:
    0 18px 50px rgba(15, 23, 42, 0.16),
    0 2px 8px rgba(15, 23, 42, 0.06);
  transform: translateY(18px);
  opacity: 0;
  transition: transform 0.28s ease, opacity 0.28s ease;
}

.dh-consent.is-open .dh-consent__panel {
  transform: none;
  opacity: 1;
}

.dh-consent__kicker {
  margin: 0 0 6px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--dh-orange);
}

.dh-consent__title {
  margin: 0 0 8px;
  font-size: 1.25rem;
  line-height: 1.25;
  letter-spacing: -0.02em;
  color: var(--dh-navy);
}

.dh-consent__text {
  margin: 0 0 18px;
  font-size: 14.5px;
  line-height: 1.55;
  color: var(--dh-muted);
}

.dh-consent__text a {
  color: var(--dh-navy);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dh-consent__actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.dh-consent__btn {
  width: 100%;
  text-align: center;
  padding: 11px 14px;
  font-size: 13.5px;
}

.dh-consent__prefs-toggle {
  display: block;
  width: 100%;
  margin-top: 12px;
  padding: 8px;
  border: 0;
  background: transparent;
  color: var(--dh-muted);
  font: 650 13.5px/1.4 var(--dh-font);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.dh-consent__prefs-toggle:hover {
  color: var(--dh-navy);
}

.dh-consent__prefs-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 4px;
}

.dh-consent__prefs-head .dh-consent__title {
  margin-bottom: 0;
}

.dh-consent__back {
  flex: none;
  margin-top: 2px;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--dh-muted);
  font: 650 13px/1.3 var(--dh-font);
  cursor: pointer;
}

.dh-consent__back:hover {
  color: var(--dh-navy);
}

.dh-consent__cats {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: grid;
  gap: 10px;
}

.dh-consent__cat {
  border: 1px solid var(--dh-line);
  border-radius: var(--dh-r-md);
  background: var(--dh-soft);
  padding: 14px 14px 12px;
}

.dh-consent__cat-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}

.dh-consent__cat strong {
  display: block;
  margin-bottom: 4px;
  font-size: 14.5px;
  color: var(--dh-ink);
}

.dh-consent__cat p {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--dh-muted);
}

.dh-consent__lock {
  flex: none;
  margin-top: 2px;
  padding: 5px 10px;
  border-radius: var(--dh-r-sm);
  background: #e2e8f0;
  color: var(--dh-nav);
  font-size: 12px;
  font-weight: 700;
}

.dh-consent__switch {
  position: relative;
  flex: none;
  width: 44px;
  height: 26px;
  margin-top: 2px;
  cursor: pointer;
}

.dh-consent__switch input {
  position: absolute;
  inset: 0;
  opacity: 0;
  margin: 0;
  cursor: pointer;
}

.dh-consent__switch-ui {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: var(--dh-r-pill);
  background: #cbd5e1;
  transition: background 0.2s ease;
}

.dh-consent__switch-ui::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 20px;
  height: 20px;
  border-radius: var(--dh-r-full);
  background: #fff;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.2);
  transition: transform 0.2s ease;
}

.dh-consent__switch input:checked + .dh-consent__switch-ui {
  background: var(--dh-cart);
}

.dh-consent__switch input:checked + .dh-consent__switch-ui::after {
  transform: translateX(18px);
}

.dh-consent__switch input:focus-visible + .dh-consent__switch-ui {
  outline: 2px solid var(--dh-orange);
  outline-offset: 2px;
}

@media (max-width: 560px) {
  .dh-consent__panel {
    width: 100%;
    margin: 0;
    border-radius: var(--dh-r-lg) var(--dh-r-lg) 0 0;
    border-left: 0;
    border-right: 0;
    border-bottom: 0;
    padding: 20px 18px calc(16px + env(safe-area-inset-bottom, 0px));
  }

  .dh-consent__actions {
    grid-template-columns: 1fr;
  }

  .dh-consent__btn {
    order: 0;
  }

  .dh-consent__actions .dh-btn:not(.dh-btn-outline) {
    order: -1;
  }
}

@media (prefers-reduced-motion: reduce) {
  .dh-consent__panel,
  .dh-consent__backdrop,
  .dh-consent__switch-ui,
  .dh-consent__switch-ui::after {
    transition: none;
  }
}
