/* ==========================================================================
   ABC Tour — booking pages  (/booking/<slug>-<essential|classic|premium>.php)
   Layout: hero with 4 step rings → .booking wrapper → form of raised .neo
   fieldsets (left) + dark trip-summary panel (right, sticky on desktop).
   The summary <aside> sits inside the form right after "Your package", so on
   phones it follows the package recap; on desktop the grid lifts it into the
   right-hand column.
   ========================================================================== */

/* ---------- Hero + step rings ---------- */
.booking-page { padding-bottom: var(--section); }
.booking-hero { padding-bottom: clamp(28px, 4vw, 52px); }
.booking-hero .breadcrumb ol { padding-left: 0; }   /* breadcrumb() emits a class-less <ol> */
.booking-hero__grid {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end;
  gap: 32px clamp(32px, 5vw, 72px); margin-top: clamp(22px, 3vw, 34px);
}
.booking-hero__title { font-size: clamp(2.05rem, 1.35rem + 2.7vw, 3.45rem); margin-top: 0; }
.booking-hero .page-hero__lead { max-width: 56ch; }

.booking-steps { width: min(100%, 470px); }
.booking-steps ol { position: relative; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
/* dashed rail behind the rings (the rings' solid discs hide it where they sit) */
.booking-steps ol::before {
  content: ""; position: absolute; left: 12.5%; right: 12.5%; top: calc(var(--step-ring, 88px) / 2);
  border-top: 2px dashed rgb(var(--shadow-dark));
}
.booking-steps li { position: relative; display: flex; justify-content: center; }
.booking-steps a { display: flex; flex-direction: column; align-items: center; gap: 14px; padding: 0 2px 4px; border-radius: var(--r-sm); }
.booking-steps .ring { --size: var(--step-ring, 88px); transition: transform .25s var(--ease), box-shadow .25s var(--ease); }
.booking-steps .ring__label { order: -1; margin: 0 0 3px; font-size: .55rem; }
.booking-steps .ring__value { font-size: calc(var(--size) * .24); }
.booking-steps a:hover .ring { transform: translateY(-3px); box-shadow: var(--raise-lg); }
.booking-steps__name { font-family: var(--font-display); font-weight: 700; font-size: var(--fs-xs); letter-spacing: .03em; color: var(--ink-2); white-space: nowrap; transition: color .2s; }
.booking-steps a:hover .booking-steps__name { color: var(--accent-text); }

@media (max-width: 960px) {
  .booking-hero__grid { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 520px) {
  .booking-steps { --step-ring: 70px; width: 100%; }
  .booking-steps .ring__label { font-size: .5rem; }
  .booking-steps a { gap: 10px; }
}

/* ---------- Two-column booking layout ---------- */
.booking__form { display: grid; grid-template-columns: minmax(0, 1fr); gap: clamp(22px, 2.6vw, 30px); }
@media (min-width: 1000px) {
  .booking__form {
    grid-template-columns: minmax(0, 1fr) clamp(330px, 30vw, 380px);
    column-gap: clamp(28px, 3vw, 44px); align-items: start;
  }
  .booking__form > * { grid-column: 1; }
  .booking__summary { grid-column: 2; grid-row: 1 / span 6; align-self: start; }
}
@media (min-width: 1000px) and (min-height: 760px) {
  .booking__summary { position: sticky; top: calc(var(--header-h) + 22px); }
  /* never taller than the screen: the panel scrolls on its own so the total + CTA stay reachable */
  .booking__summary .summary {
    max-height: calc(100vh - var(--header-h) - 44px); overflow-y: auto; overscroll-behavior: contain;
    scrollbar-width: thin; scrollbar-color: var(--panel-3) transparent;
  }
}
/* Laptop-height screens: the banner shrinks with the screen so the sticky panel fits with no scrollbar of
   its own until add-ons are switched on (684px = 44px panel offset + ~640px tallest summary body, Premium).
   The .booking__summary prefix is needed to out-rank the base .summary__media rule further down. */
@media (min-width: 1000px) and (max-height: 959px) {
  .booking__summary .summary__media { aspect-ratio: auto; height: clamp(88px, 100vh - var(--header-h) - 684px, 156px); }
}
/* short laptops, and the narrow 1000–1199px two-column layout (its 330px panel wraps more): the total + CTA matter more */
@media (min-width: 1000px) and (max-height: 859px), (min-width: 1000px) and (max-width: 1199px) and (max-height: 959px) {
  .booking__summary .summary__media { display: none; }
  .booking__summary .summary__body { gap: 14px; }
}

/* ---------- Form sections (raised fieldsets) ---------- */
.booking-step {
  container: step / inline-size;
  min-width: 0; margin: 0; border: 0;
  padding: clamp(22px, 3.2vw, 38px);
}
.booking-step:target { box-shadow: var(--raise), 0 0 0 2px rgb(45 91 255 / .45); }
/* float trick: lets the legend behave like a normal heading inside the padded card */
.booking-step__legend { float: left; width: 100%; display: flex; align-items: center; gap: 16px; padding: 0; margin-bottom: 8px; }
.booking-step__legend + * { clear: both; }
.booking-step__num {
  width: 50px; height: 50px; border-radius: 50%; flex: none;
  display: grid; place-items: center;
  background: var(--grad); color: #fff; box-shadow: var(--glow);
  font-family: var(--font-display); font-weight: 800; font-size: 1.05rem;
}
.booking-step__num .icon { width: 22px; height: 22px; }
.booking-step__title { font-size: var(--fs-lg); font-weight: 800; }
.booking-step__lead { margin: 6px 0 26px 66px; font-size: var(--fs-sm); color: var(--ink-2); max-width: 60ch; }

@container step (max-width: 520px) {
  .booking-step__lead { margin-left: 0; }
}

/* Nested group (room preference) — a fieldset without the card chrome */
.field-group { min-width: 0; margin: 26px 0 0; padding: 0; border: 0; }
.field-group > legend { float: left; width: 100%; padding: 0; margin-bottom: 12px; }
.field-group > legend + * { clear: both; }

/* Field grids (container queries: they react to the card width, not the viewport) */
.form-grid { display: grid; gap: 22px 20px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.form-grid__full { grid-column: 1 / -1; }
.form-grid--trip { grid-template-columns: minmax(0, 1.5fr) repeat(2, minmax(0, 1fr)); }
@container step (max-width: 600px) {
  .form-grid--trip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .form-grid--trip > :first-child { grid-column: 1 / -1; }
}
@container step (max-width: 500px) {
  .form-grid { grid-template-columns: minmax(0, 1fr); }
  .form-grid--trip { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@container step (max-width: 300px) {
  .form-grid--trip { grid-template-columns: minmax(0, 1fr); }
}
.booking-step .input[type="date"] { color-scheme: light; }
.booking-step .input[type="number"] { padding-right: 14px; }
.booking-step .textarea { min-height: 128px; }

/* ---------- Selectable cards (room + payment) ---------- */
.option-grid { display: grid; gap: 16px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.option-stack { display: grid; gap: 16px; }
@container step (max-width: 600px) { .option-grid { grid-template-columns: minmax(0, 1fr); } }
.booking .option { align-items: center; min-height: 72px; }
.choice { display: grid; gap: 2px; min-width: 0; }
.choice__title { font-weight: 700; font-size: .95rem; color: var(--ink); line-height: 1.3; }
.choice__desc { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.45; }
.choice__icon {
  width: 44px; height: 44px; margin-left: auto; flex: none; border-radius: 50%;
  display: grid; place-items: center; color: var(--accent); box-shadow: var(--inset-sm);
  transition: color .2s, background-color .2s, box-shadow .2s;
}
.choice__icon .icon { width: 20px; height: 20px; }
.option:has(> input:checked) .choice__icon { background: var(--grad); color: #fff; box-shadow: var(--glow); }

/* ---------- Step 1: package recap ---------- */
.tier-switch { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); width: 100%; }
.segmented.tier-switch a { flex-direction: column; justify-content: center; align-items: center; gap: 0; min-height: 58px; padding: 6px 10px; text-align: center; line-height: 1.25; }
.tier-switch__label { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-display); font-weight: 700; font-size: .9rem; }
.tier-switch__label .icon { width: 16px; height: 16px; }
.tier-switch__price { font-size: .72rem; font-weight: 600; letter-spacing: .02em; opacity: .85; }
.tier-switch a:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }

.pkg-recap { margin-top: 26px; padding: clamp(18px, 2.6vw, 26px); border-radius: var(--r-lg); box-shadow: var(--inset); }
.pkg-recap__head { display: flex; align-items: center; gap: 16px; }
.pkg-recap__icon { width: 56px; height: 56px; flex: none; border-radius: 50%; display: grid; place-items: center; background: var(--surface); color: var(--accent); box-shadow: var(--raise-sm); }
.pkg-recap__icon .icon { width: 26px; height: 26px; }
.pkg-recap__heading { min-width: 0; flex: 1; }
.pkg-recap__dest { display: flex; align-items: center; gap: 6px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-3); }
.pkg-recap__dest .icon { width: 15px; height: 15px; color: var(--accent); }
.pkg-recap__name { margin-top: 3px; font-size: clamp(1.2rem, 1.05rem + .6vw, 1.45rem); font-weight: 800; }
.pkg-recap__head .tag { flex: none; align-self: flex-start; }
.pkg-recap__blurb { margin-top: 14px; font-size: var(--fs-sm); color: var(--ink-2); }
.pkg-recap__facts { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.pkg-recap__facts li {
  display: inline-flex; align-items: center; gap: 7px; min-height: 38px; padding: 0 14px; border-radius: var(--pill);
  background: var(--surface); box-shadow: var(--raise-sm); font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2);
}
.pkg-recap__facts .icon { width: 17px; height: 17px; color: var(--accent); }
.pkg-recap__facts strong { color: var(--ink); }
.pkg-recap__sub { margin: 22px 0 12px; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--ink-3); }
.pkg-recap__includes { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px 24px; }
.pkg-recap__includes li + li { margin-top: 0; }
.pkg-recap__links { display: flex; flex-wrap: wrap; gap: 10px 22px; margin-top: 22px; padding-top: 16px; border-top: 1.5px dashed rgb(var(--shadow-dark)); }
.pkg-recap__links a { display: inline-flex; align-items: center; gap: 7px; font-size: var(--fs-sm); font-weight: 700; color: var(--accent-text); border-radius: var(--r-xs); }
.pkg-recap__links a:hover { color: var(--accent-2); }
.pkg-recap__links .icon { width: 16px; height: 16px; }
@container step (max-width: 560px) {
  .pkg-recap__includes { grid-template-columns: minmax(0, 1fr); }
}
@container step (max-width: 440px) {
  .pkg-recap__head { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "icon tag" "heading heading"; row-gap: 14px; }
  .pkg-recap__icon { grid-area: icon; width: 48px; height: 48px; }
  .pkg-recap__head .tag { grid-area: tag; justify-self: end; align-self: center; }
  .pkg-recap__heading { grid-area: heading; }
  .tier-switch__label .icon, .tier-switch__dn { display: none; }
}

/* ---------- Step 3½: add-on switches ---------- */
.addon-list { display: grid; gap: 16px; }
.toggle.addon {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto auto;
  grid-template-areas: "icon text price track"; align-items: center; gap: 6px 18px;
  padding: 16px 20px; border-radius: var(--r); background: var(--surface); box-shadow: var(--raise-sm);
  transition: box-shadow .25s var(--ease);
}
.addon > .toggle__track { grid-area: track; }
.addon__icon { grid-area: icon; width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; color: var(--accent); box-shadow: var(--inset-sm); }
.addon__icon .icon { width: 22px; height: 22px; }
.addon__text { grid-area: text; display: grid; gap: 2px; min-width: 0; }
.addon__name { font-weight: 700; font-size: .95rem; color: var(--ink); }
.addon__desc { font-size: var(--fs-xs); color: var(--ink-3); line-height: 1.45; }
.addon__price { grid-area: price; display: grid; justify-items: end; font-family: var(--font-display); font-weight: 800; font-size: 1rem; color: var(--ink); white-space: nowrap; line-height: 1.2; }
.addon__price small { font-family: var(--font-body); font-size: .7rem; font-weight: 600; color: var(--ink-3); }
.addon:hover .addon__icon { color: var(--accent-2); }
/* the switch's own card shows its state; its summary line is revealed further down */
.addon:has(> .toggle__input:checked) { box-shadow: var(--inset-sm), 0 0 0 2px rgb(45 91 255 / .55); }
@container step (max-width: 520px) {
  .toggle.addon { grid-template-columns: auto minmax(0, 1fr) auto; grid-template-areas: "icon text track" "icon price track"; padding: 14px 16px; gap: 6px 14px; }
  .addon__price { justify-items: start; display: flex; align-items: baseline; gap: 6px; }
  .addon__icon { width: 42px; height: 42px; }
}
@container step (max-width: 400px) {
  .toggle.addon { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "text track" "price track"; }
  .addon__icon { display: none; }
}

/* ---------- Final confirm block ---------- */
.booking-confirm { display: grid; gap: 20px; padding: clamp(22px, 3.2vw, 34px); }
.booking-confirm .option { min-height: 0; align-items: flex-start; }
.booking-confirm .option__dot { margin-top: 1px; }
.booking-confirm__terms-text { font-size: var(--fs-sm); color: var(--ink-2); line-height: 1.5; }
.booking-confirm__total {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: 4px 16px;
  padding: 16px 22px; border-radius: var(--r); box-shadow: var(--inset-sm);
}
.booking-confirm__total span { font-size: var(--fs-sm); color: var(--ink-2); }
.booking-confirm__total strong { font-family: var(--font-display); font-size: 1.35rem; font-weight: 800; background: var(--grad); -webkit-background-clip: text; background-clip: text; color: transparent; }
.booking-confirm__note { text-align: center; font-size: var(--fs-sm); font-weight: 600; color: var(--ink-2); }
.booking-confirm__note .icon { display: inline-block; width: 17px; height: 17px; margin-right: 6px; vertical-align: -3px; color: var(--success); }

/* ---------- Trip summary (dark panel) ---------- */
.summary { padding: 12px; overflow: hidden; }
.summary__media { position: relative; aspect-ratio: 16 / 7; border-radius: calc(var(--r-lg) - 8px); overflow: hidden; background: var(--panel-2); }
.summary__media img { width: 100%; height: 100%; object-fit: cover; }
.summary__body { display: grid; gap: 16px; padding: 18px 12px 10px; }
.summary__name { font-family: var(--font-display); font-size: 1.55rem; font-weight: 800; line-height: 1.15; color: #fff; }
.summary__state { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: var(--fs-sm); color: var(--on-panel-2); }
.summary__state .icon { width: 16px; height: 16px; color: var(--cyan); }
.summary__pkg { padding: 16px 18px; border-radius: var(--r); background: rgb(0 0 0 / .16); box-shadow: var(--panel-inset); }
.summary__pkg-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; }
.summary__pkg-name { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; color: #fff; }
.summary__tier { background: var(--grad); color: #fff; box-shadow: none; }
.summary__facts { display: flex; flex-wrap: wrap; gap: 6px 16px; margin-top: 10px; font-size: var(--fs-sm); color: var(--on-panel-2); }
.summary__facts li { display: inline-flex; align-items: center; gap: 6px; }
.summary__facts .icon { width: 16px; height: 16px; color: var(--cyan); }

/* price breakdown — one row per line (dt label · dd amount) */
.summary__lines { display: grid; padding: 0 4px; }
.summary__line { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding-block: 10px; font-size: var(--fs-sm); }
.summary__line + .summary__line { border-top: 1px dashed rgb(255 255 255 / .16); }
.summary__line dt { min-width: 0; color: var(--on-panel-2); }
.summary__line dt small { display: block; font-size: .72rem; color: var(--on-panel-2); opacity: .85; }
.summary__line dd { margin: 0; flex: none; font-family: var(--font-display); font-weight: 700; color: #fff; white-space: nowrap; }

/* add-on lines: hidden until their toggle is on */
.summary__addon { display: none; }
.summary__addon dt { display: flex; align-items: baseline; gap: 8px; }
.summary__addon dt::before {
  content: "+"; flex: none; align-self: center; width: 18px; height: 18px; border-radius: 50%;
  display: grid; place-items: center; background: rgb(75 184 238 / .18); color: var(--cyan);
  font-size: .8rem; font-weight: 800; line-height: 1;
}
.summary__addon dt small { display: inline; }
.summary__addon dd { color: var(--cyan); }

/* Reveal each add-on line in the summary when its toggle is switched on (CSS-only, no JS):
   body always contains both the checkbox and the summary, so :has() connects them. */
body:has(#addon-insurance:checked) .summary__addon--insurance,
body:has(#addon-transfer:checked) .summary__addon--transfer,
body:has(#addon-night:checked) .summary__addon--night { display: flex; }
/* totals can't be recalculated without JS, so flag them as excluding the switched-on extras */
body:has(.addon .toggle__input:checked) .summary__total-label::after {
  content: "Before add-ons"; display: block; margin-top: 2px; letter-spacing: .02em; text-transform: none; font-weight: 600; color: var(--cyan);
}
body:has(.addon .toggle__input:checked) .booking-confirm__total > span::after {
  content: "Before add-ons"; display: block; margin-top: 2px; font-size: var(--fs-xs); font-weight: 600; color: var(--accent-text);
}

.summary__total {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  padding: 16px 16px 16px 20px; border-radius: var(--r); background: rgb(0 0 0 / .18); box-shadow: var(--panel-inset);
}
.summary__total-label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--on-panel-2); }
.summary__total-value { margin-top: 4px; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.8rem, 1.5rem + 1vw, 2.15rem); line-height: 1.05; color: #fff; }
.summary__deposit { margin-top: 8px; font-size: var(--fs-sm); color: var(--on-panel-2); }
.summary__deposit strong { color: #fff; }
/* the reference "DATA" ring, re-skinned for the dark panel */
.summary .ring { --size: 80px; --track: var(--panel-3); background: var(--panel-2); box-shadow: 6px 8px 16px -6px rgb(8 10 30 / .7), -3px -3px 8px rgb(255 255 255 / .05); }
.summary .ring__value { color: #fff; font-size: 1.05rem; }
.summary .ring__label { color: var(--on-panel-2); font-size: .52rem; }
.summary__note { font-size: var(--fs-xs); line-height: 1.55; color: var(--on-panel-2); }

@media (min-width: 600px) and (max-width: 999px) {
  /* single-column tablet: image beside the details instead of a tall banner */
  .summary { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 8px; align-items: start; }
  .summary__media { aspect-ratio: auto; height: 100%; min-height: 260px; }
  .summary__body { padding: 12px 12px 12px 16px; }
}
@media (max-width: 380px) {
  .summary__total { flex-wrap: wrap; }
}
