/* ============================================================
   BOOKING LAYOUT (2-column: list + sidebar)
   ============================================================ */
.booking-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 24px;
  align-items: start;
}

/* ============================================================
   STEP PROGRESS BAR
   ============================================================ */
.steps-bar {
  background: var(--bg-card);
  border-bottom: 1px solid var(--border);
  padding: 14px 0;
}
.steps-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 0;
}
.step-item {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
}
.step-item:last-child { flex: 0; }
.step-num {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid var(--border-light);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all var(--transition);
}
.step-item.active .step-num {
  border-color: var(--gold);
  background: var(--gold);
  color: #111;
}
.step-item.done .step-num {
  border-color: var(--green);
  background: var(--green);
  color: #fff;
}
.step-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.step-item.active .step-label { color: var(--gold); font-weight: 500; }
.step-item.done .step-label { color: var(--green); }
.step-line {
  flex: 1;
  height: 1px;
  background: var(--border);
  margin: 0 12px;
}
.step-item.done + .step-line { background: var(--green); }

/* ============================================================
   PAGE HEADER
   ============================================================ */
.page-header {
  margin-bottom: 20px;
}
.page-header h1 {
  font-family: 'Playfair Display', serif;
  font-size: 22px;
  font-weight: 600;
  color: var(--h1-color);
}
.page-header p {
  margin-top: 4px;
  color: var(--text-secondary);
  font-size: 13px;
}

/* ============================================================
   CATEGORY FILTER TABS
   ============================================================ */
.category-tabs {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.cat-tab {
  padding: 6px 16px;
  border-radius: 20px;
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.cat-tab:hover { border-color: var(--gold); color: var(--gold); }
.cat-tab.active {
  background: var(--gold);
  border-color: var(--gold);
  color: #111;
  font-weight: 500;
}

/* ============================================================
   SERVICE CARDS
   ============================================================ */
.service-list { display: flex; flex-direction: column; }

.service-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 0;
  overflow: hidden;
  display: flex;
  align-items: stretch;
  gap: 0;
  min-height: 100px;
  margin-bottom: 10px;
  transition: transform .25s, box-shadow .25s, border-color .2s;
  position: relative;
}
.service-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,.13);
  border-color: var(--border-light);
}
.service-card.selected {
  border-color: var(--gold);
  background: rgba(201,169,110,0.05);
}

.service-thumb {
  width: 110px;
  min-width: 110px;
  height: auto;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
}
.service-thumb-placeholder {
  width: 110px;
  min-width: 110px;
  min-height: 100px;
  background: var(--bg-card-hover);
  border-right: 1px solid var(--border);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  color: var(--gold);
}

.service-info { flex: 1; min-width: 0; padding: 12px 14px; }
.service-name {
  font-size: 14px;
  font-weight: 500;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.service-name-th {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

/* Duration selector pills */
.duration-pills {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.duration-pill {
  padding: 5px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--border-light);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.duration-pill:hover { border-color: var(--btn-primary); color: var(--btn-primary); }
.duration-pill.selected {
  background: linear-gradient(135deg, var(--btn-primary), var(--gold-dark));
  border-color: var(--btn-primary);
  color: var(--btn-primary-text);
}

.service-meta {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 11px;
  color: var(--text-secondary);
  margin-top: 4px;
}
.service-meta-icon { font-size: 11px; color: var(--gold); }

/* Price + actions */
.service-right {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 8px;
  flex-shrink: 0;
  padding: 12px 14px 12px 0;
}
.service-price {
  font-size: 16px;
  font-weight: 600;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
}
.service-price .currency {
  font-size: 11px;
  font-family: 'Inter', sans-serif;
  margin-right: 1px;
}
.service-price .original {
  font-size: 12px;
  text-decoration: line-through;
  color: var(--text-muted);
  font-weight: 400;
}
.service-actions { display: flex; gap: 8px; }

/* Category section header */
.category-section { margin-bottom: 8px; }
.category-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--gold);
  padding: 12px 0 6px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 4px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.category-icon { font-size: 14px; }

/* ============================================================
   SIDEBAR
   ============================================================ */
.booking-sidebar {
  position: sticky;
  top: 84px;
  background: var(--bg-sidebar);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  /* จำกัดความสูงไม่เกินจอ + ให้ปุ่มล่างปักติดสายตาเสมอ (ไม่ต้องเลื่อนหา) */
  display: flex;
  flex-direction: column;
  max-height: calc(100vh - 84px - 24px);
  overflow-y: auto;
  overflow-x: hidden;
  /* ความลึก + เส้นทองบาง ๆ ขอบบนให้ดูพรีเมียม */
  box-shadow: var(--shadow);
  background-clip: padding-box;
  scrollbar-width: thin;
  scrollbar-color: var(--border-light) transparent;
}
/* เส้นไฮไลต์ทองบาง ๆ พาดหัวการ์ด — สัญญะความหรู */
.booking-sidebar::before {
  content: "";
  position: sticky;
  top: 0;
  display: block;
  height: 3px;
  flex-shrink: 0;
  background: linear-gradient(90deg, transparent 0%, var(--gold) 50%, transparent 100%);
  opacity: 0.7;
  z-index: 3;
}
.booking-sidebar::-webkit-scrollbar { width: 6px; }
.booking-sidebar::-webkit-scrollbar-track { background: transparent; }
.booking-sidebar::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 999px;
}
.booking-sidebar::-webkit-scrollbar-thumb:hover { background: var(--gold-dark); }
/* ปุ่มดำเนินการ — ลอยติดล่างกล่อง อยู่ในระดับสายตาเสมอแม้เนื้อหายาว */
.booking-sidebar .sidebar-actions {
  position: sticky;
  bottom: 0;
  margin-top: auto;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 14px -8px rgba(0,0,0,0.45);
}

.sidebar-spa-header {
  padding: 18px 20px 16px;
  text-align: center;
  border-bottom: 1px solid var(--border);
  background: linear-gradient(180deg, rgba(201,169,110,0.08) 0%, transparent 100%);
}
/* โลโก้ — วางในกรอบวงกลมทองอ่อน ให้ดูตั้งบนฐาน ไม่ลอย */
.sidebar-diamond {
  width: 78px;
  height: 78px;
  margin: 0 auto 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 45%, rgba(201,169,110,0.16) 0%, rgba(201,169,110,0.05) 65%, transparent 100%);
  border: 1px solid rgba(201,169,110,0.32);
  box-shadow: 0 6px 18px -8px rgba(201,169,110,0.45), inset 0 0 18px rgba(201,169,110,0.06);
}
.sidebar-diamond img {
  height: 50px !important;
  width: auto;
  display: block;
}
.sidebar-spa-name {
  font-family: 'Playfair Display', serif;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 2px;
}
.sidebar-spa-sub {
  font-size: 11px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.sidebar-stars {
  display: flex;
  justify-content: center;
  gap: 2px;
  margin-bottom: 6px;
}
.star { color: var(--gold); font-size: 13px; }
.star.empty { color: var(--border-light); }
.sidebar-rating-text { font-size: 11px; color: var(--text-muted); }
.sidebar-address {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 8px;
  line-height: 1.5;
}

/* Summary list */
.sidebar-summary {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}
.summary-title {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 12px;
}
.summary-empty {
  text-align: center;
  color: var(--text-muted);
  font-size: 12px;
  padding: 12px 0;
}
.summary-item {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.summary-item:last-child { border-bottom: none; }
.summary-item-name {
  font-size: 14px;
  color: var(--gold);
  flex: 1;
  line-height: 1.4;
}
.summary-item-duration {
  font-size: 10px;
  color: var(--text-muted);
  display: block;
  margin-top: 1px;
}
.summary-item-price {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  flex-shrink: 0;
}
.summary-item-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 14px;
  padding: 0 2px;
  line-height: 1;
  transition: color var(--transition);
  flex-shrink: 0;
}
.summary-item-remove:hover { color: var(--red); }

/* Total — แถบไฮไลต์ทองอ่อน ดึงสายตาให้ยอดรวมเด่นแบบหรู */
.sidebar-total {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: linear-gradient(180deg, rgba(201,169,110,0.06) 0%, transparent 100%);
}
.total-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}
.total-amount {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
}
.total-amount .currency { font-size: 13px; font-family: 'Inter', sans-serif; }

/* Reassurance block (checkout ก่อนปุ่มยืนยัน) */
.reassure-list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 9px; }
.reassure-list li {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 13px; line-height: 1.5; color: var(--text-secondary);
}
.reassure-tick {
  flex-shrink: 0; width: 18px; height: 18px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700;
  color: var(--gold);
  background: rgba(201,169,110,0.14);
  border: 1px solid rgba(201,169,110,0.3);
}
/* ลิงก์ยุบหมายเหตุ — secondary action (จาง) ไอคอนทองตามมาตรฐาน */
.note-toggle-link {
  background: none; border: none; padding: 0; cursor: pointer;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-muted); font-family: inherit;
  transition: color var(--transition);
}
.note-toggle-link:hover { color: var(--gold); }
.note-toggle-link i { color: var(--gold); }

/* Sidebar actions */
.sidebar-actions { padding: 16px 20px; }
.sidebar-note {
  font-size: 11px;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
  line-height: 1.5;
}

/* ============================================================
   DETAIL MODAL
   ============================================================ */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s, visibility 0.25s;
}
.modal-overlay.open { opacity: 1; visibility: visible; }
.modal-box {
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  max-width: 520px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  transform: translateY(20px);
  transition: transform 0.25s;
}
.modal-overlay.open .modal-box { transform: translateY(0); }

/* Premium svc-detail-card inside booking overlay */
.modal-overlay .svc-detail-card {
  max-height: 88vh;
  overflow-y: auto;
  transform: translateY(24px);
  transition: transform 0.28s cubic-bezier(.4,0,.2,1);
}
.modal-overlay.open .svc-detail-card { transform: translateY(0); }
.modal-img {
  width: 100%;
  height: 220px;
  object-fit: cover;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-body { padding: 24px; }
.modal-name {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  color: var(--text-primary);
  margin-bottom: 4px;
}
.modal-name-th { font-size: 14px; color: var(--text-muted); margin-bottom: 12px; }
.modal-desc { font-size: 13px; color: var(--text-secondary); line-height: 1.7; margin-bottom: 16px; }
.modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  background: rgba(0,0,0,0.5);
  border: none;
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

/* ============================================================
   CHECKOUT PAGE
   ============================================================ */
.checkout-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin-bottom: 24px;
}
.form-group { margin-bottom: 18px; }
.form-label {
  display: block;
  font-size: 12px;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 6px;
  letter-spacing: 0.3px;
}
.form-control {
  width: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 10px 14px;
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  transition: border-color var(--transition);
  outline: none;
  -webkit-appearance: none;
}
.form-control:focus { border-color: var(--gold); }
.form-control option { background: var(--bg-card); }
/* placeholder ให้เห็นชัดบนพื้นมืด (opacity:1 กัน Firefox หรี่ลง) */
.form-control::placeholder { color: var(--text-muted); opacity: 1; }

/* Time slots grid */
.time-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 6px;
}
.time-slot {
  padding: 8px 4px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  text-align: center;
  font-size: 12px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition);
}
.time-slot:hover { border-color: var(--gold); color: var(--gold); }
.time-slot.selected {
  background: rgba(201,169,110,0.15);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 500;
}
.time-slot.unavailable {
  opacity: 0.35;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Slot status styles (real-data grid) ── */
.time-slot.ts-available {
  border-color: rgba(201,169,110,0.4);
  color: var(--text-primary);
  cursor: pointer;
}
.time-slot.ts-available:hover,
.time-slot.ts-available.selected {
  background: rgba(201,169,110,0.15);
  border-color: var(--gold);
  color: var(--gold);
  font-weight: 600;
}

.time-slot.ts-booked {
  background: rgba(239,83,80,0.08);
  border-color: rgba(239,83,80,0.35);
  color: rgba(239,83,80,0.7);
  cursor: not-allowed;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  padding: 4px 2px;
}
.time-slot.ts-booked span:first-child {
  font-size: 12px;
  line-height: 1;
}

.time-slot.ts-break {
  background: rgba(120,120,120,0.06);
  border-color: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.25);
  cursor: not-allowed;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  flex-direction: column;
  padding: 4px 2px;
}
.time-slot.ts-break span:first-child {
  font-size: 12px;
  line-height: 1;
}

.time-slot.ts-past {
  opacity: 0.2;
  cursor: not-allowed;
  pointer-events: none;
  text-decoration: line-through;
}

.time-slot.ts-unavailable {
  opacity: 0.18;
  cursor: not-allowed;
  pointer-events: none;
}

/* Badge inside slot (จอง / พัก) */
.ts-badge {
  font-size: 9px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  line-height: 1;
  padding: 1px 4px;
  border-radius: 3px;
  background: currentColor;
  color: var(--bg-primary);
  opacity: 0.9;
}
.time-slot.ts-booked .ts-badge { background: rgba(239,83,80,0.7); color: #fff; }
.time-slot.ts-break  .ts-badge { background: rgba(1, 97, 49, 0.15); color: rgba(255,255,255,0.5); }

/* Legend dots */
.slot-dot {
  display: inline-block;
  width: 10px; height: 10px;
  border-radius: 50%;
  border: 1px solid;
}
.dot-available  { background: rgba(201,169,110,0.2);  border-color: rgba(201,169,110,0.6); }
.dot-booked     { background: rgba(239,83,80,0.15);   border-color: rgba(239,83,80,0.5); }
.dot-break      { background: rgba(255,255,255,0.06); border-color: rgba(255,255,255,0.2); }
.dot-past       { background: rgba(255,255,255,0.04); border-color: rgba(255,255,255,0.12); }

/* Therapist cards */
.therapist-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 6px;
}
.therapist-card {
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  text-align: center;
  cursor: pointer;
  transition: all var(--transition);
}
.therapist-card:hover { border-color: var(--gold); }
.therapist-card.selected {
  border-color: var(--gold);
  background: rgba(201,169,110,0.08);
}
.therapist-card img {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 8px;
  border: 2px solid var(--border-light);
}
.therapist-card.selected img { border-color: var(--gold); }
.therapist-card-name { font-size: 11px; color: var(--text-primary); }
.therapist-card-any {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: var(--border);
  margin: 0 auto 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  color: var(--text-muted);
}

.checkout-section {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 24px;
  margin-bottom: 16px;
}
.checkout-section:last-of-type {
  margin-bottom: 0;
}
.checkout-section-title {
  font-family: 'Playfair Display', serif;
  font-size: 16px;
  color: var(--h3-color);
  margin-bottom: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  gap: 2px;
}
.section-icon { color: var(--gold); font-size: 16px; }

/* ============================================================
   CONFIRM PAGE
   ============================================================ */
.confirm-card {
  max-width: 520px;
  margin: 60px auto;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 40px;
  text-align: center;
}
.confirm-icon { font-size: 56px; margin-bottom: 16px; }
.confirm-title {
  font-family: 'Playfair Display', serif;
  font-size: 26px;
  color: var(--text-primary);
  margin-bottom: 8px;
}
.confirm-subtitle { color: var(--text-muted); font-size: 14px; margin-bottom: 28px; }
.confirm-details {
  background: var(--bg-primary);
  border-radius: var(--radius);
  padding: 20px;
  text-align: left;
  margin-bottom: 24px;
}
.confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.confirm-row:last-child { border-bottom: none; }
.confirm-row-label { color: var(--text-muted); }
.confirm-row-value { color: var(--text-primary); font-weight: 500; }


/* ============================================================
   THERAPIST SELECTION (Step 2)
   ============================================================ */
/* ── Therapist select cards — สไตล์เดียวกับการ์ดบริการ (รูปบน/ข้อมูลล่าง) ── */
.therapist-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}
@media (min-width: 576px) { .therapist-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 992px) { .therapist-grid { grid-template-columns: repeat(3, 1fr); } }

.therapist-select-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1.5px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s, border-color var(--transition);
  position: relative;
}
.therapist-select-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 10px 32px rgba(0,0,0,0.15);
  border-color: var(--gold-dark);
}
.therapist-select-card.selected {
  border-color: rgba(201,169,110,.55);
  box-shadow: 0 0 0 1px rgba(201,169,110,.35), 0 10px 30px rgba(201,169,110,.20);
}

/* ── ขอบทองไล่เฉด "วิ่งวน" รอบการ์ดพนักงานที่เลือก (เหมือน Step 1) ── */
@property --th-angle { syntax: '<angle>'; initial-value: 0deg; inherits: false; }
.therapist-select-card.selected::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: 14px;
  padding: 2px;                 /* ความหนาเส้นกรอบ */
  --th-angle: 0deg;             /* fallback ถ้าไม่รองรับ @property */
  background: conic-gradient(from var(--th-angle),
              transparent 0deg,
              var(--gold) 55deg,
              #f6e7c4 90deg,     /* ทองสว่าง = หัวแสงวิ่ง */
              var(--gold) 125deg,
              transparent 200deg,
              transparent 360deg);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
          mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
          mask-composite: exclude;
  animation: thBorderSpin 2.6s linear infinite;
  pointer-events: none;         /* คลิกการ์ดได้ปกติ */
  z-index: 3;                   /* เหนือรูป ต่ำกว่า check badge (z-index ในรูป) */
}
@keyframes thBorderSpin { to { --th-angle: 360deg; } }

/* เคารพผู้ที่ตั้งค่าลดการเคลื่อนไหว — โชว์กรอบทองนิ่งแทน */
@media (prefers-reduced-motion: reduce) {
  .therapist-select-card.selected::after { animation: none; }
}

/* Photo (top, full width) */
.therapist-select-photo {
  position: relative;
  width: 100%;
  height: 200px;
  overflow: hidden;
}
.therapist-select-photo img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  display: block;
  transition: transform .4s;
}
.therapist-select-card:hover .therapist-select-photo img { transform: scale(1.04); }
.therapist-select-photo-empty {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, rgba(201,169,110,0.14), rgba(201,169,110,0.04));
}
.therapist-select-photo-empty span { font-size: 56px; color: var(--gold); opacity: .5; }

/* Check badge — overlay บนรูป (มุมขวาบน) */
.therapist-select-check {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: var(--gold);
  color: #111;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 10px rgba(0,0,0,0.3);
  z-index: 2;
}

/* Body */
.therapist-select-info {
  padding: 14px 16px 16px;
  flex: 1;
  min-width: 0;
}
.therapist-select-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 3px;
}
.therapist-select-sub {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 8px;
}
.therapist-select-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
}
.therapist-tag {
  font-size: 10px;
  padding: 2px 8px;
  border-radius: 20px;
  background: var(--border-light);
  color: var(--text-secondary);
  border: 1px solid var(--border);
}
.therapist-tag.tag-gold {
  background: rgba(201,169,110,0.12);
  color: var(--gold);
  border-color: rgba(201,169,110,0.3);
}

/* ============================================================
   BOOKING RECEIPT SIDEBAR
   ============================================================ */

.receipt-body {
  padding: 0 20px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.receipt-section-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 14px 0 8px;
}

/* Service rows */
.receipt-svc-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-bottom: 1px solid rgba(255,255,255,0.05);
}
.receipt-svc-row:last-child { border-bottom: none; }

.receipt-svc-info {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.receipt-svc-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.receipt-svc-meta {
  font-size: 11px;
  color: var(--text-muted);
}
.receipt-svc-price {
  font-size: 14px;
  font-weight: 700;
  color: var(--gold);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Divider */
.receipt-divider {
  height: 1px;
  background: var(--border);
  margin: 4px 0;
}

/* Appointment rows */
.receipt-appt-rows {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 2px 0;
}
.receipt-appt-row {
  display: grid;
  grid-template-columns: 18px 68px 1fr;
  align-items: flex-start;
  gap: 4px;
  font-size: 12px;
  line-height: 1.4;
}
.receipt-appt-icon {
  color: var(--gold);
  font-size: 12px;
  line-height: 1.4;
}
.receipt-appt-label {
  color: var(--text-muted);
  flex-shrink: 0;
}
.receipt-appt-value {
  color: var(--text-primary);
  font-weight: 500;
  word-break: break-word;
}

/* Total */
.receipt-total-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 14px 0 6px;
}
.receipt-total-label {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--text-secondary);
}
.receipt-total-amount {
  font-size: 22px;
  font-weight: 700;
  color: var(--gold);
  font-family: 'Playfair Display', serif;
}

/* ============================================================
   CHECKOUT — Smart login / guest
   ============================================================ */

/* Login shortcut card (guest view) */
.login-shortcut-card {
  display: flex;
  align-items: center;
  gap: 14px;
  background: rgba(201,169,110,0.08);
  border: 1px solid rgba(201,169,110,0.3);
  border-radius: 12px;
  padding: 16px 20px;
  margin-bottom: 20px;
}
.login-shortcut-icon {
  font-size: 26px;
  flex-shrink: 0;
}
.login-shortcut-body { flex: 1; }
.login-shortcut-title {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
  margin-bottom: 3px;
}
.login-shortcut-sub {
  font-size: 12px;
  color: var(--text-muted);
}
.btn-login-shortcut {
  display: inline-block;
  padding: 8px 18px;
  background: var(--gold);
  color: #111;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: opacity .2s;
}
.btn-login-shortcut:hover { opacity: .85; }

/* Divider with text */
.checkout-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 20px 0;
  color: var(--text-muted);
  font-size: 12px;
}
.checkout-divider::before,
.checkout-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

/* Appointment details grid (logged-in confirm view) */
.appt-details-grid {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.appt-detail-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  padding: 8px 12px;
  background: rgba(255,255,255,0.03);
  border-radius: 8px;
}
.appt-detail-label {
  color: var(--text-muted);
  flex-shrink: 0;
  min-width: 130px;
}
.appt-detail-value {
  color: var(--text-primary);
  font-weight: 500;
  text-align: right;
}

/* Sidebar user profile card */
.sidebar-user-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
  background: rgba(76,175,80,0.06);
}
.sidebar-user-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: #4caf50;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-user-info { flex: 1; min-width: 0; }
.sidebar-user-label {
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text-muted);
  margin-bottom: 1px;
}
.sidebar-user-name {
  font-size: 14px;
  color: var(--text-primary);
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sidebar-user-detail {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ============================================================
   CHECKOUT — SINGLE CARD LAYOUT
   ============================================================ */
.checkout-single-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}
.checkout-single-card {
  width: 100%;
  max-width: 640px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 8px 32px rgba(0,0,0,0.35);
}
/* Override inner padding for the wider single card */
.checkout-single-card .sidebar-spa-header,
.checkout-single-card .sidebar-user-card,
.checkout-single-card .sidebar-done-section,
.checkout-single-card .receipt-body,
.checkout-single-card .sidebar-actions {
  padding-left: 28px;
  padding-right: 28px;
}
/* "หรือ" divider inside guest form */
.checkout-or-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 0;
  color: var(--text-muted);
  font-size: 11px;
}
.checkout-or-divider::before,
.checkout-or-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}
/* Login row inside guest section */
.checkout-login-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0 10px;
}

/* ============================================================
   BOOKING SUMMARY CARD — numbered rows (steps 2-6)
   ฟอร์มสรุปเดียวกับ Booking Detail Modal
   ============================================================ */
.bk-sum-body { padding: 20px 24px; display: flex; flex-direction: column; gap: 18px; }
.bk-sum-row  { display: flex; gap: 14px; align-items: flex-start; }
.bk-sum-divider { height: 1px; background: var(--border); }
.bk-num {
  font-size: 11px; font-weight: 700; color: var(--text-muted);
  opacity: .45; min-width: 18px; padding-top: 2px; text-align: center;
}
.bk-num-active { color: var(--gold); opacity: 1; }
.bk-num-done   { color: var(--green); opacity: 1; }
.bk-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px;
}
.bk-sum-col { flex: 1; min-width: 0; }

/* ============================================================
   SIDEBAR — DONE STEP SECTIONS (steps 2, 3, 4+)
   ============================================================ */
.sidebar-done-section {
  padding: 16px 20px 18px;
  border-bottom: 1px solid var(--border);
}
.sidebar-done-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--text-muted);
  font-weight: 600;
}
.sidebar-done-check {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #4caf50;
  color: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.sidebar-done-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
}
.sidebar-done-item-name {
  font-size: 13px;
  color: var(--text-secondary);
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding-right: 8px;
}
.sidebar-done-item-price {
  font-size: 13px;
  color: var(--gold);
  font-weight: 500;
  flex-shrink: 0;
}
.sidebar-done-subtotal {
  text-align: right;
  font-size: 11px;
  color: var(--text-muted);
  padding-top: 5px;
  margin-top: 4px;
  border-top: 1px solid var(--border);
}
.sidebar-done-single {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-primary);
  font-weight: 500;
}

/* ── Sidebar summary rows: หัวข้อซ้าย / รายละเอียดขวา ──
   modifier เฉพาะแถว summary (บริการที่เลือก/นักบำบัด/วันเวลา) — ไม่กระทบ
   ตะกร้าสด Step 1 หรือฟอร์มล็อกอิน checkout ที่ใช้ base class เดิม */
.sidebar-done-section.is-row,
.sidebar-summary.is-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.sidebar-done-section.is-row > .sidebar-done-header,
.sidebar-summary.is-row > .summary-title {
  margin-bottom: 0;
  flex: 0 0 auto;
  /* ยึดมุมบนซ้าย — เวลาค่าฝั่งขวา wrap หลายบรรทัด หัวข้อตรงกับบรรทัดแรก */
  align-self: flex-start;
  padding-top: 2px;
  white-space: nowrap;
  /* หัวข้อเล็ก/จาง — โฟกัสไปที่รายละเอียดในการ์ดนี้ */
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.3px;
  color: var(--text-muted);
}
.is-row > .is-row-value {
  flex: 1 1 auto;
  min-width: 0;
  text-align: right;
  margin-top: 0;
  /* รายละเอียดเด่นกว่าหัวข้อ */
  font-size: 14px;
  color: var(--text-primary);
}
/* ค่าหลายบรรทัด (วันเวลา) — ก้อนชิดขวา แต่ข้อความในก้อนชิดซ้ายเพื่ออ่านง่าย */
.is-row > .is-row-value.block {
  flex: 0 1 auto;
  margin-left: auto;
  text-align: left;
}
/* ชื่อบริการแสดงครบ ไม่ถูกตัด — ตัดบรรทัดได้หลายบรรทัด ชิดขวา */
.is-row .sidebar-done-item {
  align-items: flex-start;
  justify-content: flex-end;
}
.is-row .sidebar-done-item-name {
  font-size: 14px;
  color: var(--text-primary);
  flex: 0 1 auto;
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
  line-height: 1.4;
  padding-right: 0;
}
.is-row .sidebar-done-single {
  justify-content: flex-end;
  white-space: normal;
}
.is-row .sidebar-done-subtotal { text-align: right; padding-top: 4px; }

/* Tier badge */
.sidebar-tier-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 10px;
  font-weight: 600;
  margin-top: 3px;
  letter-spacing: 0.5px;
}
.tier-bronze  { background: rgba(121,85,72,0.25);  color: #a1887f; border: 1px solid rgba(121,85,72,0.4); }
.tier-silver  { background: rgba(158,158,158,0.2); color: #bdbdbd; border: 1px solid rgba(158,158,158,0.35); }
.tier-gold    { background: rgba(201,169,110,0.2); color: var(--gold); border: 1px solid rgba(201,169,110,0.4); }
.tier-platinum{ background: rgba(77,208,225,0.18); color: #4dd0e1; border: 1px solid rgba(77,208,225,0.35); }

/* Avatar color per tier */
.avatar-bronze   { background: #795548; }
.avatar-silver   { background: #9e9e9e; }
.avatar-gold     { background: var(--gold); color: #1a1205 !important; }
.avatar-platinum { background: #26c6da; }

/* ============================================================
   MOBILE CART BAR (hidden on desktop)
   ============================================================ */
.mobile-cart-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--bg-sidebar);
  border-top: 1px solid var(--border-light);
  padding: 12px 20px;
  padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  align-items: center;
  gap: 12px;
  z-index: 100;
  box-shadow: 0 -4px 24px rgba(0,0,0,0.45);
}
.mobile-cart-info { flex: 1; min-width: 0; }
.mobile-cart-count { font-size: 11px; color: var(--text-muted); margin-bottom: 2px; }
.mobile-cart-total {
  font-family: 'Playfair Display', serif;
  font-size: 20px;
  font-weight: 700;
  color: var(--gold);
  line-height: 1.1;
}
.mobile-cart-total .currency { font-size: 13px; font-family: 'Inter', sans-serif; }
.mobile-cart-bar .btn-continue {
  width: auto;
  padding: 11px 22px;
  font-size: 13px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ============================================================
   CHECKOUT / CONFIRM — single-column centered wrap
   (Steps 4-6: no sidebar, no mobile cart bar needed)
   ============================================================ */
.booking-single-wrap {
  max-width: 860px;
  margin: 0 auto;
  padding: 40px 24px;
}

/* ============================================================
   RESPONSIVE — Tablet (≤ 900px)
   ============================================================ */
@media (max-width: 900px) {
  /* Booking layout (steps 1-3): stack to 1-col */
  .booking-layout {
    grid-template-columns: 1fr;
    padding-bottom: 90px;
  }
  /* Sidebar replaced by floating cart bar */
  .booking-sidebar { display: none; }
  .mobile-cart-bar { display: flex; }

  /* Category tabs: horizontal scroll, no wrap */
  .category-tabs {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding-bottom: 4px;
  }
  .category-tabs::-webkit-scrollbar { display: none; }
  .cat-tab { flex-shrink: 0; }

  /* Home page grids */
  .why-grid        { grid-template-columns: repeat(2, 1fr); }
  .reviews-grid    { grid-template-columns: 1fr; }
  .checkout-grid   { grid-template-columns: 1fr; }
  .therapist-cards { grid-template-columns: repeat(4, 1fr); }
  .stats-bar       { grid-template-columns: repeat(2, 1fr); }
  .gallery-grid    { grid-template-columns: 1fr 1fr; grid-template-rows: 180px 180px 180px; }
  .gallery-item:first-child { grid-row: span 1; grid-column: span 2; }
  .staff-card      { width: 85vw; min-width: 85vw; }
  .info-bar-inner  { grid-template-columns: 1fr; }
  .loyalty-teaser-inner { flex-direction: column; text-align: center; }
  .line-oa-inner   { flex-direction: column; text-align: center; gap: 12px; }
  .footer-inner    { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-cta-inner { flex-direction: column; text-align: center; gap: 16px; }
  .footer-copy     { flex-direction: column; text-align: center; gap: 8px; }

  /* Single-wrap (steps 4-6) */
  .booking-single-wrap { padding: 24px 16px; }
}

/* ============================================================
   RESPONSIVE — Mobile (≤ 600px)
   ============================================================ */
@media (max-width: 600px) {
  .hero { height: 280px; }
  .hero-title { font-size: 26px; }
  .navbar-links .nav-link { display: none; }
  .time-slots { grid-template-columns: repeat(3, 1fr); }
  .therapist-cards { grid-template-columns: repeat(3, 1fr); }
  .footer-inner { grid-template-columns: 1fr; }

  /* Steps bar: numbers only */
  .step-label { display: none; }
  .step-item  { gap: 0; }
  .step-line  { margin: 0 4px; }
  .steps-inner { justify-content: center; padding: 0 16px; }

  /* Booking layout (steps 1-3) */
  .booking-layout { padding: 14px 12px 90px; }
  .page-header h1 { font-size: 18px; }
  .page-header p  { font-size: 12px; }

  /* Service cards */
  .service-card { gap: 0; }
  .service-thumb, .service-thumb-placeholder, .svc-card .svc-img { width: 80px; min-width: 80px; }
  .service-name     { font-size: 13px; white-space: normal; line-height: 1.3; }
  .service-name-th  { font-size: 11px; }
  .service-meta     { font-size: 10px; }
  .service-price    { font-size: 14px; }
  .service-actions  { gap: 6px; }
  .btn-detail { padding: 5px 8px;  font-size: 10px; }
  .btn-add    { padding: 5px 10px; font-size: 11px; }
  .cat-tab    { padding: 7px 14px; font-size: 12px; touch-action: manipulation; }

  /* Therapist cards (step 2) — stacked, รูปเด่นบนมือถือ 1 คอลัมน์ */
  .therapist-select-photo  { height: 240px; }
  .therapist-select-name   { font-size: 15px; }
  .therapist-select-sub    { font-size: 11px; }
  .therapist-tag           { font-size: 10px; padding: 2px 7px; }

  /* Modal: bottom sheet */
  .modal-overlay { padding: 0; align-items: flex-end; }
  .modal-box { max-width: 100%; width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-overlay .svc-detail-card { width: 100%; border-radius: 20px 20px 0 0; max-height: 92vh; }
  .modal-overlay .svc-detail-hero { height: 180px; }

  /* Single-wrap (steps 4-6) */
  .booking-single-wrap { padding: 16px 12px; }
}

/* ============================================================
