/*
 * Odoom cookie consent — Morzine Bus.
 *
 * ────────────────────────────────────────────────────────────────────────────
 * EVERY COLOUR AND SIZE HERE IS DECLARED, NEVER INHERITED
 * ────────────────────────────────────────────────────────────────────────────
 *
 * The banner is injected into somebody else's document, so anything it does not state
 * for itself is decided by the host page's stylesheet. On this site that was not
 * theoretical: `.cc-banner__title` is an <h2>, morzine-bus.webflow.css sets
 * `h2 { color: var(--title) }` with `--title: black`, and the title rendered BLACK ON THE
 * NEAR-BLACK BANNER — invisible, while every other element looked fine.
 *
 * The same trap is waiting on any site whose headings are dark, so the rule is: state the
 * colour, the font-size, the line-height, the margin and the font-family on every element
 * this component owns. `font: inherit` on the buttons is the one deliberate exception —
 * matching the host's typeface is the point there.
 *
 * ────────────────────────────────────────────────────────────────────────────
 * SIZE
 * ────────────────────────────────────────────────────────────────────────────
 *
 * A consent banner is an interruption, and the honest thing is to make it small enough to
 * read past. On wide screens the copy and the buttons sit on ONE ROW, which takes the
 * banner from 210px of viewport height to roughly 90px. It stacks below 860px, where a
 * row would wrap into something worse than a stack.
 */

.cc-banner,
.cc-banner *,
.cc-modal-overlay,
.cc-modal-overlay * {
  box-sizing: border-box;
}

/* ── the bar ──────────────────────────────────────────────────────────────── */

.cc-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 99999;
  padding: 12px;
  pointer-events: none;
}

.cc-banner__inner {
  pointer-events: auto;
  display: flex;
  align-items: center;
  gap: 18px;
  max-width: 880px;
  margin: 0 auto;
  padding: 14px 18px;
  border-radius: 12px;
  background: #111827;
  color: #f9fafb;
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.3);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-family: inherit;
}

.cc-banner__copy {
  flex: 1 1 auto;
  min-width: 0;
}

/* Declared, not inherited — see the note at the top of this file. */
.cc-banner__title {
  margin: 0 0 3px;
  padding: 0;
  color: #ffffff;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0;
  text-transform: none;
}

.cc-banner__text {
  margin: 0;
  padding: 0;
  color: #cbd5e1;
  font-family: inherit;
  font-size: 13px;
  font-weight: 400;
  line-height: 1.5;
}

.cc-banner__text a {
  color: #ffffff;
  font-size: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.cc-banner__text a:hover {
  color: #ffffff;
  text-decoration: underline;
}

.cc-banner__actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── buttons ──────────────────────────────────────────────────────────────── */

.cc-btn {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 9px 15px;
  margin: 0;
  font: inherit;             /* deliberate: the host's typeface */
  font-size: 13px;
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.cc-btn--primary {
  background: var(--cc-accent, #2563eb);
  color: #fff;
}

.cc-btn--primary:hover {
  filter: brightness(1.15);
}

/*
 * "Reject" and "Manage" must not read as less available than "Accept". A refusal that is
 * harder to find than a consent is not a free choice, and under GDPR/PECR it is not a
 * valid one either — so these differ from the primary in colour only, never in size or
 * prominence.
 */
.cc-btn--secondary {
  background: transparent;
  color: #f9fafb;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.cc-btn--secondary:hover {
  border-color: rgba(255, 255, 255, 0.6);
}

/* ── preferences modal ────────────────────────────────────────────────────── */

.cc-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(17, 24, 39, 0.72);
}

.cc-modal-overlay.is-open {
  display: flex;
}

.cc-modal {
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 22px;
  border-radius: 14px;
  background: #fff;
  color: #111827;
  font-family: inherit;
}

.cc-modal h2 {
  margin: 0 0 6px;
  padding: 0;
  color: #111827;
  font-family: inherit;
  font-size: 19px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: 0;
  text-transform: none;
}

.cc-modal p {
  margin: 0 0 16px;
  padding: 0;
  color: #4b5563;
  font-family: inherit;
  font-size: 13.5px;
  line-height: 1.5;
}

.cc-preference {
  display: flex;
  gap: 14px;
  justify-content: space-between;
  align-items: flex-start;
  padding: 13px 0;
  border-top: 1px solid #e5e7eb;
}

.cc-preference:last-of-type {
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 16px;
}

.cc-preference__title {
  margin: 0 0 3px;
  padding: 0;
  color: #111827;
  font-family: inherit;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
}

.cc-preference__desc {
  margin: 0;
  padding: 0;
  color: #6b7280;
  font-family: inherit;
  font-size: 12.5px;
  line-height: 1.45;
}

.cc-toggle {
  position: relative;
  width: 44px;
  height: 25px;
  flex: 0 0 44px;
}

.cc-toggle input {
  opacity: 0;
  width: 0;
  height: 0;
}

.cc-toggle span {
  position: absolute;
  inset: 0;
  border-radius: 999px;
  background: #d1d5db;
  transition: background 0.2s ease;
}

.cc-toggle span::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 3px;
  width: 19px;
  height: 19px;
  border-radius: 50%;
  background: #fff;
  transition: transform 0.2s ease;
}

.cc-toggle input:checked + span {
  background: var(--cc-accent, #2563eb);
}

.cc-toggle input:checked + span::after {
  transform: translateX(19px);
}

.cc-toggle input:disabled + span {
  opacity: 0.65;
}

.cc-modal__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

/* ── the persistent reopen button ─────────────────────────────────────────── */

.cc-settings-link {
  cursor: pointer;
  text-decoration: underline;
}

/*
 * Bottom LEFT on purpose. The right-hand corner is where chat widgets and back-to-top
 * controls land, and this is the one control a visitor may need months after they last
 * thought about it — so it goes where nothing else competes for the corner.
 */
.cc-settings-fab {
  position: fixed;
  left: 14px;
  bottom: 14px;
  z-index: 99998;
  border: 1px solid #e6e6e6;
  border-radius: 999px;
  padding: 7px 12px;
  margin: 0;
  font: inherit;
  font-size: 12px;
  font-weight: 600;
  line-height: 1.2;
  color: #374151;
  background: #fff;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
  cursor: pointer;
}

.cc-settings-fab:hover {
  color: #111827;
  border-color: #d3d3d3;
}

/* ── narrow screens ───────────────────────────────────────────────────────── */

/*
 * 860px, not 640px. The break is set by the point at which the copy and three buttons
 * stop fitting on one row, which happens well above the usual mobile breakpoint —
 * leaving it at 640 gives tablets a squashed row rather than a clean stack.
 */
@media screen and (max-width: 860px) {
  .cc-banner__inner {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    padding: 14px 16px;
  }

  .cc-banner__actions {
    flex-wrap: wrap;
  }

  .cc-btn {
    flex: 1 1 auto;
  }
}

/*
 * Phones.
 *
 * Three full-width buttons stacked took 32% of a 375x812 screen — a third of the page
 * spent on a dialogue nobody came for. Two per row halves that.
 *
 * `white-space` has to go back to normal here: the labels are kept long deliberately
 * ("Reject non-essential" says what it does, where "Reject" alone does not), and at this
 * width nowrap would push them past the button edge rather than let them use two lines.
 */
@media screen and (max-width: 560px) {
  .cc-banner {
    padding: 8px;
  }

  .cc-banner__inner {
    gap: 10px;
    padding: 12px 14px;
  }

  .cc-banner__text {
    font-size: 12.5px;
  }

  .cc-banner__actions {
    gap: 6px;
  }

  .cc-btn {
    flex: 1 1 calc(50% - 3px);
    min-width: 0;
    padding: 9px 10px;
    font-size: 12.5px;
    white-space: normal;
  }
}
