/* ==========================================================================
   Configurator / checkout — Airstream "Build Yours" layout
   (warm greys, rounded cards, dark pill buttons, sticky bottom bar)
   ========================================================================== */

body.page-configurator { background: #efedeb; color: #333; }

.cfg {
  --cfg-ink: #333;
  --cfg-muted: #6f6a66;
  --cfg-line: #d6d3cf;
  --cfg-panel: #fbfaf8;
  --cfg-brown: #7a6a63;

  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(360px, 0.8fr);
  gap: 20px;
  align-items: start;
  padding: calc(var(--header-h) + 20px) 20px 120px;
}

/* ---------- Left stage ---------- */
.cfg__stage {
  position: sticky;
  top: calc(var(--header-h) + 20px);
  height: calc(100svh - var(--header-h) - 110px);
  min-height: 420px;
  overflow: hidden;
  border-radius: 24px;
  background: linear-gradient(180deg, #f7f6f4 0%, #e6e3df 100%);
}

.cfg-stage__slides { position: absolute; inset: 0; }

.cfg-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.6s ease, transform 0.8s ease;
}

.cfg-slide.is-contain {
  object-fit: contain;
  padding: 8% 6% 14%;
  filter: drop-shadow(0 30px 30px rgba(0, 0, 0, 0.25));
}

.cfg-slide.is-active { opacity: 1; transform: none; }

/* dark fade under the controls on photo slides */
.cfg__stage::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 30%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.55), transparent);
  opacity: var(--shade, 0);
  transition: opacity 0.4s;
  pointer-events: none;
}

.cfg-stage__expand {
  position: absolute;
  top: 20px;
  left: 20px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #fff;
  color: #333;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.cfg-stage__expand svg,
.cfg-stage__nav svg,
.cfg-bar svg {
  width: 16px;
  height: 16px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.cfg-stage__caption {
  position: absolute;
  left: 40px;
  bottom: 70px;
  z-index: 2;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 14px;
  letter-spacing: 0.81px;
  text-transform: uppercase;
  color: var(--cap, #333);
}

.cfg-stage__nav {
  position: absolute;
  left: 40px;
  right: 40px;
  bottom: 28px;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--cap, #333);
}

.cfg-stage__nav button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  color: inherit;
}

.cfg-stage__track {
  position: relative;
  flex: 1;
  max-width: 300px;
  height: 2px;
  margin-left: 8px;
  background: rgba(127, 127, 127, 0.35);
}

.cfg-stage__track i {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  background: currentColor;
  transition: width 0.4s ease, left 0.4s ease;
}

/* ---------- Right panel ---------- */
.cfg__panel {
  padding: 36px 32px 40px;
  border-radius: 24px;
  background: var(--cfg-panel);
}

.cfg-kicker {
  margin: 0 0 6px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: #df5828;
}

.cfg-title {
  margin: 0 0 8px;
  font-family: var(--font-head);
  font-weight: 900;
  font-size: 28px;
  line-height: 1;
  letter-spacing: 0.81px;
  text-transform: uppercase;
  color: var(--cfg-ink, #333);
}

.cfg-sub { margin: 0; font-size: 15px; color: var(--cfg-muted); }

.cfg-sec {
  padding-top: 36px;
  margin-top: 36px;
  border-top: 1px solid var(--cfg-line);
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.cfg-intro + .cfg-sec { border-top: 0; margin-top: 12px; }

.cfg-h {
  margin: 0 0 18px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 26px;
  line-height: 1.1;
  letter-spacing: -0.8px;
  color: var(--cfg-ink);
}

.cfg-label {
  margin: 18px 0 6px;
  font-family: var(--font-label);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--cfg-ink, #333);
}

.cfg-note { margin: 14px 0 0; font-size: 14px; line-height: 1.55; color: var(--cfg-muted, #6f6a66); }

/* Kit options (Airstream floor-plan cards) */
.cfg-opts { display: grid; gap: 12px; }

.cfg-opt {
  padding: 14px 16px;
  border: 1px solid var(--cfg-line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  transition: border-color 0.2s, box-shadow 0.2s;
}

.cfg-opt:hover { border-color: #999; }

.cfg-opt[aria-checked="true"] {
  border: 2px solid var(--cfg-ink);
  padding: 13px 15px;
}

.cfg-opt__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 15px;
}

.cfg-flag {
  margin-left: 6px;
  padding: 3px 7px;
  border-radius: 6px;
  background: #df5828;
  color: #fff;
  font-style: normal;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-transform: uppercase;
  vertical-align: 2px;
}

.cfg-price { font-size: 14px; white-space: nowrap; }
.cfg-price s { margin-right: 6px; color: #9d9792; }

.cfg-opt__more {
  display: none;
  margin-top: 10px;
  font-size: 13.5px;
  line-height: 1.55;
  color: #4a4643;
  animation: cfg-reveal 0.35s ease;
}

.cfg-opt[aria-checked="true"] .cfg-opt__more { display: block; }
.cfg-opt__more p,
.cfg-opt__more ul { margin: 0; }
.cfg-opt__more ul { padding-left: 18px; list-style: disc; }
.cfg-opt__more .cfg-label { margin: 12px 0 4px; font-size: 11px; }

@keyframes cfg-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: none; }
}

.cfg-qty {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 18px;
}

.cfg-qty .cfg-label { margin: 0; }

.cfg-stepper {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--cfg-line);
  border-radius: 999px;
  background: #fff;
}

.cfg-stepper button { width: 40px; height: 38px; font-size: 18px; color: var(--cfg-ink); }
.cfg-stepper output { min-width: 24px; text-align: center; font-weight: 700; }

/* Fitment swatches (Airstream exterior colours) */
.cfg-sub-row {
  display: flex;
  justify-content: space-between;
  font-size: 15px;
  margin-bottom: 12px;
}

.cfg-swatches { display: flex; gap: 14px; }

.cfg-swatch {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: #e8e5e1;
  box-shadow: inset 0 0 0 1px var(--cfg-line);
  transition: box-shadow 0.2s, background-color 0.2s;
}

.cfg-swatch .ico { width: 26px; height: 26px; color: var(--cfg-ink); }

.cfg-swatch.is-on {
  background: #fff;
  box-shadow: 0 0 0 2px var(--cfg-panel), 0 0 0 4px var(--cfg-ink);
}

/* Install chips */
.cfg-opts--inline { grid-template-columns: 1fr 1fr; }

.cfg-chip {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border: 1px solid var(--cfg-line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font-size: 12.5px;
  line-height: 1.35;
  color: var(--cfg-muted);
}

.cfg-chip strong { display: block; font-size: 14px; color: var(--cfg-ink); }
.cfg-chip .ico { width: 26px; height: 26px; }
.cfg-chip.is-on { border: 2px solid var(--cfg-ink); padding: 13px; }

/* Add-on cards (Airstream upgrades) */
.cfg-group { margin: 18px 0 10px; font-weight: 700; font-size: 15px; color: var(--cfg-ink); }

.cfg-card {
  padding: 12px;
  border: 1px solid var(--cfg-line);
  border-radius: 16px;
  background: #fff;
}

.cfg-card img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 8px; background: #e6e3df; }
.cfg-card h3 { margin: 12px 0 6px; font-size: 15px; font-weight: 700; color: var(--cfg-ink); }
.cfg-card p { margin: 0; font-size: 13.5px; line-height: 1.5; color: #4a4643; }

.cfg-card__foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 14px;
  font-size: 14px;
}

.cfg-card--row { display: grid; grid-template-columns: 110px 1fr; gap: 14px; align-items: center; }
.cfg-card--row img { aspect-ratio: 1; }
.cfg-card--row h3 { margin-top: 0; }

.cfg-link { display: inline-block; margin-top: 8px; font-size: 13px; font-weight: 700; color: var(--cfg-ink); text-decoration: underline; }

/* Pills (Airstream buttons) */
.cfg-pill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px 18px 10px;
  border-radius: 999px;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.cfg-pill--ghost { box-shadow: inset 0 0 0 1.5px #333; color: #333; background: transparent; }
.cfg-pill--ghost:hover { background: #333; color: #fff; }
.cfg-pill--solid { background: #7a6a63; color: #fff; }
.cfg-pill--solid:hover { background: #333; }
.cfg-pill--block { width: 100%; padding: 16px; margin-top: 12px; }

/* Checkout form */
.cfg-form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }
.cfg-form > .cfg-label,
.cfg-form > .cfg-ship,
.cfg-form > .cfg-pay,
.cfg-form > .cfg-check,
.cfg-form > .cfg-pill,
.cfg-form > .cfg-form__status { grid-column: 1 / -1; }

.cfg-field { display: grid; gap: 6px; }
.cfg-field--full { grid-column: 1 / -1; }

.cfg-field span {
  font-family: var(--font-label);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--cfg-ink);
}

.cfg-field input,
.cfg-field select {
  width: 100%;
  height: 46px;
  padding: 0 16px;
  border: 1px solid var(--cfg-line);
  border-radius: 999px;
  background: #fff;
  font: 15px var(--font-body);
  color: var(--cfg-ink);
  appearance: none;
}

.cfg-field select { background: #fff url("../images/storyteller/bg/icon-arrow-bottom.svg") right 16px center / 11px no-repeat; }

.cfg-field input:focus,
.cfg-field select:focus { outline: none; border-color: var(--cfg-ink); box-shadow: 0 0 0 3px rgba(51, 51, 51, 0.12); }

.cfg-field.is-invalid input,
.cfg-field.is-invalid select { border-color: #c62828; }

.cfg-ship,
.cfg-pay {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border: 2px solid var(--cfg-ink);
  border-radius: 12px;
  background: #fff;
  font-size: 13px;
  color: var(--cfg-muted);
}

.cfg-ship strong { display: block; font-size: 14px; color: var(--cfg-ink); }
.cfg-pay { justify-content: flex-start; border: 1px dashed var(--cfg-line); }
.cfg-pay p { margin: 0; }

.cfg-check { display: flex; align-items: center; gap: 10px; font-size: 13px; color: var(--cfg-muted); }
.cfg-check input { width: 18px; height: 18px; accent-color: #333; }

.cfg-form__status { margin: 0; font-size: 13px; }
.cfg-form__status.is-error { color: #c62828; }

/* ---------- Bottom bar ---------- */
.cfg-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 70;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  height: 68px;
  padding: 0 32px;
  border-top: 1px solid #dcd9d5;
  background: rgba(239, 237, 235, 0.96);
  -webkit-backdrop-filter: blur(8px);
          backdrop-filter: blur(8px);
  color: #333;
}

.cfg-bar__model { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
.cfg-bar__model strong { font-size: 17px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cfg-bar__model a { font-size: 12px; color: #6f6a66; text-decoration: underline; }
.cfg-bar__actions { display: flex; align-items: center; gap: 10px; }
.cfg-bar__total { margin-left: 12px; font-size: 20px; font-weight: 700; }
.cfg-bar svg { width: 13px; height: 13px; }
body.menu-open .cfg-bar { opacity: 0; pointer-events: none; }

/* ---------- Summary drawer ---------- */
.cfg-drawer { position: fixed; inset: 0; z-index: 150; visibility: hidden; transition: visibility 0s linear 0.45s; color: #333; }
.cfg-drawer.is-open { visibility: visible; transition-delay: 0s; }

.cfg-drawer__scrim {
  position: absolute;
  inset: 0;
  background: rgba(20, 18, 16, 0.45);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.cfg-drawer__panel {
  position: absolute;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(460px, 100%);
  padding: 36px 32px;
  overflow-y: auto;
  background: #fbfaf8;
  transform: translateX(100%);
  transition: transform 0.45s cubic-bezier(0.77, 0, 0.18, 1);
}

.cfg-drawer.is-open .cfg-drawer__scrim { opacity: 1; }
.cfg-drawer.is-open .cfg-drawer__panel { transform: none; }

.cfg-drawer__close {
  position: absolute;
  top: 18px;
  right: 20px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
  color: #333;
}

.cfg-drawer__img {
  width: 100%;
  aspect-ratio: 16 / 9;
  margin: 18px 0;
  object-fit: contain;
  border-radius: 16px;
  background: linear-gradient(180deg, #f7f6f4, #e6e3df);
}

.cfg-sum { margin: 0; }

.cfg-sum div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2px 12px;
  padding: 12px 0;
  border-bottom: 1px solid #d6d3cf;
}

.cfg-sum dt { font-family: var(--font-label); font-size: 11px; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; color: #6f6a66; grid-column: 1 / -1; }
.cfg-sum dd { margin: 0; font-size: 15px; }
.cfg-sum dd + dd { text-align: right; }

.cfg-sum__totals { margin: 16px 0 6px; font-size: 15px; }
.cfg-sum__totals div { display: flex; justify-content: space-between; padding: 5px 0; }
.cfg-sum__totals .is-save { color: #2e7d32; }
.cfg-sum__totals .is-total { margin-top: 6px; padding-top: 12px; border-top: 2px solid #333; font-size: 20px; font-weight: 700; }

/* Toast */
.cfg-toast {
  position: fixed;
  left: 50%;
  bottom: 88px;
  z-index: 160;
  padding: 12px 20px;
  border-radius: 999px;
  background: #333;
  color: #fff;
  font-size: 14px;
  opacity: 0;
  transform: translate(-50%, 10px);
  transition: opacity 0.3s, transform 0.3s;
  pointer-events: none;
}

.cfg-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* The footer sits below the bar */
.page-configurator .site-footer { padding-bottom: 68px; }
.page-configurator .back-to-top { bottom: 90px; }

/* ---------- Responsive ---------- */
@media (max-width: 991px) {
  .cfg { grid-template-columns: 1fr; padding-top: calc(var(--header-h) + 12px); }
  .cfg__stage { position: relative; top: 0; height: 56vw; min-height: 260px; }
  .cfg-bar { padding: 0 16px; }
  .cfg-bar__model a,
  #cfgSave,
  #cfgShare { display: none; }
}

@media (max-width: 520px) {
  .cfg__panel { padding: 28px 18px; }
  .cfg-form,
  .cfg-opts--inline { grid-template-columns: 1fr; }
  .cfg-bar__model strong { font-size: 14px; }
  .cfg-bar__total { font-size: 17px; margin-left: 4px; }
}

/* No dark photo-fade above the footer on this light page */
.page-configurator .footer-top::before { display: none; }

.cfg-flag,
.cfg-pill { white-space: nowrap; }

@media (max-width: 520px) {
  .cfg-flag { display: inline-block; margin: 4px 0 0; }
  .cfg-bar .cfg-pill { padding: 10px 12px 9px; font-size: 10px; }
}

/* ---------- Order summary (cart) inside checkout ---------- */
.cfg-order {
  margin: 18px 0 26px;
  padding: 18px 18px 8px;
  border-radius: 16px;
  background: var(--cfg-panel);
  border: 1px solid var(--cfg-line);
}

.cfg-order__head { display: flex; align-items: center; justify-content: space-between; }
.cfg-order__head .cfg-label { margin: 0; }
.cfg-order__head .cfg-link { border: 0; background: none; padding: 0; cursor: pointer; font: inherit; font-size: 13px; text-decoration: underline; color: var(--cfg-ink); }

.cfg-order__lines { margin: 12px 0 0; padding: 0; list-style: none; }

.cfg-order__lines li {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-top: 1px solid var(--cfg-line);
  font-size: 13px;
  color: var(--cfg-muted);
}

.cfg-order__lines img { width: 64px; height: 64px; object-fit: contain; border-radius: 10px; background: #ebe8e4; }
.cfg-order__lines strong { display: block; font-size: 14px; color: var(--cfg-ink); }
.cfg-order__lines em { display: block; font-style: normal; font-size: 12px; }
.cfg-order__lines b { font-size: 15px; color: var(--cfg-ink); }

.cfg-order__empty { padding: 14px 0 12px; font-size: 14px; color: var(--cfg-muted); }
.cfg-order__empty p { margin: 0 0 12px; }

.cfg-order__totals { padding: 8px 0; border-top: 1px solid var(--cfg-line); font-size: 14px; }
.cfg-order__totals div { display: flex; justify-content: space-between; padding: 4px 0; }
.cfg-order__totals .is-save { color: #2e7d32; }
.cfg-order__totals .is-total { margin-top: 6px; padding-top: 10px; border-top: 2px solid var(--cfg-ink); font-size: 18px; font-weight: 700; color: var(--cfg-ink); }

.cfg-paylogos { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 0; padding: 0; list-style: none; }

.cfg-paylogos li {
  padding: 5px 9px;
  border: 1px solid var(--cfg-line);
  border-radius: 6px;
  background: #fff;
  font-size: 11px;
  font-weight: 700;
  color: var(--cfg-ink);
}

.cfg-trust {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 4px 16px;
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  font-size: 12px;
  color: var(--cfg-muted);
}

.cfg-trust li::before { content: "✓ "; font-weight: 700; color: #df5828; }

/* ---------- Order confirmation ---------- */
.cfg-confirm {
  position: fixed;
  inset: 0;
  z-index: 520;
  display: grid;
  place-items: center;
  padding: 16px;
  background: rgba(20, 18, 16, 0.6);
  -webkit-backdrop-filter: blur(4px);
          backdrop-filter: blur(4px);
  visibility: hidden;
  opacity: 0;
  transition: opacity 0.35s, visibility 0s linear 0.35s;
}

.cfg-confirm.is-open { visibility: visible; opacity: 1; transition-delay: 0s; }

.cfg-confirm__card {
  width: min(520px, 100%);
  max-height: calc(100dvh - 32px);
  overflow-y: auto;
  padding: 34px 30px 28px;
  border-radius: 22px;
  background: #fbfaf8;
  color: #333;
  text-align: center;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
  transform: translateY(20px);
  transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1);
}

.cfg-confirm.is-open .cfg-confirm__card { transform: none; }

.cfg-confirm__tick {
  display: inline-grid;
  place-items: center;
  width: 64px;
  height: 64px;
  margin-bottom: 14px;
  border-radius: 50%;
  background: #3d9a2e;
  animation: tick-pop 0.6s cubic-bezier(0.16, 1, 0.3, 1) both 0.15s;
}

.cfg-confirm__tick svg { width: 32px; height: 32px; fill: none; stroke: #fff; stroke-width: 3; }

@keyframes tick-pop { from { transform: scale(0.4); opacity: 0; } }

.cfg-confirm__lines { margin: 18px 0 0; padding: 0; list-style: none; text-align: left; font-size: 14px; }
.cfg-confirm__lines li { display: flex; justify-content: space-between; gap: 12px; padding: 8px 0; border-top: 1px solid #d6d3cf; }
.cfg-confirm__total { display: flex; justify-content: space-between; padding: 12px 0; border-top: 2px solid #333; font-size: 18px; }

.cfg-confirm__next { margin: 8px 0 16px; padding: 16px 16px 16px 36px; border-radius: 12px; background: #efedeb; text-align: left; font-size: 14px; line-height: 1.5; }
.cfg-confirm__next li + li { margin-top: 6px; }
.cfg-demo-note { margin: 0 0 18px; font-size: 12px; color: #8a847f; }
.cfg-confirm__btns { display: flex; flex-wrap: wrap; justify-content: center; gap: 10px; }

@media (max-width: 767px) {
  .cfg-bar #cfgSummaryBtn { display: none; }
}

/* Buying actions stand out in brand orange */
#cfgAdd,
#placeOrder,
#cfgAddBuild,
#cfgSumCheckout { background: #df5828; border-color: #df5828; color: #fff; }
#cfgAdd:hover,
#placeOrder:hover,
#cfgAddBuild:hover,
#cfgSumCheckout:hover { background: #c44a1f; border-color: #c44a1f; }
