/* Fit & finish: one viewport. Header, then a full-bleed strip of matched cards (R1S left, R2 right) that takes all the
   height left over, then the step buttons and card index. Cards peek in from both sides; js/sections/finish.js. */
.section--finish {
  --field: var(--field-finish);
  height: clamp(640px, 100svh, 1080px);
  padding-block: clamp(36px, 5.5vh, 72px) clamp(72px, 10vh, 120px);
}
/* Full-bleed container: card width, header width and the strip all measure against the page width. */
.finish { --finish-card: min(1320px, 88cqw); height: 100%; margin-inline: calc(var(--gutter) * -1); display: flex; flex-direction: column; container-type: inline-size; }
.finish__head { flex: none; width: var(--finish-card); max-width: none; margin: 0 auto clamp(10px, 1.8vh, 18px); display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; }
.finish__hint { margin: 0 0 8px; color: var(--ink-2); font-size: 12px; font-weight: 550; white-space: nowrap; }
.finish__hint span { margin-right: 8px; font-size: 19px; vertical-align: -1px; }
.finish__body { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.finish-strip { flex: 1 1 auto; min-height: 0; padding-block: 6px 12px; overflow: clip; cursor: grab; touch-action: pan-y; outline-offset: -5px; }
.finish-strip.is-dragging { cursor: grabbing; }
.finish-track { display: flex; gap: 22px; width: max-content; height: 100%; will-change: transform; }
.finish-card {
  width: var(--finish-card); flex: 0 0 var(--finish-card); height: 100%; display: flex; flex-direction: column;
  padding: 18px 22px 14px; border: 1px solid rgb(31 36 28 / 7%); border-radius: 24px; background: #fafaf7;
  box-shadow: 0 12px 30px -22px rgb(24 29 16 / 30%); opacity: 0.48; transform: scale(0.965);
  transition: opacity 260ms, transform 420ms var(--ease-out); user-select: none; -webkit-user-select: none;
}
.finish-card.is-active { opacity: 1; transform: none; }
.finish-card__head { flex: none; display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 14px; }
.finish-card__title { margin: 0; font-size: 28px; font-weight: 650; line-height: 1; letter-spacing: -0.045em; }
.finish-card__number { color: #8a8c83; font-size: 11px; letter-spacing: 0.08em; }

/* Card bodies: every photo area flexes to fill the card. */
.finish-card__body { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: 16px; }
.finish-car { min-width: 0; min-height: 0; display: flex; flex-direction: column; }
.finish-car--solo { grid-column: 1 / -1; }
.finish-solo { flex: 1 1 auto; min-height: 0; display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 16px; }
.finish-stack { flex: 1 1 auto; min-height: 0; display: grid; grid-template-rows: minmax(0, 1fr) minmax(0, 1fr); gap: 10px; }
.finish-frame { position: relative; flex: 1 1 auto; min-height: 0; overflow: hidden; border-radius: 12px; background: #e6e4dd; }
.finish-frame > img { position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.finish-chip {
  position: absolute; left: 12px; bottom: 12px; display: inline-flex; align-items: baseline; gap: 9px; padding: 7px 13px 8px;
  border-radius: var(--radius-pill); color: var(--white); background: rgb(18 20 16 / 56%);
  backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); font-size: 13px; font-weight: 600; line-height: 1.2; letter-spacing: -0.01em;
}
.finish-chip:empty { display: none; }
.finish-chip small { font-size: 10.5px; font-weight: 550; letter-spacing: 0.01em; opacity: 0.76; }
/* Same height in every column whether or not a trim tag shows, so paired frames line up. */
.finish-caption { flex: none; min-height: 56px; display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 10px; align-content: start; padding-top: 13px; }
.finish-caption .vname { font-size: 18px; line-height: 1.3; }
.finish-caption__label { margin: 0; font-size: 18px; font-weight: 580; line-height: 1.3; letter-spacing: -0.03em; }
.finish-caption__tag { grid-column: 2; margin-top: 2px; color: #72756b; font-size: 11px; letter-spacing: 0.01em; }

/* Crops: keep each photo's subject inside the frame at every card size (renders and photos are never warped). */
.finish-interior { object-position: 46% 64%; }
[data-card="details"] .v-r1s .finish-frame:nth-child(1) img { object-position: 50% 74%; }
[data-card="details"] .v-r2 .finish-frame:nth-child(1) img { object-position: 50% 56%; }
[data-card="details"] .finish-frame:nth-child(2) img { object-position: 50% 52%; }
[data-card="rear"] .v-r1s img { object-position: 50% 46%; }
[data-card="rear"] .v-r2 img { object-position: 100% 40%; transform: scale(1.08); transform-origin: 100% 46%; }
[data-card="wheel"] .v-r1s img { object-position: 0% 50%; }
[data-card="wheel"] .v-r2 img { object-position: 40% 50%; }

/* Interiors: the configurator's own swatches, grouped by trim. */
.finish-swatches { flex: none; height: 50px; display: flex; align-items: center; gap: 14px; padding-left: 54px; }
.finish-swatches__group { display: flex; gap: 8px; }
.finish-swatches__divider { width: 1px; height: 24px; background: rgb(31 36 28 / 16%); }
.finish-swatch {
  width: 44px; height: 44px; padding: 3px; border: 1.5px solid transparent; border-radius: 50%; background: transparent;
  transition: transform 240ms var(--ease-spring), border-color 180ms; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.finish-swatch img { width: 100%; height: 100%; border-radius: 50%; pointer-events: none; box-shadow: 0 0 0 1px rgb(0 0 0 / 6%); }
.finish-swatch[aria-pressed="true"] { border-color: var(--c); }
.finish-swatch:hover { transform: translateY(-2px); }
.finish-swatch:active { transform: scale(0.92); }

.finish-controls { flex: none; display: flex; align-items: center; justify-content: center; gap: 24px; margin-top: 2px; }
.finish-step { width: 44px; height: 44px; flex: none; display: grid; place-items: center; border: 1px solid #d3d5cb; border-radius: 50%; background: #f9f9f4; color: var(--ink); font-size: 22px; transition: transform 250ms var(--ease-spring), background-color 200ms; }
.finish-step:hover { background: var(--white); transform: scale(1.08); }
.finish-step:active { transform: scale(0.94); }
.finish-step:disabled { opacity: 0.3; cursor: default; transform: none; }
.finish-index { display: flex; align-items: center; gap: 4px; }
.finish-index__button { position: relative; padding: 15px 12px; border: 0; background: transparent; color: #777a70; font-size: 12px; font-weight: 550; white-space: nowrap; transition: color 180ms; }
.finish-index__button::after { content: ""; position: absolute; bottom: 3px; left: calc(50% - 2px); width: 4px; height: 4px; border-radius: 50%; background: currentColor; opacity: 0; transform: scale(0); transition: opacity 180ms, transform 300ms var(--ease-spring); }
.finish-index__button:hover, .finish-index__button[aria-pressed="true"] { color: var(--ink); }
.finish-index__button[aria-pressed="true"]::after { opacity: 1; transform: scale(1); }

@media (max-width: 1200px) {
  .finish { --finish-card: 90cqw; }
  .finish-card { padding: 16px 18px 12px; }
  .finish-card__body, .finish-solo { column-gap: 14px; }
  .finish-caption__label { font-size: 16px; }
  .finish-swatches { gap: 10px; }
  .finish-swatches__group { gap: 6px; }
  .finish-swatch { width: 40px; height: 40px; }
}
@media (max-height: 820px) {
  .finish-card__title { font-size: 25px; }
  .finish-card__head { margin-bottom: 12px; }
  .finish-caption { min-height: 52px; padding-top: 11px; }
  .finish-swatches { height: 46px; }
  .finish-index__button { padding-block: 13px; }
}
@media (max-width: 1050px) {
  .finish__hint { display: none; }
  .finish-swatches { gap: 8px; padding-left: 0; }
  .finish-swatches__group { gap: 4px; }
  .finish-swatch { width: 38px; height: 38px; padding: 2.5px; }
  .finish-chip { left: 10px; bottom: 10px; padding: 6px 11px 7px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .finish-card, .finish-swatch, .finish-step, .finish-index__button, .finish-index__button::after { transition: none; }
}
