/**
 * Smart Booking Pro — Public Styles
 * Scoped entirely under .sb-booking-wrap and .sb-services-grid
 */

/* ── CSS custom properties ───────────────────────────────────────── */
.sb-booking-wrap {
  --sb-primary: #2563eb;
  --sb-primary-dark: #1d4ed8;
  --sb-primary-light: #dbeafe;
  --sb-radius: 10px;
  --sb-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
}

/* ── Container ───────────────────────────────────────────────────── */
.sb-booking-wrap {
  font-family: var(--sb-font);
  color: #1e293b;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: var(--sb-radius);
  overflow: hidden;
  box-shadow: 0 4px 24px rgba(0,0,0,.07);
  position: relative;
}
.sb-booking-wrap * { box-sizing: border-box; }

/* ── Business header ─────────────────────────────────────────────── */
.sb-booking-header {
  background: var(--sb-primary);
  padding: 14px 22px;
  display: flex;
  align-items: center;
}
.sb-booking-logo {
  max-height: 36px;
  max-width: 160px;
  object-fit: contain;
  filter: brightness(0) invert(1);
}
.sb-booking-business-name {
  color: #fff;
  font-size: 16px;
  font-weight: 700;
}

/* ── Step progress bar ───────────────────────────────────────────── */
.sb-steps {
  display: flex;
  background: #f8fafc;
  border-bottom: 1px solid #e2e8f0;
  overflow-x: auto;
}
.sb-step {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 10px 8px;
  min-width: 80px;
  border-right: 1px solid #e2e8f0;
  transition: background .2s;
  cursor: default;
}
.sb-step:last-child { border-right: none; }
.sb-step--hidden { display: none; }
.sb-step__number {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #d1d5db;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 3px;
  transition: background .2s;
}
.sb-step__label { font-size: 10px; color: #94a3b8; text-align: center; font-weight: 500; }
.sb-step--active .sb-step__number { background: var(--sb-primary); }
.sb-step--active .sb-step__label  { color: var(--sb-primary); font-weight: 600; }
.sb-step--done .sb-step__number   { background: #10b981; }
.sb-step--done .sb-step__label    { color: #059669; }

/* ── Booking body ────────────────────────────────────────────────── */
.sb-booking-body { padding: 22px; position: relative; }

/* ── Panel (step wrapper) ────────────────────────────────────────── */
.sb-panel { animation: sb-fadein .2s ease; }
.sb-panel--hidden { display: none; }
.sb-panel__title { font-size: 18px; font-weight: 700; margin: 0 0 18px; color: #0f172a; }
.sb-panel__nav { display: flex; justify-content: space-between; margin-top: 22px; }
.sb-panel__nav--right { justify-content: flex-end; }
@keyframes sb-fadein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ── Buttons ─────────────────────────────────────────────────────── */
.sb-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: none;
  transition: all .15s;
  text-decoration: none;
  white-space: nowrap;
}
.sb-btn:disabled { opacity: .5; cursor: not-allowed; }
.sb-btn--primary { background: var(--sb-primary); color: #fff; }
.sb-btn--primary:hover:not(:disabled) { background: var(--sb-primary-dark); }
.sb-btn--ghost { background: #f8fafc; color: #374151; border: 1px solid #e2e8f0; }
.sb-btn--ghost:hover { background: #f1f5f9; }
.sb-btn--lg { padding: 13px 28px; font-size: 15px; }
.sb-btn--pay { background: #10b981; color: #fff; }
.sb-btn--pay:hover:not(:disabled) { background: #059669; }

/* ── Service list ────────────────────────────────────────────────── */
.sb-search-input {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 7px;
  font-size: 13px;
  margin-bottom: 12px;
  outline: none;
}
.sb-search-input:focus { border-color: var(--sb-primary); box-shadow: 0 0 0 3px var(--sb-primary-light); }

.sb-service-list { display: flex; flex-direction: column; gap: 8px; max-height: 420px; overflow-y: auto; padding-right: 2px; }
.sb-service-list::-webkit-scrollbar { width: 4px; }
.sb-service-list::-webkit-scrollbar-thumb { background: #e2e8f0; border-radius: 4px; }

.sb-service-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  transition: all .15s;
  width: 100%;
}
.sb-service-option:hover { border-color: var(--sb-primary); background: #fafbff; }
.sb-service-option--selected { border-color: var(--sb-primary); background: var(--sb-primary-light); box-shadow: 0 0 0 1px var(--sb-primary); }

.sb-service-option__img { width: 48px; height: 48px; border-radius: 7px; object-fit: cover; flex-shrink: 0; }
.sb-service-option__color { width: 12px; height: 36px; border-radius: 4px; flex-shrink: 0; }
.sb-service-option__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sb-service-option__name { font-size: 14px; font-weight: 600; color: #0f172a; }
.sb-service-option__desc { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-service-option__meta { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; margin-top: 3px; }
.sb-service-option__duration,
.sb-service-option__price { font-size: 12px; color: #475569; }
.sb-service-option__check { width: 20px; height: 20px; border-radius: 50%; background: var(--sb-primary); color: #fff; display: none; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.sb-service-option--selected .sb-service-option__check { display: flex; }
.sb-free { color: #059669; font-weight: 600; }

/* ── Staff list ──────────────────────────────────────────────────── */
.sb-staff-list { display: flex; flex-direction: column; gap: 8px; }

.sb-staff-option {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 9px;
  cursor: pointer;
  background: #fff;
  text-align: left;
  transition: all .15s;
  width: 100%;
}
.sb-staff-option:hover { border-color: var(--sb-primary); background: #fafbff; }
.sb-staff-option--selected { border-color: var(--sb-primary); background: var(--sb-primary-light); box-shadow: 0 0 0 1px var(--sb-primary); }

.sb-staff-option__avatar { width: 48px; height: 48px; border-radius: 50%; overflow: hidden; flex-shrink: 0; background: #e2e8f0; display: flex; align-items: center; justify-content: center; }
.sb-staff-option__avatar img { width: 100%; height: 100%; object-fit: cover; }
.sb-staff-option__avatar--any { background: linear-gradient(135deg, #dbeafe, #e0e7ff); font-size: 20px; }
.sb-staff-option__initials { font-size: 16px; font-weight: 700; color: var(--sb-primary); }
.sb-staff-option__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.sb-staff-option__name { font-size: 14px; font-weight: 600; color: #0f172a; }
.sb-staff-option__position { font-size: 11px; color: #2563eb; font-weight: 500; }
.sb-staff-option__desc { font-size: 11px; color: #64748b; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sb-staff-option__check { width: 20px; height: 20px; border-radius: 50%; background: var(--sb-primary); color: #fff; display: none; align-items: center; justify-content: center; font-size: 11px; flex-shrink: 0; }
.sb-staff-option--selected .sb-staff-option__check { display: flex; }

/* ── Date & time ─────────────────────────────────────────────────── */
.sb-datetime-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .sb-datetime-layout { grid-template-columns: 1fr; } }

.sb-calendar-wrap {}
.sb-flatpickr-inline .flatpickr-calendar { position: relative !important; box-shadow: none !important; border: 1px solid #e2e8f0; border-radius: 9px; width: 100% !important; }

.sb-slots-title { font-size: 13px; font-weight: 600; color: #374151; margin: 0 0 10px; }
.sb-slots-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(75px, 1fr)); gap: 6px; max-height: 280px; overflow-y: auto; }
.sb-slot-btn {
  padding: 8px 6px;
  border: 1.5px solid #e2e8f0;
  border-radius: 7px;
  background: #fff;
  font-size: 12px;
  font-weight: 600;
  color: #374151;
  cursor: pointer;
  transition: all .15s;
  text-align: center;
}
.sb-slot-btn:hover { border-color: var(--sb-primary); color: var(--sb-primary); background: var(--sb-primary-light); }
.sb-slot-btn--selected { background: var(--sb-primary); border-color: var(--sb-primary); color: #fff; }
.sb-slot-btn--unavailable { opacity: .4; cursor: not-allowed; text-decoration: line-through; }
.sb-slots-empty { font-size: 12px; color: #94a3b8; padding: 20px; text-align: center; grid-column: 1 / -1; }
.sb-slots-loading { display: flex; align-items: center; gap: 8px; font-size: 12px; color: #64748b; padding: 10px 0; }
.sb-spinner-sm { width: 14px; height: 14px; border: 2px solid #e2e8f0; border-top-color: var(--sb-primary); border-radius: 50%; animation: sb-spin .6s linear infinite; display: inline-block; }
.sb-hidden { display: none !important; }

/* ── Summary card ────────────────────────────────────────────────── */
.sb-summary-card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 14px 16px;
  margin-bottom: 18px;
}
.sb-summary-card__row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 13px;
}
.sb-summary-card__row:last-child { border-bottom: none; }
.sb-summary-card__label { color: #64748b; }
.sb-summary-card__value { font-weight: 600; color: #0f172a; text-align: right; max-width: 60%; }
.sb-summary-card__row--total .sb-summary-card__value--price { font-size: 16px; color: var(--sb-primary); }

/* ── Customer form ───────────────────────────────────────────────── */
.sb-customer-form { display: flex; flex-direction: column; gap: 14px; }
.sb-label { font-size: 12px; font-weight: 600; color: #374151; display: block; margin-bottom: 4px; }
.sb-input, .sb-textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid #d1d5db;
  border-radius: 7px;
  font-size: 14px;
  color: #1e293b;
  background: #fff;
  transition: border-color .15s, box-shadow .15s;
  font-family: var(--sb-font);
}
.sb-input:focus, .sb-textarea:focus {
  border-color: var(--sb-primary);
  box-shadow: 0 0 0 3px var(--sb-primary-light);
  outline: none;
}
.sb-textarea { resize: vertical; min-height: 70px; }
.sb-checkbox-label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 12px;
  color: #475569;
  cursor: pointer;
}
.sb-checkbox-label input { margin-top: 2px; accent-color: var(--sb-primary); }
.sb-checkbox-label a { color: var(--sb-primary); }
.sb-form-error { color: #b91c1c; background: #fef2f2; border: 1px solid #fecaca; border-radius: 7px; padding: 10px 12px; font-size: 13px; margin-top: 10px; }

/* ── Payment step ────────────────────────────────────────────────── */
.sb-payment-amount { font-size: 22px; font-weight: 700; text-align: center; margin: 0 0 18px; color: #0f172a; }
.sb-payment-amount__label { font-size: 14px; font-weight: 400; color: #64748b; margin-right: 6px; }
.sb-payment-tabs { display: flex; gap: 6px; margin-bottom: 16px; }
.sb-payment-tab { flex: 1; padding: 10px; border: 1.5px solid #e2e8f0; border-radius: 8px; background: #fff; cursor: pointer; font-size: 13px; font-weight: 600; transition: all .15s; display: flex; align-items: center; justify-content: center; gap: 6px; }
.sb-payment-tab--active { border-color: var(--sb-primary); background: var(--sb-primary-light); color: var(--sb-primary); }

.sb-stripe-wrap, .sb-paypal-wrap { margin-bottom: 14px; }
.sb-card-element {
  padding: 12px 14px;
  border: 1.5px solid #e2e8f0;
  border-radius: 8px;
  background: #fff;
  min-height: 44px;
  transition: border-color .15s;
}
.sb-card-element.StripeElement--focus { border-color: var(--sb-primary); box-shadow: 0 0 0 3px var(--sb-primary-light); }
.sb-card-element.StripeElement--invalid { border-color: #ef4444; }
.sb-card-errors { color: #b91c1c; font-size: 12px; margin-top: 6px; }
.sb-secure-badge { font-size: 11px; color: #64748b; text-align: center; margin: 12px 0 0; }

/* ── Confirmation ────────────────────────────────────────────────── */
.sb-panel--confirmation { text-align: center; }
.sb-confirmation { max-width: 440px; margin: 0 auto; padding: 10px 0; }
.sb-confirmation__icon { font-size: 52px; margin-bottom: 10px; }
.sb-confirmation__title { font-size: 22px; font-weight: 800; margin: 0 0 8px; color: #0f172a; }
.sb-confirmation__subtitle { font-size: 14px; color: #64748b; margin: 0 0 20px; }
.sb-confirmation__card {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 9px;
  padding: 14px 16px;
  margin-bottom: 16px;
  text-align: left;
}
.sb-confirmation__row { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid #f1f5f9; font-size: 13px; }
.sb-confirmation__row:last-child { border-bottom: none; }
.sb-confirmation__row span { color: #64748b; }
.sb-confirmation__row strong { text-align: right; }
.sb-conf-uid { font-family: monospace; font-size: 11px; color: #94a3b8; }
.sb-confirmation__hint { font-size: 12px; color: #94a3b8; margin: 0 0 20px; }

/* ── Overlay spinner ─────────────────────────────────────────────── */
.sb-overlay {
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,.85);
  backdrop-filter: blur(2px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 100;
}
.sb-spinner {
  width: 32px;
  height: 32px;
  border: 3px solid #e2e8f0;
  border-top-color: var(--sb-primary);
  border-radius: 50%;
  animation: sb-spin .7s linear infinite;
}
.sb-spinner-text { font-size: 13px; color: #64748b; margin-top: 10px; }
@keyframes sb-spin { to { transform: rotate(360deg); } }

/* ── Services grid (shortcode [sb_services]) ─────────────────────── */
.sb-services-grid { display: grid; gap: 16px; }
.sb-services-grid--cols-1 { grid-template-columns: 1fr; }
.sb-services-grid--cols-2 { grid-template-columns: repeat(2, 1fr); }
.sb-services-grid--cols-3 { grid-template-columns: repeat(3, 1fr); }
.sb-services-grid--cols-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 640px) { .sb-services-grid { grid-template-columns: 1fr 1fr !important; } }
@media (max-width: 420px) { .sb-services-grid { grid-template-columns: 1fr !important; } }

.sb-service-card { border: 1px solid #e2e8f0; border-radius: 10px; overflow: hidden; background: #fff; transition: box-shadow .2s, transform .2s; }
.sb-service-card:hover { box-shadow: 0 4px 20px rgba(0,0,0,.09); transform: translateY(-2px); }
.sb-service-card__image { height: 140px; background-size: cover; background-position: center; }
.sb-service-card__color-bar { height: 6px; }
.sb-service-card__body { padding: 14px 16px; }
.sb-service-card__name { font-size: 15px; font-weight: 700; margin: 0 0 4px; }
.sb-service-card__desc { font-size: 12px; color: #64748b; margin: 0 0 10px; }
.sb-service-card__meta { display: flex; justify-content: space-between; font-size: 12px; color: #475569; }

/* ── Misc ────────────────────────────────────────────────────────── */
.sb-notice { color: #64748b; font-size: 13px; padding: 12px; background: #f8fafc; border-radius: 7px; border: 1px solid #e2e8f0; }

/* ── Flatpickr overrides ─────────────────────────────────────────── */
.sb-booking-wrap .flatpickr-day.selected,
.sb-booking-wrap .flatpickr-day.selected:hover { background: var(--sb-primary); border-color: var(--sb-primary); }
.sb-booking-wrap .flatpickr-day:hover { background: var(--sb-primary-light); }

/* ── Responsive ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .sb-booking-body { padding: 16px; }
  .sb-panel__title { font-size: 16px; }
  .sb-step__label { display: none; }
  .sb-step { min-width: 42px; }
}