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

.cookie-consent {
  --tk-type-body: 1rem;
  --tk-type-small: 1rem;
  position: fixed;
  z-index: 10000;
  inset: 0;
  margin: auto;
  width: min(520px, calc(100% - 36px));
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid rgba(255,112,65,.38);
  border-radius: 18px;
  background: #222222;
  color: #eef8ff;
  box-shadow: 0 20px 56px rgba(23,23,23, 0.4);
}

.cookie-consent::backdrop { background: rgba(0, 0, 0, .55); }
.cookie-consent__header { display: flex; align-items: start; gap: 16px; margin-bottom: 16px; }
html body .cookie-consent .cookie-consent__header h2 {
  flex: 1;
  margin: 0;
  font-family: var(--font-body, sans-serif);
  font-size: 1.5rem;
  line-height: 1.3;
  letter-spacing: 0;
}
.cookie-consent__close {
  min-width: 60px;
  min-height: 44px;
  padding: 8px;
  border: 1px solid #c9a99b;
  border-radius: 6px;
  background: transparent;
  color: #fff;
  cursor: pointer;
}
.cookie-consent__close:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

/* Keep the first-visit privacy choice out of document flow so its deferred insertion cannot shift the page. */
.cookie-notice {
  --tk-type-body: 1rem;
  --tk-type-small: .875rem;
  position: fixed;
  z-index: 9998;
  left: 16px;
  right: 16px;
  bottom: 16px;
  width: min(1160px, calc(100% - 32px));
  margin-inline: auto;
  border: 1px solid #c9c5bf;
  border-radius: 14px;
  background: #f4f2ed;
  color: #302d29;
  box-shadow: 0 16px 40px rgba(23,23,23,.16);
}
.cookie-notice__inner {
  display: flex;
  align-items: center;
  gap: 16px 24px;
  width: 100%;
  margin-inline: auto;
  padding: 14px 16px;
}
html body .cookie-notice p { flex: 1; margin: 0; color: #302d29; line-height: 1.6; }
.cookie-notice__actions { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.cookie-notice .cookie-consent__button--secondary { background: #fff; color: #242424; border-color: #77716a; }
.cookie-notice__settings { min-height: 44px; padding: 8px; border: 0; background: transparent; color: #a32d0c; text-decoration: underline; cursor: pointer; }
.cookie-notice button:focus-visible { outline: 3px solid #242424; outline-offset: 3px; }

.cookie-consent__eyebrow {
  margin: 0 0 7px;
  color: #ff7041;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.cookie-consent h2 {
  margin: 0 0 9px;
  color: #fff;
  font-size: clamp(1.3rem, 2.2vw, 1.6rem);
  line-height: 1.12;
  text-wrap: balance;
}

.cookie-consent p {
  margin: 0;
  color: #f0e4df;
  font-size: 0.95rem;
  line-height: 1.5;
}

.cookie-consent__status {
  margin-top: 10px !important;
  color: #c9b4aa !important;
  font-size: 0.8rem !important;
}

.cookie-consent__actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px;
  margin-top: 15px;
}

.cookie-consent__button {
  min-height: 44px;
  padding: 10px 14px;
  border: 1px solid transparent;
  border-radius: 11px;
  font: inherit;
  font-size: 0.92rem;
  font-weight: 850;
  line-height: 1.25;
  cursor: pointer;
}

.cookie-consent__button--primary {
  border-color: #ff7041;
  background: #ff7041;
  color: #171717;
}

.cookie-consent__button--secondary {
  border-color: #c9a99b;
  background: transparent;
  color: #fff;
}

.cookie-consent__button:hover {
  transform: translateY(-1px);
}

.cookie-consent__button:focus-visible,
.cookie-consent__policy:focus-visible,
.cookie-settings-link:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

.cookie-consent__policy {
  display: inline-block;
  margin-top: 13px;
  color: #ffb099;
  font-size: 0.9rem;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.footer__links .cookie-settings-link {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.legalCard p button[data-cookie-settings] {
  appearance: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.cookie-settings-card {
  border-color: rgba(255,112,65,.45);
}

.cookie-settings-card button {
  min-height: 44px;
  margin-top: 8px;
  padding: 10px 15px;
  border: 1px solid #c9a99b;
  border-radius: 10px;
  background: #222222;
  color: #fff;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
}

@media (max-width: 560px) {
  .cookie-consent {
    inset: 0;
    width: calc(100% - 24px);
    max-height: calc(100dvh - 24px);
    padding: 16px;
    border-radius: 16px;
  }

  .cookie-consent h2 {
    font-size: clamp(1.2rem, 6vw, 1.45rem);
  }

  .cookie-consent p {
    font-size: 0.91rem;
    line-height: 1.46;
  }

  .cookie-consent__actions {
    grid-template-columns: 1fr;
    gap: 8px;
    margin-top: 13px;
  }

  .cookie-consent__button {
    width: 100%;
    min-height: 44px;
    padding: 10px 12px;
  }

  .cookie-consent__policy {
    margin-top: 11px;
  }
}

@media (max-width: 390px) {
  .cookie-consent {
    padding: 14px;
  }

  .cookie-consent__eyebrow {
    font-size: 0.68rem;
  }

  .cookie-consent h2 {
    font-size: 1.18rem;
  }

  .cookie-consent p {
    font-size: 0.88rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cookie-consent__button:hover {
    transform: none;
  }
}

@media (max-width: 900px) {
  .cookie-notice { left: 10px; right: 10px; bottom: 10px; width: calc(100% - 20px); }
  .cookie-notice__inner { flex-direction: column; align-items: stretch; padding: 12px; }
  .cookie-notice__actions { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .cookie-notice__settings { grid-column: 1 / -1; justify-self: start; }
}

/* First-visit mobile consent: keep both choices visible without obscuring the quote CTA.
   Uses only presentation changes; no consent state or tracking behaviour is changed. */
@media (max-width: 900px) {
  .cookie-notice {
    bottom: max(8px, env(safe-area-inset-bottom, 0px));
    left: 10px;
    right: 10px;
    width: calc(100% - 20px);
    border-radius: 12px;
  }
  .cookie-notice__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  html body .cookie-notice p {
    font-size: 0.875rem;
    line-height: 1.35;
    letter-spacing: 0;
  }
  .cookie-notice__actions {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 6px;
    align-items: stretch;
    width: 100%;
  }
  .cookie-notice .cookie-consent__button {
    min-width: 0;
    min-height: 44px;
    padding: 7px 5px;
    border-radius: 8px;
    font-size: 0.82rem;
    line-height: 1.2;
  }
  .cookie-notice__settings {
    grid-column: 1 / -1;
    min-height: 40px;
    padding: 5px 0;
    justify-self: start;
    font-size: 0.82rem;
  }
}
