/* ═══════════════════════════════════════════════════════════════════
   OPTIMA CONFIGURATOR — scoped styles (.cfg-*)
   Inherits global tokens from /optima-v2.css
   ═══════════════════════════════════════════════════════════════════ */

/* The configurator has a fixed-bottom .cfg-bar (160px tall on desktop).
   Push the page bottom by that height so the footer / last content
   isn't covered by the sticky bar. We pad the .page wrapper (paper bg)
   instead of body so the painted area stays inside the .page rectangle
   — keeps wide-screen gutters paper-colored. */
.cfg-page .page { padding-bottom: 160px; }

/* ─── HERO ─────────────────────────────────────────────────────── */
.cfg-hero {
  position: relative;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  padding: 88px 96px 64px;
  box-shadow: 0 0 0 100vmax var(--paper);
  clip-path: inset(0 -100vmax);
}

.cfg-hero-inner {
  max-width: 1100px;
}

.cfg-hero-h {
  font-family: var(--sans);
  font-size: 56px;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.028em;
  color: var(--ink);
  margin: 16px 0 24px;
}

.cfg-hero-p {
  font-size: 19px;
  line-height: 1.5;
  color: var(--ink-2);
  max-width: 680px;
  margin: 0 0 40px;
}

/* Payment toggle in hero */
.cfg-pay-toggle {
  display: inline-flex;
  border: 1px solid var(--ink);
  border-radius: 0;
  background: #fff;
  padding: 0;
  overflow: hidden;
}

.cfg-pay-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 18px 32px;
  background: #fff;
  border: 0;
  border-right: 1px solid var(--rule);
  cursor: pointer;
  text-align: left;
  transition: background 120ms ease, color 120ms ease;
  min-width: 240px;
}
.cfg-pay-btn:last-child { border-right: 0; }

.cfg-pay-btn:hover { background: #FAFAF7; }

.cfg-pay-btn.is-active {
  background: var(--ink);
  color: var(--paper);
}

.cfg-pay-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.cfg-pay-detail {
  font-family: var(--sans);
  font-size: 13px;
  letter-spacing: 0;
  margin-top: 4px;
  opacity: 0.7;
}

.cfg-pay-btn.is-active .cfg-pay-detail { opacity: 0.8; }

/* ─── STEP SECTIONS ────────────────────────────────────────────── */
.cfg-step {
  position: relative;
  padding: 80px 96px 64px;
  border-bottom: 1px solid var(--rule);
}

.cfg-step[data-gated="true"] {
  transition: opacity 200ms ease, filter 200ms ease;
}
.cfg-step.is-disabled {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(0.4);
}

.cfg-step-head {
  display: grid;
  grid-template-columns: 1fr 480px;
  gap: 64px;
  align-items: end;
  margin-bottom: 40px;
}

.cfg-step-meta {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cfg-step-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--blue);
}

.cfg-step-h {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 700;
  line-height: 1.04;
  letter-spacing: -0.024em;
  color: var(--ink);
  margin: 0;
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.cfg-step-sub {
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 0;
  padding-bottom: 8px;
}

.cfg-included-badge {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue);
  border: 1px solid var(--blue);
  padding: 4px 8px;
  align-self: center;
}
/* Inline-with-headline row: the badge sits to the right of the h2
   on its baseline. Used when .cfg-step-meta wraps h2 + badge in a
   row instead of leaving the badge as a third stacked child. */
.cfg-step-h-row {
  display: flex;
  align-items: baseline;
  gap: 20px;
  flex-wrap: wrap;
}
.cfg-step-h-row .cfg-included-badge { align-self: baseline; }

/* ─── PACKAGE ROWS ─────────────────────────────────────────────── */
.cfg-pkg-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 16px;
}

.cfg-pkg-row {
  position: relative;
  display: grid;
  grid-template-columns: 160px 1fr 220px;
  gap: 32px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--rule);
  padding: 28px 32px;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.cfg-pkg-row:hover {
  border-color: var(--ink);
  background: #FAFAF7;
}

.cfg-pkg-row.is-selected {
  border-color: var(--blue);
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.cfg-pkg-row-featured {
  border-color: var(--ink);
}

.pkg-band {
  position: absolute;
  top: -1px;
  right: 24px;
  background: var(--blue);
  color: #fff;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 6px 10px;
}

.pkg-head { display: flex; flex-direction: column; gap: 8px; }
.pkgh-num {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink-2);
}

.pkg-plan-mini {
  display: block;
  width: 140px;
  padding: 4px;
}
.pkg-plan-svg {
  display: block;
  width: 100%;
  height: auto;
}
.cfg-pkg-row.is-selected .pkg-plan-svg rect[fill="#0069FF"],
.cfg-pkg-row.is-selected .pkg-plan-svg rect[fill-opacity="0.14"] {
  fill-opacity: 0.28;
}

.pkg-main { display: flex; flex-direction: column; gap: 6px; }
.pkg-name {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.pkg-dim {
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}
.pkg-icp {
  font-size: 14px;
  color: var(--ink-2);
  margin-top: 4px;
}

.pkg-price {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
}
.pkgp-num {
  font-family: var(--sans);
  font-size: 28px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.pkgp-mo {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--blue);
}

/* ─── ROW GRID (spa, heater, jets, fence) ──────────────────────── */
.cfg-row-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 12px;
}
.cfg-row-grid-3 {
  grid-template-columns: 1fr 1fr 1fr;
  gap: 16px;
}

.cfg-row {
  position: relative;
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 24px;
  align-items: center;
  background: #fff;
  border: 1px solid var(--rule);
  padding: 24px 28px;
  text-align: left;
  cursor: pointer;
  transition: border-color 120ms ease, background 120ms ease;
}

.cfg-row-grid-3 .cfg-row {
  grid-template-columns: 1fr;
  align-items: stretch;
}
.cfg-row-grid-3 .cfgr-price {
  margin-top: 16px;
  align-self: flex-start;
}

.cfg-row:hover {
  border-color: var(--ink);
  background: #FAFAF7;
}

.cfg-row.is-selected,
.cfg-row.is-on {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 2px var(--blue);
}

/* Heater + Jets get locked + visually muted when a spa is selected — the
   price is bundled into the spa. The row still shows as 'on' (blue) but
   the cursor + opacity signal it's no longer toggle-able. */
.cfg-row.is-bundled {
  cursor: not-allowed;
  opacity: 0.78;
}
/* Bundled rows show only the "INCLUDED WITH SPA" badge — the original
   "+$X" price is hidden via visibility:hidden so the slot keeps its
   width, then the pseudo-element overlays the badge text in its place. */
.cfg-row.is-bundled .cfgr-price {
  visibility: hidden;
  position: relative;
}
.cfg-row.is-bundled .cfgr-price::after {
  content: 'INCLUDED WITH SPA';
  visibility: visible;
  position: absolute;
  top: 0;
  right: 0;
  white-space: nowrap;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue);
}
.cfg-row.is-bundled .cfgr-price-zero { display: none; }

.cfgr-main { display: flex; flex-direction: column; gap: 4px; }
.cfgr-name {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.cfgr-detail {
  font-size: 14px;
  color: var(--ink-2);
  line-height: 1.5;
}
.cfgr-price {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cfgr-price-zero {
  color: var(--ink-3, var(--ink-2));
  opacity: 0.6;
}

.cfgr-check {
  width: 28px;
  height: 28px;
  border: 1px solid var(--rule);
  background: #fff;
  position: relative;
  flex-shrink: 0;
}
.cfg-row.is-on .cfgr-check {
  background: var(--blue);
  border-color: var(--blue);
}
.cfg-row.is-on .cfgr-check::after {
  content: '';
  position: absolute;
  left: 9px;
  top: 5px;
  width: 8px;
  height: 14px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

/* ─── SEGMENTED CONTROL (extend length / width / depth) ────────── */
.cfg-seg {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.cfg-seg[data-seg="additionalDepth"] {
  grid-template-columns: repeat(3, 1fr);
}

.cfg-seg-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 22px 24px;
  background: #fff;
  border: 1px solid var(--rule);
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease;
}

.cfg-seg-btn:hover {
  border-color: var(--ink);
  background: #FAFAF7;
}

.cfg-seg-btn.is-selected {
  border-color: var(--blue);
  background: #fff;
  box-shadow: inset 0 0 0 2px var(--blue);
}

.segb-val {
  font-family: var(--sans);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.segb-price {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.cfg-seg-btn.is-selected .segb-price {
  color: var(--blue);
}

/* ─── SWATCH GRID (tile / coping / pebble) ─────────────────────── */
.cfg-swatch-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}
.cfg-swatch-grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

.cfg-swatch {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--rule);
  cursor: pointer;
  text-align: left;
  transition: border-color 120ms ease, background 120ms ease;
}

.cfg-swatch:hover {
  border-color: var(--ink);
  background: #FAFAF7;
}

.cfg-swatch.is-selected {
  border-color: var(--blue);
  box-shadow: inset 0 0 0 2px var(--blue);
}

.sw-disc {
  width: 100%;
  height: 100px;
  border: 1px solid var(--rule);
  background: #eee;
}
/* Tile & coping — real photo swatches */
.sw-white { background: url('/assets/tile/white.webp') center/cover no-repeat #EEEAE2; }
.sw-tan   { background: url('/assets/tile/tan.webp')   center/cover no-repeat #D8C8A8; }
.sw-grey  { background: url('/assets/tile/grey.webp')  center/cover no-repeat #6E7378; }
.sw-black { background: url('/assets/tile/black.webp') center/cover no-repeat #1F2122; }
/* Legacy tile keys preserved (fall through to closest new finish) */
.sw-natural   { background: url('/assets/tile/tan.webp')   center/cover no-repeat #D8C8A8; }
.sw-graphite  { background: url('/assets/tile/grey.webp')  center/cover no-repeat #6E7378; }
.sw-obsidian  { background: url('/assets/tile/black.webp') center/cover no-repeat #1F2122; }
/* Pebble — official PebbleTech finishes Optima ships (real photo swatches) */
.sw-whitediamond { background: url('/assets/pebble/whitediamond.webp') center/cover no-repeat #E6E2D8; }
.sw-bluesurf    { background: url('/assets/pebble/bluesurf.webp')    center/cover no-repeat #4F8FB5; }
.sw-oceanblue   { background: url('/assets/pebble/oceanblue.webp')   center/cover no-repeat #2A3142; }
/* Legacy class names kept for cached state — point at the closest new finish */
.sw-azure       { background: url('/assets/pebble/bluesurf.webp')    center/cover no-repeat #4F8FB5; }
.sw-mineral     { background: url('/assets/pebble/oceanblue.webp')   center/cover no-repeat #2A3142; }
.sw-midnight    { background: url('/assets/pebble/oceanblue.webp')   center/cover no-repeat #2A3142; }

.sw-name {
  font-family: var(--sans);
  font-size: 16px;
  font-weight: 600;
  color: var(--ink);
}
.sw-detail {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

/* ─── ALREADY INCLUDED LIST ────────────────────────────────────── */
.cfg-included-section {
  padding: 80px 96px 64px;
  background: #FAFAF7;
  border-bottom: 1px solid var(--rule);
  box-shadow: 0 0 0 100vmax #FAFAF7;
  clip-path: inset(0 -100vmax);
}

.cfg-incl-list {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px 32px;
  padding: 0;
  margin: 0;
}
.cfg-incl-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--ink);
  padding: 8px 0;
  border-bottom: 1px dashed var(--rule);
}

.incl-tick {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  background: var(--blue);
  position: relative;
}
.incl-tick::after {
  content: '';
  position: absolute;
  left: 4px;
  top: 1px;
  width: 4px;
  height: 8px;
  border: solid #fff;
  border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}

/* ─── RESERVE STEP ─────────────────────────────────────────────── */
.cfg-reserve {
  padding: 96px 96px 96px;
  background: var(--paper);
  border-bottom: 1px solid var(--rule);
  scroll-margin-top: 96px;
}

.cfg-reserve-grid {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 64px;
  align-items: start;
}

.cfg-form {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.cf-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cf-field-grow { flex: 1; }

.cf-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}

.cf-lbl {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink);
}
.cf-opt {
  font-weight: 400;
  letter-spacing: 0.06em;
  color: var(--ink-2);
}

.cf-input,
.cf-textarea {
  font-family: var(--sans);
  font-size: 16px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--rule);
  padding: 14px 16px;
  width: 100%;
  border-radius: 0;
  transition: border-color 120ms ease;
}
.cf-input:focus,
.cf-textarea:focus {
  outline: none;
  border-color: var(--blue);
  box-shadow: inset 0 0 0 1px var(--blue);
}

.cf-textarea {
  resize: vertical;
  min-height: 84px;
}

.cf-input.is-invalid {
  border-color: #C0392B;
}

.cfg-form-deposit {
  margin-top: 16px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--ink);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.cfd-lbl {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue);
}
.cfd-amount {
  font-family: var(--sans);
  font-size: 40px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--ink);
  line-height: 1;
}
.cfd-note {
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

.cfg-form-submit {
  margin-top: 16px;
  align-self: stretch;
  justify-content: center;
}

.cfg-form-submit.is-loading {
  pointer-events: none;
  opacity: 0.6;
}

.cfg-form-meta {
  font-size: 12px;
  line-height: 1.5;
  color: var(--ink-2);
  margin: 8px 0 0;
}

/* ─── LIVE SUMMARY SIDEBAR ─────────────────────────────────────── */
.cfg-summary {
  position: sticky;
  top: 96px;
  background: #fff;
  border: 1px solid var(--rule);
  padding: 32px;
}

.cfg-summary-head .sh-eyebrow {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--blue);
  margin-bottom: 16px;
}

.cfg-summary-empty {
  font-size: 14px;
  color: var(--ink-2);
  margin: 0;
}

.cfg-summary-body {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cs-pkg {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--rule);
}
.cs-pkg-name {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.cs-pkg-dim {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}

.cs-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}
.cs-line {
  display: flex;
  justify-content: space-between;
  color: var(--ink-2);
}
.cs-line-name { flex: 1; }
.cs-line-amt {
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}

.cs-finishes {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 0;
  border-top: 1px dashed var(--rule);
  border-bottom: 1px dashed var(--rule);
  margin: 16px 0;
}
.cs-finish-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
}
.cs-finish-lbl {
  font-family: var(--mono);
  letter-spacing: 0.08em;
  color: var(--ink-2);
  text-transform: uppercase;
}
.cs-finish-val {
  color: var(--ink);
  font-weight: 500;
}

.cs-totals {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding-top: 4px;
}
.cs-total-row-primary {
  background: var(--paper);
  margin: 0 -32px 8px;
  padding: 18px 32px;
  border-top: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
}
.cs-total-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.cs-total-lbl {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.12em;
  color: var(--ink-2);
}
.cs-total-amt {
  font-family: var(--sans);
  font-size: 22px;
  font-weight: 700;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
}
.cs-total-row-primary .cs-total-amt {
  color: var(--blue);
  font-size: 32px;
  letter-spacing: -0.025em;
}

/* ─── STICKY CALC BAR ──────────────────────────────────────────── */
.cfg-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: var(--ink);
  color: var(--paper);
  border-top: 1px solid var(--ink);
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

.cfg-bar.is-visible {
  transform: translateY(0);
}

.cfg-bar-inner {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 48px;
  padding: 20px 96px;
  max-width: 1440px;
  margin: 0 auto;
}

.cfgb-eyebrow {
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--blue);
}

.cfgb-label {
  font-family: var(--sans);
  font-size: 14px;
  color: var(--paper);
  margin-top: 4px;
  opacity: 0.85;
}

.cfgb-mid {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
}
.cfgb-primary {
  font-family: var(--sans);
  font-size: 36px;
  font-weight: 700;
  letter-spacing: -0.025em;
  color: var(--paper);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.cfgb-secondary {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--paper);
  opacity: 0.65;
}

.cfg-cta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background: var(--blue);
  color: #fff;
  padding: 16px 28px;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
  border: 1px solid var(--blue);
  transition: background 120ms ease;
}
.cfg-cta:hover {
  background: #0058DC;
  border-color: #0058DC;
}
.cfg-cta .arrow {
  display: inline-block;
  width: 0;
  height: 0;
  border-top: 5px solid transparent;
  border-bottom: 5px solid transparent;
  border-left: 6px solid #fff;
}

.cfg-bar-empty .cfgb-mid .cfgb-primary { opacity: 0.35; }
.cfg-bar-empty .cfg-cta {
  pointer-events: none;
  opacity: 0.4;
}


/* Responsive overrides live in /optima-mobile.css (Phase 4) — keep mobile rules out of this file. */
