/* ═══════════════════════════════════════════════════════════════
   BUENA HEALTH — BOOKING MODAL  (Shared Stylesheet)
   Clean, minimal wellness aesthetic.
   CSS vars (--cream, --forest, --accent, etc.) are defined
   in each page's own stylesheet — NOT duplicated here.
   ═══════════════════════════════════════════════════════════════ */

/* ── OVERLAY ─────────────────────────────────── */
.booking-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 100vh;
  height: 100dvh;            /* cap to the visible window, never the tall content */
  z-index: 10000;
  background: rgba(14, 26, 20, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  overflow-y: auto;
}
.booking-overlay.open {
  display: flex;
}
/* JS will set top position on .modal for iframe compatibility */

/* ═══════════════════════════════════════════════════════════════
   MODAL CONTAINER
   ═══════════════════════════════════════════════════════════════ */
.modal {
  background: #FAF8F3;
  border-radius: 16px;
  width: 100%;
  max-width: 560px;
  max-height: calc(100vh - 96px);
  box-shadow: 0 20px 60px rgba(26, 46, 34, 0.12), 0 2px 8px rgba(26, 46, 34, 0.06);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  z-index: 1;
  margin-top: 40px;
}

/* ── HEADER ──────────────────────────────────── */
.modal-header {
  padding: 20px 28px 16px;
  position: relative;
  border-bottom: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}
.modal-brand {
  display: flex;
  align-items: center;
  gap: 10px;
}
.modal-brand-mark {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 0.72rem;
  font-weight: 600;
  color: #1A2E22;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.modal-brand-divider {
  width: 1px;
  height: 12px;
  background: rgba(26, 46, 34, 0.15);
}
.modal-brand-context {
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: #5A5A5A;
}
.modal-close {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: none;
  background: transparent;
  color: #5A5A5A;
  font-size: 1.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
  line-height: 1;
  padding: 0;
}
.modal-close:hover {
  color: #1A2E22;
  background: rgba(26, 46, 34, 0.06);
}

/* ── PROGRESS ──────────────────────────────── */
.modal-progress {
  padding: 0 28px;
}
.modal-progress-track {
  position: relative;
  height: 2px;
  background: rgba(26, 46, 34, 0.06);
  border-radius: 1px;
  overflow: hidden;
}
.modal-progress-fill {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 0%;
  background: #B87B4A;
  border-radius: 1px;
  transition: width 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}
.modal-progress-meta {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
}
.modal-progress-step {
  color: #B87B4A;
}
.modal-progress-total {
  color: #5A5A5A;
}

/* ── BODY ──────────────────────────────────── */
.modal-body {
  padding: 28px 28px 20px;
  overflow-y: auto;
  flex: 1;
}
.step {
  display: none;
  animation: stepFadeIn 0.3s ease;
}
.step.active {
  display: block;
}
@keyframes stepFadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}
.step-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: #5A5A5A;
  background: transparent;
  border: none;
  cursor: pointer;
  margin-bottom: 20px;
  padding: 0;
  transition: color 0.2s ease;
}
.step-back:hover {
  color: #B87B4A;
}
.step-back svg {
  width: 10px;
  height: 10px;
}

.step-eyebrow {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
  color: #B87B4A;
  margin-bottom: 8px;
}
.step-title {
  font-family: var(--font-serif, Georgia, serif);
  font-weight: 400;
  font-size: 1.6rem;
  color: #1A2E22;
  letter-spacing: -0.01em;
  line-height: 1.2;
  margin-bottom: 6px;
}
.step-title em {
  font-style: italic;
  color: #B87B4A;
}
.step-sub {
  font-size: 0.88rem;
  color: #5A5A5A;
  line-height: 1.55;
  margin-bottom: 28px;
}

/* ═════ STEP 1 — CATEGORIES ═════ */
.cat-grid {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.cat-card {
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(26, 46, 34, 0.08);
  border-radius: 0;
  padding: 16px 4px;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: left;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0;
  width: 100%;
}
.cat-card:first-child {
  border-top: 1px solid rgba(26, 46, 34, 0.08);
}
.cat-card:hover {
  background: rgba(26, 46, 34, 0.025);
  border-color: rgba(26, 46, 34, 0.08);
  transform: none;
  box-shadow: none;
}
.cat-card:hover .cat-card-arrow {
  transform: translateX(3px);
  color: #B87B4A;
}
.cat-card-top {
  display: none;
}
.cat-card-mark {
  display: none;
}
.cat-card-tag {
  display: none;
}
.cat-card-tag--clinic {
  display: none;
}
.cat-card-name {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.3;
  color: #1A2E22;
  letter-spacing: 0;
  flex: 1;
}
.cat-card-foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 12px;
  margin-top: 0;
}
.cat-card-count {
  font-size: 0.78rem;
  color: #5A5A5A;
}
.cat-card-arrow {
  color: #5A5A5A;
  font-size: 0.85rem;
  transition: transform 0.25s ease, color 0.25s ease;
}

/* ═════ STEP 2 — SERVICES ═════ */
.svc-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}
.svc-row {
  position: relative;
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(26, 46, 34, 0.08);
  border-radius: 0;
  padding: 16px 4px;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: center;
  cursor: pointer;
  transition: background 0.2s ease;
  text-align: left;
  width: 100%;
}
.svc-row:first-child {
  border-top: 1px solid rgba(26, 46, 34, 0.08);
}
.svc-row:hover {
  background: rgba(26, 46, 34, 0.025);
  border-color: rgba(26, 46, 34, 0.08);
}
.svc-row.selected {
  background: rgba(184, 123, 74, 0.12);
  border-color: rgba(184, 123, 74, 0.45);
  box-shadow: inset 3px 0 0 var(--accent, #B87B4A);
  border-radius: 8px;
}
.svc-row.selected .svc-row-name { color: #A56B3C; font-weight: 600; }
.svc-row.selected .svc-row-price::before {
  content: '\2713  ';
  color: var(--accent, #B87B4A);
  font-weight: 700;
}
.svc-row-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}
.svc-row-name {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-weight: 500;
  font-size: 0.92rem;
  letter-spacing: 0;
  color: #1A2E22;
}
.svc-row-meta {
  font-size: 0.78rem;
  color: #5A5A5A;
  line-height: 1.4;
}
.svc-row-price {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-size: 0.92rem;
  font-weight: 600;
  color: #1A2E22;
  letter-spacing: 0;
  white-space: nowrap;
}
.svc-row-price small {
  display: block;
  font-family: inherit;
  font-size: 0.65rem;
  letter-spacing: 0.02em;
  font-weight: 400;
  color: #5A5A5A;
  text-transform: none;
  margin-top: 1px;
  text-align: right;
}
.svc-row-price--free {
  color: #B87B4A;
}

.svc-callout {
  margin-top: 20px;
  padding: 0;
  background: transparent;
  border-radius: 0;
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-style: normal;
  font-size: 0.78rem;
  color: #5A5A5A;
  line-height: 1.5;
}

/* ═════ STEP 3 — INFO ═════ */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.form-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.form-field--full {
  grid-column: 1 / -1;
}
.form-label {
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 500;
  color: #5A5A5A;
}
.form-input,
.form-select,
.form-textarea {
  font-family: inherit;
  font-size: 0.9rem;
  padding: 11px 14px;
  border: 1px solid rgba(26, 46, 34, 0.12);
  border-radius: 8px;
  background: #FFFFFF;
  color: #1A2E22;
  transition: border-color 0.2s ease;
  width: 100%;
  outline: none;
}
.form-input:focus,
.form-select:focus,
.form-textarea:focus {
  outline: none;
  border-color: #B87B4A;
}
.form-textarea {
  min-height: 80px;
  resize: vertical;
}

.form-consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  margin-top: 4px;
}
.form-consent input[type="checkbox"] {
  flex-shrink: 0;
  margin-top: 3px;
  width: 16px;
  height: 16px;
  accent-color: #B87B4A;
}
.form-consent-text {
  font-size: 0.8rem;
  color: #5A5A5A;
  line-height: 1.5;
}
.form-consent-text a {
  color: #B87B4A;
  text-decoration: underline;
}

.form-section-divider {
  margin: 20px 0 16px;
  padding-top: 16px;
  border-top: 1px solid rgba(26, 46, 34, 0.08);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 600;
  color: #5A5A5A;
}

/* ═════ STEP 4 — DATE/TIME ═════ */
.dt-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}
.dt-col-label {
  font-size: 0.65rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: #5A5A5A;
  margin-bottom: 12px;
}
.dt-days {
  display: flex;
  flex-direction: column;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.dt-day {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid rgba(26, 46, 34, 0.08);
  border-radius: 8px;
  background: #FFFFFF;
  cursor: pointer;
  transition: border-color 0.2s ease, background 0.2s ease;
  font-size: 0.85rem;
  text-align: left;
  width: 100%;
}
.dt-day:hover {
  border-color: #B87B4A;
}
.dt-day.selected {
  border-color: #B87B4A;
  background: rgba(184, 123, 74, 0.06);
}
.dt-day-name {
  font-weight: 600;
  color: #1A2E22;
  letter-spacing: 0;
}
.dt-day-date {
  font-size: 0.78rem;
  color: #5A5A5A;
}

.dt-times {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4px;
  max-height: 260px;
  overflow-y: auto;
  padding-right: 4px;
}
.dt-time {
  padding: 10px 6px;
  border: 1px solid rgba(26, 46, 34, 0.08);
  border-radius: 100px;
  background: #FFFFFF;
  font-size: 0.8rem;
  font-weight: 500;
  color: #1A2E22;
  cursor: pointer;
  transition: all 0.2s ease;
  text-align: center;
}
.dt-time:hover {
  border-color: #B87B4A;
  color: #B87B4A;
}
.dt-time.selected {
  background: #B87B4A;
  color: #FFFFFF;
  border-color: #B87B4A;
}
.dt-time[disabled] {
  opacity: 0.3;
  cursor: not-allowed;
  text-decoration: line-through;
}

.dt-policy {
  margin-top: 20px;
  padding: 0;
  background: transparent;
  border-left: none;
  font-size: 0.78rem;
  color: #5A5A5A;
  line-height: 1.5;
  border-radius: 0;
}
.dt-policy strong {
  color: #1A2E22;
  font-weight: 600;
}

@media (max-width: 540px) {
  .dt-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}

/* ═════ STEP 5 — PAYMENT ═════ */
.pay-summary {
  background: #FFFFFF;
  border: 1px solid rgba(26, 46, 34, 0.08);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
}
.pay-summary-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid rgba(26, 46, 34, 0.06);
}
.pay-summary-line:last-child {
  border-bottom: none;
  padding-bottom: 0;
}
.pay-summary-line.total {
  margin-top: 4px;
  padding-top: 12px;
  border-top: 1px solid rgba(26, 46, 34, 0.12);
  border-bottom: none;
}
.pay-summary-label {
  font-size: 0.82rem;
  color: #5A5A5A;
}
.pay-summary-line.total .pay-summary-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: #5A5A5A;
}
.pay-summary-value {
  font-size: 0.9rem;
  color: #1A2E22;
  font-weight: 500;
  text-align: right;
}
.pay-summary-line.total .pay-summary-value {
  font-family: var(--font-serif, Georgia, serif);
  font-size: 1.4rem;
  font-weight: 400;
  letter-spacing: -0.01em;
  color: #1A2E22;
}

.pay-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr); /* minmax(0,…) lets the column shrink below content min-width */
  gap: 14px;
  margin-bottom: 20px;
}
.pay-card > * { min-width: 0; }            /* grid items must be allowed to shrink, or the card row overflows the modal */
.pay-card input, .pay-card .pay-card-row, .pay-card > div { max-width: 100%; }
.pay-card-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}
.pay-trust {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: 8px 0;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
  font-weight: 500;
  color: #5A5A5A;
  text-transform: none;
}
.pay-trust span {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}

/* ═════ STEP 6 — CONFIRMED ═════ */
.confirm-wrap {
  text-align: center;
  padding: 8px 0;
}
.confirm-icon {
  width: 48px;
  height: 48px;
  margin: 0 auto 16px;
  border-radius: 50%;
  background: #B87B4A;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
}
.confirm-icon svg {
  width: 24px;
  height: 24px;
}
.confirm-title {
  font-family: var(--font-serif, Georgia, serif);
  font-weight: 400;
  font-size: 1.6rem;
  color: #1A2E22;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
}
.confirm-title em {
  font-style: italic;
  color: #B87B4A;
}
.confirm-sub {
  font-size: 0.88rem;
  color: #5A5A5A;
  line-height: 1.55;
  max-width: 380px;
  margin: 0 auto 24px;
}
.confirm-detail-card {
  background: #FFFFFF;
  border: 1px solid rgba(26, 46, 34, 0.08);
  border-radius: 10px;
  padding: 16px 20px;
  margin-bottom: 24px;
  text-align: left;
}
.confirm-detail-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 10px 0;
  border-bottom: 1px solid rgba(26, 46, 34, 0.06);
  gap: 16px;
}
.confirm-detail-row:last-child {
  border-bottom: none;
}
.confirm-detail-label {
  font-size: 0.68rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 500;
  color: #5A5A5A;
}
.confirm-detail-value {
  font-size: 0.88rem;
  color: #1A2E22;
  font-weight: 500;
  text-align: right;
}
.confirm-next {
  text-align: left;
  margin-bottom: 24px;
}
.confirm-next-label {
  font-size: 0.65rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  font-weight: 600;
  color: #5A5A5A;
  margin-bottom: 14px;
}
.confirm-next-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 0;
  margin: 0;
}
.confirm-next-list li {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  font-size: 0.85rem;
  color: #5A5A5A;
  line-height: 1.5;
}
.confirm-next-num {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: rgba(184, 123, 74, 0.1);
  color: #B87B4A;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 600;
  margin-top: 1px;
}
.confirm-next-list li strong {
  color: #1A2E22;
  font-weight: 600;
}
.confirm-cal-row {
  display: flex;
  gap: 8px;
  justify-content: center;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.confirm-cal-btn {
  font-size: 0.75rem;
  font-weight: 500;
  padding: 8px 16px;
  border: 1px solid rgba(26, 46, 34, 0.12);
  border-radius: 100px;
  background: transparent;
  color: #1A2E22;
  cursor: pointer;
  transition: all 0.2s ease;
}
.confirm-cal-btn:hover {
  border-color: #1A2E22;
  background: #1A2E22;
  color: #FAF8F3;
}

/* ═════ FOOTER ═════ */
.modal-footer {
  padding: 16px 28px;
  border-top: 1px solid rgba(26, 46, 34, 0.06);
  background: #FAF8F3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-shrink: 0;
}
.modal-footer-fineprint {
  font-size: 0.75rem;
  color: #5A5A5A;
  font-style: normal;
}
.modal-btn {
  font-family: var(--font-sans, 'Inter', sans-serif);
  font-weight: 500;
  font-size: 0.85rem;
  padding: 12px 24px;
  border-radius: 100px;
  border: none;
  background: #1A2E22;
  color: #FAF8F3;
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
}
.modal-btn:hover {
  background: #2D4A35;
}
.modal-btn[disabled] {
  opacity: 0.35;
  cursor: not-allowed;
}
.modal-btn--accent {
  background: #B87B4A;
}
.modal-btn--accent:hover {
  background: #a06a3d;
}

/* ═════ RESPONSIVE ═════ */
@media (max-width: 640px) {
  .booking-overlay {
    padding: 0;
  }
  .modal {
    max-height: 100vh;
    max-height: 100dvh;
    max-width: 100vw;
    border-radius: 0;
    margin-top: 0;
  }
  .modal-header,
  .modal-progress,
  .modal-body,
  .modal-footer {
    padding-left: 20px;
    padding-right: 20px;
  }
  .modal-footer {
    padding-bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
  .modal-footer-fineprint {
    display: none;
  }
  .form-grid {
    grid-template-columns: 1fr;
  }
  .cat-grid {
    flex-direction: column;
  }
}
