/* ==========================================================================
   Stepped checkout — Sunny Orange Stays (2026-10-30)
   Loaded after checkout.css. The page keeps every id and block checkout.js /
   cart-checkout.js rely on; these rules only shape the .sos-step shells:
   one step open at a time, finished steps fold into a one-line recap, the
   rail on the left shows where the guest is. checkout-steps.js drives the
   is-open / is-done classes.
   ========================================================================== */

/* ---- Hero: the property photo stays, but shorter, so the first step is near the fold */
.page-template-page-checkout .sos-page-hero--img {
  padding: calc(var(--sos-header-h) + 4.5rem) 0 5.5rem;
}
.page-template-page-checkout .sos-page-hero h1 {
  font-size: clamp(1.9rem, 3.4vw, 2.8rem);
}
.page-template-page-checkout .sos-section {
  padding-top: var(--sos-gap-xl);
}

/* ---- Rail + steps ------------------------------------------------------- */
.sos-checkout-main {
  counter-reset: sosstep;
  position: relative;
  padding-left: 62px;             /* 44px marker + 18px gap */
}
.sos-checkout-main::before {       /* the tide line */
  content: '';
  position: absolute;
  left: 21px;
  top: 28px;
  bottom: 40px;
  width: 2px;
  background: var(--sos-sand-200);
}
.sos-step {
  counter-increment: sosstep;
  position: relative;
  margin: 0 0 22px;
  padding: 0;
  border: 0;
}
.sos-step:last-child { margin-bottom: 0; }

/* The marker sits in the rail column (absolute, left of the card) */
.sos-step__marker {
  position: absolute;
  left: -62px;
  top: 0;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: #fff;
  border: 2px solid var(--sos-sand-200);
  color: var(--sos-gray-400);
  font-family: var(--sos-font-body);
  font-weight: 800;
  font-size: 0.95rem;
  z-index: 1;
  transition: background 0.35s var(--sos-ease), border-color 0.35s var(--sos-ease), color 0.35s var(--sos-ease), box-shadow 0.35s var(--sos-ease), transform 0.35s var(--sos-ease);
}
.sos-step__marker::before { content: counter(sosstep); }
.sos-step__marker svg { display: none; width: 18px; height: 18px; }
.sos-step.is-done .sos-step__marker {
  background: var(--sos-teal);
  border-color: var(--sos-teal);
  color: #fff;
}
.sos-step.is-done .sos-step__marker::before { content: none; }
.sos-step.is-done .sos-step__marker svg { display: block; }
.sos-step.is-open .sos-step__marker {            /* the sun: the one warm accent on the page */
  background: var(--sos-orange);
  border-color: var(--sos-orange);
  color: #fff;
  transform: scale(1.08);
  box-shadow: 0 0 0 7px rgba(248, 164, 30, 0.16), 0 10px 24px -6px rgba(248, 164, 30, 0.55);
}
.sos-step.is-open.is-done .sos-step__marker::before { content: counter(sosstep); }
.sos-step.is-open.is-done .sos-step__marker svg { display: none; }
/* the line behind a finished step turns teal */
.sos-step.is-done::before {
  content: '';
  position: absolute;
  left: -41px;
  top: 22px;
  bottom: -22px;
  width: 2px;
  background: var(--sos-teal);
  z-index: 0;
}
.sos-step.is-done:last-child::before { display: none; }

/* ---- Card --------------------------------------------------------------- */
.sos-step__card {
  min-width: 0;
  border-radius: 22px;
  background: #fff;
  border: 1px solid transparent;
  transition: box-shadow 0.45s var(--sos-ease), border-color 0.45s var(--sos-ease);
}
.sos-step.is-open .sos-step__card {
  border-color: var(--sos-sand-200);
  box-shadow: 0 28px 60px -30px rgba(26, 58, 63, 0.30), 0 2px 6px rgba(26, 58, 63, 0.05);
}

.sos-step__head {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 44px;
  padding: 0;
  transition: padding 0.45s var(--sos-ease);
}
.sos-step.is-open .sos-step__head { padding: 26px 30px 0; }
.sos-step.is-open .sos-step__marker { top: 26px; }
.sos-step.is-done:not(.is-open) .sos-step__head { cursor: pointer; }
.sos-step__titles { min-width: 0; flex: 1 1 auto; }
.sos-step__title {
  margin: 0;
  font-size: 1.45rem;
  line-height: 1.15;
  color: var(--sos-slate-800);
  transition: color 0.35s var(--sos-ease), font-size 0.35s var(--sos-ease);
}
.sos-step.is-open .sos-step__title { font-size: 2rem; color: var(--sos-slate-900); }
.sos-step.is-upcoming .sos-step__title { color: var(--sos-gray-400); }
.sos-step__recap,
.sos-step__note {
  display: none;
  margin: 4px 0 0;
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--sos-gray-500);
}
.sos-step.is-done:not(.is-open) .sos-step__recap { display: block; }
.sos-step__note { color: #b91c1c; font-weight: 600; }
.sos-step__note:not([hidden]) { display: block; }
.sos-step__edit {
  display: none;
  flex: 0 0 auto;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  padding: 7px 14px;
  border: 1px solid var(--sos-sand-200);
  border-radius: 999px;
  background: #fff;
  color: var(--sos-teal);
  font-family: var(--sos-font-body);
  font-size: 0.86rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}
.sos-step__edit:hover { background: var(--sos-teal-light); border-color: var(--sos-teal); }
.sos-step__edit:focus-visible { outline: 3px solid var(--sos-teal-light); outline-offset: 2px; }
.sos-step.is-done:not(.is-open) .sos-step__edit { display: inline-flex; }

/* ---- Body: folds with the grid-rows trick so the fields keep their width (the signature canvas measures itself) */
.sos-step__body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.sos-step.is-open .sos-step__body { grid-template-rows: 1fr; }
.sos-step__inner {
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  transition: visibility 0s linear 0.5s;
}
.sos-step.is-open .sos-step__inner { visibility: visible; transition-delay: 0s; }
.sos-step.is-open.is-settled .sos-step__inner { overflow: visible; }   /* lets the address suggestions drop below the card */
.sos-step__pad { padding: 22px 30px 30px; }

.sos-step__sub {
  margin: 26px 0 12px;
  font-size: 1.15rem;
  color: var(--sos-slate-800);
}
.sos-step__pending {
  display: none;
  align-items: center;
  gap: 10px;
  padding: 18px 20px;
  border: 1.5px dashed var(--sos-sand-300);
  border-radius: var(--sos-radius-md);
  color: var(--sos-gray-500);
  font-size: 0.92rem;
}
.sos-step__pending i { font-size: 1.3rem; color: var(--sos-teal); }
.sos-step.is-pending .sos-step__pending { display: flex; }

.sos-step__foot {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin-top: 22px;
  padding-top: 20px;
  border-top: 1px dashed var(--sos-sand-200);
}
.sos-step__err {
  flex: 1 1 260px;
  margin: 0;
  color: #b91c1c;
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}
.sos-step__err[hidden] { display: none; }
.sos-step__next { min-width: 240px; }
.sos-step__next:focus-visible { outline: 3px solid rgba(248, 164, 30, 0.35); outline-offset: 2px; }

/* An empty trip bag has nothing to continue to */
.sos-step__pad:has(#sos-cart-empty:not([style*="none"])) .sos-step__foot { display: none; }

/* Blocks that used to be whole sections now sit inside a step */
.sos-checkout-protect .sos-checkout-insurance { margin-top: 0; }
.sos-checkout-protect + .sos-checkout-addons { margin-top: 6px; }
.sos-checkout-addons:first-child .sos-step__sub { margin-top: 0; }
.sos-checkout-terms { margin-top: 0; }
.sos-payment-cards { margin-top: 0; }
.sos-checkout-insurance--required .sos-checkout-insurance__card {
  border-color: #dc2626 !important;
  box-shadow: 0 0 0 3px rgba(220, 38, 38, 0.08);
}
/* a field the guest skipped, pointed at when they try to unlock wallets or continue */
.sos-checkout-field.is-nudge {
  border-radius: 12px;
  box-shadow: 0 0 0 3px rgba(248, 164, 30, 0.35);
  transition: box-shadow 0.3s;
}

/* ---- Sidebar ------------------------------------------------------------ */
.sos-checkout-sidebar { position: sticky; top: calc(var(--sos-header-h) + 16px); }
.sos-ck-mini { display: none; }

/* ---- Phones and upright foldables (≤960: the layout is one column) ------- */
@media (max-width: 960px) {
  .sos-checkout-sidebar {
    position: sticky;
    top: var(--sos-header-h);
    z-index: 30;
    order: -1;
    margin: 0 0 12px;
    padding: 8px 0 6px;
    background: #fff;          /* folded step heads scroll under this, not through it */
  }
  .sos-checkout-sidebar::after {   /* soft edge under the strip */
    content: '';
    position: absolute;
    left: 0; right: 0; bottom: -14px;
    height: 14px;
    background: linear-gradient(to bottom, rgba(255,255,255,0.95), rgba(255,255,255,0));
    pointer-events: none;
  }
  .sos-ck-mini {
    display: grid;
    grid-template-columns: 54px minmax(0, 1fr) auto 18px;
    gap: 12px;
    align-items: center;
    width: 100%;
    padding: 10px 14px 10px 10px;
    text-align: left;
    background: rgba(255, 255, 255, 0.92);
    -webkit-backdrop-filter: blur(14px);
    backdrop-filter: blur(14px);
    border: 1px solid var(--sos-sand-200);
    border-radius: 18px;
    box-shadow: 0 14px 34px -22px rgba(26, 58, 63, 0.45);
    font-family: var(--sos-font-body);
    color: var(--sos-slate-900);
    cursor: pointer;
  }
  .sos-ck-mini__thumb {
    width: 54px;
    height: 42px;
    border-radius: 12px;
    background: var(--sos-sand-100) center/cover no-repeat;
    display: grid;
    place-items: center;
    color: var(--sos-teal);
    font-size: 1.4rem;
  }
  .sos-ck-mini__text { min-width: 0; display: flex; flex-direction: column; gap: 1px; }
  .sos-ck-mini__text strong { font-size: 0.95rem; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sos-ck-mini__text span { font-size: 0.78rem; color: var(--sos-gray-500); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .sos-ck-mini__total { font-weight: 800; font-size: 1.02rem; white-space: nowrap; }
  .sos-ck-mini__total:empty { display: none; }
  .sos-ck-mini__caret { font-size: 1.1rem; color: var(--sos-gray-500); transition: transform 0.3s var(--sos-ease); }
  .sos-checkout-sidebar.is-open .sos-ck-mini__caret { transform: rotate(180deg); }
  .sos-checkout-sidebar .sos-checkout-summary {
    display: none;
    margin-top: 10px;
    max-height: min(70vh, 640px);
    overflow: auto;
    -webkit-overflow-scrolling: touch;
  }
  .sos-checkout-sidebar.is-open .sos-checkout-summary { display: block; }

  .sos-checkout-main { padding-left: 0; }
  .sos-checkout-main::before,
  .sos-step.is-done::before { display: none; }
  .sos-step { margin-bottom: 14px; }
  .sos-step__marker {
    position: static;
    width: 34px;
    height: 34px;
    font-size: 0.85rem;
    flex: 0 0 auto;
  }
  .sos-step__marker svg { width: 15px; height: 15px; }
  .sos-step.is-open .sos-step__marker { transform: none; box-shadow: 0 0 0 5px rgba(248, 164, 30, 0.16); }
  .sos-step__head { min-height: 34px; gap: 12px; }
  .sos-step.is-open .sos-step__head { padding: 18px 18px 0; }
  .sos-step__title { font-size: 1.15rem; }
  .sos-step.is-open .sos-step__title { font-size: 1.5rem; }
  .sos-step__recap, .sos-step__note { font-size: 0.85rem; }
  .sos-step__edit { padding: 6px 11px; font-size: 0.8rem; }
  .sos-step__card { border-radius: 18px; }
  .sos-step:not(.is-open) .sos-step__card { padding: 8px 0; }
  .sos-step__pad { padding: 16px 18px 22px; }
  .sos-step__foot { margin-top: 16px; padding-top: 16px; }
  .sos-step__next { width: 100%; min-width: 0; }
  .sos-step__err { flex-basis: 100%; }
}

@media (max-width: 640px) {
  .page-template-page-checkout .sos-page-hero--img { padding: calc(var(--sos-header-h) + 2.5rem) 0 4rem; }
  .page-template-page-checkout .sos-page-hero h1 { font-size: 1.6rem; }
  .page-template-page-checkout .sos-hero-pill { font-size: 0.9rem; padding: 6px 18px; }
  .page-template-page-checkout .sos-section { padding-top: 6px; }
  /* the protection card header stacks on narrow screens: icon + title, price underneath */
  .sos-checkout-insurance__card { padding: 16px; }
  .sos-checkout-insurance__header { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px 12px; align-items: start; }
  .sos-checkout-insurance__header > i { font-size: 1.6rem; }
  .sos-checkout-insurance__header h3 { font-size: 1rem; line-height: 1.25; letter-spacing: 0; }
  .sos-checkout-insurance__price { grid-column: 2; justify-self: start; font-size: 1.3rem; }
  .sos-checkout-insurance__options { flex-direction: column; }
}

@media (max-width: 480px) {
  .sos-ck-mini { grid-template-columns: 46px minmax(0, 1fr) auto 16px; gap: 10px; padding: 8px 12px 8px 8px; }
  .sos-ck-mini__thumb { width: 46px; height: 38px; }
  .sos-step.is-open .sos-step__head { padding: 16px 14px 0; }
  .sos-step__pad { padding: 14px 14px 18px; }
  .sos-step.is-open .sos-step__title { font-size: 1.35rem; }
}

@media (prefers-reduced-motion: reduce) {
  .sos-step__body, .sos-step__inner, .sos-step__head, .sos-step__marker, .sos-step__title, .sos-step__card, .sos-ck-mini__caret {
    transition: none !important;
  }
}

/* ---- Booking summary card (2026-10-31): photo header with caption, itinerary strip, ledger-style breakdown ---- */
.sos-checkout-summary:not(.sos-cart-summary) { padding: 14px 14px 16px; border-radius: 22px; border-color: var(--sos-sand-200); box-shadow: 0 24px 50px -30px rgba(26, 58, 63, 0.35), 0 1px 4px rgba(26, 58, 63, 0.05); }
.sos-checkout-summary:not(.sos-cart-summary) .sos-checkout-summary__title { font-family: var(--sos-font-body); font-size: 0.68rem; font-weight: 800; letter-spacing: 0.16em; text-transform: uppercase; color: var(--sos-gray-500); margin: 2px 2px 10px; }
.sos-checkout-summary__hero { position: relative; border-radius: 16px; overflow: hidden; background: var(--sos-sand-100); }
.sos-checkout-summary__hero .sos-checkout-summary__slideshow { margin: 0; border-radius: 0; aspect-ratio: 16 / 8; }
.sos-checkout-summary__hero .sos-checkout-summary__slideshow::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(10, 40, 50, 0.82) 0%, rgba(10, 40, 50, 0.2) 55%, rgba(10, 40, 50, 0) 100%); }
.sos-checkout-summary__cap { position: absolute; left: 0; right: 0; bottom: 0; padding: 12px 16px 12px; color: #fff; }
.sos-checkout-summary__hero .sos-checkout-summary__name { font-size: 1.35rem; letter-spacing: 0.04em; color: #fff; margin: 0 0 4px; line-height: 1.1; text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); }
.sos-checkout-summary__hero .sos-checkout-summary__stats { margin: 0; gap: 12px; color: rgba(255, 255, 255, 0.92); font-size: 0.8rem; font-weight: 600; }
.sos-checkout-summary__hero .sos-checkout-summary__stats i { color: #ffd27a; }
/* itinerary strip */
.sos-ck-itin { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 6px 10px; padding: 16px 6px 4px; }
.sos-ck-itin:empty { display: none; }
.sos-ck-itin__col { display: flex; flex-direction: column; line-height: 1.1; }
.sos-ck-itin__col:last-of-type { text-align: right; align-items: flex-end; }
.sos-ck-itin__k { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--sos-teal); margin-bottom: 4px; }
.sos-ck-itin__d { font-family: var(--sos-font-display); font-size: 2.3rem; color: var(--sos-slate-900); line-height: 0.95; }
.sos-ck-itin__m { font-size: 0.8rem; color: var(--sos-gray-600); margin-top: 3px; white-space: nowrap; }
.sos-ck-itin__mid { display: flex; flex-direction: column; align-items: center; gap: 5px; align-self: center; padding-top: 12px; }
.sos-ck-itin__line { display: block; width: 2px; height: 10px; background: var(--sos-sand-300); border-radius: 2px; }
.sos-ck-itin__n { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; color: var(--sos-slate-800); background: var(--sos-sand-50); border-radius: 999px; padding: 5px 10px; white-space: nowrap; }
.sos-ck-itin__foot { grid-column: 1 / -1; display: flex; justify-content: center; gap: 14px; margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--sos-sand-100); font-size: 0.84rem; font-weight: 600; color: var(--sos-slate-800); }
.sos-ck-itin__foot i { color: var(--sos-teal); margin-right: 3px; vertical-align: -1px; }
.sos-ck-itin:not(:empty) + .sos-checkout-summary__details { display: none; }
/* breakdown as a quiet ledger */
.sos-checkout-summary:not(.sos-cart-summary) .sos-checkout-summary__pricing { margin-top: 10px; padding-top: 12px; border-top: 1px solid var(--sos-sand-100); }
.sos-checkout-summary__pricing .sos-checkout-pricing__row { font-size: 0.88rem; padding: 5px 0; color: var(--sos-slate-800); }
.sos-checkout-summary__pricing .sos-checkout-pricing__pb-summary { font-size: 0.88rem; padding: 5px 0; color: var(--sos-slate-800); }
.sos-checkout-summary__pricing .sos-checkout-pricing__row--total { margin-top: 6px; padding: 12px 0 6px; border-top: 1px solid var(--sos-sand-200); font-size: 1.08rem; font-weight: 800; color: var(--sos-slate-900); }
.sos-checkout-summary__pricing .sos-checkout-pricing__divider { display: none; }
.sos-checkout-summary__pricing .sos-checkout-pricing__row--due-today { margin-top: 8px; padding: 11px 14px; border-radius: 14px; background: #fff4df; color: #b36a04; font-size: 0.98rem; font-weight: 800; }
.sos-checkout-summary__pricing .sos-checkout-pricing__row--due-today + .sos-checkout-pricing__row--balance,
.sos-checkout-summary__pricing .sos-checkout-pricing__row--balance { margin-top: 6px; padding: 6px 14px 0; border: 0 !important; font-size: 0.8rem; color: var(--sos-gray-500); }
.sos-checkout-summary__pricing .sos-checkout-pricing__row--due-today { border: 0 !important; }
.sos-checkout-summary__pricing .sos-checkout-pricing__balance-note { display: none; }
@media (min-width: 961px) {
  .sos-checkout-summary__toggle { display: none; }
  .sos-checkout-summary__collapsible { max-height: none !important; overflow: visible; }
}
