/*
 * Simple Closure Cookie Consent — banner styles
 *
 * Plain CSS: edit, save, upload. No build step.
 * Colours use the theme's Bootstrap variables, with fallbacks so the banner
 * still looks right with any theme.
 *
 * Layout: a card at the bottom-left on desktop, a compact full-width bar at the bottom on mobile.
 * "Accept all" and "Reject all" are deliberately identical: UK guidance expects
 * rejecting to be as easy and as prominent as accepting.
 */

.sc-consent {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 1000000; /* above the floating WhatsApp button and the mobile quote bar */
  padding: 0;
  font-family: var(--bs-body-font-family, system-ui, sans-serif);
  font-size: 0.95rem;
  line-height: 1.45;
  color: var(--bs-body-color, #212529);
}

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

.sc-consent__box {
  background: #fff;
  border-top: 4px solid var(--bs-primary, #22babb);
  box-shadow: 0 -0.25rem 1.5rem rgba(0, 0, 0, 0.18);
  padding: 1rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px));
  max-height: 85vh;
  overflow-y: auto;
}

/* Desktop: a card in the bottom-left corner */
@media (min-width: 768px) {
  .sc-consent {
    left: 1.25rem;
    right: auto;
    bottom: 1.25rem;
    max-width: 34rem;
  }

  .sc-consent__box {
    border-top: 0;
    border: 3px solid var(--bs-primary, #22babb);
    border-radius: 1em;
    padding: 1.25rem 1.5rem;
  }
}

.sc-consent__title {
  margin: 0 0 0.35rem;
  font-family: "Georama", var(--bs-body-font-family, sans-serif);
  font-weight: 600;
  font-size: 1.15rem;
  color: var(--bs-primary, #22babb);
}

.sc-consent__text {
  margin: 0 0 0.85rem;
}

.sc-consent__text a {
  color: var(--bs-dark, #379fa3);
  font-weight: 600;
}

/* Preference toggles */
.sc-consent__prefs {
  margin: 0 0 0.85rem;
  padding: 0.75rem;
  background: var(--bs-info, #d2f8ee);
  border-radius: 0.5rem;
}

.sc-consent__prefs[hidden] {
  display: none;
}

.sc-consent__option {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0 0 0.6rem;
  cursor: pointer;
}

.sc-consent__option:last-child {
  margin-bottom: 0;
}

.sc-consent__option input {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.15rem;
  accent-color: var(--bs-primary, #22babb);
}

.sc-consent__option strong {
  display: block;
}

/* Buttons */
.sc-consent__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.sc-consent__btn {
  flex: 1 1 8rem;
  padding: 0.55rem 1rem;
  border: 0;
  border-radius: 0.5rem;
  background: var(--bs-success, #fa7f08);
  color: #fff;
  font-family: "Georama", var(--bs-body-font-family, sans-serif);
  font-weight: 700;
  font-size: 1rem;
  cursor: pointer;
}

.sc-consent__btn:hover {
  filter: brightness(1.08);
}

.sc-consent__btn[hidden],
.sc-consent__link[hidden] {
  display: none;
}

.sc-consent__link {
  flex: 1 0 100%;
  padding: 0.25rem 0;
  border: 0;
  background: none;
  color: var(--bs-dark, #379fa3);
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}

.sc-consent__btn:focus-visible,
.sc-consent__link:focus-visible,
.sc-consent__option input:focus-visible {
  outline: 3px solid var(--bs-dark, #379fa3);
  outline-offset: 2px;
}

/*
 * Mobile: a compact bar rather than a large panel, so the hero and quote form stay visible.
 * The heading is hidden visually but kept for screen readers (the dialog is labelled by it).
 * Reject and Accept stay side by side and identical in size and colour.
 */
@media (max-width: 767.98px) {
  .sc-consent {
    font-size: 0.85rem;
    line-height: 1.35;
  }

  .sc-consent__box {
    border-top-width: 3px;
    padding: 0.65rem 0.85rem calc(0.5rem + env(safe-area-inset-bottom, 0px));
  }

  .sc-consent__title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  .sc-consent__text {
    margin-bottom: 0.55rem;
  }

  .sc-consent__prefs {
    margin-bottom: 0.55rem;
    padding: 0.6rem;
  }

  .sc-consent__actions {
    gap: 0.4rem;
  }

  .sc-consent__btn {
    flex: 1 1 0;
    min-height: 2.75rem; /* comfortable tap target */
    padding: 0.45rem 0.75rem;
    font-size: 0.95rem;
  }

  .sc-consent__link {
    padding: 0.15rem 0 0;
    font-size: 0.8rem;
  }
}

/* Keep the floating WhatsApp button out of the way while the banner is open on mobile */
@media (max-width: 767.98px) {
  .sc-consent-open .whatsapp-icon,
  .sc-consent-open .fixed-bottom {
    visibility: hidden;
  }
}
