/* Online booking on a shop's public page (assets/shop-book.js). Phone
   first: every target is a full-width or two-up button at least 48px
   tall, days scroll sideways, nothing needs a second screen. */

/* The shop's bar is sticky: two rows tall on a phone, one on a laptop. A
   jump to the booking card (or to step 3) lands below it, not under it. */
.shop-book {
  margin: 8px auto 28px;
  scroll-margin-top: 164px;
}
.book-card {
  max-width: 880px;
  margin: 0;
  padding: 20px;
}
.book-title {
  margin: 0 0 4px;
  font-size: 24px;
  line-height: 1.2;
  text-wrap: balance;
}
.book-lede {
  margin: 0 0 18px;
  text-wrap: pretty;
}
.book-step {
  margin: 0 0 18px;
  scroll-margin-top: 164px;
}
@media (min-width: 860px) {
  .shop-book,
  .book-step {
    scroll-margin-top: 96px;
  }
}
.book-step-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 10px;
  font-weight: 700;
  font-size: 16px;
}
.book-n {
  display: inline-grid;
  place-items: center;
  width: 24px;
  height: 24px;
  border-radius: 999px;
  background: var(--shop-ink);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

/* Buttons here are choices, not the page's black buttons. */
.shop-public .book-card button.book-svc,
.shop-public .book-card button.book-day,
.shop-public .book-card button.book-time {
  background: var(--shop-paper);
  color: var(--shop-ink);
  border: 1px solid var(--shop-line);
  border-radius: 12px;
  font-weight: 600;
  min-height: 48px;
  padding: 10px 14px;
  text-align: left;
  transition:
    border-color 0.12s ease,
    background-color 0.12s ease;
}
.shop-public .book-card button.book-svc:hover,
.shop-public .book-card button.book-day:hover,
.shop-public .book-card button.book-time:hover {
  border-color: color-mix(in srgb, var(--shop-accent) 45%, var(--shop-line));
}
.shop-public .book-card button[aria-pressed="true"] {
  border-color: var(--shop-accent);
  background: color-mix(in srgb, var(--shop-accent) 8%, var(--shop-paper));
  box-shadow: inset 0 0 0 1px var(--shop-accent);
}
.shop-public .book-card button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--shop-accent) 45%, transparent);
  outline-offset: 2px;
}

.book-svcs {
  display: grid;
  grid-template-columns: 1fr;
  gap: 8px;
}
.shop-public .book-card button.book-svc {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  width: 100%;
}
.book-svc-name {
  font-weight: 650;
  text-wrap: balance;
}
.book-svc-meta {
  color: var(--shop-muted);
  font-weight: 500;
  font-size: 14px;
}

.book-days {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 8px;
  margin: 0 -2px 6px;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}
.shop-public .book-card button.book-day {
  flex: 0 0 auto;
  min-width: 84px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  padding: 8px 10px;
  scroll-snap-align: start;
}
.book-day-name {
  font-weight: 700;
}
.book-day-date {
  font-size: 14px;
}
.book-day-count {
  color: var(--shop-muted);
  font-size: 12px;
  font-weight: 500;
  white-space: nowrap;
}
.book-times {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin: 0 0 8px;
}
.shop-public .book-card button.book-time {
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
.book-empty,
.book-warn {
  margin: 8px 0;
  padding: 12px 14px;
  border-radius: 12px;
  background: #fffbeb;
  border: 1px solid #fde68a;
  color: var(--shop-ink);
}

.book-form {
  border-top: 1px solid var(--shop-line);
  padding-top: 16px;
}
.book-picked {
  margin: 0 0 12px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--shop-canvas);
  line-height: 1.45;
}
.shop-public .book-card button.book-change {
  display: inline;
  min-height: 0;
  padding: 0 0 0 4px;
  border: 0;
  background: none;
  color: var(--shop-accent);
  font-weight: 650;
  text-decoration: underline;
  text-underline-offset: 3px;
}
.book-fields {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
  margin: 0 0 14px;
}
/* The page's form labels are small capitals; these read as plain words. */
.shop-public label.book-field {
  display: grid;
  gap: 6px;
  margin: 0;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0;
  text-transform: none;
  color: var(--shop-ink);
}
.book-field input,
.book-field textarea {
  width: 100%;
  min-height: 48px;
  margin: 0;
  font-size: 16px;
}
.book-field textarea {
  min-height: 72px;
}
.book-field input[aria-invalid="true"] {
  border-color: var(--shop-accent);
}
.book-err {
  color: var(--shop-accent);
  font-weight: 600;
  font-size: 13px;
}
.book-trap {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.shop-public .book-card .book-go {
  width: 100%;
  min-height: 52px;
  font-size: 17px;
  background: var(--shop-accent);
  border-color: var(--shop-accent);
}
.book-status:empty {
  display: none;
}
.book-alt {
  margin: 4px 0 0;
  font-size: 14px;
  text-wrap: balance;
}

.book-done h2 {
  margin: 0 0 4px;
  font-size: 26px;
  line-height: 1.2;
  text-wrap: balance;
}
.book-done:focus {
  outline: none;
}
.book-done-lead {
  margin: 0 0 14px;
  font-size: 17px;
}
.book-done-facts {
  display: grid;
  gap: 8px;
  margin: 0 0 14px;
  padding: 12px 14px;
  border-radius: 12px;
  background: var(--shop-canvas);
}
.book-done-facts div {
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr);
  gap: 10px;
}
.book-done-facts dt {
  color: var(--shop-muted);
}
.book-done-facts dd {
  margin: 0;
  font-weight: 600;
}

@media (min-width: 640px) {
  .book-card {
    padding: 26px 28px;
  }
  .book-svcs {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .book-times {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
  .book-fields {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .book-field:nth-child(3),
  .book-wide {
    grid-column: 1 / -1;
  }
}
@media (min-width: 900px) {
  .book-svcs {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}
@media (prefers-reduced-motion: reduce) {
  .shop-public .book-card button {
    transition: none;
  }
}
/* Lines a person reads, not a banner: kept to a readable measure. */
.book-card .note,
.book-done-lead {
  max-width: 64ch;
}

/* The chat bubble steps aside while the booking card is on a phone's screen
   or a field has the keyboard (assets/shop-book.js keepDockClear). The card
   also keeps room at its foot, so its last line is never under the bubble
   as the page scrolls past. */
@media (max-width: 760px) {
  body.book-dock-away .chat-btn {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(16px);
  }
  .shop-public .chat-btn {
    transition:
      opacity 0.15s ease,
      transform 0.15s ease,
      visibility 0.15s;
  }
  .book-card {
    padding-bottom: 28px;
  }
}
@media (max-width: 760px) and (prefers-reduced-motion: reduce) {
  .shop-public .chat-btn {
    transition: none;
  }
}
/* A narrow phone (320–359): times and days stay on one line each. */
@media (max-width: 359px) {
  .book-card {
    padding: 16px 14px 28px;
  }
  .shop-public .book-card button.book-time {
    padding: 10px 6px;
    font-size: 15px;
  }
  .shop-public .book-card button.book-day {
    min-width: 76px;
  }
}

/* The booking ends on the same visit-details page a caller is texted. */
.book-visit {
  margin: 16px 0;
  padding: 16px;
  border: 1px solid var(--shop-line);
  border-radius: 12px;
  background: var(--shop-paper, #fff);
}
.book-visit h3 {
  margin: 0 0 6px;
  font-size: 18px;
}
.book-visit .shop-btn {
  display: inline-block;
  margin-top: 6px;
  text-decoration: none;
}
.book-more {
  margin: 10px 0 0;
}
