:root {
  --panel-width: clamp(430px, 25vw, 560px);
  --rail-width: 58px;
  --line: #dedede;
  --soft: #f7f7f7;
  --black: #080808;
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body {
  color: var(--black);
  background: #f6f6f7;
  font-family: "Helvetica Neue", "Segoe UI Variable", "Segoe UI", Arial, sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
button, select, input { font: inherit; }
button { color: inherit; }
a { color: inherit; text-decoration: none; }

.configurator-shell { position: relative; width: 100%; height: 100%; }
.vehicle-stage {
  position: absolute;
  inset: 0 calc(var(--panel-width) + var(--rail-width)) 0 0;
  overflow: hidden;
  background: #f6f6f7;
}
.config-header {
  position: absolute;
  z-index: 8;
  inset: 0 0 auto;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  min-height: 66px;
  padding: 0 30px;
  pointer-events: none;
}
.config-header > * { pointer-events: auto; }
.back-button { font-size: 46px; font-weight: 200; line-height: 1; }
.model-button {
  position: absolute;
  left: 75px;
  display: flex;
  align-items: center;
  gap: 14px;
  border: 0;
  background: transparent;
  font-size: 18px;
  font-weight: 600;
  cursor: pointer;
}
.config-wordmark {
  grid-column: 2;
  display: block;
  width: 145px;
  line-height: 0;
}
.config-wordmark img {
  display: block;
  width: 100%;
  height: auto;
}
.model-menu {
  position: absolute;
  z-index: 12;
  top: 58px;
  left: 74px;
  width: 230px;
  padding: 8px;
  border: 1px solid var(--line);
  background: #fff;
  box-shadow: 0 12px 35px rgba(0,0,0,.12);
}
.model-menu button {
  width: 100%;
  min-height: 42px;
  padding: 0 12px;
  border: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}
.model-menu button:hover, .model-menu button.active { color: #fff; background: #111; }
.stage-frame, .stage-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
  visibility: hidden;
  opacity: 0;
  transition: opacity .25s;
}
.stage-frame.active, .stage-poster.active { visibility: visible; opacity: 1; }
.viewer-busy:not(.viewer-initialized) .stage-frame.active { opacity: 0; }

.stage-poster { z-index: 3; background: #eee; }
.stage-poster img { width: 100%; height: 100%; object-fit: cover; }
.stage-status {
  position: absolute;
  z-index: 7;
  top: 50%;
  left: 50%;
  display: grid;
  justify-items: center;
  gap: 10px;
  min-width: 190px;
  margin: 0;
  padding: 10px 14px;
  color: #777;
  background: rgba(255,255,255,.85);
  transform: translate(-50%, -50%);
  font-size: 13px;
  text-align: center;
}
.stage-status.ready { display: none; }
.stage-status button {
  min-height: 34px;
  padding: 0 14px;
  border: 1px solid #111;
  background: #111;
  color: #fff;
  cursor: pointer;
  font: inherit;
}
.interior-active .body-button { visibility: hidden; pointer-events: none; }
.stage-note {
  position: absolute;
  z-index: 7;
  left: 30px;
  bottom: 24px;
  margin: 0;
  color: #999;
  font-size: 12px;
}
.body-button {
  position: absolute;
  z-index: 7;
  right: 28px;
  bottom: 22px;
  min-height: 38px;
  padding: 0 18px;
  border: 1px solid #bbb;
  background: rgba(255,255,255,.9);
  cursor: pointer;
}
.body-button:disabled { opacity: .45; cursor: default; }
.view-switch {
  position: absolute;
  z-index: 7;
  bottom: 22px;
  left: 50%;
  display: grid;
  grid-template-columns: 1fr 1fr;
  width: 190px;
  padding: 3px;
  border-radius: 24px;
  background: #e8e8e8;
  transform: translateX(-50%);
}
.view-switch button {
  min-height: 36px;
  border: 0;
  border-radius: 20px;
  background: transparent;
  cursor: pointer;
}
.view-switch button.active { background: #fff; box-shadow: 0 1px 4px rgba(0,0,0,.08); }
.view-switch button:disabled,
.step-rail button:disabled,
.model-button:disabled,
.selector-footer > button:disabled {
  cursor: wait;
  opacity: .42;
}

.step-rail {
  position: absolute;
  z-index: 10;
  top: 0;
  right: var(--panel-width);
  bottom: 0;
  display: grid;
  align-content: center;
  width: var(--rail-width);
  background: #f1f2f3;
}
.step-rail button {
  position: relative;
  display: grid;
  place-items: center;
  width: 100%;
  height: 68px;
  border: 0;
  background: transparent;
  color: #74787b;
  cursor: pointer;
  font-size: 22px;
}
.step-rail button.active { color: #111; background: #fff; }
.step-rail button > img {
  width: 28px;
  height: 28px;
  object-fit: contain;
  opacity: .55;
  filter: grayscale(1);
}
.step-fallback-icon {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
}
.step-fallback-icon svg {
  width: 26px;
  height: 26px;
  overflow: visible;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.45;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.step-rail button.active > img { opacity: 1; }
.step-rail button::after {
  content: attr(data-label);
  position: absolute;
  right: 64px;
  width: max-content;
  padding: 6px 9px;
  color: #fff;
  background: #111;
  visibility: hidden;
  opacity: 0;
  font-size: 11px;
  pointer-events: none;
}
.step-rail button:hover::after { visibility: visible; opacity: 1; }

.selector-panel {
  position: absolute;
  z-index: 11;
  inset: 0 0 0 auto;
  width: var(--panel-width);
  background: #fff;
  border-left: 1px solid #ececec;
  transition: transform .25s;
}
.selector-panel.collapsed { transform: translateX(calc(100% - 42px)); }
.panel-toggle {
  position: absolute;
  z-index: 3;
  top: 0;
  left: 0;
  width: 58px;
  height: 64px;
  border: 0;
  background: #f2f3f4;
  color: #6d7174;
  font-size: 42px;
  font-weight: 200;
  cursor: pointer;
}
.selector-scroll { position: relative; height: calc(100% - 82px); overflow-y: auto; overscroll-behavior: contain; }
.selector-scroll::before {
  content: attr(data-lock-message);
  position: sticky;
  z-index: 8;
  top: 0;
  display: none;
  width: 100%;
  padding: 10px 18px;
  box-sizing: border-box;
  border-bottom: 1px solid #e6e6e6;
  background: rgba(255,255,255,.96);
  color: #666;
  text-align: center;
  font-size: 12px;
  line-height: 1.35;
  backdrop-filter: blur(10px);
}
.configuration-locked .selector-scroll::before { display: block; }
.configuration-locked #selector-content { opacity: .58; }
.configuration-locked #selector-content [data-option-info] { opacity: 1; }
#selector-content { padding: 78px 26px 50px; }
.panel-heading { margin: 0 0 36px; text-align: center; font-size: 32px; font-weight: 600; }
.panel-section-title { margin: 28px 0 14px; font-size: 16px; font-weight: 600; }
.specs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 18px;
}
.specs div { text-align: center; }
.specs strong { display: block; min-height: 28px; font-size: 21px; font-weight: 500; }
.specs span { color: #929292; font-size: 12px; }
.version-list, .option-list { display: grid; gap: 12px; }
.option-card-shell {
  position: relative;
}
.version-card, .option-card {
  position: relative;
  width: 100%;
  min-height: 78px;
  padding: 16px 14px;
  border: 1px solid transparent;
  background: var(--soft);
  text-align: left;
  cursor: pointer;
}
.version-card.active, .option-card.active { border-color: #111; background: #fff; }
.version-card:disabled, .option-card:disabled { opacity: .38; cursor: not-allowed; }
.version-card strong, .option-card strong { display: block; padding-right: 96px; font-size: 16px; font-weight: 500; }
.version-card small, .option-card small {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 8px;
  color: #777;
  font-size: 12px;
  line-height: 1.42;
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}
.version-card .price, .option-card .price {
  position: absolute;
  top: 17px;
  right: 14px;
  font-size: 14px;
}
.option-card.has-image { min-height: 102px; padding-right: 114px; }
.option-card.has-image strong { padding-right: 0; }
.option-card.has-image .price { top: auto; right: 112px; bottom: 14px; }
.option-card img {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 92px;
  height: 80px;
  object-fit: contain;
}
.option-card-shell:has(.option-info) .option-card { padding-bottom: 42px; }
.option-info {
  position: absolute;
  z-index: 4;
  left: 14px;
  bottom: 10px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 25px;
  padding: 0;
  border: 0;
  border-bottom: 1px solid rgba(16, 20, 24, .32);
  border-radius: 0;
  color: #41464a;
  background: transparent;
  font-family: inherit;
  font-size: 11px;
  font-style: normal;
  font-weight: 600;
  line-height: 1;
  cursor: pointer;
}
.option-info span { font-size: 13px; font-weight: 400; }
.option-card-shell:has(.has-image) .option-info { right: auto; }
.option-info:hover,
.option-info:focus-visible {
  border-color: #111;
  background: transparent;
  color: #111;
  outline: 0;
}
.option-blocked-hit,
.color-blocked-hit {
  position: absolute;
  z-index: 3;
  inset: 0;
  border: 0;
  background: transparent;
  cursor: help;
}
.option-card-shell.is-unavailable .option-info { opacity: 1; }
.color-options { display: flex; flex-wrap: wrap; gap: 16px; }
.color-option-shell {
  position: relative;
  display: inline-grid;
}
.color-option {
  position: relative;
  width: 54px;
  height: 54px;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  cursor: pointer;
}
.color-option::before {
  content: "";
  position: absolute;
  inset: 6px;
  border-radius: 50%;
  background: var(--color, #bbb);
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
.color-option img {
  position: absolute;
  z-index: 1;
  inset: 6px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
}
.color-option.active { border-color: #111; }
.color-option:disabled { cursor: not-allowed; opacity: .38; }
.color-option-shell .color-blocked-hit { border-radius: 50%; }
.color-option-shell .color-info {
  left: auto;
  right: -3px;
  bottom: -3px;
  width: 20px;
  height: 20px;
  min-height: 20px;
  justify-content: center;
  border: 1px solid rgba(16, 20, 24, .18);
  border-radius: 50%;
  background: #fff;
  color: #555;
  font-family: Georgia, serif;
  font-size: 0;
  font-style: italic;
  line-height: 1;
}
.color-option-shell .color-info span {
  font-size: 12px;
  font-weight: 700;
}
.color-selection {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  min-height: 32px;
  margin-top: 12px;
}
.color-name {
  display: block;
  color: #555;
  font-size: 13px;
  font-weight: 500;
}
.color-price {
  flex: 0 0 auto;
  color: #24282c;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
}
.selector-footer {
  position: absolute;
  inset: auto 0 0;
  display: grid;
  grid-template-columns: 1fr 118px;
  align-items: center;
  min-height: 82px;
  padding: 10px 20px 10px 26px;
  border-top: 1px solid var(--line);
  background: rgba(255,255,255,.97);
}
.selector-footer strong, .selector-footer span { display: block; }
.selector-footer strong { font-size: 20px; }
.selector-footer span { margin-top: 5px; color: #888; font-size: 11px; }
.selector-footer button { min-height: 44px; border: 0; color: #fff; background: #050505; cursor: pointer; }
.empty-options { padding: 36px 0; color: #777; text-align: center; font-size: 14px; }

.option-detail-dialog {
  width: min(940px, calc(100vw - 40px));
  height: min(760px, calc(100dvh - 40px));
  max-width: none;
  max-height: min(760px, calc(100dvh - 40px));
  padding: 0;
  overflow: hidden;
  border: 0;
  border-radius: 20px;
  color: #101315;
  background: #f7f7f5;
  box-shadow: 0 30px 90px rgba(0, 0, 0, .28);
}
.option-detail-dialog::backdrop {
  background: rgba(5, 7, 9, .58);
  backdrop-filter: blur(8px);
}
.option-detail-sheet {
  position: relative;
  display: grid;
  grid-template-columns: minmax(300px, .9fr) minmax(340px, 1.1fr);
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.option-detail-close {
  position: absolute;
  z-index: 2;
  top: 18px;
  right: 18px;
  width: 38px;
  height: 38px;
  border: 1px solid rgba(16, 19, 21, .12);
  border-radius: 50%;
  color: #101315;
  background: rgba(255, 255, 255, .88);
  font-size: 25px;
  font-weight: 300;
  line-height: 1;
  cursor: pointer;
}
.option-detail-visual {
  display: grid;
  min-width: 0;
  min-height: 0;
  padding: 42px 28px;
  overflow: hidden;
  place-items: center;
  background: #ececea;
}
.option-detail-visual img {
  display: block;
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  object-position: center;
}
.option-detail-visual img[hidden] { display: none; }
.option-detail-content {
  min-width: 0;
  min-height: 0;
  padding: 58px 54px 38px;
  overflow-y: auto;
  overscroll-behavior: contain;
}
.option-detail-kicker {
  color: #7c8185;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .14em;
  text-transform: uppercase;
}
.option-detail-content h2 {
  margin: 12px 44px 18px 0;
  font-size: clamp(25px, 3vw, 38px);
  font-weight: 540;
  letter-spacing: -.035em;
  line-height: 1.06;
}
.option-detail-description {
  margin: 0;
  color: #3e4347;
  font-size: 15px;
  line-height: 1.72;
  white-space: pre-line;
}
.option-detail-meta {
  display: grid;
  gap: 12px;
  margin-top: 24px;
}
.option-detail-meta:empty { display: none; }
.option-detail-meta > div {
  padding: 14px 16px;
  border: 1px solid rgba(16, 19, 21, .08);
  border-radius: 10px;
  background: rgba(255, 255, 255, .72);
}
.option-detail-meta strong {
  display: block;
  margin-bottom: 5px;
  font-size: 11px;
  font-weight: 650;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.option-detail-meta p {
  margin: 0;
  color: #505559;
  font-size: 13px;
  line-height: 1.55;
  white-space: pre-line;
}
.option-detail-footer {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin-top: 30px;
  padding-top: 18px;
  border-top: 1px solid rgba(16, 19, 21, .1);
}
.option-detail-footer span {
  color: #74797d;
  font-size: 12px;
}
.option-detail-footer strong {
  flex: 0 0 auto;
  font-size: 18px;
  font-variant-numeric: tabular-nums;
}

@media (max-width: 1050px) {
  :root { --panel-width: 390px; }
  .vehicle-stage { inset-right: calc(var(--panel-width) + var(--rail-width)); }
  .config-wordmark { width: 132px; }
  .model-button { left: 62px; }
}

@media (min-width: 761px) and (max-height: 820px) {
  .option-detail-dialog {
    width: min(860px, calc(100vw - 24px));
    height: calc(100dvh - 24px);
    max-height: calc(100dvh - 24px);
    border-radius: 16px;
  }
  .option-detail-sheet {
    grid-template-columns: minmax(260px, .84fr) minmax(320px, 1.16fr);
  }
  .option-detail-close {
    top: 12px;
    right: 12px;
    width: 34px;
    height: 34px;
    font-size: 22px;
  }
  .option-detail-visual {
    padding: 24px 20px;
  }
  .option-detail-content {
    padding: 32px 36px 24px;
    scrollbar-width: thin;
  }
  .option-detail-kicker {
    font-size: 9px;
  }
  .option-detail-content h2 {
    margin: 8px 38px 12px 0;
    font-size: clamp(22px, 2.5vw, 30px);
    line-height: 1.08;
  }
  .option-detail-description {
    font-size: 13px;
    line-height: 1.5;
  }
  .option-detail-meta {
    gap: 8px;
    margin-top: 14px;
  }
  .option-detail-meta > div {
    padding: 10px 12px;
  }
  .option-detail-meta strong {
    margin-bottom: 3px;
    font-size: 9px;
  }
  .option-detail-meta p {
    font-size: 11px;
    line-height: 1.4;
  }
  .option-detail-footer {
    margin-top: 16px;
    padding-top: 12px;
  }
  .option-detail-footer span {
    font-size: 10px;
  }
  .option-detail-footer strong {
    font-size: 16px;
  }
}

@media (max-width: 760px) {
  :root { --panel-width: 100vw; --rail-width: 0px; }
  .option-detail-dialog {
    width: calc(100vw - 20px);
    height: auto;
    max-height: calc(100dvh - 20px);
    border-radius: 16px;
  }
  .option-detail-sheet {
    display: block;
    height: auto;
    max-height: calc(100dvh - 20px);
    overflow-y: auto;
  }
  .option-detail-close {
    position: fixed;
    top: 22px;
    right: 22px;
  }
  .option-detail-visual {
    min-height: 250px;
    height: auto;
    max-height: 38dvh;
    padding: 32px 20px 20px;
  }
  .option-detail-visual img { max-height: 32dvh; }
  .option-detail-content {
    padding: 28px 24px 30px;
    overflow: visible;
  }
  .option-detail-content h2 {
    margin-right: 34px;
    font-size: 28px;
  }
  .option-detail-description { font-size: 14px; }
  .option-detail-footer {
    align-items: flex-start;
    flex-direction: column;
    gap: 6px;
  }
  .vehicle-stage { inset: 0 0 46vh; }
  .config-header { min-height: 54px; padding: 0 14px; }
  .back-button { font-size: 38px; }
  .model-button { left: 47px; font-size: 14px; }
  .model-button { max-width: 100px; gap: 5px; overflow: hidden; font-size: 11px; white-space: nowrap; }
  .config-wordmark { width: 96px; }
  .model-menu { top: 48px; left: 44px; width: 200px; }
  .step-rail {
    top: 54vh;
    right: 0;
    bottom: auto;
    display: flex;
    width: 100%;
    height: 54px;
    overflow-x: auto;
    background: #f1f2f3;
  }
  .step-rail button { flex: 0 0 58px; height: 54px; font-size: 18px; }
  .step-rail button::after { display: none; }
  .selector-panel { top: calc(54vh + 54px); width: 100%; }
  .selector-panel.collapsed { transform: none; }
  .panel-toggle { display: none; }
  .selector-scroll { height: calc(46vh - 136px); }
  #selector-content { padding: 22px 18px 38px; }
  .panel-heading { margin-bottom: 20px; font-size: 24px; }
  .specs strong { font-size: 17px; }
  .selector-footer { grid-template-columns: 1fr 104px; min-height: 82px; }
  .view-switch { bottom: 12px; width: 170px; }
  .body-button { right: 12px; bottom: 58px; min-height: 34px; font-size: 11px; }
  .stage-note { display: none; }
  .stage-status { font-size: 11px; }
}
