/* ═══════════════════════════════════════════════════════════════
   booking.css — Royal Braid Boutique Custom Square Booking Modal
   ═══════════════════════════════════════════════════════════════ */

/* ── Overlay backdrop ────────────────────────────────────────────── */
#bk-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.82);
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
#bk-overlay.open {
  opacity: 1;
  pointer-events: auto;
}

/* ── Modal shell ─────────────────────────────────────────────────── */
#bk-modal {
  background: #1a1a1a;
  border: 1px solid #c8a84b;
  border-radius: 12px;
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  transform: translateY(24px) scale(0.97);
  transition: transform 0.28s ease;
  overflow: hidden;
}
#bk-overlay.open #bk-modal {
  transform: translateY(0) scale(1);
}

/* ── Modal header ────────────────────────────────────────────────── */
.bk-header {
  background: linear-gradient(135deg, #c8a84b 0%, #a07830 100%);
  padding: 1.1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.bk-header-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.15rem;
  font-weight: 700;
  color: #1a1a1a;
  letter-spacing: 0.02em;
}
.bk-close {
  background: none;
  border: none;
  color: #1a1a1a;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
  padding: 0 0.25rem;
  opacity: 0.8;
  transition: opacity 0.2s;
}
.bk-close:hover { opacity: 1; }

/* ── Step progress bar ───────────────────────────────────────────── */
.bk-progress {
  display: flex;
  align-items: center;
  padding: 0.8rem 1.4rem;
  gap: 0;
  background: #111;
  flex-shrink: 0;
  border-bottom: 1px solid #2a2a2a;
}
.bk-step-dot {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 2px solid #444;
  color: #666;
  font-size: 0.72rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background 0.25s, border-color 0.25s, color 0.25s;
  position: relative;
  z-index: 1;
}
.bk-step-dot.active {
  border-color: #c8a84b;
  background: #c8a84b;
  color: #1a1a1a;
}
.bk-step-dot.done {
  border-color: #c8a84b;
  background: transparent;
  color: #c8a84b;
}
.bk-step-line {
  flex: 1;
  height: 2px;
  background: #333;
  transition: background 0.25s;
}
.bk-step-line.done { background: #c8a84b; }

/* ── Scrollable body ─────────────────────────────────────────────── */
.bk-body {
  flex: 1;
  overflow-y: auto;
  padding: 1.4rem;
  scrollbar-width: thin;
  scrollbar-color: #c8a84b #1a1a1a;
}
.bk-body::-webkit-scrollbar { width: 6px; }
.bk-body::-webkit-scrollbar-track { background: #1a1a1a; }
.bk-body::-webkit-scrollbar-thumb { background: #c8a84b; border-radius: 3px; }

/* ── Step panels ─────────────────────────────────────────────────── */
.bk-panel { display: none; }
.bk-panel.active { display: block; }

.bk-step-label {
  font-family: 'Playfair Display', serif;
  font-size: 1.05rem;
  color: #c8a84b;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #2a2a2a;
}

/* ── Service summary card ─────────────────────────────────────────── */
.bk-service-card {
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem 1.2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.bk-service-name {
  color: #f0f0f0;
  font-weight: 600;
  font-size: 1rem;
}
.bk-service-meta {
  color: #999;
  font-size: 0.82rem;
  margin-top: 0.2rem;
}
.bk-service-price {
  color: #c8a84b;
  font-weight: 700;
  font-size: 1.15rem;
  flex-shrink: 0;
}

/* ── Calendar ────────────────────────────────────────────────────── */
.bk-cal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}
.bk-cal-month {
  color: #f0f0f0;
  font-weight: 600;
  font-size: 0.95rem;
}
.bk-cal-nav {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #c8a84b;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
}
.bk-cal-nav:hover { background: #333; }
.bk-cal-nav:disabled { opacity: 0.3; cursor: not-allowed; }
.bk-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.bk-cal-dow {
  text-align: center;
  font-size: 0.7rem;
  color: #666;
  font-weight: 600;
  text-transform: uppercase;
  padding: 0.25rem 0;
}
.bk-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  font-size: 0.85rem;
  cursor: pointer;
  color: #ccc;
  border: 2px solid transparent;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.bk-cal-day:hover:not(.disabled):not(.empty):not(.past) {
  background: #2a2a2a;
  border-color: #c8a84b;
  color: #c8a84b;
}
.bk-cal-day.selected {
  background: #c8a84b;
  color: #1a1a1a;
  font-weight: 700;
  border-color: #c8a84b;
}
.bk-cal-day.today { color: #c8a84b; font-weight: 700; }
.bk-cal-day.today.selected { color: #1a1a1a; }
.bk-cal-day.disabled,
.bk-cal-day.past,
.bk-cal-day.empty {
  color: #444;
  cursor: not-allowed;
  pointer-events: none;
}

/* ── Time slot grid ──────────────────────────────────────────────── */
.bk-slots-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.55rem;
  margin-top: 0.5rem;
}
.bk-slot {
  background: #2a2a2a;
  border: 2px solid #333;
  border-radius: 8px;
  color: #ccc;
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.55rem 0.3rem;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.bk-slot:hover {
  background: #333;
  border-color: #c8a84b;
  color: #c8a84b;
}
.bk-slot.selected {
  background: #c8a84b;
  border-color: #c8a84b;
  color: #1a1a1a;
}
.bk-no-slots {
  color: #888;
  font-size: 0.9rem;
  text-align: center;
  padding: 1.5rem 0;
}

/* ── Loading spinner ─────────────────────────────────────────────── */
.bk-spinner {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  gap: 0.6rem;
  color: #888;
  font-size: 0.9rem;
}
.bk-spinner::before {
  content: '';
  width: 22px;
  height: 22px;
  border: 3px solid #333;
  border-top-color: #c8a84b;
  border-radius: 50%;
  animation: bk-spin 0.7s linear infinite;
  flex-shrink: 0;
}
@keyframes bk-spin { to { transform: rotate(360deg); } }

/* ── Form fields ─────────────────────────────────────────────────── */
.bk-form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin-bottom: 0.75rem;
}
.bk-form-group {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  margin-bottom: 0.75rem;
}
.bk-form-group.full { grid-column: 1 / -1; }
.bk-label {
  color: #aaa;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}
.bk-input {
  background: #2a2a2a;
  border: 1px solid #444;
  border-radius: 6px;
  color: #f0f0f0;
  font-size: 0.95rem;
  padding: 0.65rem 0.85rem;
  width: 100%;
  box-sizing: border-box;
  transition: border-color 0.2s;
  font-family: inherit;
}
.bk-input:focus {
  outline: none;
  border-color: #c8a84b;
}
.bk-input::placeholder { color: #555; }

/* ── Square card form container ──────────────────────────────────── */
.bk-card-wrap {
  background: #f7f5f0;
  border: 1px solid rgba(201,168,75,0.4);
  border-radius: 8px;
  padding: 6px 4px;
  margin-bottom: 0.75rem;
  min-height: 56px;
  transition: border-color 0.2s, box-shadow 0.2s;
  overflow: hidden;
}
.bk-card-wrap:focus-within {
  border-color: #c8a84b;
  box-shadow: 0 0 0 3px rgba(201,168,75,0.15);
}

/* ── Order summary ───────────────────────────────────────────────── */
.bk-summary {
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.bk-summary-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.3rem 0;
  color: #ccc;
  font-size: 0.9rem;
}
.bk-summary-row + .bk-summary-row { border-top: 1px solid #2a2a2a; }
.bk-summary-row.total {
  font-weight: 700;
  color: #c8a84b;
  font-size: 1rem;
  border-top: 1px solid #444 !important;
  margin-top: 0.25rem;
  padding-top: 0.6rem;
}
.bk-summary-label { color: #888; }

/* ── Security note ───────────────────────────────────────────────── */
.bk-secure-note {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: #666;
  font-size: 0.78rem;
  margin-bottom: 1rem;
}
.bk-secure-note svg {
  width: 14px;
  height: 14px;
  fill: #666;
  flex-shrink: 0;
}

/* ── Buttons ─────────────────────────────────────────────────────── */
.bk-btn-row {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.2rem;
  flex-wrap: wrap;
}
.bk-btn {
  flex: 1;
  padding: 0.75rem 1.2rem;
  border-radius: 8px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  border: none;
  transition: opacity 0.2s, transform 0.15s;
  font-family: inherit;
  min-width: 0;
}
.bk-btn:active { transform: scale(0.97); }
.bk-btn-primary {
  background: linear-gradient(135deg, #c8a84b 0%, #a07830 100%);
  color: #1a1a1a;
}
.bk-btn-primary:hover { opacity: 0.92; }
.bk-btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  transform: none;
}
.bk-btn-secondary {
  background: #2a2a2a;
  border: 1px solid #444;
  color: #ccc;
}
.bk-btn-secondary:hover { background: #333; }

/* ── Error message ───────────────────────────────────────────────── */
.bk-error {
  background: rgba(220, 50, 50, 0.12);
  border: 1px solid rgba(220, 50, 50, 0.4);
  border-radius: 6px;
  color: #f07070;
  font-size: 0.88rem;
  padding: 0.65rem 0.9rem;
  margin-bottom: 0.75rem;
  display: none;
}
.bk-error.visible { display: block; }

/* ── Confirmation step ───────────────────────────────────────────── */
.bk-confirm-icon {
  text-align: center;
  margin-bottom: 1.2rem;
}
.bk-confirm-icon svg {
  width: 64px;
  height: 64px;
}
.bk-confirm-title {
  font-family: 'Playfair Display', serif;
  font-size: 1.4rem;
  color: #c8a84b;
  text-align: center;
  margin-bottom: 0.5rem;
}
.bk-confirm-sub {
  color: #999;
  font-size: 0.9rem;
  text-align: center;
  margin-bottom: 1.5rem;
  line-height: 1.5;
}
.bk-confirm-details {
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 1rem 1.1rem;
  margin-bottom: 1rem;
}
.bk-confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.88rem;
  color: #ccc;
  border-top: 1px solid #2a2a2a;
}
.bk-confirm-row:first-child { border-top: none; }
.bk-confirm-row span:first-child { color: #888; }
.bk-confirm-row span:last-child { font-weight: 600; color: #f0f0f0; }
.bk-ref-code {
  font-size: 1.2rem;
  color: #c8a84b !important;
  letter-spacing: 0.1em;
  font-weight: 700 !important;
}

/* ── Booking date/time selection bar ─────────────────────────────── */
.bk-selection-bar {
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.65rem 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 1rem;
  flex-wrap: wrap;
}
.bk-selection-bar .bk-badge {
  background: #c8a84b;
  color: #1a1a1a;
  font-size: 0.75rem;
  font-weight: 700;
  border-radius: 4px;
  padding: 0.2rem 0.5rem;
}
.bk-selection-bar .bk-sel-text {
  color: #ccc;
  font-size: 0.88rem;
}

/* ── Service picker (Step 0) ─────────────────────────────────────── */
.bk-pick-cat {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #c8a84b;
  margin: 1rem 0 0.5rem;
  padding-bottom: 0.3rem;
  border-bottom: 1px solid #2a2a2a;
}
.bk-pick-cat:first-child { margin-top: 0; }
.bk-pick-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
  margin-bottom: 0.25rem;
}
.bk-pick-item {
  background: #222;
  border: 1px solid #333;
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  text-align: left;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  font-family: inherit;
}
.bk-pick-item:hover {
  background: #2a2a2a;
  border-color: #c8a84b;
}
.bk-pick-name {
  color: #f0f0f0;
  font-size: 0.85rem;
  font-weight: 600;
  line-height: 1.2;
}
.bk-pick-meta {
  color: #c8a84b;
  font-size: 0.75rem;
  font-weight: 500;
}

/* ── Mobile tweaks ───────────────────────────────────────────────── */
@media (max-width: 480px) {
  #bk-modal { border-radius: 10px; }
  .bk-header { padding: 0.9rem 1rem; }
  .bk-body { padding: 1rem; }
  .bk-form-row { grid-template-columns: 1fr; }
  .bk-slots-grid { grid-template-columns: repeat(2, 1fr); }
  .bk-btn-row { flex-direction: column-reverse; }
  .bk-btn { flex: none; width: 100%; }
}
