/**
 * Booking modal — multi-step popup (Trip → Details → Contact → Review)
 */

.booking-modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 1100;
  background: rgba(13, 17, 23, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.booking-modal-backdrop.is-visible {
  opacity: 1;
}

.booking-modal {
  inset: 0;
  z-index: 1101;
  position: fixed;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  padding: 0;
  pointer-events: none;
}

@media (min-width: 640px) {
  .booking-modal {
    align-items: center;
    padding: 1.5rem;
  }
}

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

.booking-modal-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-height: calc(96dvh - env(safe-area-inset-bottom, 0px));
  background: #fff;
  border-radius: 1.25rem 1.25rem 0 0;
  box-shadow: 0 24px 80px rgba(13, 17, 23, 0.2);
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
  overflow: hidden;
}

@media (min-width: 640px) {
  .booking-modal-panel {
    max-width: 920px;
    max-height: 90dvh;
    border-radius: 1.25rem;
    transform: translateY(24px) scale(0.98);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1),
      opacity 0.25s ease;
  }
}

.booking-modal.is-open .booking-modal-panel {
  transform: translateY(0) scale(1);
  opacity: 1;
}

/* Header */
.booking-modal-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.25rem 1.25rem 0;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .booking-modal-head {
    padding: 1.5rem 1.5rem 0;
  }
}

.booking-modal-eyebrow {
  margin: 0 0 0.25rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: #c4694a;
}

.booking-modal-head-text {
  min-width: 0;
  flex: 1;
}

.booking-modal-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0d1117;
  line-height: 1.25;
}

@media (min-width: 480px) {
  .booking-modal-title {
    font-size: 1.375rem;
  }
}

.booking-modal-close {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border: 1px solid #e8ecf2;
  border-radius: 999px;
  background: #fff;
  color: #4a5568;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.2s, border-color 0.2s;
}

.booking-modal-close:hover {
  background: #f7f9fc;
  border-color: #c4694a;
  color: #0d1117;
}

.booking-modal-close svg {
  width: 1.125rem;
  height: 1.125rem;
}

/* Stepper */
.booking-stepper {
  padding: 1rem 1.25rem 0;
  flex-shrink: 0;
}

@media (min-width: 640px) {
  .booking-stepper {
    padding: 1.25rem 1.5rem 0;
  }
}

.booking-stepper-list {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.booking-stepper-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.375rem;
  flex: 1;
  min-width: 0;
}

.booking-stepper-dot {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 999px;
  border: 2px solid #e8ecf2;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: #8892a4;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
}

.booking-stepper-label {
  font-size: 10px;
  font-weight: 600;
  color: #8892a4;
  text-align: center;
  line-height: 1.25;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (min-width: 400px) {
  .booking-stepper-label {
    font-size: 11px;
  }
}

@media (max-width: 359px) {
  .booking-stepper-label {
    font-size: 9px;
    white-space: normal;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
  }
}

.booking-stepper-item.is-active .booking-stepper-dot,
.booking-stepper-item.is-done .booking-stepper-dot {
  border-color: #c4694a;
  background: #c4694a;
  color: #fff;
  cursor: pointer;
}

.booking-stepper-item.is-active .booking-stepper-label {
  color: #0d1117;
}

.booking-stepper-item.is-done .booking-stepper-label {
  color: #4a5568;
}

.booking-stepper-bar {
  height: 3px;
  margin-top: 0.75rem;
  border-radius: 999px;
  background: #e8ecf2;
  overflow: hidden;
}

.booking-stepper-bar-fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: linear-gradient(90deg, #c4694a, #9e5238);
  transition: width 0.35s ease;
}

/* Body layout */
.booking-modal-body {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .booking-modal-body {
    flex-direction: row;
  }
}

.booking-modal-form-col {
  flex: 1;
  min-width: 0;
  overflow-y: auto;
  padding: 1.25rem;
  -webkit-overflow-scrolling: touch;
}

@media (min-width: 640px) {
  .booking-modal-form-col {
    padding: 1.5rem;
  }
}

.booking-step-title {
  margin: 0 0 0.25rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #0d1117;
}

.booking-step-sub {
  margin: 0 0 1.25rem;
  font-size: 0.875rem;
  color: #8892a4;
  line-height: 1.5;
}

.booking-field-hint {
  margin: 0.375rem 0 0;
  font-size: 0.75rem;
  color: #8892a4;
  line-height: 1.4;
}

/* Form fields */
.booking-field {
  margin-bottom: 1rem;
}

.booking-field-row {
  display: grid;
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (min-width: 640px) {
  .booking-field-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .booking-field-row .booking-field {
    margin-bottom: 0;
  }
}

/* Counter */
.booking-counter {
  display: flex;
  align-items: center;
  border: 1px solid #e8ecf2;
  border-radius: 0.75rem;
  overflow: hidden;
}

.booking-counter-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  border: 0;
  background: #f7f9fc;
  font-size: 1.125rem;
  color: #0d1117;
  cursor: pointer;
  transition: background 0.2s;
}

.booking-counter-btn:hover {
  background: #f6ebe5;
}

.booking-counter-input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: #fff;
  text-align: center;
  font-size: 0.9375rem;
  font-weight: 600;
  color: #0d1117;
  outline: none;
  -moz-appearance: textfield;
}

.booking-counter-input::-webkit-outer-spin-button,
.booking-counter-input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

/* Review list */
.booking-review-list {
  margin: 0 0 2.5rem;
  padding: 0;
}

.booking-review-list dt {
  margin-top: 0.875rem;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #8892a4;
}

.booking-review-list dt:first-child {
  margin-top: 0;
}

.booking-review-list dd {
  margin: 0.25rem 0 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: #0d1117;
}

/* Summary sidebar */
.booking-summary {
  display: none;
  width: 280px;
  flex-shrink: 0;
  border-left: 1px solid #e8ecf2;
  background: #f7f9fc;
  overflow-y: auto;
}

@media (min-width: 768px) {
  .booking-summary {
    display: block;
  }
}

.booking-summary-inner {
  padding: 1.5rem;
  position: sticky;
  top: 0;
}

.booking-summary-eyebrow {
  margin: 0 0 0.375rem;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #c4694a;
}

.booking-summary-tour {
  margin: 0 0 0.25rem;
  font-size: 1rem;
  font-weight: 600;
  color: #0d1117;
  line-height: 1.35;
}

.booking-summary-meta {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  color: #8892a4;
}

.booking-summary-details {
  margin: 0 0 1rem;
  padding: 0;
  list-style: none;
  border-top: 1px solid #e8ecf2;
}

.booking-summary-details li {
  display: flex;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.625rem 0;
  border-bottom: 1px solid #e8ecf2;
  font-size: 0.8125rem;
}

.booking-summary-label {
  color: #8892a4;
}

.booking-summary-value {
  font-weight: 600;
  color: #0d1117;
  text-align: right;
}

.booking-summary-price {
  padding: 0.875rem;
  border-radius: 0.75rem;
  background: #fff;
  border: 1px solid #e8ecf2;
  margin-bottom: 1rem;
}

.booking-summary-price-label {
  display: block;
  font-size: 11px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: #8892a4;
}

.booking-summary-price-value {
  display: block;
  margin-top: 0.25rem;
  font-size: 1.5rem;
  font-weight: 700;
  color: #0d1117;
}

.booking-summary-price-note {
  display: block;
  margin-top: 0.25rem;
  font-size: 10px;
  color: #8892a4;
}

.booking-summary-trust {
  display: flex;
  align-items: flex-start;
  gap: 0.5rem;
  font-size: 11px;
  color: #8892a4;
  line-height: 1.4;
}

.booking-summary-trust svg {
  width: 1rem;
  height: 1rem;
  flex-shrink: 0;
  stroke: #c4694a;
  margin-top: 0.125rem;
}

/* Mobile summary card (sidebar hidden below 768px) */
.booking-mobile-summary {
  display: none;
}

.booking-mobile-summary[hidden] {
  display: none !important;
}

.booking-mobile-summary:not(:empty):not([hidden]) {
  display: block;
  margin-bottom: 1rem;
  padding: 0.75rem 0.875rem;
  border-radius: 0.625rem;
  background: #f7f9fc;
  border: 1px solid #e8ecf2;
  font-size: 0.75rem;
  font-weight: 500;
  color: #4a5568;
  line-height: 1.45;
  word-break: break-word;
}

@media (min-width: 768px) {
  .booking-mobile-summary,
  .booking-mobile-summary:not(:empty) {
    display: none !important;
  }
}

/* Footer actions */
.booking-modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 1rem 1.25rem calc(1rem + env(safe-area-inset-bottom, 0px));
  border-top: 1px solid #e8ecf2;
  background: #fff;
  flex-shrink: 0;
}

.booking-modal-foot .booking-btn--primary {
  margin-left: auto;
}

@media (min-width: 640px) {
  .booking-modal-foot {
    padding: 1rem 1.5rem calc(1.25rem + env(safe-area-inset-bottom, 0px));
  }
}

@media (max-width: 479px) {
  .booking-modal-foot {
    flex-direction: column-reverse;
    align-items: stretch;
  }

  .booking-modal-foot .booking-btn {
    width: 100%;
    min-width: 0;
  }

  .booking-modal-foot .booking-btn--primary {
    margin-left: 0;
    min-width: 0;
  }
}

.booking-modal-foot.is-hidden {
  display: none;
}

#bookingBackBtn[hidden] {
  display: none;
}

.booking-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  height: 2.75rem;
  padding: 0 1.25rem;
  border-radius: 999px;
  font-size: 0.875rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  border: none;
  transition: background 0.2s, transform 0.15s;
}

.booking-btn svg {
  width: 1rem;
  height: 1rem;
}

.booking-btn--primary {
  background: #0d1117;
  color: #fff;
  min-width: 8.5rem;
}

.booking-btn--primary:hover {
  background: #1a1a1a;
}

.booking-btn--primary:active {
  transform: scale(0.98);
}

.booking-btn.is-loading {
  cursor: wait;
  opacity: 0.92;
}

.booking-btn-spinner {
  width: 1rem;
  height: 1rem;
  border: 2px solid rgba(255, 255, 255, 0.35);
  border-top-color: #fff;
  border-radius: 50%;
  animation: booking-btn-spin 0.65s linear infinite;
  flex-shrink: 0;
}

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

.booking-btn--ghost {
  background: transparent;
  color: #4a5568;
  border: 1px solid #e8ecf2;
}

.booking-btn--ghost:hover {
  background: #f7f9fc;
  color: #0d1117;
}

/* Success */
.booking-success {
  text-align: center;
  padding: 2rem 0.5rem;
}

.booking-success-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 3.5rem;
  height: 3.5rem;
  margin: 0 auto 1rem;
  border-radius: 999px;
  background: #f6ebe5;
  color: #c4694a;
}

.booking-success-icon svg {
  width: 1.75rem;
  height: 1.75rem;
}

.booking-success-title {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 600;
  color: #0d1117;
}

.booking-success-text {
  margin: 0 0 0.75rem;
  font-size: 0.875rem;
  color: #4a5568;
  line-height: 1.55;
}

.booking-success-ref {
  margin: 0 0 1.5rem;
  font-size: 0.8125rem;
  color: #8892a4;
}

.booking-success-ref strong {
  color: #0d1117;
  font-weight: 700;
}

/* Body lock */
body.is-booking-open {
  overflow: hidden;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  .booking-modal-backdrop,
  .booking-modal-panel,
  .booking-stepper-bar-fill {
    transition: none;
  }
}

/* Admin styles */
.booking-modal.admin {
  position: relative;
}

.booking-modal.admin .booking-modal-panel {
  max-width: 100%;
  max-height: none;
  box-shadow: none;
  border-radius: 0;
}

@media (max-width: 782px) {
  .booking-modal.admin .booking-modal-body {
    flex-direction: column;
  }

  .booking-modal.admin .booking-summary {
    display: block;
    width: 100%;
    border-left: 0;
    border-top: 1px solid #e8ecf2;
  }

  .booking-modal.admin .booking-mobile-summary,
  .booking-modal.admin .booking-mobile-summary:not(:empty) {
    display: none !important;
  }
}


/* Clickable stepper items (admin edit page only) */
.booking-stepper-item.is-clickable {
  cursor: pointer;
  transition: opacity 0.2s;
}

.booking-stepper-item.is-clickable:hover {
  opacity: 0.8;
}

.booking-stepper-item.is-clickable:focus-visible {
  outline: 2px solid #2563eb;
  outline-offset: 2px;
  border-radius: 4px;
}