/* ==========================================================================
   XPLOROO · Booking flow module
   booking.css — Styles for booking.html (summary card, traveller form,
   additional details, payment summary) and payment.html (secure-payment
   placeholder). Everything is scoped under the `.bk-*` namespace so this
   stylesheet can't leak into any other page component. Reuses global
   tokens from variables.css. Load AFTER utilities.css.
   ========================================================================== */

.bk-page {
  padding-block: clamp(2rem, 1.4rem + 2.4vw, 3.5rem) var(--section-gap);
}

.bk-container {
  max-width: var(--container-xl);
  margin-inline: auto;
  padding-inline: var(--container-pad);
}

/* Page head */
.bk-head { margin-bottom: var(--space-7); }
.bk-head__eyebrow {
  margin-bottom: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-widest);
  text-transform: uppercase;
  color: var(--violet-300);
}
.bk-head__title { font-size: var(--fs-2xl); margin: 0; }
.bk-head__subtitle { margin-top: var(--space-2); color: var(--color-text-muted); max-width: 60ch; }

/* Two-column layout: steps (left) + sticky payment summary (right).
   Single column on mobile — summary stacks below the form. */
.bk-layout {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-7);
}
@media (min-width: 1025px) {
  .bk-layout { grid-template-columns: 1.7fr 1fr; align-items: start; }
  .bk-layout__aside { position: sticky; top: calc(var(--scroll-offset) + 1.5rem); }
}
.bk-layout__main {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  min-width: 0; /* grid min-width:auto trap guard */
}

/* -------------------------------------------------------------------------
   Shared step card shell — glass panel, thin white border
   ------------------------------------------------------------------------- */
.bk-card {
  padding: clamp(1.25rem, 1rem + 1vw, 2rem);
  border-radius: var(--radius-2xl);
  border: 1px solid var(--glass-border);
  background: var(--glass-bg);
  -webkit-backdrop-filter: blur(var(--glass-blur));
  backdrop-filter: blur(var(--glass-blur));
  box-shadow: var(--shadow-card);
}

.bk-card__head {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.bk-card__step {
  flex: none;
  display: grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 50%;
  background: var(--gradient-brand);
  color: #fff;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  font-weight: var(--fw-bold);
}
.bk-card__title { margin: 0; font-size: var(--fs-lg); }

/* -------------------------------------------------------------------------
   STEP 1 — Package summary
   ------------------------------------------------------------------------- */
.bk-summary {
  display: flex;
  gap: var(--space-5);
  align-items: flex-start;
}
.bk-summary__media {
  flex: none;
  width: clamp(110px, 18vw, 168px);
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  background: var(--color-surface-inset);
}
.bk-summary__media img { width: 100%; height: 100%; object-fit: cover; display: block; }

.bk-summary__body { flex: 1; min-width: 0; }
.bk-summary__name {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-xl);
}

.bk-summary__grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-3) var(--space-5);
}
.bk-summary__item { min-width: 0; }
.bk-summary__label {
  display: block;
  font-size: var(--fs-2xs);
  letter-spacing: var(--ls-wider);
  text-transform: uppercase;
  color: var(--color-text-subtle);
}
.bk-summary__value {
  display: block;
  margin-top: 0.15rem;
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--color-text-strong);
  overflow: hidden;
  text-overflow: ellipsis;
}
.bk-summary__value--accent { color: var(--violet-300); }

@media (max-width: 640px) {
  .bk-summary { flex-direction: column; }
  .bk-summary__media { width: 100%; aspect-ratio: 16 / 9; }
  .bk-summary__grid { grid-template-columns: repeat(2, 1fr); }
}

/* -------------------------------------------------------------------------
   Forms (Steps 2 & 3) — reuses the global .field / .input design system
   from utilities.css; only the grid arrangement is defined here.
   ------------------------------------------------------------------------- */
.bk-form-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-4) var(--space-5);
}
@media (max-width: 640px) {
  .bk-form-grid { grid-template-columns: 1fr; }
}
.bk-form-grid .field--full { grid-column: 1 / -1; }

/* Date inputs: force the dark scheme's native picker indicator to stay visible */
.bk-page input[type="date"]::-webkit-calendar-picker-indicator {
  filter: invert(0.7);
  cursor: pointer;
}
/* Light theme: the input surface flips light, so the native icon (already
   dark by default) needs no inversion — inverting it here would wash it
   out against the now-light field background. */
:root[data-theme="light"] .bk-page input[type="date"]::-webkit-calendar-picker-indicator {
  filter: none;
}

/* Coupon row — input + apply button side by side */
.bk-coupon {
  display: flex;
  gap: var(--space-3);
}
.bk-coupon .input { flex: 1; }
.bk-coupon__apply {
  flex: none;
  height: var(--control-height);
  padding-inline: var(--space-5);
  border-radius: var(--radius-pill);
  border: 1px solid var(--color-border-strong);
  background: transparent;
  color: var(--color-text-strong);
  font-family: var(--font-body);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  cursor: pointer;
  transition:
    border-color var(--dur-fast) var(--ease-standard),
    background-color var(--dur-fast) var(--ease-standard),
    transform var(--dur-fast) var(--ease-out);
}
.bk-coupon__apply:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-subtle);
  transform: translateY(-1px);
}
.bk-coupon__message {
  margin-top: var(--space-2);
  font-size: var(--fs-xs);
  min-height: 1.2em;
}
.bk-coupon__message.is-success { color: var(--color-success); }
.bk-coupon__message.is-error { color: var(--color-danger); }

/* -------------------------------------------------------------------------
   STEP 4 — Payment summary (sticky aside on desktop)
   ------------------------------------------------------------------------- */
.bk-pay {
  padding: clamp(1.25rem, 1rem + 1vw, 1.75rem);
  border-radius: var(--radius-2xl);
  border: 1px solid transparent;
  background:
    linear-gradient(var(--color-surface), var(--color-surface)) padding-box,
    var(--gradient-brand) border-box;
  box-shadow: var(--shadow-xl);
}
.bk-pay__title { margin: 0 0 var(--space-4); font-size: var(--fs-lg); }

.bk-pay__rows {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}
.bk-pay__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
  font-size: var(--fs-sm);
  color: var(--color-text-muted);
}
.bk-pay__row dd {
  margin: 0;
  font-family: var(--font-mono);
  font-weight: var(--fw-semibold);
  color: var(--color-text-strong);
  white-space: nowrap;
}
.bk-pay__row--discount dd { color: var(--color-success); }
.bk-pay__row--discount[hidden] { display: none; }

.bk-pay__divider {
  height: 1px;
  border: 0;
  margin: var(--space-4) 0;
  background: var(--gradient-hairline);
}

.bk-pay__total {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-3);
}
.bk-pay__total dt {
  font-family: var(--font-display);
  font-size: var(--fs-base);
  font-weight: var(--fw-bold);
  color: var(--color-text-strong);
}
.bk-pay__total dd {
  margin: 0;
  font-family: var(--font-display);
  font-size: var(--fs-xl);
  font-weight: var(--fw-extrabold);
  color: var(--color-text-strong);
  white-space: nowrap;
}

/* Large gradient CTA — same visual language as the package pages' .pkg-cta */
.bk-cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  height: 3.5rem;
  margin-top: var(--space-5);
  padding-inline: 2rem;
  border: none;
  border-radius: var(--radius-pill);
  font-family: var(--font-body);
  font-size: var(--fs-md);
  font-weight: var(--fw-bold);
  color: #fff;
  background-image: var(--gradient-brand);
  box-shadow: var(--glow-brand);
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition:
    transform var(--dur-fast) var(--ease-out),
    box-shadow var(--dur-base) var(--ease-out),
    filter var(--dur-fast) var(--ease-standard),
    opacity var(--dur-fast) var(--ease-standard);
}
.bk-cta:hover {
  transform: translateY(-3px);
  filter: brightness(1.07);
  box-shadow: 0 16px 40px rgba(91, 107, 255, 0.5), 0 6px 18px rgba(139, 60, 240, 0.42);
  color: #fff;
}
.bk-cta:active { transform: translateY(-1px) scale(0.98); }
.bk-cta:disabled {
  opacity: 0.45;
  pointer-events: none;
  box-shadow: none;
}
.bk-cta svg { width: 1.1em; height: 1.1em; flex: none; }

/* Secondary/ghost variant — used for "Cancel & Start Over" next to the
   primary gradient CTA on the resume-payment panel. */
.bk-cta--ghost {
  background-image: none;
  background: transparent;
  color: var(--color-text-strong);
  border: 1px solid var(--color-border-strong);
  box-shadow: none;
}
.bk-cta--ghost:hover {
  background: var(--color-surface-hover);
  box-shadow: none;
  filter: none;
}

/* -------------------------------------------------------------------------
   Wallet contribution box (Phase 5 — Commerce Engine payment card)
   ------------------------------------------------------------------------- */
.bk-wallet-box {
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-divider);
}
.bk-wallet-box[hidden] { display: none; }
.bk-wallet-box .bk-pay__rows { margin-bottom: var(--space-3); }

.bk-wallet-box__title {
  margin: 0 0 var(--space-3);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.bk-wallet-toggle {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: var(--color-text-strong);
  cursor: pointer;
  user-select: none;
}
.bk-wallet-toggle input[type="checkbox"] {
  width: 1.15rem;
  height: 1.15rem;
  accent-color: var(--violet-500, #7c3aed);
  cursor: pointer;
}
.bk-wallet-toggle input[type="checkbox"]:disabled {
  cursor: not-allowed;
  opacity: 0.4;
}
.bk-wallet-toggle:has(input:disabled) {
  cursor: not-allowed;
  color: var(--color-text-muted);
}

/* Zero-balance empty state — subtle nudge + CTA, never hides the card. */
.bk-wallet-box__empty {
  margin: var(--space-2) 0 0;
  font-size: var(--fs-xs);
  color: var(--color-text-muted);
}
.bk-wallet-box__empty[hidden] { display: none; }

.bk-wallet-box__add-coins {
  margin-top: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.55rem 1.1rem;
  border-radius: var(--radius-pill);
  font-size: var(--fs-sm);
  font-weight: var(--fw-semibold);
  color: #fff;
  background-image: var(--gradient-brand);
  box-shadow: var(--glow-brand);
  text-decoration: none;
  transition: filter var(--dur-fast) var(--ease-standard), transform var(--dur-fast) var(--ease-out);
}
.bk-wallet-box__add-coins:hover { filter: brightness(1.07); transform: translateY(-2px); }
.bk-wallet-box__add-coins svg { width: 1em; height: 1em; }
.bk-wallet-box__add-coins[hidden] { display: none; }

.bk-pay__note {
  margin-top: var(--space-3);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-size: var(--fs-xs);
  color: var(--color-text-subtle);
}
.bk-pay__note svg { width: 14px; height: 14px; flex: none; color: var(--color-success); }

/* Form validation feedback (shown above the CTA when submit fails) */
.bk-form-error {
  margin-top: var(--space-3);
  font-size: var(--fs-xs);
  color: var(--color-danger);
  text-align: center;
  min-height: 1.2em;
}

/* -------------------------------------------------------------------------
   PAYMENT PAGE (payment.html)
   ------------------------------------------------------------------------- */
.bk-payment {
  max-width: 560px;
  margin-inline: auto;
  text-align: center;
}
.bk-payment__icon {
  display: grid;
  place-items: center;
  width: 4rem;
  height: 4rem;
  margin: 0 auto var(--space-5);
  border-radius: 50%;
  color: #fff;
  background: var(--gradient-brand);
  box-shadow: var(--glow-brand);
}
.bk-payment__icon svg { width: 26px; height: 26px; }
.bk-payment__title { margin: 0; font-size: var(--fs-2xl); }
.bk-payment__subtitle { margin: var(--space-3) auto 0; color: var(--color-text-muted); }

.bk-payment .bk-pay { margin-top: var(--space-7); text-align: left; }
