/*
 * Booking calendar styles. Colours and fonts come from shared/tokens.css once it exists;
 * the fallbacks below keep the widget usable on its own.
 */
.bk {
  container: bk / inline-size;
  --bk-bg: var(--color-surface, #fbf9f4);
  --bk-ink: var(--color-ink, #24221e);
  --bk-muted: var(--color-muted, #5c574d);
  --bk-line: var(--color-line, #d6cfc1);
  --bk-soft: var(--color-ground, #efeae0);
  --bk-accent: var(--color-accent, #2b4c9b);
  --bk-accent-ink: var(--color-accent-ink, #ffffff);
  --bk-error: var(--color-error, #a3261b);
  --bk-radius: var(--radius-sm, 6px);
  --bk-gap: var(--space-4, 16px);

  display: grid;
  gap: calc(var(--bk-gap) * 1.5);
  color: var(--bk-ink);
  background: var(--bk-bg);
  border: 1px solid var(--bk-line);
  border-radius: var(--radius-md, 10px);
  padding: clamp(16px, 4vw, 32px);
  font-size: 1rem;
  line-height: 1.5;
  min-width: 0;
}
.bk *, .bk *::before, .bk *::after { box-sizing: border-box; }
.bk [hidden] { display: none !important; }

.bk-suggest-box { display: grid; gap: 10px; }
.bk-suggest { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
@container bk (min-width: 520px) { .bk-suggest { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.bk .bk-sug {
  display: grid;
  gap: 2px;
  min-height: 64px;
  padding: 10px 8px;
  border: 1px solid var(--bk-line);
  border-radius: var(--bk-radius);
  background: #fff;
  text-align: center;
  transition: border-color 120ms ease, background-color 120ms ease, transform 80ms ease;
}
.bk-sug-day { font-size: 0.9375rem; color: var(--bk-muted); }
.bk-sug-time { font-size: 1.125rem; font-weight: 600; font-variant-numeric: tabular-nums; }
.bk .bk-sug:hover { border-color: var(--bk-accent); }
.bk .bk-sug:active { transform: translateY(1px); }
.bk .bk-sug.is-selected { background: var(--bk-accent); border-color: var(--bk-accent); color: var(--bk-accent-ink); }
.bk .bk-sug.is-selected .bk-sug-day { color: inherit; }
.bk .bk-more {
  justify-self: start;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--bk-accent);
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bk-pickers { display: grid; gap: calc(var(--bk-gap) * 1.5); min-width: 0; }
@container bk (min-width: 660px) {
  .bk-pickers { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: start; }
}
.bk-col { min-width: 0; }

.bk-step {
  margin: 0 0 12px;
  font: inherit;
  font-weight: 600;
  font-size: 1.0625rem;
}
.bk-month { margin: 0 0 8px; color: var(--bk-muted); font-size: 0.9375rem; }

.bk-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 4px; }
.bk-dow { text-align: center; font-size: 0.8125rem; color: var(--bk-muted); padding-bottom: 2px; }

.bk button { font: inherit; color: inherit; cursor: pointer; -webkit-tap-highlight-color: transparent; }
.bk button:focus-visible, .bk a:focus-visible, .bk input:focus-visible, .bk textarea:focus-visible {
  outline: 3px solid var(--bk-accent);
  outline-offset: 2px;
}

.bk-day, .bk-time {
  min-height: 44px;
  border: 1px solid var(--bk-line);
  border-radius: var(--bk-radius);
  background: #fff;
  font-variant-numeric: tabular-nums;
  transition: border-color 120ms ease, background-color 120ms ease, transform 80ms ease;
}
.bk-day { aspect-ratio: 1 / 1; min-height: 44px; padding: 0; font-weight: 600; }
.bk-day--off { background: transparent; border-color: transparent; color: var(--bk-muted); font-weight: 400; cursor: default; opacity: 0.45; text-decoration: line-through; }
.bk-day--out { opacity: 0.25; }
.bk-day:not(:disabled):hover, .bk-time:hover { border-color: var(--bk-accent); }
.bk-day:not(:disabled):active, .bk-time:active { transform: translateY(1px); }
.bk-day.is-selected, .bk-time.is-selected {
  background: var(--bk-accent);
  border-color: var(--bk-accent);
  color: var(--bk-accent-ink);
}

.bk-times { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.bk-time { padding: 8px 4px; font-weight: 500; }
.bk-times .bk-note { grid-column: 1 / -1; }

.bk-form { display: grid; gap: 14px; border-top: 1px solid var(--bk-line); padding-top: calc(var(--bk-gap) * 1.5); }
@container bk (min-width: 660px) {
  .bk-form { grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 20px; }
  .bk-form > * { grid-column: 1 / -1; }
  .bk-form > .bk-field:nth-of-type(1), .bk-form > .bk-field:nth-of-type(2) { grid-column: auto; }
  .bk .bk-submit { justify-self: start; min-width: 320px; }
}
.bk-field { display: grid; gap: 4px; }
.bk-field label { font-weight: 500; }
.bk-hint { font-size: 0.875rem; color: var(--bk-muted); }
.bk-field-error { font-size: 0.9375rem; font-weight: 500; color: var(--bk-error); }
.bk-field-error:empty { display: none; }
.bk-field input, .bk-field textarea {
  width: 100%;
  min-height: 48px;
  padding: 10px 12px;
  font: inherit;
  font-size: max(16px, 1rem); /* 16px+ stops iOS zooming in */
  color: var(--bk-ink);
  background: #fff;
  border: 1px solid var(--bk-line);
  border-radius: var(--bk-radius);
}
.bk-field textarea { resize: vertical; min-height: 88px; }
.bk-field [aria-invalid='true'] { border-color: var(--bk-error); }

.bk-hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.bk .bk-submit {
  min-height: 52px;
  padding: 12px 20px;
  border: 0;
  border-radius: var(--bk-radius);
  background: var(--bk-accent);
  color: var(--bk-accent-ink);
  font-weight: 600;
  font-size: 1.0625rem;
  transition: filter 120ms ease, transform 80ms ease;
}
.bk-submit:hover { filter: brightness(1.08); }
.bk-submit:active { transform: translateY(1px); }
.bk-submit:disabled { opacity: 0.6; cursor: progress; }

.bk .bk-switch {
  justify-self: start;
  min-height: 44px;
  padding: 8px 0;
  border: 0;
  background: none;
  color: var(--bk-accent);
  text-align: left;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.bk-status { margin: 0; min-height: 1.5em; color: var(--bk-muted); }
.bk-status:empty { min-height: 0; }
.bk-status--error { color: var(--bk-error); font-weight: 500; }
.bk-note { margin: 0; color: var(--bk-muted); font-size: 0.9375rem; }
.bk a { color: var(--bk-accent); text-underline-offset: 3px; }
.bk .bk-note a { display: inline-block; min-height: 44px; line-height: 44px; font-weight: 600; }
.bk-tz { font-size: 0.875rem; }

.bk-done { display: grid; gap: 8px; }
.bk-done p { margin: 0; }
.bk-done-title { margin: 0; font-size: 1.5rem; font-family: var(--font-display, inherit); }
.bk-done-title:focus { outline: none; }
.bk-done-when { font-size: 1.125rem; font-weight: 600; }
.bk-ics { display: inline-block; min-height: 44px; line-height: 44px; font-weight: 600; }

@media (prefers-reduced-motion: reduce) {
  .bk * { transition: none !important; }
}

/* Reserve the calendar's space before its script runs, so the page doesn't jump when it appears. */
[data-booking]:not(.bk) { min-height: 1240px; }
.bk-suggest { min-height: 156px; align-content: start; }
@container bk (min-width: 520px) { .bk-suggest { min-height: 74px; } }
@media (min-width: 640px) { [data-booking]:not(.bk) { min-height: 1080px; } }
