/* ==================================================================
   CHECK AVAILABILITY FLOW
   Four steps in one container. Runs on its own page and inside the
   homepage booking section, so nothing here sets a page background or
   section padding: the including page supplies both.

   Every custom property used below exists in base.css. An earlier
   version reached for --fs-h4, --speed and --error, none of which are
   defined in this codebase, so those headings fell back to browser
   defaults and every transition was dropped silently.
================================================================== */

.bk {
  display: block;
  container-type: inline-size;

  --bk-speed:  .18s;
  --bk-red:    #c0392b;
  --bk-red-d:  #a5321f;
  --bk-red-bg: #fdf3f2;
  --bk-tap:    46px;   /* smallest comfortable touch target */
}

/* ---------- the four points above the flow on the homepage ----------
   Carried over from reservation.css. The homepage no longer loads that
   sheet, and without these the list rendered as bare text. */

.bookpoints {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 24px;
  padding: 0;
  list-style: none;
}

.bookpoints li {
  position: relative;
  padding: 12px 16px 12px 40px;
  border-radius: var(--radius-sm);
  background: var(--band);
  font-size: var(--fs-small);
}


.bookpoints__aside {
  margin: 22px 0 0;
  text-align: center;
  font-size: var(--fs-small);
  color: var(--muted);
}

/* ---------- headings ---------- */

.bk-h {
  margin: 0 0 6px;
  font-family: var(--font-display);
  font-size: var(--fs-h4);
  line-height: var(--lh-h3);
  font-weight: var(--w-h2);
  color: var(--ink);
}

.bk-h3 {
  margin: 0 0 12px;
  font-family: var(--font-display);
  font-size: var(--fs-h5);
  line-height: var(--lh-h456);
  color: var(--ink);
}

.bk-sub {
  margin: 0 0 22px;
  max-width: 100%;
  color: var(--muted);
  font-size: var(--fs-small);
  line-height: var(--lh-body);
}

.bk-fine {
  margin: 10px 0 0;
  font-size: var(--fs-micro);
  line-height: 1.5;
  color: var(--muted);
}

/* ---------- step rail ---------- */

.bk-rail {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 20px;
  padding: 0;
  list-style: none;
}

.bk-rail__step {
  display: flex;
  align-items: center;
  gap: 9px;
  min-height: 44px;
  padding: 8px 14px 8px 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--white);
  font-size: var(--fs-small);
  font-weight: var(--w-ui);
  color: var(--muted);
  transition: border-color var(--bk-speed) var(--ease),
              color var(--bk-speed) var(--ease);
}

.bk-rail__num {
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--band);
  color: var(--muted);
  font-size: var(--fs-micro);
  font-weight: 700;
  transition: background var(--bk-speed) var(--ease),
              color var(--bk-speed) var(--ease);
}



.bk-rail__step.is-done .bk-rail__num { background: var(--ink); color: var(--white); }

/* ---------- panels ---------- */

.bk-panel {
  padding: clamp(18px, 3vw, 32px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow);
}

.bk-panel[hidden] { display: none; }

/* ---------- fields ---------- */

.bk-field { margin: 0 0 16px; }

.bk-field label {
  display: block;
  margin-bottom: 6px;
  font-size: var(--fs-micro);
  font-weight: var(--w-ui);
  color: var(--ink);
}

.bk-field input,
.bk-field select,
.bk-field textarea {
  width: 100%;
  min-height: var(--bk-tap);
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
  font: inherit;
  /* Never below 16px. Anything smaller makes iOS Safari zoom the page in
     when the field takes focus, and the guest then has to pinch back out. */
  font-size: var(--fs-body);
  color: var(--ink);
}

.bk-field textarea { min-height: 96px; resize: vertical; }

/* iOS draws its own oversized double chevron on a select, which on a narrow
   phone sits half outside the box. One small chevron at a fixed size instead,
   so the time fields match the date fields beside them. */
.bk-field select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  padding-right: 38px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2358657a' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  background-size: 12px 8px;
}

.bk-field input[type="date"] { -webkit-appearance: none; appearance: none; }

.bk-field input[type="date"]::-webkit-calendar-picker-indicator {
  margin-inline-start: auto;
  cursor: pointer;
}

.bk-field input:focus-visible,
.bk-field select:focus-visible,
.bk-field textarea:focus-visible {
  outline: 2px solid var(--green);
  outline-offset: 1px;
  border-color: var(--green);
}

.bk-dates {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0 14px;
  max-width: 900px;
}

.bk-two {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 14px;
  max-width: 760px;
}

.bk-phone {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: 8px;
}

.bk-phone select { text-overflow: ellipsis; }

/* Reachable by a bot, invisible to a person. Moved off screen rather than
   display none, which some bots check for. */
.bk-hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- buttons ---------- */

.bk-go,
.bk-back,
.bk-pin {
  font: inherit;
  font-size: var(--fs-btn);
  font-weight: 700;
  min-height: 48px;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background var(--bk-speed) var(--ease),
              color var(--bk-speed) var(--ease),
              border-color var(--bk-speed) var(--ease);
}

.bk-go {
  padding: 13px 30px;
  border: 1px solid var(--green);
  background: var(--green);
  color: var(--white);
}

.bk-go:hover:not(:disabled),
.bk-go:focus-visible:not(:disabled) {
  background: var(--green-dark);
  border-color: var(--green-dark);
}

.bk-go:disabled {
  background: var(--line);
  border-color: var(--line);
  color: var(--muted);
  cursor: not-allowed;
}

.bk-back {
  padding: 13px 22px;
  border: 1px solid var(--line);
  background: var(--white);
  color: var(--ink);
}

.bk-back:hover,
.bk-back:focus-visible { background: var(--band); }

.bk-go:focus-visible,
.bk-back:focus-visible,
.bk-pin:focus-visible,
.bk-step:focus-visible,
.bk-extra input:focus-visible,
.bk-check input:focus-visible {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.bk-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  align-items: center;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}

.bk-nav .bk-go { margin-left: auto; }

/* ---------- messages ---------- */

.bk-msg {
  margin: 14px 0 0;
  font-size: var(--fs-small);
  font-weight: var(--w-ui);
}

.bk-msg:empty { margin: 0; }

.bk-msg.is-bad  { color: var(--bk-red); }
.bk-msg.is-good { color: var(--green-dark); }

/* ---------- cart cards ---------- */

.bk-carts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  max-width: 880px;
}

.bk-cart {
  display: flex;
  flex-direction: column;
  border: 2px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--white);
  transition: border-color var(--bk-speed) var(--ease),
              box-shadow var(--bk-speed) var(--ease);
}

.bk-cart:hover { box-shadow: var(--shadow); }

.bk-cart.is-chosen { border-color: var(--green); box-shadow: var(--shadow); }

.bk-cart.is-out { opacity: .6; }

.bk-cart__pic {
  position: relative;
  aspect-ratio: 16 / 10;
  background: var(--band);
}

.bk-cart__pic img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* The discount flag sits on the photo, where the eye lands first and where
   the guest is choosing between the two carts. */
.bk-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 1;
  max-width: calc(100% - 24px);
  padding: 6px 13px;
  border-radius: 999px;
  background: var(--bk-red);
  color: var(--white);
  font-size: var(--fs-micro);
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: .02em;
  text-transform: capitalize;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .22);
}

/* High season is a premium, not a saving, so it must not wear the discount
   colour. */
.bk-badge--high { background: var(--ink); }

.bk-cart__body {
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 4px;
  padding: 18px;
}

.bk-cart__name {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-h5);
  line-height: var(--lh-h456);
  color: var(--ink);
}

.bk-cart__blurb {
  margin: 0 0 10px;
  font-size: var(--fs-small);
  line-height: 1.5;
  color: var(--muted);
}

.bk-cart__rate {
  margin: 12px 0 0;
  font-size: var(--fs-h5);
  line-height: 1.15;
  color: var(--ink);
}

.bk-cart__rate strong { color: var(--green-dark); font-weight: var(--w-h2); }

.bk-cart__rate s {
  margin-right: 5px;
  color: var(--muted);
  font-size: var(--fs-body);
  font-weight: 400;
}

.bk-cart__sub {
  display: block;
  margin-top: 4px;
  font-size: var(--fs-micro);
  font-weight: 400;
  line-height: 1.45;
  color: var(--muted);
}

.bk-cart__total {
  margin: 10px 0 12px;
  font-size: var(--fs-small);
  color: var(--ink);
}

/* ---------- stock line ---------- */

.bk-stock {
  align-self: flex-start;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: var(--fs-micro);
  font-weight: 700;
}

.bk-stock--yes { background: var(--green-soft); color: #10632b; }
.bk-stock--low { background: #fdf5e8;           color: #8a5a12; }
.bk-stock--no  { background: var(--bk-red-bg);  color: var(--bk-red); }
.bk-stock--ask { background: var(--band);       color: var(--muted); }

/* ---------- quantity stepper ----------
   Track widths set on the stepper itself. A sibling stepper elsewhere on
   the site broke because an outer grid rule reached its inner field and
   tore it out of the row, so nothing here inherits sizing from a parent. */

.bk-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: auto;
  padding-top: 14px;
}

.bk-qty__label {
  font-size: var(--fs-small);
  font-weight: var(--w-ui);
  color: var(--muted);
}

.bk-stepper {
  display: inline-grid;
  grid-template-columns: 44px 48px 44px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: var(--white);
}

.bk-step {
  height: var(--bk-tap);
  border: 0;
  background: var(--band);
  color: var(--ink);
  font: inherit;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  cursor: pointer;
  transition: background var(--bk-speed) var(--ease),
              color var(--bk-speed) var(--ease);
}

.bk-step:hover:not(:disabled) { background: var(--green); color: var(--white); }

.bk-step:disabled { color: var(--line); cursor: not-allowed; }

.bk-qty__n {
  text-align: center;
  font-size: var(--fs-body);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

/* ---------- the bill ---------- */

.bk-split {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 26px;
  align-items: start;
  max-width: 980px;
}

.bk-bill__t { width: 100%; border-collapse: collapse; }

.bk-bill__t td {
  padding: 11px 0;
  border-bottom: 1px solid var(--line);
  font-size: var(--fs-small);
  vertical-align: top;
}

.bk-bill__t td:last-child {
  text-align: right;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}

.bk-bill__sub td { font-weight: var(--w-ui); }

.bk-bill__off td { color: var(--bk-red-d); font-weight: 700; }

.bk-bill__tot td {
  padding-top: 14px;
  border-bottom: 0;
  border-top: 2px solid var(--ink);
  font-size: var(--fs-h5);
  font-weight: var(--w-h2);
}

.bk-where {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--band);
}

.bk-live { margin: 4px 0 12px; }

.bk-pin {
  width: 100%;
  padding: 11px 18px;
  border: 1px solid var(--green);
  background: var(--white);
  color: var(--green-dark);
}

.bk-pin:hover,
.bk-pin:focus-visible { background: var(--green); color: var(--white); }

/* ---------- optional extras ---------- */

.bk-extras {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.bk-extra {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  padding: 13px 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color var(--bk-speed) var(--ease),
              background var(--bk-speed) var(--ease);
}

.bk-extra:hover { border-color: var(--green); }

.bk-extra:has(input:checked) {
  border-color: var(--green);
  background: var(--green-soft);
}

.bk-extra input {
  flex: 0 0 auto;
  margin-top: 2px;
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.bk-extra__text { display: block; font-size: var(--fs-small); }

.bk-extra__price { color: var(--green-dark); font-weight: 800; }

.bk-extra__note {
  display: block;
  margin-top: 3px;
  font-size: var(--fs-micro);
  line-height: 1.45;
  color: var(--muted);
}

/* ---------- the saving ---------- */

.bk-save {
  margin: 0 0 14px;
  padding: 8px 12px;
  border-left: 3px solid var(--bk-red);
  border-radius: var(--radius-sm);
  background: var(--bk-red-bg);
  color: var(--bk-red-d);
  font-size: var(--fs-micro);
  font-weight: 700;
}

.bk-save--big { margin: 16px 0 0; padding: 12px 16px; font-size: var(--fs-small); }

/* ---------- checkout ---------- */

.bk-check { margin: 6px 0 18px; font-size: var(--fs-small); }

.bk-check label {
  display: flex;
  gap: 11px;
  align-items: flex-start;
  line-height: 1.5;
  cursor: pointer;
}

.bk-check input {
  flex: 0 0 auto;
  margin-top: 3px;
  width: 20px;
  height: 20px;
  accent-color: var(--green);
}

.bk-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--band);
  font-size: var(--fs-small);
}

.bk-total strong {
  font-size: var(--fs-h5);
  font-weight: var(--w-h2);
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

#bk-stripe { min-height: 460px; }

/* ---------- card form placeholder ---------- */

.bk-skeleton {
  display: grid;
  gap: 14px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--white);
}

.bk-skeleton__label { margin: 0; font-size: var(--fs-small); color: var(--muted); }

.bk-skeleton__bar {
  height: 44px;
  border-radius: var(--radius-sm);
  background: linear-gradient(90deg, var(--band) 25%, #e8eef6 37%, var(--band) 63%);
  background-size: 400% 100%;
  animation: bk-shimmer 1.4s var(--ease) infinite;
}

.bk-skeleton__bar--short { width: 55%; }

@keyframes bk-shimmer {
  from { background-position: 100% 0; }
  to   { background-position: 0 0; }
}

/* ==================================================================
   RESPONSIVE

   Container queries where the flow's own width decides the layout, and
   media queries where the viewport does. The flow sits in a narrower
   column on the homepage than on its own page, so the cards and the
   bill have to respond to their container, not to the screen.
================================================================== */

@container (max-width: 900px) {
  .bk-split { grid-template-columns: 1fr; }
  .bk-carts { grid-template-columns: 1fr; max-width: 560px; }
}

@media (max-width: 900px) {
  .bookpoints { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .bk-split   { grid-template-columns: 1fr; }
  .bk-carts   { grid-template-columns: 1fr; max-width: 560px; }
  .bk-dates   { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .bookpoints { grid-template-columns: 1fr; gap: 8px; }
  .bookpoints li { padding: 10px 14px 10px 36px; }
  .bookpoints li::before { top: 15px; left: 14px; }

  .bk-two { grid-template-columns: 1fr; }

  /* Two rows of two. Four pills on one line at this width truncate their
     labels to a couple of characters. */
  .bk-rail { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 7px; }

  .bk-panel { padding: 18px 16px; }

  .bk-nav { flex-direction: column-reverse; align-items: stretch; }
  .bk-nav .bk-go,
  .bk-nav .bk-back { width: 100%; margin-left: 0; }
}

@media (max-width: 400px) {
  /* One field per row below this. Two date fields side by side on a 360px
     screen leaves each about 150px, narrower than the native date control
     needs, and the calendar icon gets clipped. */
  .bk-dates { grid-template-columns: 1fr; }

  .bk-rail__step { padding: 7px 10px 7px 7px; font-size: var(--fs-micro); }

  .bk-cart__body { padding: 15px; }

  .bk-badge { padding: 5px 10px; font-size: 11.5px; }

  .bk-total { flex-direction: column; align-items: flex-start; gap: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  .bk-skeleton__bar { animation: none; }

  .bk-rail__step,
  .bk-rail__num,
  .bk-cart,
  .bk-step,
  .bk-extra,
  .bk-go,
  .bk-back,
  .bk-pin { transition: none; }
}

/* ---------- room for the fixed mobile action bar ----------
   .callbar is fixed to the bottom on phones and is 64px tall. Only the site
   footer allowed for it, so on the flow the last thing in a panel sat behind
   it: on step 4 that is the Pay and confirm button and the error message
   under the total. Both were unreachable and invisible. */

@media (max-width: 900px) {
  .bk .bk-panel { padding-bottom: calc(var(--callbar-h, 0px) + 20px); }
}

/* Anchored jumps and scrollIntoView must clear the sticky header. */
.bk-panel { scroll-margin-top: 90px; }

/* Step 1's Check-availability button sits directly in the panel, not
   inside .bk-nav, so it has no spacing rule of its own. Give it breathing
   room from the field above and the fine-print note below. */
#bk-check {
  margin-top: 22px;
  margin-bottom: 4px;
}