/* Cookie consent — bottom bar (not a popup) */

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

.cookie-consent {
  position: fixed;
  inset-inline: 0;
  bottom: 0;
  z-index: 12000;
  margin: 0;
  padding: 0;
  background: #1a2422;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  box-shadow: 0 -8px 28px rgba(26, 36, 34, 0.18);
}

.cookie-consent__inner {
  max-width: var(--layout-max, 1120px);
  margin-inline: auto;
  display: grid;
  gap: 0.75rem;
  padding: 0.85rem var(--layout-gutter, 1.25rem) calc(0.85rem + env(safe-area-inset-bottom, 0px));
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.cookie-consent__title {
  margin: 0 0 0.25rem;
  font-family: DM Sans, system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
}

.cookie-consent__text,
.cookie-consent__policy {
  margin: 0;
  font-family: DM Sans, system-ui, sans-serif;
  font-size: 0.8125rem;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}

.cookie-consent__policy {
  margin-top: 0.35rem;
}

.cookie-consent__policy a {
  color: #9fd9d1;
  text-decoration: underline;
  text-underline-offset: 0.15em;
}

.cookie-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.cookie-consent__btn {
  appearance: none;
  border: 1px solid transparent;
  border-radius: 999px;
  padding: 0.5rem 0.85rem;
  font-family: DM Sans, system-ui, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}

.cookie-consent__btn--primary {
  background: #2d9688;
  color: #fff;
}

.cookie-consent__btn--secondary {
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.18);
}

.cookie-consent__btn--ghost {
  background: transparent;
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 255, 255, 0.28);
}

/* Mobile: stacked, large tap targets — Accept first and obvious */
@media (max-width: 767px) {
  .cookie-consent__inner {
    gap: 1rem;
    padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  }

  .cookie-consent__title {
    font-size: 0.875rem;
  }

  .cookie-consent__text,
  .cookie-consent__policy {
    font-size: 0.875rem;
    line-height: 1.5;
  }

  .cookie-consent__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
    width: 100%;
  }

  .cookie-consent__btn {
    width: 100%;
    min-height: 2.75rem;
    padding: 0.85rem 1rem;
    font-size: 0.9375rem;
    border-radius: 0;
    text-align: center;
  }

  .cookie-consent__btn--primary {
    order: -1;
    box-shadow: 0 4px 14px rgba(45, 150, 136, 0.35);
  }

  .cookie-consent__btn--secondary,
  .cookie-consent__btn--ghost {
    background: rgba(255, 255, 255, 0.08);
  }

  .cookie-consent-modal {
    padding: 0.75rem;
    align-items: end;
  }

  .cookie-consent-modal__panel {
    width: 100%;
    max-height: min(88vh, 36rem);
    padding: 1.15rem 1rem calc(1.15rem + env(safe-area-inset-bottom, 0px));
    border-radius: 0.75rem 0.75rem 0 0;
  }

  .cookie-consent-modal__actions {
    display: grid;
    grid-template-columns: 1fr;
    gap: 0.65rem;
  }

  .cookie-consent-modal__actions .cookie-consent__btn {
    width: 100%;
    min-height: 2.75rem;
    border-radius: 0;
  }

  html.cookie-consent-banner-visible .wa-fab {
    bottom: calc(16.5rem + env(safe-area-inset-bottom, 0px));
  }

  html.cookie-consent-banner-visible .wa-panel {
    bottom: calc(21.5rem + env(safe-area-inset-bottom, 0px));
  }
}

/* Preferences dialog — only when Manage choices is opened */
.cookie-consent-modal {
  position: fixed;
  inset: 0;
  z-index: 12010;
  display: grid;
  place-items: center;
  padding: 1rem;
}

.cookie-consent-modal__backdrop {
  position: absolute;
  inset: 0;
  border: 0;
  background: rgba(26, 36, 34, 0.5);
  cursor: pointer;
}

.cookie-consent-modal__panel {
  position: relative;
  width: min(100%, 34rem);
  max-height: calc(100vh - 2rem);
  overflow: auto;
  padding: 1.35rem;
  border-radius: 0.75rem;
  background: var(--cream-bright, #fff);
  box-shadow: var(--shadow-lg, 0 24px 56px rgba(26, 36, 34, 0.14));
}

.cookie-consent-modal__title {
  margin: 0 0 0.5rem;
  font-family: Cormorant Garamond, Georgia, serif;
  font-size: 1.65rem;
  font-weight: 600;
  color: var(--ink, #1a2422);
}

.cookie-consent-modal__intro {
  margin: 0 0 1rem;
  font-family: DM Sans, system-ui, sans-serif;
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-soft, #506560);
}

.cookie-consent__toggle {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.85rem 0;
  border-top: 1px solid var(--border, rgba(45, 150, 136, 0.15));
  cursor: pointer;
}

.cookie-consent__toggle-meta {
  display: grid;
  gap: 0.25rem;
}

.cookie-consent__toggle-meta strong {
  font-family: DM Sans, system-ui, sans-serif;
  font-size: 0.95rem;
  color: var(--ink, #1a2422);
}

.cookie-consent__toggle-desc {
  font-family: DM Sans, system-ui, sans-serif;
  font-size: 0.875rem;
  line-height: 1.45;
  color: var(--ink-soft, #506560);
}

.cookie-consent__toggle-input {
  width: 1.1rem;
  height: 1.1rem;
  margin-top: 0.2rem;
  accent-color: var(--amber, #2d9688);
}

.cookie-consent-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1rem;
}

.cookie-consent-modal .cookie-consent__btn--ghost {
  color: var(--ink-mid, #2d3d3a);
  border-color: var(--border-mid, rgba(45, 150, 136, 0.25));
}

.footer-cookie-settings {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.15em;
  cursor: pointer;
}

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

/* Keep WhatsApp FAB above the cookie bar */
html.cookie-consent-banner-visible .wa-fab {
  bottom: calc(9.5rem + env(safe-area-inset-bottom, 0px));
}

html.cookie-consent-banner-visible .wa-panel {
  bottom: calc(14.5rem + env(safe-area-inset-bottom, 0px));
}

@media (min-width: 768px) {
  .cookie-consent__inner {
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
  }

  .cookie-consent__actions {
    justify-content: flex-end;
    flex-shrink: 0;
  }

  html.cookie-consent-banner-visible .wa-fab {
    bottom: calc(6.5rem + env(safe-area-inset-bottom, 0px));
  }

  html.cookie-consent-banner-visible .wa-panel {
    bottom: calc(11.5rem + env(safe-area-inset-bottom, 0px));
  }
}
