/* Booking modal */

.book-modal[hidden] {
  display: none !important;
}

.book-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 72px 16px 48px;
  overflow: hidden;
  overscroll-behavior: contain;
}

.book-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  background: rgba(15, 23, 42, 0.45);
}

.book-modal-dialog {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  width: min(100%, 420px);
  max-height: min(480px, calc(100vh - 140px));
  margin: auto;
  border-radius: 16px;
  border: 1px solid #e2e8f0;
  background: #ffffff;
  box-shadow: 0 20px 48px rgba(15, 23, 42, 0.16);
  overflow: hidden;
}

.book-modal-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  flex-shrink: 0;
  padding: 18px 18px 0;
}

.book-modal-header-copy {
  min-width: 0;
  flex: 1;
}

.book-modal-header h2 {
  margin: 0;
  font-family: var(--font-body);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--text-primary);
}

.book-modal-context {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--text-secondary);
}

.book-modal-context[hidden] {
  display: none !important;
}

.book-modal-close {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--text-secondary);
  cursor: pointer;
}

.book-modal-close:hover {
  background: #e2e8f0;
  color: var(--text-primary);
}

.book-modal-close svg,
.book-modal-close i {
  width: 18px;
  height: 18px;
}

.book-modal-form {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  padding: 14px 0 0;
}

.book-step {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.book-step[hidden] {
  display: none !important;
}

.book-modal-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 0 18px;
  -webkit-overflow-scrolling: touch;
}

.book-modal-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.book-modal-field--full {
  grid-column: 1 / -1;
}

.book-modal-field {
  display: grid;
  gap: 6px;
}

.book-modal-field span {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
}

.book-modal-field input,
.book-modal-field select,
.book-modal-field textarea {
  width: 100%;
  border: 1px solid #dbe3ea;
  border-radius: 8px;
  background: #ffffff;
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 14px;
}

.book-modal-field input,
.book-modal-field select {
  height: 42px;
  padding: 0 12px;
}

.book-modal-field select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%2364748B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}

.book-modal-field textarea {
  padding: 10px 12px;
  resize: none;
  min-height: 56px;
  max-height: 72px;
}

.book-modal-field input:focus,
.book-modal-field select:focus,
.book-modal-field textarea:focus {
  outline: none;
  border-color: var(--primary-700);
  box-shadow: 0 0 0 3px rgba(15, 118, 110, 0.1);
}

.book-modal-mode {
  margin: 0;
  padding: 0;
  border: 0;
  display: grid;
  gap: 8px;
}

.book-modal-mode legend {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 0;
}

.book-modal-mode-options {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.book-modal-mode-option {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 40px;
  padding: 0 10px;
  border-radius: 8px;
  border: 1px solid #dbe3ea;
  background: #ffffff;
  cursor: pointer;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.book-modal-mode-option:has(input:checked) {
  border-color: var(--primary-700);
  background: #f0fdfa;
  color: var(--primary-800);
}

.book-modal-mode-option input {
  accent-color: var(--primary-700);
}

.book-modal-error {
  margin: 10px 0 0;
  padding: 8px 10px;
  border-radius: 8px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #991b1b;
  font-size: 12px;
}

.book-modal-actions {
  flex-shrink: 0;
  padding: 14px 18px 18px;
  margin-top: 0;
  border-top: 1px solid #eef2f6;
  background: #ffffff;
}

.book-modal-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 8px;
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  border: 1px solid transparent;
}

.book-modal-btn--primary {
  background: var(--primary-700);
  color: #ffffff;
}

.book-modal-btn--primary:hover {
  background: var(--primary-800);
}

.book-modal-btn--primary:disabled {
  opacity: 0.65;
  cursor: wait;
}

.book-modal-success {
  text-align: center;
  padding: 12px 18px 18px;
  display: grid;
  gap: 10px;
  justify-items: center;
}

.book-modal-success-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  background: #ecfdf5;
  color: var(--primary-700);
}

.book-modal-success-icon svg,
.book-modal-success-icon i {
  width: 24px;
  height: 24px;
}

.book-modal-success h3 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary);
}

.book-modal-success p {
  margin: 0;
  font-size: 14px;
  line-height: 1.5;
  color: var(--text-secondary);
}

html.book-modal-open,
body.book-modal-open {
  overflow: hidden;
}

@media (max-width: 520px) {
  .book-modal {
    align-items: center;
    padding: 56px 12px 32px;
  }

  .book-modal-dialog {
    max-height: min(440px, calc(100vh - 100px));
  }

  .book-modal-fields {
    grid-template-columns: 1fr;
  }

  .book-modal-field--full {
    grid-column: auto;
  }
}
