/* ====================================================================
   BookingModal.css
   Full-screen overlay containing the SimplePractice booking widget.
   Opened by booking-modal.js when [data-booking-modal] links are clicked.
==================================================================== */

/* ── Overlay ─────────────────────────────────────────────────────── */

.booking-modal {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--spacing-5);
  opacity: 0;
  transition: opacity 0.25s ease;
  pointer-events: none; /* invisible & non-interactive until is-open */
}

.booking-modal.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* Prevent page scroll while modal is open */
.booking-modal-open {
  overflow: hidden;
}

/* ── Backdrop ────────────────────────────────────────────────────── */

.booking-modal__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(26, 26, 46, 0.72); /* --color-bg-dark at 72% opacity */
  cursor: pointer;
}

/* ── Panel ───────────────────────────────────────────────────────── */

.booking-modal__panel {
  position: relative;
  z-index: 1; /* above backdrop */
  background: #ffffff;
  border-radius: var(--radius-card, 12px);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.28);
  width: 100%;
  max-width: 860px;
  height: 88vh;
  max-height: 840px;
  display: flex;
  flex-direction: column;
  overflow: hidden;

  /* Slide-up entry */
  transform: translateY(16px);
  transition: transform 0.25s ease;
}

.booking-modal.is-open .booking-modal__panel {
  transform: translateY(0);
}

/* ── Header ──────────────────────────────────────────────────────── */

.booking-modal__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-3) var(--spacing-5);
  border-bottom: 1px solid rgba(0, 0, 0, 0.08);
  flex-shrink: 0;
}

.booking-modal__title {
  font-family: var(--font-primary);
  font-weight: 600;
  font-size: var(--text-base);
  color: var(--color-text-primary);
  margin: 0;
}

/* ── Close button ────────────────────────────────────────────────── */

.booking-modal__close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: none;
  background: transparent;
  border-radius: 50%;
  cursor: pointer;
  color: var(--color-text-muted);
  transition: background 0.15s ease, color 0.15s ease;
  flex-shrink: 0;
}

.booking-modal__close:hover {
  background: var(--color-bg-alt);
  color: var(--color-text-primary);
}

.booking-modal__close:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 2px;
}

.booking-modal__close svg {
  width: 20px;
  height: 20px;
  display: block;
}

/* ── Body — iframe fills remaining height ────────────────────────── */

.booking-modal__body {
  flex: 1;
  min-height: 0; /* critical for flex children with overflow */
  position: relative;
}

#booking-modal-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* ── Mobile — bottom sheet style ─────────────────────────────────── */

@media (max-width: 768px) {
  .booking-modal {
    padding: 0;
    align-items: flex-end;
  }

  .booking-modal__panel {
    max-width: 100%;
    height: 93vh;
    max-height: none;
    border-radius: var(--radius-card, 12px) var(--radius-card, 12px) 0 0;
    transform: translateY(100%); /* slide up from bottom on mobile */
  }

  .booking-modal.is-open .booking-modal__panel {
    transform: translateY(0);
  }
}
