/* ============================================================
   Booking Wizard v2 — Massage Salon
   Gold accent · Light bg · RTL · Mobile-first
   Scoped under .booking-v2-wrap to override main.css
   ============================================================ */

:root {
  --bw-gold: #C9A96E;
  --bw-gold-light: #E8D5A8;
  --bw-gold-dark: #A88B4A;
  --bw-green: #4CAF50;
  --bw-white: #FFFFFF;
  --bw-gray-100: #F9F9F6;
  --bw-gray-200: #EDEDEA;
  --bw-gray-300: #D4D4CE;
  --bw-gray-400: #A3A39C;
  --bw-gray-500: #73736C;
  --bw-gray-600: #52524C;
  --bw-gray-700: #3D3D38;
  --bw-gray-800: #262623;
  --bw-text: var(--bw-gray-800);
  --bw-text-muted: var(--bw-gray-500);
  --bw-radius: 12px;
  --bw-radius-sm: 8px;
  --bw-radius-xs: 6px;
  --bw-shadow: 0 4px 20px rgba(0,0,0,.08);
  --bw-shadow-sm: 0 1px 3px rgba(0,0,0,.06);
  --bw-transition: .25s cubic-bezier(.4,0,.2,1);
  --bw-gap: 16px;
  --bw-gap-sm: 10px;
  --bw-gap-xs: 6px;
  --bw-pad: 20px;
  --bw-pad-sm: 14px;
  --bw-font: 'Vazirmatn', 'Tahoma', 'Segoe UI', sans-serif;
}

/* ============================================================
   1. Main Wrapper
   ============================================================ */

.booking-v2-wrap {
  font-family: var(--bw-font);
  direction: rtl;
  max-width: 800px;
  margin: 100px auto 40px;
  padding: var(--bw-pad);
  background: var(--bw-white);
  border-radius: var(--bw-radius);
  box-shadow: var(--bw-shadow);
  color: var(--bw-text);
  line-height: 1.7;
  position: relative;
  overflow: hidden;
}

.booking-v2-wrap * { box-sizing: border-box; }

.booking-v2-header {
  text-align: center;
  margin-bottom: var(--bw-pad);
}

.booking-v2-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--bw-gray-800);
  margin: 0 0 6px;
}

.booking-v2-subtitle {
  font-size: .9rem;
  color: var(--bw-text-muted);
  margin: 0;
}

/* ============================================================
   2. Step Progress Bar
   ============================================================ */

.booking-v2-progress {
  margin-bottom: 28px;
  padding: 0 10px;
}

.progress-steps {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
}

.progress-steps .step {
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
  z-index: 2;
  flex: 0 0 auto;
  opacity: .4;
  transition: opacity var(--bw-transition);
}

.progress-steps .step.active,
.progress-steps .step.done { opacity: 1; }

.step-num {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bw-gray-200);
  border: 3px solid var(--bw-gray-300);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  font-weight: 700;
  color: var(--bw-gray-400);
  transition: all var(--bw-transition);
}

.step.active .step-num {
  background: var(--bw-gold);
  border-color: var(--bw-gold);
  color: var(--bw-white);
  box-shadow: 0 0 0 4px var(--bw-gold-light);
}

.step.done .step-num {
  background: var(--bw-green);
  border-color: var(--bw-green);
  color: var(--bw-white);
}

.step-label {
  font-size: .7rem;
  color: var(--bw-gray-400);
  margin-top: 6px;
  white-space: nowrap;
  transition: color var(--bw-transition);
}

.step.active .step-label {
  color: var(--bw-gold-dark);
  font-weight: 600;
}

.step.done .step-label { color: var(--bw-green); }

.step-line {
  flex: 1;
  height: 3px;
  background: var(--bw-gray-300);
  min-width: 30px;
  max-width: 70px;
  z-index: 1;
  margin: 0 -2px;
  margin-bottom: 20px;
}

/* ============================================================
   3. Wizard Steps
   ============================================================ */

.wizard-step {
  display: none;
  animation: bwFadeIn .35s ease;
}

.wizard-step.active { display: block; }

@keyframes bwFadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.step-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--bw-gray-700);
  margin: 0 0 var(--bw-pad);
  text-align: center;
}

/* ============================================================
   4. Service Cards (Step 1)
   ============================================================ */

.service-cards {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bw-gap);
}

.booking-v2-wrap .service-card {
  border: 2px solid var(--bw-gray-200);
  border-radius: var(--bw-radius-sm);
  padding: var(--bw-pad) var(--bw-pad-sm);
  cursor: pointer;
  transition: all var(--bw-transition);
  text-align: center;
  background: var(--bw-white);
  position: relative;
  user-select: none;
  overflow: visible;
}

.booking-v2-wrap .service-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--bw-shadow-sm);
  border-color: var(--bw-gold-light);
}

.booking-v2-wrap .service-card.selected {
  border-color: var(--bw-gold);
  background: linear-gradient(135deg, var(--bw-white) 0%, #FBF7EE 100%);
  box-shadow: 0 0 0 1px var(--bw-gold), var(--bw-shadow-sm);
}

.booking-v2-wrap .service-card.selected::after {
  content: '\2713';
  position: absolute;
  top: 8px;
  left: 8px;
  width: 22px;
  height: 22px;
  background: var(--bw-gold);
  color: var(--bw-white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .7rem;
  font-weight: 700;
}

.booking-v2-wrap .service-icon {
  font-size: 2.5rem;
  margin-bottom: 10px;
  display: block;
  width: auto;
  height: auto;
  background: none;
  border-radius: 0;
}

.booking-v2-wrap .service-name {
  font-size: 1rem;
  font-weight: 600;
  color: var(--bw-gray-700);
  margin-bottom: 6px;
}

.booking-v2-wrap .service-duration {
  font-size: .8rem;
  color: var(--bw-text-muted);
  margin-bottom: 8px;
}

.booking-v2-wrap .service-price {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bw-gold-dark) !important;
  background: none !important;
}

/* ============================================================
   5. Couple Toggle
   ============================================================ */

.couple-toggle {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--bw-gap-xs);
  margin: var(--bw-gap) 0;
  padding: var(--bw-pad-sm) var(--bw-pad);
  background: var(--bw-gray-100);
  border-radius: var(--bw-radius-sm);
}

.toggle-label {
  display: flex;
  align-items: center;
  gap: var(--bw-gap-sm);
  font-size: .9rem;
  font-weight: 500;
  color: var(--bw-gray-600);
  cursor: pointer;
}

.toggle-input {
  opacity: 0;
  width: 0;
  height: 0;
  position: absolute;
}

.toggle-slider {
  position: relative;
  width: 50px;
  height: 26px;
  background: var(--bw-gray-300);
  border-radius: 26px;
  transition: background var(--bw-transition);
  cursor: pointer;
  flex-shrink: 0;
}

.toggle-slider::before {
  content: '';
  position: absolute;
  top: 3px;
  right: 3px;
  width: 20px;
  height: 20px;
  background: var(--bw-white);
  border-radius: 50%;
  transition: transform var(--bw-transition);
  box-shadow: 0 1px 3px rgba(0,0,0,.15);
}

.toggle-input:checked + .toggle-slider {
  background: var(--bw-gold);
}

.toggle-input:checked + .toggle-slider::before {
  transform: translateX(-24px);
}

.toggle-hint {
  font-size: .75rem;
  color: var(--bw-text-muted);
  margin: 0;
}

/* ============================================================
   6. Calendar (Step 2)
   ============================================================ */

.date-time-section {
  display: flex;
  flex-direction: column;
  gap: var(--bw-gap);
}

.calendar-section {
  background: var(--bw-white);
  border-radius: var(--bw-radius-sm);
  padding: var(--bw-pad);
  border: 1px solid var(--bw-gray-200);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.booking-v2-wrap .calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: var(--bw-gap);
}

.btn-calendar-nav {
  background: var(--bw-gray-100);
  border: 1px solid var(--bw-gray-300);
  border-radius: var(--bw-radius-xs);
  padding: var(--bw-gap-sm);
  cursor: pointer;
  color: var(--bw-gray-600);
  transition: all var(--bw-transition);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  font-weight: 700;
}

.btn-calendar-nav:hover {
  border-color: var(--bw-gold);
  color: var(--bw-gold);
  background: var(--bw-white);
}

.cal-month-label {
  font-weight: 700;
  font-size: 1rem;
  color: var(--bw-gray-700);
}

.booking-v2-wrap .calendar-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--bw-gap-xs);
  margin-bottom: var(--bw-gap-xs);
  text-align: center;
  font-weight: 600;
  color: var(--bw-gray-400);
  font-size: .78rem;
  padding-bottom: var(--bw-gap-xs);
  border-bottom: 1px solid var(--bw-gray-200);
}

.booking-v2-wrap .calendar-weekdays span {
  padding: 4px 0;
}

.booking-v2-wrap .calendar-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: var(--bw-gap-xs);
}

.booking-v2-wrap .calendar-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: .85rem;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--bw-transition);
  background: transparent;
  border: 2px solid transparent;
  color: var(--bw-gray-700);
}

.booking-v2-wrap .calendar-day:hover:not(.disabled):not(.empty):not(.selected) {
  background: var(--bw-gray-100);
}

.booking-v2-wrap .calendar-day.selected {
  background: var(--bw-gold);
  color: var(--bw-white);
  font-weight: 700;
  box-shadow: 0 0 0 3px var(--bw-gold-light);
}

.booking-v2-wrap .calendar-day.today {
  border-color: var(--bw-gold-light);
}

.booking-v2-wrap .calendar-day.disabled {
  color: var(--bw-gray-300);
  cursor: not-allowed;
  text-decoration: line-through;
}

.booking-v2-wrap .calendar-day.empty { cursor: default; }

/* ============================================================
   7. Time Slots (Step 2)
   ============================================================ */

.time-section {
  background: var(--bw-white);
  border-radius: var(--bw-radius-sm);
  padding: var(--bw-pad);
  border: 1px solid var(--bw-gray-200);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
}

.time-title {
  font-size: .95rem;
  font-weight: 600;
  color: var(--bw-gray-700);
  margin: 0 0 var(--bw-gap);
  text-align: center;
}

.time-title span {
  color: var(--bw-gold-dark);
  font-weight: 700;
}

.booking-v2-wrap .time-slots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--bw-gap-sm);
}

.booking-v2-wrap .time-slot {
  padding: 10px 6px;
  border: 2px solid var(--bw-gray-200);
  border-radius: var(--bw-radius-xs);
  background: var(--bw-white);
  text-align: center;
  cursor: pointer;
  font-size: .85rem;
  font-weight: 500;
  color: var(--bw-gray-600);
  transition: all var(--bw-transition);
  user-select: none;
  font-family: var(--bw-font);
}

.booking-v2-wrap .time-slot:hover:not(.disabled) {
  border-color: var(--bw-gold-light);
  background: var(--bw-gray-100);
}

.booking-v2-wrap .time-slot.selected {
  border-color: var(--bw-gold);
  background: var(--bw-gold);
  color: var(--bw-white);
  font-weight: 700;
  box-shadow: 0 2px 8px rgba(201,169,110,.3);
}

.booking-v2-wrap .time-slot.disabled {
  background: var(--bw-gray-100);
  color: var(--bw-gray-300);
  border-color: var(--bw-gray-200);
  cursor: not-allowed;
  text-decoration: line-through;
}

.loading-text, .no-slots, .error-text {
  grid-column: 1 / -1;
  text-align: center;
  padding: var(--bw-pad);
  color: var(--bw-text-muted);
  font-size: .9rem;
}

.error-text { color: #E57373; }

/* ============================================================
   8. Customer Form (Step 3)
   ============================================================ */

.booking-v2-wrap .booking-form {
  margin: 0;
}

.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--bw-gap-sm);
  margin-bottom: var(--bw-gap);
}

.form-row:last-child { margin-bottom: 0; }

.booking-v2-wrap .form-group {
  display: flex;
  flex-direction: column;
  margin-bottom: var(--bw-gap);
}

.booking-v2-wrap .form-group label {
  display: block;
  font-size: .82rem;
  font-weight: 600;
  color: var(--bw-gray-600);
  margin-bottom: 6px;
}

.booking-v2-wrap .form-group input,
.booking-v2-wrap .form-group textarea,
.booking-v2-wrap .form-group select {
  width: 100%;
  padding: 12px 14px;
  border: 2px solid var(--bw-gray-200);
  border-radius: var(--bw-radius-xs);
  font-family: var(--bw-font);
  font-size: .9rem;
  color: var(--bw-text);
  background: var(--bw-white);
  transition: border-color var(--bw-transition), box-shadow var(--bw-transition);
  outline: none;
}

.booking-v2-wrap .form-group input:focus,
.booking-v2-wrap .form-group textarea:focus,
.booking-v2-wrap .form-group select:focus {
  border-color: var(--bw-gold);
  box-shadow: 0 0 0 3px var(--bw-gold-light);
}

.booking-v2-wrap .form-group input::placeholder,
.booking-v2-wrap .form-group textarea::placeholder {
  color: var(--bw-gray-400);
}

.booking-v2-wrap .form-group textarea {
  min-height: 90px;
  resize: vertical;
}

#companion-row { display: none; }
#companion-row.visible { display: grid; }

/* ============================================================
   9. Confirmation Box (Step 4)
   ============================================================ */

.confirmation-box {
  background: var(--bw-gray-100);
  border-radius: var(--bw-radius-sm);
  padding: var(--bw-pad);
  margin: 0 0 var(--bw-gap);
}

.confirm-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid var(--bw-gray-200);
}

.confirm-row:last-child { border-bottom: none; }

.confirm-label {
  font-size: .85rem;
  color: var(--bw-text-muted);
}

.confirm-value {
  font-weight: 600;
  color: var(--bw-gray-700);
  font-size: .9rem;
}

.confirm-total {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 0 4px;
  margin-top: 8px;
  border-top: 2px solid var(--bw-gray-300);
  font-size: 1.05rem;
}

.confirm-total span:first-child {
  font-weight: 600;
  color: var(--bw-gray-700);
}

.confirm-total span:last-child {
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--bw-gold-dark);
}

.tracking-code-box {
  text-align: center;
  padding: var(--bw-pad);
  background: var(--bw-gray-100);
  border: 2px dashed var(--bw-gold-light);
  border-radius: var(--bw-radius-sm);
  margin: 0 0 var(--bw-gap);
}

.tracking-code-box h3 {
  font-size: 1rem;
  font-weight: 700;
  color: var(--bw-gray-700);
  margin: 0 0 var(--bw-gap-sm);
}

.tracking-code {
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--bw-gold-dark);
  letter-spacing: 1px;
  direction: ltr;
  margin: 0 0 var(--bw-gap);
}

.btn-download-ics {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--bw-white);
  border: 2px solid var(--bw-gray-300);
  border-radius: var(--bw-radius-sm);
  font-family: var(--bw-font);
  font-size: .88rem;
  font-weight: 600;
  color: var(--bw-gray-600);
  cursor: pointer;
  transition: all var(--bw-transition);
}

.btn-download-ics:hover {
  border-color: var(--bw-gold);
  color: var(--bw-gold-dark);
}

/* ============================================================
   10. Navigation Buttons
   ============================================================ */

.step-navigation {
  display: flex;
  gap: var(--bw-gap-sm);
  margin-top: var(--bw-pad);
  padding-top: var(--bw-gap);
  border-top: 1px solid var(--bw-gray-200);
}

.booking-v2-wrap .btn {
  flex: 1;
  padding: 12px 20px;
  border: none;
  border-radius: var(--bw-radius-sm);
  font-family: var(--bw-font);
  font-size: .9rem;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--bw-transition);
  text-align: center;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  text-decoration: none;
}

.booking-v2-wrap .btn-next {
  background: var(--bw-gold);
  color: var(--bw-white);
  box-shadow: 0 2px 10px rgba(201,169,110,.3);
}

.booking-v2-wrap .btn-next:hover {
  background: var(--bw-gold-dark);
  transform: translateY(-1px);
  box-shadow: 0 4px 14px rgba(201,169,110,.4);
}

.booking-v2-wrap .btn-next:disabled {
  background: var(--bw-gray-300);
  color: var(--bw-gray-500);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.booking-v2-wrap .btn-back {
  background: var(--bw-gray-100);
  color: var(--bw-gray-600);
  border: 1px solid var(--bw-gray-300);
}

.booking-v2-wrap .btn-back:hover {
  background: var(--bw-gray-200);
}

.booking-v2-wrap .btn-submit {
  background: linear-gradient(135deg, var(--bw-gold) 0%, var(--bw-gold-dark) 100%);
  color: var(--bw-white);
  box-shadow: 0 4px 15px rgba(201,169,110,.35);
  font-weight: 700;
}

.booking-v2-wrap .btn-submit:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(201,169,110,.45);
}

.booking-v2-wrap .btn-submit:disabled {
  background: var(--bw-gray-300);
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

/* ============================================================
   11. Loading Overlay
   ============================================================ */

.booking-v2-loading {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.85);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
  border-radius: var(--bw-radius);
  backdrop-filter: blur(2px);
}

.spinner {
  width: 40px;
  height: 40px;
  border: 4px solid var(--bw-gray-200);
  border-top-color: var(--bw-gold);
  border-radius: 50%;
  animation: bwSpin .8s linear infinite;
  margin-bottom: var(--bw-gap-sm);
}

@keyframes bwSpin { to { transform: rotate(360deg); } }

.booking-v2-loading p {
  font-size: .85rem;
  color: var(--bw-text-muted);
  font-weight: 500;
}

/* ============================================================
   12. Responsive
   ============================================================ */

@media (min-width: 600px) {
  .booking-v2-wrap { padding: 32px; margin-top: 120px; margin-bottom: 48px; }
  .booking-v2-wrap .time-slots { grid-template-columns: repeat(4, 1fr); }
  .step-num { width: 42px; height: 42px; }
  .step-label { font-size: .78rem; }
}

@media (min-width: 768px) {
  .booking-v2-wrap { padding: 40px; }
  .booking-v2-wrap .time-slots { grid-template-columns: repeat(5, 1fr); }
  .step-num { width: 46px; height: 46px; font-size: .9rem; }
}

@media (max-width: 480px) {
  .booking-v2-wrap .time-slot { padding: 14px 8px; font-size: .88rem; min-height: 48px; }
  .booking-v2-wrap .service-card { padding: var(--bw-pad); min-height: 120px; }
  .booking-v2-wrap .calendar-day { min-height: 44px; font-size: .9rem; }
  .booking-v2-wrap .btn { min-height: 48px; font-size: .95rem; }
  .booking-v2-wrap .form-group input,
  .booking-v2-wrap .form-group textarea,
  .booking-v2-wrap .form-group select { min-height: 48px; font-size: 1rem; }
  .booking-v2-wrap { margin: 0; border-radius: 0; box-shadow: none; padding: var(--bw-pad); }
  .step-navigation { flex-direction: column; gap: var(--bw-gap-sm); }
  .booking-v2-wrap .btn { width: 100%; }
}

@supports (padding: env(safe-area-inset-bottom)) {
  .booking-v2-wrap { padding-bottom: calc(var(--bw-pad) + env(safe-area-inset-bottom)); }
}

@media (prefers-reduced-motion: reduce) {
  .booking-v2-wrap,
  .booking-v2-wrap .service-card,
  .booking-v2-wrap .time-slot,
  .step-num,
  .booking-v2-wrap .btn,
  .toggle-slider,
  .toggle-slider::before,
  .booking-v2-wrap .calendar-day {
    transition: none !important;
    animation: none !important;
  }
}
