/* ═══════════════════════════════════════════════
   Booking Widget — iOS-style embedded app
   ═══════════════════════════════════════════════ */

.booking-overlay {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.35s;
}

.booking-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.booking-overlay__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

/* Phone-style frame */
.booking-app {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: min(92dvh, 760px);
  background: #0f0f0f;
  border-radius: 28px;
  border: 1px solid #2a2a2a;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255,255,255,0.04) inset;
  transform: translateY(24px) scale(0.96);
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.booking-overlay.is-active .booking-app {
  transform: translateY(0) scale(1);
}

/* Top bar */
.ba-topbar {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem 1.25rem 0.75rem;
  background: #0f0f0f;
  border-bottom: 1px solid #1e1e1e;
  position: relative;
  min-height: 56px;
}

.ba-topbar__back {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  color: #d4ff00;
  cursor: pointer;
  transition: background 0.2s;
  flex-shrink: 0;
}

.ba-topbar__back:hover {
  background: rgba(212,255,0,0.12);
}

.ba-topbar__back svg {
  width: 18px;
  height: 18px;
}

.ba-topbar__title {
  flex: 1;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  text-align: center;
  margin-right: 36px;
}

.ba-topbar__back + .ba-topbar__title {
  margin-right: 0;
}

.ba-topbar__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: rgba(255,255,255,0.06);
  border-radius: 10px;
  color: #999;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  flex-shrink: 0;
}

.ba-topbar__close:hover {
  background: rgba(255,255,255,0.12);
  color: #fff;
}

.ba-topbar__close svg {
  width: 16px;
  height: 16px;
}

/* Steps indicator */
.ba-steps {
  flex-shrink: 0;
  display: flex;
  gap: 6px;
  padding: 0.65rem 1.25rem;
  background: #0f0f0f;
}

.ba-steps__dot {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: #222;
  transition: background 0.3s;
}

.ba-steps__dot.is-active {
  background: #d4ff00;
}

.ba-steps__dot.is-done {
  background: rgba(212, 255, 0, 0.4);
}

/* Content area */
.ba-content {
  flex: 1;
  overflow: hidden;
  position: relative;
}

.ba-screen {
  position: absolute;
  inset: 0;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 1rem 1.25rem 1.5rem;
  opacity: 0;
  transform: translateX(40px);
  transition: opacity 0.3s ease, transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  pointer-events: none;
  -webkit-overflow-scrolling: touch;
}

.ba-screen.is-active {
  opacity: 1;
  transform: translateX(0);
  pointer-events: auto;
}

.ba-screen.is-leaving {
  opacity: 0;
  transform: translateX(-40px);
}

/* ─── Screen 1: Services list ─── */
.ba-search {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.65rem 0.85rem;
  background: #1a1a1a;
  border: 1px solid #252525;
  border-radius: 12px;
  margin-bottom: 1rem;
  transition: border-color 0.2s;
}

.ba-search:focus-within {
  border-color: rgba(212, 255, 0, 0.4);
}

.ba-search__icon {
  color: #d4ff00;
  flex-shrink: 0;
}

.ba-search__icon svg {
  width: 16px;
  height: 16px;
}

.ba-search__input {
  flex: 1;
  border: none;
  background: none;
  color: #e0e0e0;
  font: inherit;
  font-size: 0.9rem;
  outline: none;
}

.ba-search__input::placeholder {
  color: #666;
}

.ba-search__clear {
  border: none;
  background: none;
  color: #666;
  cursor: pointer;
  padding: 2px;
  display: none;
}

.ba-search__clear.is-visible {
  display: block;
}

/* Categories */
.ba-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 0.75rem;
  margin-bottom: 0.25rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.ba-cats::-webkit-scrollbar { display: none; }

.ba-chip {
  flex-shrink: 0;
  padding: 0.4rem 0.9rem;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 600;
  font-size: 0.8rem;
  border: none;
  border-radius: 999px;
  background: #1a1a1a;
  color: #ccc;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  white-space: nowrap;
}

.ba-chip:hover {
  background: #222;
}

.ba-chip.is-active {
  background: #d4ff00;
  color: #000;
}

/* Service label */
.ba-section-label {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  color: #999;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin: 0.75rem 0 0.6rem;
}

/* Service card (mimics iOS layout) */
.ba-service {
  display: flex;
  gap: 0;
  background: #161616;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 0.75rem;
  cursor: pointer;
  border: 1px solid #1e1e1e;
  transition: border-color 0.2s, transform 0.2s;
  min-height: 100px;
}

.ba-service:hover {
  border-color: rgba(212,255,0,0.25);
  transform: translateY(-2px);
}

.ba-service:active {
  transform: scale(0.98);
}

.ba-service__img {
  width: 105px;
  flex-shrink: 0;
  align-self: stretch;
  min-height: 100px;
  position: relative;
  overflow: hidden;
  background: #0d0d0d;
}

.ba-service__img img {
  width: 100%;
  height: 100%;
  min-height: 100px;
  object-fit: cover;
  display: block;
}

.ba-service__img::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent 40%, rgba(22,22,22,0.6) 100%);
}

.ba-service__body {
  flex: 1;
  padding: 0.85rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.ba-service__name {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.92rem;
  color: #fff;
  line-height: 1.3;
}

.ba-service__cat {
  display: inline-block;
  font-size: 0.7rem;
  color: #888;
  background: #1e1e1e;
  padding: 0.15rem 0.4rem;
  border-radius: 4px;
  width: fit-content;
}

.ba-service__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: auto;
}

.ba-service__price {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: #d4ff00;
}

.ba-service__dur {
  font-size: 0.75rem;
  color: #777;
  display: flex;
  align-items: center;
  gap: 0.25rem;
}

.ba-service__arrow {
  margin-left: auto;
  color: #d4ff00;
  font-size: 0.75rem;
  display: flex;
  align-items: center;
  gap: 0.2rem;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 600;
}

.ba-empty {
  text-align: center;
  padding: 2rem 1rem;
  color: #666;
  font-size: 0.9rem;
}

/* ─── Screen 2: Service detail ─── */
.ba-detail-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 1rem;
}

.ba-detail-header {
  background: #161616;
  border-radius: 16px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.ba-detail-header__cat {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  color: #d4ff00;
  background: rgba(212,255,0,0.1);
  padding: 0.3rem 0.65rem;
  border-radius: 8px;
  margin-bottom: 0.6rem;
}

.ba-detail-header__name {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  margin: 0 0 0.6rem;
  line-height: 1.2;
}

.ba-detail-header__meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
}

.ba-detail-header__price {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  color: #d4ff00;
}

.ba-detail-header__dur {
  font-size: 0.85rem;
  color: #888;
  display: flex;
  align-items: center;
  gap: 0.3rem;
}

.ba-info-rows {
  background: #161616;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 1rem;
}

.ba-info-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.85rem 1.1rem;
}

.ba-info-row + .ba-info-row {
  border-top: 1px solid #1e1e1e;
}

.ba-info-row__icon {
  color: #d4ff00;
  flex-shrink: 0;
  width: 24px;
  text-align: center;
}

.ba-info-row__label {
  color: #888;
  font-size: 0.88rem;
}

.ba-info-row__val {
  margin-left: auto;
  font-weight: 600;
  color: #e0e0e0;
  font-size: 0.88rem;
}

.ba-detail-desc {
  background: #161616;
  border-radius: 16px;
  padding: 1.1rem;
  margin-bottom: 6rem;
}

.ba-detail-desc__title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #e0e0e0;
  margin: 0 0 0.5rem;
}

.ba-detail-desc__text {
  color: #888;
  font-size: 0.88rem;
  line-height: 1.6;
  margin: 0;
}

/* ─── Screen 3: Date & Time ─── */
.ba-cal-label {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #e0e0e0;
  margin: 0 0 0.75rem;
}

/* Date strip (horizontal scroll of 14 days) */
.ba-dates {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 0.5rem;
  margin-bottom: 1.25rem;
  scrollbar-width: none;
}

.ba-dates::-webkit-scrollbar { display: none; }

.ba-date-btn {
  flex-shrink: 0;
  width: 56px;
  padding: 0.55rem 0;
  border: 1px solid #222;
  border-radius: 14px;
  background: #161616;
  color: #ccc;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.ba-date-btn:hover {
  border-color: #444;
}

.ba-date-btn.is-active {
  background: #d4ff00;
  border-color: #d4ff00;
  color: #000;
}

.ba-date-btn__dow {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ba-date-btn__day {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.15rem;
  line-height: 1;
}

.ba-date-btn__mon {
  font-size: 0.6rem;
  opacity: 0.7;
}

.ba-date-btn.is-active .ba-date-btn__mon {
  opacity: 1;
}

/* Time slots grid */
.ba-times-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.ba-slots {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 1.25rem;
}

.ba-slot {
  padding: 0.65rem 0;
  border: 1px solid #222;
  border-radius: 12px;
  background: #161616;
  color: #ccc;
  font-size: 0.88rem;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: all 0.2s;
}

.ba-slot:hover {
  border-color: #444;
}

.ba-slot.is-active {
  background: #d4ff00;
  border-color: #d4ff00;
  color: #000;
  font-weight: 700;
}

.ba-slot.is-disabled {
  opacity: 0.3;
  pointer-events: none;
}

.ba-no-slots {
  text-align: center;
  padding: 1.5rem 1rem;
  background: #161616;
  border-radius: 12px;
  color: #666;
  font-size: 0.88rem;
  margin-bottom: 1.25rem;
}

/* Notes */
.ba-notes-label {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #e0e0e0;
  margin: 0 0 0.5rem;
}

.ba-notes-input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid #222;
  border-radius: 12px;
  background: #161616;
  color: #e0e0e0;
  font: inherit;
  font-size: 0.88rem;
  resize: vertical;
  min-height: 80px;
  margin-bottom: 5rem;
  transition: border-color 0.2s;
}

.ba-notes-input::placeholder { color: #555; }
.ba-notes-input:focus { outline: none; border-color: rgba(212,255,0,0.4); }

/* ─── Screen 4: Confirmation ─── */
.ba-confirm-summary {
  background: #161616;
  border-radius: 16px;
  padding: 1.1rem;
  margin-bottom: 1rem;
}

.ba-confirm-summary__title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  font-size: 0.95rem;
  color: #fff;
  margin: 0 0 0.75rem;
}

.ba-confirm-row {
  display: flex;
  justify-content: space-between;
  padding: 0.4rem 0;
  font-size: 0.88rem;
}

.ba-confirm-row__label { color: #888; }
.ba-confirm-row__val { color: #e0e0e0; font-weight: 600; }
.ba-confirm-row__val--accent { color: #d4ff00; }

.ba-confirm-form-label {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.85rem;
  color: #e0e0e0;
  margin: 1rem 0 0.5rem;
}

.ba-confirm-input {
  width: 100%;
  padding: 0.75rem 0.85rem;
  border: 1px solid #222;
  border-radius: 12px;
  background: #161616;
  color: #e0e0e0;
  font: inherit;
  font-size: 0.9rem;
  margin-bottom: 0.65rem;
  transition: border-color 0.2s;
}

.ba-confirm-input::placeholder { color: #555; }
.ba-confirm-input:focus { outline: none; border-color: rgba(212,255,0,0.4); }

.ba-consent-row {
  display: flex;
  gap: 0.6rem;
  align-items: flex-start;
  margin: 0.75rem 0 0;
  font-size: 0.78rem;
  color: #888;
  line-height: 1.5;
}

.ba-consent-row input {
  accent-color: #d4ff00;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  margin-top: 2px;
}

.ba-consent-row a { color: #d4ff00; }

.ba-trust {
  margin: 0.6rem 0 0;
  font-size: 0.72rem;
  color: #666;
  text-align: center;
}

/* ─── Screen 5: Success ─── */
.ba-success {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 2rem 1rem;
  height: 100%;
}

.ba-success__icon {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  background: rgba(212,255,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  animation: ba-pop 0.5s cubic-bezier(0.16, 1, 0.3, 1) both;
}

@keyframes ba-pop {
  0% { transform: scale(0); }
  100% { transform: scale(1); }
}

.ba-success__icon svg {
  width: 32px;
  height: 32px;
  color: #d4ff00;
}

.ba-success__title {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  font-size: 1.2rem;
  color: #fff;
  margin: 0 0 0.5rem;
}

.ba-success__text {
  color: #888;
  font-size: 0.9rem;
  line-height: 1.6;
  max-width: 300px;
  margin: 0 0 2rem;
}

/* ─── Bottom bar (sticky CTA) ─── */
.ba-bottom {
  flex-shrink: 0;
  padding: 0.85rem 1.25rem;
  background: #0f0f0f;
  border-top: 1px solid #1e1e1e;
}

.ba-bottom__info {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
  font-size: 0.82rem;
}

.ba-bottom__datetime { color: #999; }
.ba-bottom__price {
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 800;
  color: #d4ff00;
}

.ba-bottom__btn {
  width: 100%;
  padding: 0.85rem;
  border: none;
  border-radius: 14px;
  background: #d4ff00;
  color: #000;
  font-family: "Montserrat", system-ui, sans-serif;
  font-weight: 700;
  font-size: 0.95rem;
  cursor: pointer;
  transition: background 0.2s, transform 0.15s;
}

.ba-bottom__btn:hover {
  background: #e8ff4d;
}

.ba-bottom__btn:active {
  transform: scale(0.98);
}

.ba-bottom__btn:disabled {
  opacity: 0.35;
  pointer-events: none;
}

.ba-bottom__btn--secondary {
  background: transparent;
  color: #d4ff00;
  border: 2px solid #d4ff00;
}

.ba-bottom__btn--secondary:hover {
  background: rgba(212,255,0,0.08);
}

.ba-err-msg {
  color: #ff6b6b;
  font-size: 0.82rem;
  margin-top: 0.35rem;
  text-align: center;
}

/* Loading spinner */
.ba-spinner {
  width: 28px;
  height: 28px;
  border: 3px solid #222;
  border-top-color: #d4ff00;
  border-radius: 50%;
  animation: ba-spin 0.7s linear infinite;
  margin: 0 auto;
}

@keyframes ba-spin {
  to { transform: rotate(360deg); }
}

.ba-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 3rem 1rem;
}

.ba-service__img--placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #111;
}

/* Scrollbar styling inside booking */
.ba-screen::-webkit-scrollbar { width: 4px; }
.ba-screen::-webkit-scrollbar-track { background: transparent; }
.ba-screen::-webkit-scrollbar-thumb { background: #2a2a2a; border-radius: 2px; }

@media (max-width: 520px) {
  .booking-overlay {
    padding: 0;
    align-items: stretch;
  }

  .booking-app {
    max-width: none;
    width: 100%;
    height: 100dvh;
    height: 100svh;
    max-height: none;
    border-radius: 0;
    border: none;
    box-shadow: none;
    transform: none;
  }

  .booking-overlay.is-active .booking-app {
    transform: none;
  }

  .ba-topbar {
    padding-top: calc(1rem + env(safe-area-inset-top, 0));
  }

  .ba-bottom {
    padding-bottom: calc(0.85rem + env(safe-area-inset-bottom, 0));
  }

  .ba-slots {
    grid-template-columns: repeat(3, 1fr);
  }

  .ba-service__img {
    width: 88px;
    min-height: 88px;
  }

  .ba-service {
    min-height: 88px;
  }
}

@media (max-width: 360px) {
  .ba-slots {
    grid-template-columns: repeat(2, 1fr);
  }

  .ba-date-btn {
    width: 50px;
  }
}
