/* Booking widget. Reads the page's tokens (--text, --bg, --line-2 ...) plus the
   widget tokens below, which a light page overrides. */

.booker {
  --bk-on-meta: #3a3a39;      /* secondary text on a selected (inverted) option */
  --bk-mono-on: #d9d8d3;
  --bk-err: #f0b8b0;          /* 10:1 on dark surfaces */
  --bk-err-bg: #1d1413;
  --bk-err-line: #6b3d38;
  --bk-err-field: #e2a8a0;
  --bk-r: 0px;                /* radius of options and fields */
  --bk-legend-font: var(--serif);
}

.booker { min-height: 420px; scroll-margin-top: calc(var(--nav-h) + 24px); }
.booker__flow { display: grid; gap: clamp(36px, 4vw, 52px); }
.booker__upcoming { padding: 14px 16px; border: 1px solid var(--line-2); border-radius: var(--bk-r); font-size: 15px; color: var(--text-2); }
.booker__upcoming strong { color: var(--text); font-weight: 600; }

.booker__step { margin: 0; padding: 0; border: 0; min-width: 0; }
.booker__legend {
  padding: 0;
  margin-bottom: 18px;
  font-family: var(--bk-legend-font);
  font-size: clamp(1.4rem, 2vw, 1.75rem);
  line-height: 1.2;
}

/* Shared option button --------------------------------------------------- */

.opt {
  appearance: none;
  display: grid;
  align-items: center;
  border: 1px solid var(--line-2);
  background: transparent;
  color: var(--text);
  text-align: left;
  border-radius: var(--bk-r);
  cursor: pointer;
  transition: border-color 0.25s var(--ease), background-color 0.25s var(--ease), color 0.25s var(--ease), transform 0.15s var(--ease);
}
.opt:hover { border-color: var(--text-2); }
.opt:active { transform: translateY(1px); }
.opt.is-on { background: var(--text); border-color: var(--text); color: var(--bg); }
.opt.is-on .opt__meta, .opt.is-on .opt__price { color: var(--bk-on-meta); }
.opt[disabled] { cursor: not-allowed; opacity: 0.32; }
.opt[disabled]:hover { border-color: var(--line-2); }

.opt__title { font-size: 16px; font-weight: 500; }
.opt__meta { font-size: 13px; color: var(--text-3); }
.opt__price { font-variant-numeric: tabular-nums; white-space: nowrap; color: var(--text-2); }

/* Barbers ----------------------------------------------------------------- */

.booker__barbers {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.opt--barber {
  grid-template-columns: 1fr;
  justify-items: start;
  gap: 4px;
  padding: 12px 12px 14px;
}
.opt__face {
  height: auto;
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  margin-bottom: 10px;
  border-radius: calc(var(--bk-r) * 0.6);
  filter: grayscale(0.25);
}
.opt__face--mono {
  display: grid;
  place-items: center;
  background: var(--bg-3);
  font-family: var(--serif);
  font-size: 44px;
  color: var(--text-2);
}
@media (max-width: 520px) {
  .booker__barbers { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
  .opt--barber { padding: 8px 8px 10px; }
  .opt--barber .opt__title { font-size: 14px; }
  .opt--barber .opt__meta { display: none; }
  .opt__face--mono { font-size: 32px; }
}
.opt__face--any { font-size: 22px; letter-spacing: 0.28em; padding-left: 0.28em; }
.opt.is-on .opt__face--mono { background: var(--bk-mono-on); color: var(--bg); }

/* Services ---------------------------------------------------------------- */

.booker__services { display: grid; gap: 8px; }
.opt--service {
  grid-template-columns: minmax(0, 1fr) auto auto;
  gap: 18px;
  min-height: 60px;
  padding: 12px 18px;
}

@media (max-width: 520px) {
  .opt--service { grid-template-columns: minmax(0, 1fr) auto; row-gap: 2px; }
  .opt--service .opt__meta { grid-row: 2; }
  .opt--service .opt__price { grid-row: 1 / span 2; grid-column: 2; }
}

/* Dates ------------------------------------------------------------------- */

.dates {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 68px;
  gap: 8px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: 10px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.dates__item {
  justify-items: center;
  gap: 2px;
  padding: 10px 0 12px;
  scroll-snap-align: start;
  text-align: center;
}
.dates__wd, .dates__mon { font-size: 12px; text-transform: lowercase; color: var(--text-3); }
.dates__day { font-family: var(--serif); font-size: 26px; line-height: 1.1; }
.dates__item.is-on .dates__wd, .dates__item.is-on .dates__mon { color: var(--bk-on-meta); }

.dates__pager {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 6px;
}
.dates__pager .link {
  appearance: none;
  border: 0;
  background: none;
  min-height: 44px;
  padding: 0;
  font-size: 14px;
  color: var(--text-2);
  cursor: pointer;
}
.dates__pager .link[disabled] { opacity: 0.3; cursor: default; }
.dates__pager .link[disabled]::after { display: none; }

/* Slots ------------------------------------------------------------------- */

.slots__label { margin: 26px 0 12px; color: var(--text-2); font-size: 15px; }
.slots__label::first-letter { text-transform: uppercase; }
.slots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(84px, 1fr));
  gap: 8px;
}
.slots__group { margin: 18px 0 10px; font-size: 11px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-3); }
.slots__label + .slots__group { margin-top: 4px; }
@media (max-width: 520px) {
  /* Four times per row on a 360px phone instead of three. */
  .slots { grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)); gap: 6px; }
}
.slots__item {
  justify-content: center;
  min-height: 46px;
  font-variant-numeric: tabular-nums;
  font-size: 15px;
}

/* Details form ------------------------------------------------------------- */

.booker__form { display: grid; gap: 20px; max-width: 560px; }
.field { display: grid; gap: 8px; }
.field label { font-size: 14px; color: var(--text-2); }
.field input, .field textarea {
  width: 100%;
  min-height: 50px;
  padding: 12px 14px;
  border: 1px solid var(--line-2);
  border-radius: var(--bk-r);
  background: var(--bg);
  color: var(--text);
  font-size: 16px; /* 16px stops iOS zooming into the field */
  transition: border-color 0.25s var(--ease);
}
.field textarea { resize: vertical; min-height: 76px; }
.field input::placeholder, .field textarea::placeholder { color: var(--text-3); }
.field input:hover, .field textarea:hover { border-color: var(--text-3); }
.field input:focus, .field textarea:focus { outline: none; border-color: var(--text); }
.field input:focus-visible, .field textarea:focus-visible { outline: 2px solid var(--silver); outline-offset: 2px; }
.field__help { font-size: 13px; color: var(--text-3); }
.field--error input, .field--error textarea { border-color: var(--bk-err-field); }
.field__error, .booker__error { font-size: 14px; color: var(--bk-err); }
.booker__error { padding: 12px 14px; border: 1px solid var(--bk-err-line); background: var(--bk-err-bg); border-radius: var(--bk-r); }

.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

.summary {
  display: grid;
  gap: 10px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
.summary > div { display: grid; grid-template-columns: 110px minmax(0, 1fr); gap: 16px; }
.summary dt { color: var(--text-3); font-size: 14px; }
.summary dd { font-size: 15px; }
.summary dd::first-letter { text-transform: uppercase; }
.booker__privacy { font-size: 13px; color: var(--text-3); }

/* Confirmation and manage views -------------------------------------------- */

.done { display: grid; gap: 22px; max-width: 560px; }
.done__title {
  font-family: var(--serif);
  font-weight: 400;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
  line-height: 1.1;
}
.done__title:focus { outline: none; }
.done__lede { color: var(--text-2); font-size: 17px; }
.summary--done { padding: 22px 0; }
.done__actions { display: flex; flex-wrap: wrap; gap: 10px; }
.done__keep { font-size: 14px; color: var(--text-3); overflow-wrap: anywhere; }
.done__keep .link { color: var(--text-2); }

/* Empty, loading, no-JS ------------------------------------------------------ */

.booker__empty {
  display: grid;
  justify-items: start;
  gap: 14px;
  margin-top: 20px;
  padding: 22px;
  border: 1px dashed var(--line-2);
  color: var(--text-2);
}
.booker__noscript { color: var(--text-2); }

.skeleton { display: grid; gap: 22px; }
.skeleton--block { height: 360px; background: var(--bg-3); }
.skeleton__row { display: grid; grid-auto-flow: column; grid-auto-columns: 68px; gap: 8px; overflow: hidden; }
.skeleton__row--slots { grid-auto-columns: 84px; }
.skeleton__date { height: 82px; background: var(--bg-3); }
.skeleton__slot { height: 46px; background: var(--bg-3); }
.skeleton > *, .skeleton--block {
  background-image: linear-gradient(90deg, transparent 0%, rgba(236, 235, 231, 0.05) 50%, transparent 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.skeleton__date, .skeleton__slot { background-color: var(--bg-3); }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: -100% 0; } }

/* Same Bodoni tuning as the page (lux.css): sturdier hairlines on touch screens. */
@media (max-width: 900px), (hover: none) {
  .booker__legend, .dates__day, .opt__face--mono, .done__title {
    font-weight: 550;
    font-variation-settings: "opsz" 12;
  }
}
