/* ── Booking: + Nova marcação, reagendar, mensagem, detalhe ─────────────────
   Design A2/5 (the sheet), A3 (slots), A4 (message ready), 3 (detail). Values
   1:1 with docs/design/screens. */

.booking [hidden], .booking-detail [hidden] { display: none !important; }

/* The sheet's form fills the sheet, so the button can sit at the bottom. */
.booking, .booking-done {
  flex: 1 0 auto;
  display: flex;
  flex-direction: column;
}

.booking .flash { margin-top: 12px; }

.booking-subtitle { margin: 6px 0 0; font: 400 13px var(--font-body); color: var(--muted); }

.booking-section { margin-top: 16px; }
.booking-section > .kicker,
.booking-section__head { margin: 0 0 6px; }
.booking-section__head { display: flex; justify-content: space-between; align-items: baseline; }
.booking-section__head .kicker { margin: 0; }

.booking-more { font: 500 13px var(--font-body); color: var(--verniz); }

.booking-note { margin: 8px 0 0; font: 400 13px/1.45 var(--font-body); color: var(--muted); }
.booking-note a { color: var(--verniz); font-weight: 600; }
.booking-note--empty { color: var(--pending-ink); }

/* Choices are real radios, so the form posts without JS bookkeeping; the
   chip around each one is what she taps. */
.booking-radio {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0;
  pointer-events: none;
}

/* ── Quem ─────────────────────────────────────────────────────────────── */
.booking-search {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 48px;
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--card);
}
.booking-search:focus-within { outline: 3px solid var(--verniz); outline-offset: 3px; }
.booking-search__icon {
  flex: none;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--soft);
}
.booking-search__input {
  flex: 1;
  min-width: 0;
  height: 100%;
  padding: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font: 500 16px var(--font-body);   /* 16px: iOS zooms into anything smaller */
  -webkit-appearance: none;
  appearance: none;
}
.booking-search__input::placeholder { color: var(--muted); font-weight: 400; }
.booking-search__input::-webkit-search-cancel-button { display: none; }

.booking-chips { margin-top: 8px; }
.booking-section > .kicker + .booking-chips,
.booking-section__head + .booking-chips { margin-top: 0; }

.booking-chip { position: relative; cursor: pointer; }
.booking-chip:has(.avatar) { padding-left: 8px; }
.booking-chip:has(.booking-radio:checked) {
  border-color: var(--verniz);
  background: var(--verniz-wash);
  color: var(--verniz);
}
.booking-chip:has(.booking-radio:focus-visible),
.booking-day:has(.booking-radio:focus-visible),
.booking-slot:has(.booking-radio:focus-visible) { outline: 3px solid var(--verniz); outline-offset: 2px; }
.booking-chip__meta { font-weight: 400; color: var(--muted); }
.booking-chip--add {
  border: 2px dashed var(--verniz-dash);
  background: transparent;
  color: var(--verniz);
}

.booking-new-client {
  min-width: 0;
  margin: 10px 0 0;
  padding: 10px 12px 12px;
  border: 2px solid var(--verniz);
  border-radius: var(--radius-card);
  background: var(--verniz-wash);
}
.booking-new-client__head { display: flex; justify-content: space-between; align-items: center; }
.booking-new-client__title { font: 700 15px var(--font-body); color: var(--verniz); }
.booking-new-client__paste {
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: var(--card);
  font: 500 12px var(--font-body);
  color: var(--verniz);
}
.booking-new-client .field-grid { margin-top: 8px; }
.booking-new-client__input {
  width: 100%;
  min-width: 0;
  height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  font: 500 16px var(--font-body);
}
.booking-new-client__input::placeholder { color: var(--muted); }
.booking-new-client__input:focus { outline: 2px solid var(--verniz); }

/* ── Quando ───────────────────────────────────────────────────────────── */
/* Seven days and "Outro dia" don't fit a phone's width: the row scrolls
   sideways, edge to edge. */
.booking-days {
  display: flex;
  gap: 6px;
  margin: 0 calc(-1 * var(--gutter));
  padding: 0 var(--gutter);
  overflow-x: auto;
  scrollbar-width: none;
}
.booking-days::-webkit-scrollbar { display: none; }

.booking-day {
  position: relative;
  flex: 1 0 58px;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 10px;
  border-radius: 14px;
  background: var(--card);
  color: var(--muted);
  font: 600 13px var(--font-body);
  white-space: nowrap;
  cursor: pointer;
}
.booking-day:has(.booking-radio:checked),
.booking-day--chosen { background: var(--ink); color: var(--card); }
.booking-day--other { flex-basis: auto; }
/* The real date input lies invisibly over the chip: a tap on iPhone opens
   the native picker. */
.booking-day__date {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  border: 0;
  cursor: pointer;
}

.booking-slots { display: block; margin-top: 8px; }
.booking-slots[busy] { opacity: .5; transition: opacity .15s; }
.booking-slots__title {
  margin: 14px 0 8px;
  font: 600 12px var(--font-body);
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: .08em;
}
.booking-slots__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.booking-slot {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  border: 2px solid transparent;
  border-radius: 14px;
  background: var(--card);
  font: 600 14px var(--font-body);
  cursor: pointer;
}
.booking-slot:has(.booking-radio:checked) {
  border-color: var(--verniz);
  background: var(--verniz-wash);
  color: var(--verniz);
  font-weight: 700;
}

/* ── The button: thumb zone, always in reach while the sheet scrolls ──── */
.booking-cta {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  padding: 16px 0 0;
  background: linear-gradient(to bottom, transparent, var(--cream) 16px);
}
.booking-cta .btn { height: 58px; gap: 10px; }
.booking-cta__dot {
  flex: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--card);
}
.booking-cta__dot--sm { width: 14px; height: 14px; }

/* ── A4: marcada, mensagem pronta ─────────────────────────────────────── */
.booking-done__check {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 72px;
  height: 72px;
  margin-top: 30px;
  border-radius: 50%;
  background: var(--whatsapp);
  color: var(--card);
  font: 700 34px var(--font-body);
}
.booking-done__title {
  margin: 18px 0 0;
  font: 800 32px/1.05 var(--font-display);
  letter-spacing: -.02em;
}
.booking-bubble {
  align-self: flex-end;
  max-width: 300px;
  margin-top: 18px;
  padding: 12px 14px;
  border-radius: 18px 18px 4px 18px;
  background: var(--whatsapp-bubble);
  color: var(--whatsapp-bubble-ink);
  font: 400 15px/1.45 var(--font-body);
  white-space: pre-line;
}
.booking-done__hint { margin: 14px 0 0; font: 400 13px/1.5 var(--font-body); color: var(--muted); }
.booking-done__hint--warn { color: var(--pending-ink); }
.booking-done__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 22px;
}
.booking-done__actions .btn { height: 58px; }
.booking-done__actions .btn--ghost { height: 44px; font-size: 14px; }

/* ── 3: detalhe da marcação ───────────────────────────────────────────── */
.booking-detail__hero {
  margin-top: calc(-1 * env(safe-area-inset-top));
  padding: calc(env(safe-area-inset-top) + 20px) var(--gutter) 26px;
  border-radius: 0 0 var(--radius-sheet) var(--radius-sheet);
  background: var(--wine);
  color: var(--card);
}
.booking-detail__top { display: flex; justify-content: space-between; align-items: center; }
.booking-detail__back { font: 500 15px var(--font-body); opacity: .85; }

.booking-status {
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font: 600 12px var(--font-body);
  background: color-mix(in srgb, var(--card) 18%, transparent);
}
.booking-status--confirmed { background: var(--whatsapp); color: var(--card); }
.booking-status--pending { background: var(--pending); color: var(--note-ink); }
.booking-status--no-show { background: var(--verniz); color: var(--card); }

.booking-detail__who { display: flex; gap: 16px; align-items: center; margin-top: 26px; }
.booking-detail__who .avatar {
  width: 80px;
  height: 80px;
  font-size: 24px;
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--card) 18%, transparent);
}
.booking-detail__name { margin: 0; font: 700 30px/1 var(--font-display); }
.booking-detail__record { margin-top: 6px; font: 400 14px var(--font-body); color: color-mix(in srgb, var(--card) 80%, transparent); }
.booking-detail__profile { text-decoration: underline; }

.booking-detail__tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.booking-detail__tag {
  padding: 7px 12px;
  border-radius: var(--radius-pill);
  background: color-mix(in srgb, var(--card) 14%, transparent);
  font: 500 13px var(--font-body);
}

.booking-detail__body { display: flex; flex-direction: column; padding: 20px var(--gutter) 0; }
.booking-detail__body > .flash { margin-bottom: 12px; }

.booking-detail__card { padding: 16px 18px; border-radius: 22px; }
.booking-detail__when {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding-bottom: 14px;
  margin-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.booking-detail__time { margin: 0; font: 700 22px var(--font-display); }
.booking-detail__until { flex: none; font: 400 14px var(--font-body); color: var(--muted); }
.booking-detail__line,
.booking-detail__total { display: flex; justify-content: space-between; gap: 12px; }
.booking-detail__line { padding: 4px 0; font: 400 15px var(--font-body); }
.booking-detail__total { padding: 8px 0 0; font: 700 17px var(--font-body); }
.booking-detail__amount { color: var(--verniz); }

.booking-detail__notes {
  margin: 12px 0 0;
  padding: 14px 18px;
  border-radius: 22px;
  background: var(--note-wash);
  color: var(--note-ink);
  font: 400 14px/1.5 var(--font-body);
}

.booking-detail__actions { display: flex; flex-direction: column; gap: 10px; margin-top: 20px; }
.booking-detail__form { display: block; }
.booking-complete { display: flex; flex-direction: column; gap: 10px; }
