/* Aurelia — the commission atelier (builder) */

.builder {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: var(--paper);
  display: flex;
  flex-direction: column;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s var(--ease-out);
}
.builder.open { opacity: 1; pointer-events: auto; }

/* ----- top bar ----- */
.b-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px clamp(18px, 3.4vw, 44px);
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
  gap: 16px;
}
.b-word {
  font-family: var(--serif);
  font-style: italic;
  font-size: 24px;
  font-weight: 550;
}
.b-model-switch {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 11px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
}
.b-model-switch select {
  appearance: none;
  -webkit-appearance: none;
  border: 1px solid var(--line);
  background: transparent;
  padding: 9px 34px 9px 14px;
  font-family: var(--sans);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6'%3E%3Cpath d='M1 1l4 4 4-4' stroke='%2357503f' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
}
.b-close {
  border: none;
  background: transparent;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--ink-soft);
  padding: 10px 4px;
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color 0.3s;
}
.b-close:hover { color: var(--ink); }
.b-close svg { width: 13px; height: 13px; }

/* ----- main columns ----- */
.b-main {
  flex: 1 1 auto;
  display: grid;
  grid-template-columns: 1fr minmax(340px, 430px);
  min-height: 0;
}

/* ----- stage ----- */
.b-stage {
  position: relative;
  background:
    radial-gradient(90% 70% at 50% 30%, #f6f2e9 0%, var(--paper-2) 58%, var(--paper-3) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  min-height: 0;
}
.b-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(70% 34% at 50% 88%, rgba(28, 26, 22, 0.05), transparent 70%);
  pointer-events: none;
}
.b-canvas {
  width: min(92%, 980px);
  transition: opacity 0.45s var(--ease-out), transform 0.45s var(--ease-out);
}
.b-canvas svg { width: 100%; height: auto; }
.b-canvas.interior-view { width: min(88%, 860px); }
.b-canvas.fading { opacity: 0; transform: scale(0.985); }
.b-viewtag {
  position: absolute;
  top: 22px;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
  transition: opacity 0.4s;
}
.b-stage-caption {
  position: absolute;
  bottom: 22px;
  left: 0; right: 0;
  text-align: center;
  font-family: var(--serif);
  font-style: italic;
  font-size: 19px;
  color: var(--ink-soft);
  opacity: 0;
  transition: opacity 0.5s;
  padding: 0 20px;
}
.b-stage-caption.show { opacity: 1; }

/* ----- rail ----- */
.b-rail {
  border-left: 1px solid var(--line-soft);
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--paper);
}
.b-tabs {
  display: flex;
  overflow-x: auto;
  border-bottom: 1px solid var(--line-soft);
  flex: 0 0 auto;
  scrollbar-width: none;
}
.b-tabs::-webkit-scrollbar { display: none; }
.b-tab {
  flex: 1 0 auto;
  border: none;
  background: transparent;
  padding: 16px 5px 13px;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 2px solid transparent;
  transition: color 0.3s, border-color 0.3s;
  position: relative;
  white-space: nowrap;
}
.b-tab:hover { color: var(--ink-soft); }
.b-tab.active { color: var(--ink); border-bottom-color: var(--brass); }
.b-tab .tick {
  display: inline-block;
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--brass);
  margin-left: 6px;
  vertical-align: 2px;
  opacity: 0;
  transition: opacity 0.3s;
}
.b-tab.done .tick { opacity: 1; }

.b-panel {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 26px 24px 40px;
  scrollbar-width: thin;
  scrollbar-color: var(--line) transparent;
}
.b-panel-head { margin-bottom: 20px; }
.b-panel-head h3 {
  font-size: 27px;
  font-weight: 480;
}
.b-panel-head p {
  margin-top: 6px;
  font-size: 13px;
  color: var(--ink-faint);
  line-height: 1.6;
}

.b-group-label {
  margin: 26px 0 12px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass-deep);
  display: flex;
  align-items: center;
  gap: 12px;
}
.b-group-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line-soft);
}
.b-group-label:first-of-type { margin-top: 4px; }

/* swatch grid for paint & leather */
.b-swatches {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 10px;
}
.b-swatch {
  border: 1px solid var(--line-soft);
  background: #faf7f0;
  padding: 10px 8px 9px;
  text-align: center;
  transition: border-color 0.3s, box-shadow 0.3s, transform 0.3s var(--ease-out);
  position: relative;
}
.b-swatch:hover { border-color: var(--brass); transform: translateY(-1px); }
.b-swatch.selected { border-color: var(--brass-deep); box-shadow: 0 0 0 1px var(--brass-deep); }
.b-swatch .chip {
  display: block;
  width: 100%;
  aspect-ratio: 1.5;
  border-radius: 2px;
  margin-bottom: 8px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.12);
  position: relative;
  overflow: hidden;
}
.b-swatch .chip::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(160deg, rgba(255,255,255,0.34), transparent 46%, rgba(0,0,0,0.14));
}
.b-swatch .chip.matte::after { background: linear-gradient(160deg, rgba(255,255,255,0.12), transparent 40%, rgba(0,0,0,0.1)); }
.b-swatch .nm {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.04em;
  line-height: 1.3;
  display: block;
}
.b-swatch .pr {
  font-size: 10px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  margin-top: 2px;
  display: block;
}

/* list cards for everything else */
.b-cards { display: flex; flex-direction: column; gap: 9px; }
.b-card {
  border: 1px solid var(--line-soft);
  background: #faf7f0;
  padding: 13px 15px;
  display: flex;
  align-items: center;
  gap: 14px;
  text-align: left;
  transition: border-color 0.3s, box-shadow 0.3s;
  width: 100%;
}
.b-card:hover { border-color: var(--brass); }
.b-card.selected { border-color: var(--brass-deep); box-shadow: 0 0 0 1px var(--brass-deep); background: #fbf8f1; }
.b-card .mini {
  flex: 0 0 52px;
  height: 40px;
  border-radius: 3px;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.1);
  position: relative;
  overflow: hidden;
}
.b-card .mini::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(155deg, rgba(255,255,255,0.28), transparent 50%, rgba(0,0,0,0.12));
}
.b-card .txt { flex: 1; min-width: 0; }
.b-card .nm { font-size: 13.5px; font-weight: 600; letter-spacing: 0.02em; display: inline; }
.b-card .ds {
  font-size: 11.5px;
  color: var(--ink-faint);
  margin-top: 2px;
  line-height: 1.45;
}
.b-card .pr {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  white-space: nowrap;
}
.b-card .pr.free { color: var(--ink-faint); font-weight: 500; }
.b-card .check {
  flex: 0 0 18px;
  height: 18px;
  border: 1px solid var(--line);
  border-radius: 50%;
  position: relative;
  transition: border-color 0.3s;
}
.b-card.selected .check { border-color: var(--brass-deep); background: var(--brass-deep); }
.b-card.selected .check::after {
  content: "";
  position: absolute;
  left: 5px; top: 4.5px;
  width: 5px; height: 8px;
  border: solid var(--paper);
  border-width: 0 1.6px 1.6px 0;
  transform: rotate(42deg);
}

/* ----- footer bar ----- */
.b-foot {
  flex: 0 0 auto;
  border-top: 1px solid var(--line);
  background: var(--paper);
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.4vw, 34px);
  padding: 15px clamp(18px, 3.4vw, 44px);
}
.b-price { display: flex; flex-direction: column; }
.b-price .lbl {
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.b-price .val {
  font-family: var(--serif);
  font-size: clamp(24px, 2.6vw, 34px);
  font-weight: 520;
  line-height: 1.15;
  font-variant-numeric: tabular-nums;
  transition: color 0.3s;
}
.b-price .val.bump { color: var(--brass-deep); }
.b-specline {
  flex: 1;
  min-width: 0;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: var(--ink-faint);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.b-foot .navbtns { display: flex; gap: 12px; align-items: center; }
.b-btn {
  border: 1px solid var(--ink);
  background: transparent;
  padding: 13px 24px;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  transition: background 0.35s, color 0.35s, opacity 0.3s;
}
.b-btn:hover:not(:disabled) { background: var(--ink); color: var(--paper); }
.b-btn.primary { background: var(--ink); color: var(--paper); }
.b-btn.primary:hover:not(:disabled) { background: var(--brass-deep); border-color: var(--brass-deep); }
.b-btn:disabled { opacity: 0.3; cursor: default; }
.b-btn.quiet { border-color: transparent; color: var(--ink-faint); }
.b-btn.quiet:hover:not(:disabled) { background: transparent; color: var(--ink); }

/* ----- review / build sheet ----- */
.review {
  position: fixed;
  inset: 0;
  z-index: 110;
  background: var(--paper);
  overflow-y: auto;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.55s var(--ease-out);
}
.review.open { opacity: 1; pointer-events: auto; }
.review-inner {
  max-width: 1060px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 70px) clamp(18px, 4vw, 40px) 90px;
}
.r-head { text-align: center; }
.r-head .kicker { display: block; }
.r-head h2 {
  margin-top: 14px;
  font-size: clamp(34px, 4.6vw, 58px);
  font-weight: 470;
}
.r-ref {
  margin-top: 14px;
  display: inline-block;
  border: 1px solid var(--line);
  padding: 8px 18px;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.3em;
  color: var(--ink-soft);
}
.r-car {
  margin: clamp(26px, 4vw, 50px) auto 0;
  background: linear-gradient(175deg, var(--paper-2), var(--paper-3));
  padding: clamp(16px, 3vw, 40px) clamp(6px, 2vw, 24px) 0;
}
.r-car svg { width: 100%; height: auto; }
.r-cabin {
  margin: 14px auto 0;
  max-width: 780px;
  border: 1px solid var(--line-soft);
}
.r-cabin svg { width: 100%; height: auto; }

.r-cols {
  margin-top: clamp(30px, 5vw, 54px);
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: clamp(28px, 5vw, 64px);
  align-items: start;
}
.r-spec h3, r-price h3 { font-size: 24px; }
.r-group { margin-top: 22px; }
.r-group .g {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--brass-deep);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.r-group .g .edit {
  border: none;
  background: none;
  font-size: 9.5px;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-faint);
  border-bottom: 1px solid var(--line);
  padding: 0 0 2px;
  transition: color 0.3s;
}
.r-group .g .edit:hover { color: var(--brass-deep); }
.r-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line-soft);
  font-size: 13.5px;
}
.r-row .k { color: var(--ink-faint); }
.r-row .v { text-align: right; font-weight: 550; }
.r-row .v small { display: block; font-weight: 400; color: var(--ink-faint); font-size: 11px; }

.r-price {
  border: 1px solid var(--line);
  padding: clamp(20px, 3vw, 34px);
  background: #faf7f0;
  position: sticky;
  top: 30px;
}
.r-price h3 { font-size: 24px; font-weight: 480; }
.r-price .prow {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 9px 0;
  font-size: 13px;
  border-bottom: 1px solid var(--line-soft);
}
.r-price .prow span:first-child { color: var(--ink-soft); }
.r-price .prow span:last-child { font-variant-numeric: tabular-nums; font-weight: 550; }
.r-price .total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--ink);
}
.r-price .total .t {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.26em;
  text-transform: uppercase;
}
.r-price .total .v {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 540;
  font-variant-numeric: tabular-nums;
}
.r-price .fineprint {
  margin-top: 16px;
  font-size: 11px;
  line-height: 1.7;
  color: var(--ink-faint);
}
.r-actions {
  margin-top: clamp(34px, 5vw, 56px);
  display: flex;
  justify-content: center;
  gap: 18px;
  flex-wrap: wrap;
}

/* print: the build sheet stands alone */
@media print {
  .builder, .site-head, .b-close { display: none !important; }
  .review { position: static; opacity: 1; }
  .r-actions, .r-group .g .edit { display: none !important; }
  .r-price { position: static; }
  body { background: #fff; }
}

/* ----- builder responsive ----- */
@media (max-width: 960px) {
  .b-main { grid-template-columns: 1fr; grid-template-rows: minmax(240px, 38vh) 1fr; }
  .b-rail { border-left: none; border-top: 1px solid var(--line-soft); }
  .b-stage { min-height: 240px; }
  .b-canvas { width: min(96%, 640px); }
  .r-cols { grid-template-columns: 1fr; }
  .r-price { position: static; }
}
@media (max-width: 640px) {
  .b-specline { display: none; }
  .b-foot { flex-wrap: wrap; }
  .b-foot .navbtns { margin-left: auto; }
  .b-model-switch span.lbl { display: none; }
}
