/*
 * Booking, in two parts:
 *
 *   1. THE SEARCH BAR in the homepage hero, under the two hero buttons. It belongs to the
 *      site. It asks for the journey, date and party and does nothing but hand them to…
 *   2. THE BOOKING PAGE (book.html), which carries the third-party booking widget. The bar
 *      is a plain GET form, so the handover is the address itself:
 *
 *          book.html?from=geneva-airport&to=morzine&date=2026-10-15&passengers=2
 *
 *      The widget's embed script reads those names from the page address and opens on the
 *      prices. Nothing here has to run for that to work.
 *
 * Why two parts rather than the widget in the hero: the widget is an iframe from another
 * origin, so the site cannot see what the visitor chose in it, and its later steps
 * (vehicles, passenger details, payment, confirmation) need a page of their own rather
 * than a hero that keeps stretching.
 */

/* ──────────────────────────────────────────────────────────────────────────────
 * The hero that carries the bar
 * ──────────────────────────────────────────────────────────────────────────────
 *
 * The Webflow hero is a fixed-height picture (750px) with its text laid over it by
 * `position: absolute`. Absolutely positioned content does not push anything, and on a
 * phone the bar stacks into a column taller than the space under the buttons — it would
 * run over the next section. So on this hero (`.hero--booking`, added by the build) the
 * text and bar are in normal flow and decide the height, and the picture is stretched
 * behind them. The hero is never shorter than it was.
 *
 * Every other page's hero is untouched — these rules all hang off `.hero--booking`.
 */

.hero--booking .hero-wrapper {
  align-items: flex-start;
  min-height: 750px;             /* the picture's old fixed height, now a floor */
}

.hero--booking .hero-img {
  position: absolute;
  inset: 0;
}

.hero--booking .hero-image {
  display: block;
  height: 100%;
  min-height: 0;
  max-height: none;
}

/* The old `top: 170px` offset becomes padding, so it still clears the same distance. */
.hero--booking .hero-top {
  position: relative;
  inset: auto;
  z-index: 1;
  width: 100%;
  padding-top: 170px;
  padding-bottom: 70px;
}

/*
 * The first section after the hero carries the Webflow `margin-top: -128px`, meant to pull
 * it up over a fixed-height picture. Over a hero whose height is set by its content, that
 * lands on the bar. Scoped to the homepage hero on purpose: the destination pages keep
 * their intended `.service-section` → `.about` overlap.
 */
.hero--booking + .page-data > .about:first-child {
  margin-top: 0;
}

/* ──────────────────────────────────────────────────────────────────────────────
 * The search bar
 * ──────────────────────────────────────────────────────────────────────────────
 * One row on a desktop: From · To · Date · Return · Passengers · button, as wide as `.container`
 * so its edges sit on the edges of the sections further down the page.
 */

.booking-bar {
  --bar-blue: #3072bd;           /* the booking widget's own brand colour, so the button
                                    here and the page it leads to read as one thing */
  --bar-line: #dcdfe5;
  --bar-ink: #18181b;
  --bar-muted: #6b7280;

  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, 1fr) auto auto;
  align-items: stretch;
  width: 100%;
  margin-top: 40px;
  padding: 6px;
  background: #fff;
  border: 1px solid var(--bar-line);
  border-radius: 46px;
  box-shadow: 0 18px 50px rgba(8, 35, 79, 0.18);
  color: var(--bar-ink);
  text-align: left;
  scroll-margin-top: 130px;      /* "Book Now" jumps here; keep it clear of the nav */
}

.booking-bar__cell {
  position: relative;
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr);
  grid-template-rows: auto auto;
  column-gap: 14px;
  align-items: center;
  min-height: 64px;
  margin: 0;                     /* Webflow gives <label> a bottom margin */
  padding: 8px 22px 8px 26px;
  border-left: 1px solid var(--bar-line);
  font-weight: 400;
  cursor: pointer;
}

.booking-bar__cell:first-child {
  border-left: 0;
}

.booking-bar__icon {
  grid-row: 1 / span 2;
  width: 20px;
  height: 20px;
  color: var(--bar-muted);
}

.booking-bar__label {
  align-self: end;
  color: var(--bar-muted);
  font-size: 13px;
  line-height: 1.3;
}

.booking-bar__value {
  align-self: start;
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: var(--bar-ink);
  font: inherit;
  font-size: 17px;
  font-weight: 600;
  line-height: 1.35;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

/*
 * A date field with nothing in it shows its format hint; that reads as a placeholder.
 * `:invalid` covers the required outbound date with no script; `.is-empty` is set by
 * booking-bar.js and also covers the return date, which is optional and so never invalid.
 */
.booking-bar__value[type="date"]:invalid,
.booking-bar__value.is-empty {
  color: var(--bar-muted);
  font-weight: 500;
}

.booking-bar__optional {
  font-size: 12px;
  opacity: 0.8;
}

.booking-bar__value:focus {
  outline: none;
}

/* The focus ring goes on the whole cell: the field inside it has no edges of its own. */
.booking-bar__cell:focus-within {
  border-radius: 40px;
  box-shadow: inset 0 0 0 2px var(--bar-blue);
}

/* Swap sits on the line between From and To, without taking a column of its own. */
.booking-bar__swap {
  position: absolute;
  top: 50%;
  right: -17px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  padding: 0;
  border: 1px solid var(--bar-line);
  border-radius: 50%;
  background: #fff;
  color: var(--bar-muted);
  cursor: pointer;
  transform: translateY(-50%);
  transition: color 150ms ease, border-color 150ms ease;
}

.booking-bar__swap:hover {
  border-color: var(--bar-blue);
  color: var(--bar-blue);
}

.booking-bar__swap svg {
  width: 16px;
  height: 16px;
}

/* The cell after the swap button gives it room, so its icon is not crowded. */
.booking-bar__cell--to {
  padding-left: 34px;
}

.booking-bar__passengers {
  grid-template-columns: auto;
  cursor: default;
}

.booking-bar__stepper {
  display: flex;
  align-items: center;
  gap: 6px;
}

.booking-bar__step {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 1.5px solid var(--bar-ink);
  border-radius: 50%;
  background: transparent;
  color: var(--bar-ink);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.booking-bar__step:disabled {
  border-color: var(--bar-line);
  color: var(--bar-line);
  cursor: default;
}

.booking-bar__count {
  width: 38px;
  text-align: center;
  cursor: text;
  -moz-appearance: textfield;
}

.booking-bar__count::-webkit-outer-spin-button,
.booking-bar__count::-webkit-inner-spin-button {
  margin: 0;
  -webkit-appearance: none;
}

.booking-bar__submit {
  align-self: stretch;
  min-height: 64px;
  padding: 0 34px;
  border: 0;
  border-radius: 40px;
  background: var(--bar-blue);
  color: #fff;
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 150ms ease, transform 120ms ease;
}

.booking-bar__submit:hover {
  background: #2862a6;
}

.booking-bar__submit:active {
  transform: scale(0.98);
}

.booking-bar__swap:focus-visible,
.booking-bar__step:focus-visible,
.booking-bar__submit:focus-visible {
  outline: 2px solid var(--bar-blue);
  outline-offset: 2px;
}

/* ──────────────────────────────────────────────────────────────────────────────
 * The booking page
 * ──────────────────────────────────────────────────────────────────────────────
 * The widget brings its whole design; this only gives it the page's measure and holds
 * its place while it loads.
 */

.booking-embed__inner {
  /*
   * RESERVED HEIGHT, so the page does not jump when the embed loads. The script is async
   * and stamps a 640px floor on its own iframe, so that is the height to hold for it.
   */
  min-height: 640px;
}

/*
 * Hide the fallback the moment the widget actually arrives.
 *
 * Without this the page reads "Loading the booking form…" directly above a fully loaded
 * booking form — which is worse than having no fallback at all, because it tells the
 * visitor something is broken while they are looking at the working thing.
 *
 * `:has()` rather than a script: the widget is third-party and gives us no load callback,
 * so the only reliable signal is "an iframe now exists in here". Browsers without :has()
 * simply keep showing the fallback text above the form — visually untidy, never broken.
 */
.booking-embed__inner:has(iframe) .booking-embed__fallback {
  display: none;
}

/* A visible fallback if the third-party script never loads — better than an empty gap. */
.booking-embed__fallback {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 360px;
  text-align: center;
  color: #656565;
  font-size: 15px;
  line-height: 1.5;
}

.booking-embed__fallback a {
  color: var(--primary, #08234f);
  font-weight: 600;
}

/* ──────────────────────────────────────────────────────────────────────────────
 * Narrower screens. The hero figures mirror the Webflow hero's own breakpoints.
 * ────────────────────────────────────────────────────────────────────────────── */

@media screen and (max-width: 1150px) {
  /* Three rows of two: the journey, the two dates, then the party beside the button. */
  .booking-bar {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    border-radius: 28px;
  }

  .booking-bar__cell--from,
  .booking-bar__cell--to,
  .booking-bar__cell--date,
  .booking-bar__cell--return {
    border-bottom: 1px solid var(--bar-line);
  }

  .booking-bar__cell--date,
  .booking-bar__passengers {
    border-left: 0;
  }

  .booking-bar__submit {
    margin: 6px 0 0 6px;
    border-radius: 22px;
  }

  .booking-bar__cell:focus-within {
    border-radius: 22px;
  }
}

@media screen and (max-width: 991px) {
  .hero--booking .hero-wrapper {
    min-height: 520px;
  }

  .hero--booking .hero-top {
    padding-top: 80px;
    padding-bottom: 50px;
  }

  .booking-bar {
    margin-top: 30px;
  }
}

@media screen and (max-width: 767px) {
  .hero--booking .hero-wrapper {
    min-height: 480px;
  }

  .hero--booking .hero-top {
    padding-top: 60px;
    padding-bottom: 40px;
  }

  /* One column: every field a full-width row, the button last. */
  .booking-bar {
    grid-template-columns: minmax(0, 1fr);
    margin-top: 25px;
    padding: 6px;
    border-radius: 22px;
  }

  .booking-bar__cell,
  .booking-bar__cell--to {
    grid-column: auto;
    min-height: 60px;
    padding: 8px 18px;
    border-left: 0;
    border-bottom: 1px solid var(--bar-line);
  }

  .booking-bar__cell:focus-within {
    border-radius: 16px;
  }

  /* On the line between the From and To rows now, at the right-hand end. */
  .booking-bar__swap {
    top: auto;
    right: 16px;
    bottom: -17px;
    transform: rotate(90deg);
  }

  /* Fingers, not a pointer: the stepper buttons get a proper target. */
  .booking-bar__step {
    width: 36px;
    height: 36px;
  }

  .booking-bar__value {
    font-size: 16px;             /* below 16px, iOS zooms the page when a field is focused */
  }

  .booking-bar__submit {
    min-height: 54px;
    margin: 6px 0 0;
    border-radius: 16px;
  }
}
