/* Оформление — как на imperiummotors.ru: тёплый бежевый фон, тёмно-зелёный акцент, шрифты Onest и Wix Madefor Display. */
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/onest-cyr.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/onest-latext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Onest"; font-style: normal; font-weight: 400 700; font-display: swap; src: url(/fonts/onest-lat.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Wix Madefor Display"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/fonts/wix-cyr.woff2) format("woff2"); unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116; }
@font-face { font-family: "Wix Madefor Display"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/fonts/wix-latext.woff2) format("woff2"); unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Wix Madefor Display"; font-style: normal; font-weight: 500 700; font-display: swap; src: url(/fonts/wix-lat.woff2) format("woff2"); unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }

:root {
  /* палитра сайта салона */
  --bg: #f3f0ee;          /* stone-beige-100 — фон страницы */
  --stage: #e4dfdb;       /* stone-beige-200 — фон под машиной */
  --card: #faf9f8;        /* карточки (белый 60% на фоне) */
  --surface: #ffffff;
  --panel: #ebe7e3;       /* серо-бежевые панели: характеристики, поля */
  --chip: rgba(143,133,121,.2);
  --line: #e4dfdb;
  --line-2: #d5ccc4;      /* warm-taupe-200 */
  --text: #1b1e1d;        /* carbon-black-500 */
  --text-2: #4c4b49;
  --muted: #8f8579;       /* warm-taupe-400 */
  --muted-2: #6a6259;     /* warm-taupe-500 */
  --accent: #294434;      /* heritage-green-500 */
  --accent-hover: #213227;
  --accent-soft: #e1eae5;
  --accent-ink: #ffffff;
  --ok: #55ab4d;
  --warn: #bb4545;
  --radius-lg: 26px;
  --radius: 16px;
  --gutter: clamp(16px, 3.125vw, 56px);
  --font: "Onest", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  --font-d: "Wix Madefor Display", "Onest", -apple-system, "Segoe UI", Arial, sans-serif;
  --shadow: 0 10px 30px rgba(180,170,163,.35);
}
@media (max-width: 768px) { :root { --radius-lg: 18px; --radius: 14px; } }
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
body { min-height: 100vh; display: flex; flex-direction: column; padding-bottom: env(safe-area-inset-bottom); }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; }
img { max-width: 100%; display: block; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* шапка — «таблетка», как на сайте */
.top { position: sticky; top: 0; z-index: 20; padding: 12px var(--gutter) 8px;
  background: linear-gradient(to bottom, var(--bg) 0, var(--bg) 55%, rgba(243,240,238,0) 100%); } /* над шапкой не просвечивает прокрученный текст */
.top-in { max-width: 1328px; margin: 0 auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 12px; padding: 10px 14px 10px 22px;
  background: rgba(250,249,248,.82); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid rgba(255,255,255,.9); border-radius: 999px; box-shadow: var(--shadow); }
.top-l { display: flex; align-items: center; gap: 8px; min-width: 0; }
.top-r { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.logo { display: block; }
.logo img { height: 22px; width: auto; }
.crumb-home { font-weight: 500; white-space: nowrap; }
.crumb { color: var(--muted); font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.crumb:not(:empty)::before { content: "›"; margin-right: 8px; color: var(--line-2); }
.back { flex: none; width: 34px; height: 34px; border-radius: 50%; border: 0; background: var(--surface); display: grid; place-items: center; margin-left: -10px; }
.back:not([hidden]) + .crumb-home { display: none; }
.call { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 14px; border-radius: 999px; background: var(--surface); color: var(--accent); font-size: 15px; white-space: nowrap; }
.site { display: flex; align-items: center; gap: 10px; height: 40px; padding: 0 4px 0 16px; border-radius: 999px; background: #f2eeea; white-space: nowrap; }
.site .arr { width: 32px; height: 32px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; }
@media (max-width: 1100px) { .call span { display: none; } .call { width: 40px; padding: 0; justify-content: center; } }
@media (max-width: 760px) {
  .top { padding: 10px 12px 6px; }
  .top-in { grid-template-columns: auto 1fr auto; padding: 8px 8px 8px 16px; }
  .top-l { order: 1; }
  .logo { order: 2; justify-self: start; }
  .logo img { height: 17px; }
  .top-r { order: 3; }
  .crumb-home, .crumb, .site { display: none; }
  .back { margin-left: -8px; }
}

main { padding: 18px var(--gutter) 24px; max-width: 1440px; width: 100%; margin: 0 auto; flex: 1; }
h1 { font: 600 clamp(28px, 2.6vw, 44px)/1.15 var(--font-d); margin: 10px 0 6px; letter-spacing: -.01em; }
h2 { font: 600 clamp(20px, 1.6vw, 26px)/1.25 var(--font-d); margin: 34px 0 14px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* марки и фильтры — «таблетки» */
.brands { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 14px; scrollbar-width: none; }
.brands::-webkit-scrollbar { display: none; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 999px; background: transparent; border: 1px solid var(--line-2); font-size: 15px; white-space: nowrap; transition: background .15s, border-color .15s, color .15s; }
.chip:hover { border-color: var(--muted); }
.chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.chip .n { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--muted); color: #fff; font-size: 12px; display: inline-grid; place-items: center; }
.chip[aria-pressed="true"] .n { background: #fff; color: var(--accent); }
.chip .n:empty { display: none; }

/* карточки моделей — как карточки машин на сайте */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); gap: 16px; }
.card { position: relative; background: var(--card); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; padding: 22px 22px 20px; transition: box-shadow .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.card[aria-disabled="true"] { opacity: .6; }
.card .title { font: 500 21px/1.25 var(--font-d); }
.card .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.tag { font-size: 14px; line-height: 1; padding: 6px 9px; border-radius: 999px; background: var(--chip); color: var(--text-2); white-space: nowrap; }
.card .pic { position: relative; aspect-ratio: 16/9; margin: 12px -8px 6px; }
.card .pic img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
img.fade { opacity: 0; transition: opacity .35s ease; }
img.fade.in { opacity: 1; }
.card .pic.photo { background: var(--panel); } /* пока фото грузится — спокойная подложка, а не пустота */
.card .pic .noimg { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; padding: 0 8px; font: 700 clamp(26px, 2.4vw, 38px)/1 var(--font-d); text-transform: uppercase; letter-spacing: .02em; color: var(--line-2); } /* марка не даёт фото — название крупно, как на главной сайта */
.card .pic.photo { margin: 14px 0 8px; border-radius: 14px; overflow: hidden; }
.card .pic.photo img { object-fit: cover; object-position: 50% 58%; } /* студийные кадры BMW почти квадратные — показываем полосу с машиной */
.card .foot2 { margin-top: auto; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; }
.card .lbl { font-size: 12px; color: var(--muted); }
.card .price { font: 700 24px/1.2 var(--font-d); letter-spacing: -.01em; }
.go { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--accent); color: #fff; display: grid; place-items: center; transition: background .15s, transform .15s; }
.card:hover .go, .variant:hover .go { background: var(--accent-hover); transform: rotate(45deg); }
.badge { display: inline-block; font-size: 12px; padding: 4px 9px; border-radius: 999px; background: var(--chip); color: var(--muted-2); }
.badge.warn { background: #efdcdd; color: var(--warn); }
.note { background: var(--card); border-radius: var(--radius); padding: 14px 18px; color: var(--muted-2); margin: 8px 0 16px; }

/* исполнения */
.vhead { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.count { display: inline-grid; place-items: center; min-width: 30px; height: 26px; padding: 0 8px; border-radius: 999px; background: #dcdfef; color: #5262c0; font-size: 14px; }
.variants { display: flex; flex-direction: column; gap: 10px; }
.variant { display: grid; grid-template-columns: 180px 1fr auto; gap: 20px; align-items: center; background: var(--card); border-radius: var(--radius-lg); padding: 12px 22px 12px 14px; transition: box-shadow .2s; }
.variant:hover { box-shadow: var(--shadow); }
.variant img { width: 180px; aspect-ratio: 16/9; object-fit: contain; }
.variant img.photo { object-fit: cover; object-position: 50% 58%; border-radius: 12px; }
.variant .name { font: 500 18px/1.3 var(--font-d); }
.variant .tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.variant .p { text-align: right; white-space: nowrap; display: flex; align-items: center; gap: 16px; }
.variant .p .big { font: 700 22px/1.2 var(--font-d); }
.variant .p .lbl { font-size: 12px; color: var(--muted); }
@media (max-width: 640px) {
  .variant { grid-template-columns: 110px 1fr; gap: 10px 14px; padding: 12px 14px 14px 10px; }
  .variant img { width: 110px; }
  .variant .name { font-size: 16px; }
  .variant .p { grid-column: 1 / -1; justify-content: space-between; text-align: left; }
  .variant .p .big { font-size: 20px; }
}

/* конфигуратор */
.build { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(360px, 1fr); gap: 28px; align-items: start; }
@media (max-width: 960px) { .build { grid-template-columns: minmax(0, 1fr); gap: 18px; } }
.build > * { min-width: 0; }
.stage { position: sticky; top: 92px; }
@media (max-width: 960px) { .stage { position: relative; top: 0; } }
.viewer { position: relative; aspect-ratio: 16/9; border-radius: var(--radius-lg); overflow: hidden; background: radial-gradient(ellipse 70% 60% at 50% 62%, #f1ede9 0%, var(--stage) 75%); touch-action: pan-y; user-select: none; cursor: grab; }
.viewer.dragging { cursor: grabbing; }
.viewer .cam { position: absolute; inset: 0; transform-origin: 0 0; transition: transform .6s cubic-bezier(.22,.7,.2,1); will-change: transform; }
.viewer.dragging .cam { transition-duration: .25s; }
.viewer .cam.ghost { pointer-events: none; transition: opacity .4s ease; z-index: 1; }
.viewer .hint, .viewer .unzoom, .viewer .chosen, .viewer .fc, .viewer .spin, .viewer .pending, .viewer .nav { z-index: 3; } /* над тающим слоем */
.viewer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; pointer-events: none; }
.viewer.cover img { object-fit: cover; object-position: 50% 60%; }
.viewer .layers { position: absolute; inset: 0; }
.viewer img.layer { inset: auto; object-fit: fill; }
/* салон 360°: куб 1000 px из шести граней, камера в центре (перспективу и поворот задаёт app.js) */
.viewer .cam.pano { background: #1b1e1d; transition: opacity .4s ease; overflow: hidden; }
.viewer .cam.pano canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.viewer .pano .cube { position: absolute; left: 50%; top: 50%; width: 0; height: 0; transform-style: preserve-3d; will-change: transform; }
.viewer .pano img.pf { inset: auto; left: -501px; top: -501px; width: 1002px; height: 1002px; max-width: none; object-fit: fill; backface-visibility: hidden; } /* max-width: у куба ширина 0 */
.viewer .pano .front { transform: translateZ(-500px); }
.viewer .pano .back { transform: rotateY(180deg) translateZ(-500px); }
.viewer .pano .left { transform: rotateY(90deg) translateZ(-500px); }
.viewer .pano .right { transform: rotateY(-90deg) translateZ(-500px); }
.viewer .pano .up { transform: rotateX(-90deg) translateZ(-500px); }
.viewer .pano .down { transform: rotateX(90deg) translateZ(-500px); }
.viewer .swatch-big { position: absolute; left: 50%; top: 46%; height: 56%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%;
  box-shadow: inset -18px -24px 40px rgba(0,0,0,.25), inset 12px 14px 30px rgba(255,255,255,.25), 0 24px 50px rgba(106,98,89,.35); }
.viewer .hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); font-size: 12px; color: var(--muted-2); background: rgba(255,255,255,.75); padding: 5px 12px; border-radius: 999px; pointer-events: none; white-space: nowrap; }
.viewer .spin { position: absolute; top: 14px; right: 14px; width: 22px; height: 22px; border: 2px solid rgba(41,68,52,.2); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.viewer .pending { position: absolute; left: 50%; top: 14px; transform: translateX(-50%); display: flex; align-items: center; gap: 8px;
  background: rgba(255,255,255,.85); color: var(--text); font-size: 13px; padding: 6px 14px; border-radius: 999px; white-space: nowrap; }
.viewer .pending .spin { position: static; width: 14px; height: 14px; }
/* пока марка рисует сборку — прежний кадр приглушён: видно, что это ещё не новая машина */
.viewer.waiting .cam:not(.ghost) { filter: saturate(.55) brightness(.97); transition: filter .3s; }
.viewer.waiting .pending { font-size: 14px; padding: 8px 16px; box-shadow: 0 4px 16px rgba(27,30,29,.12); }
.viewer .unzoom { position: absolute; top: 14px; left: 14px; height: 34px; padding: 0 14px; border-radius: 999px; border: 0; background: rgba(255,255,255,.9); font-size: 13px; }
/* стрелки листания — белые круги, как в галерее сайта салона */
.viewer .nav { position: absolute; top: 50%; transform: translateY(-50%); width: 44px; height: 44px; border-radius: 50%; border: 0; background: rgba(255,255,255,.92);
  color: var(--text); font-size: 26px; line-height: 1; display: grid; place-items: center; box-shadow: 0 4px 14px rgba(27,30,29,.18); z-index: 2; padding: 0 0 3px; }
.viewer .nav:hover { background: #fff; }
.viewer .nav.prev { left: 14px; } .viewer .nav.next { right: 14px; }
.viewer .fc { position: absolute; right: 14px; bottom: 12px; font-size: 12px; color: var(--muted-2); background: rgba(255,255,255,.8); padding: 4px 10px; border-radius: 999px; }
@media (max-width: 640px) { .viewer .nav { width: 36px; height: 36px; font-size: 22px; } .viewer .nav.prev { left: 8px; } .viewer .nav.next { right: 8px; } }
/* фото-галерея марки: выбранный цвет кузова и салона — плашкой поверх фото */
.viewer .chosen { position: absolute; left: 14px; bottom: 12px; right: 90px; display: flex; flex-wrap: wrap; gap: 6px; pointer-events: none; }
.viewer .chosen .ch { display: inline-flex; align-items: center; gap: 7px; background: rgba(255,255,255,.92); border-radius: 999px; padding: 5px 12px 5px 6px; font-size: 13px; max-width: 100%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.viewer .chosen .ch i { width: 18px; height: 18px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.12); }
.viewer .chosen .ex { align-self: center; font-size: 11px; color: #fff; background: rgba(27,30,29,.55); padding: 4px 10px; border-radius: 999px; }
@media (max-width: 640px) { .viewer .chosen .ch { font-size: 11px; padding: 3px 9px 3px 4px; } .viewer .chosen .ex { display: none; } }
.views { display: flex; gap: 8px; margin-top: 12px; }
.views button { height: 38px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: 14px; }
.views button[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.vtitle { margin-top: 16px; }
.vtitle .name { font: 600 clamp(24px, 2.2vw, 34px)/1.2 var(--font-d); letter-spacing: -.01em; }
.specs { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.specs span { font-size: 14px; line-height: 1; padding: 7px 10px; border-radius: 999px; background: var(--chip); color: var(--text-2); }

.tabs { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; position: sticky; top: 84px; background: var(--bg); z-index: 5; padding: 6px 0 10px; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; height: 40px; padding: 0 16px; border-radius: 999px; border: 1px solid var(--line-2); background: transparent; font-size: 15px; transition: background .15s, border-color .15s; }
.tabs button:hover { border-color: var(--muted); }
.tabs button::first-letter, .section .h span:first-child::first-letter { text-transform: uppercase; }
.tabs button[aria-selected="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
@media (max-width: 960px) { .tabs { top: 70px; } }
/* Телефон (вертикально): машина закреплена под шапкой, опции прокручиваются под ней — клиент видит, как меняется машина и куда смотрит камера */
@media (max-width: 960px) and (orientation: portrait) {
  .stage { display: contents; }
  .build > .viewer, .stage > .viewer { position: sticky; top: 70px; z-index: 6; box-shadow: 0 10px 24px rgba(180,170,163,.35); }
  .tabs { top: calc(70px + (100vw - 2 * var(--gutter)) * 9 / 16); padding-top: 10px; }
}
.search { width: 100%; height: 46px; padding: 0 18px; border-radius: 999px; border: 1px solid transparent; background: var(--panel); color: var(--text); margin: 4px 0 6px; font: inherit; }
.search::placeholder { color: var(--muted); }
.search:focus { outline: none; border-color: var(--line-2); background: var(--surface); }
.section { margin: 18px 0 6px; }
.section > .h { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.section > .h span:first-child { font: 600 17px/1.3 var(--font-d); }
.section > .h span:last-child { font-size: 13px; color: var(--muted); white-space: nowrap; }
.opts { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 10px; }
.opts.list { grid-template-columns: 1fr; gap: 8px; }
.opt { position: relative; text-align: left; background: var(--surface); border: 1.5px solid transparent; border-radius: var(--radius); padding: 10px; display: flex; flex-direction: column; gap: 8px; min-height: 64px; transition: border-color .15s, box-shadow .15s; }
.opt.list { flex-direction: row; align-items: center; padding: 14px 16px; }
.opt:hover { border-color: var(--line-2); }
.opt[aria-pressed="true"] { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.opt[aria-disabled="true"] { opacity: .45; }
.opt .th { aspect-ratio: 4/3; border-radius: 10px; background: var(--panel) center/cover no-repeat; }
.opt .sw { width: 38px; height: 38px; border-radius: 50%; flex: none; box-shadow: inset 0 0 0 1px rgba(0,0,0,.08), 0 2px 6px rgba(0,0,0,.12); background: #ccc center/cover; }
.opt.color { flex-direction: row; align-items: center; padding: 12px; }
.opt .t { font-size: 14px; line-height: 1.3; }
.opt .t::first-letter, .opt .d::first-letter, .lines li span:first-child::first-letter { text-transform: uppercase; }
.opt .pr { font-size: 13px; color: var(--muted); white-space: nowrap; }
.opt .d { font-size: 13px; color: var(--muted); margin-top: 3px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.opt .d.inc { color: var(--muted-2); }
.opt .d.inc::first-letter { text-transform: none; }
.opt.list { gap: 14px; }
.opt[aria-pressed="true"] .pr { color: var(--accent); font-weight: 500; }
.opt .chk { position: absolute; top: 8px; right: 8px; width: 20px; height: 20px; border-radius: 50%; background: var(--accent); color: #fff; display: none; place-items: center; font-size: 12px; font-weight: 700; }
.opt.list .chk { position: static; flex: none; }
.opt[aria-pressed="true"] .chk { display: grid; }
.opt.busy::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius); background: rgba(255,255,255,.5); }
.opt.queued { outline: 1px dashed var(--accent); outline-offset: -1px; }
.link { background: none; border: 0; padding: 0; margin-top: 14px; color: var(--accent); font: inherit; font-size: 15px; font-weight: 500; cursor: pointer; text-decoration: underline; text-decoration-color: rgba(41,68,52,.35); text-underline-offset: 4px; }
.link:hover { text-decoration-color: var(--accent); }
.opt.list .grow { flex: 1; }

.bar { position: sticky; bottom: 12px; z-index: 15; margin: 22px 0 0; padding: 14px 14px 14px 24px; background: rgba(255,255,255,.92); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-radius: 999px; box-shadow: var(--shadow); display: flex; align-items: center; gap: 14px; }
.bar .total { flex: 1; min-width: 0; }
.bar .big { font: 700 24px/1.15 var(--font-d); }
.bar .sub { font-size: 13px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
@media (max-width: 640px) { .bar { bottom: 8px; border-radius: 22px; padding: 12px 12px 12px 18px; margin: 18px -4px 0; } .bar .big { font-size: 20px; } }
.btn { border: 0; border-radius: 999px; height: 50px; padding: 0 26px; font-size: 16px; font-weight: 500; background: var(--accent); color: var(--accent-ink); white-space: nowrap; transition: background .15s; }
.btn:hover { background: var(--accent-hover); }
.btn.ghost { background: #f2eeea; color: var(--text); }
.btn.ghost:hover { background: var(--line); }
.btn:disabled { opacity: .5; }

.toast { position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%); background: var(--text); color: #fff; padding: 12px 18px; border-radius: 18px; box-shadow: 0 10px 30px rgba(0,0,0,.25); z-index: 50; max-width: min(560px, calc(100% - 32px)); font-size: 14px; line-height: 1.45; }

.sheet { border: 0; border-radius: var(--radius-lg); background: var(--bg); color: var(--text); padding: 0; width: min(560px, calc(100% - 24px)); max-height: 90vh; box-shadow: 0 30px 80px rgba(27,30,29,.25); }
.sheet::backdrop { background: rgba(27,30,29,.45); backdrop-filter: blur(3px); }
.sheet .in { padding: 26px; overflow: auto; max-height: 90vh; }
.sheet h3 { margin: 0 0 10px; font: 600 24px/1.25 var(--font-d); }
.lines { list-style: none; padding: 0; margin: 10px 0; border-top: 1px solid var(--line-2); }
.lines li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-size: 15px; }
.lines li span:last-child { white-space: nowrap; color: var(--muted-2); }
.lines li.sum { font-weight: 600; font-family: var(--font-d); font-size: 17px; }
.lines li.sum span:last-child { color: var(--text); }
.form { display: grid; gap: 10px; margin-top: 14px; }
.form input, .form textarea { width: 100%; padding: 14px 18px; border-radius: 14px; border: 1px solid transparent; background: var(--surface); color: var(--text); font: inherit; }
.form input:focus, .form textarea:focus { outline: none; border-color: var(--line-2); }
.form .row { display: flex; gap: 8px; justify-content: flex-end; margin-top: 4px; }
.form .fh { font: 600 19px/1.3 var(--font-d); margin-top: 14px; }

/* ссылки под названием: характеристики, серийное оснащение, сброс */
.links { display: flex; flex-wrap: wrap; gap: 0 22px; }
/* вкладки — одной строкой; на широком экране по краям стрелки (колесо мыши тоже листает вбок) */
.tabs .tnav { display: none; }
@media (min-width: 961px) and (hover: hover) {
  .tabs .tnav { display: grid; place-items: center; position: sticky; z-index: 2; flex: none; width: 40px; height: 40px; padding: 0; border-radius: 50%;
    border: 0; background: var(--surface); box-shadow: 0 2px 12px rgba(27,30,29,.14); font-size: 22px; line-height: 1; color: var(--text); visibility: hidden; }
  .tabs .tnav.l { left: 0; margin-right: -48px; }
  .tabs .tnav.r { right: 0; margin-left: -48px; }
  .tabs.can-l .tnav.l, .tabs.can-r .tnav.r { visibility: visible; }
}

/* цвета кружками: подпись выбранного (наведённого) над сеткой */
.swcap { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; min-height: 22px; margin: -4px 0 12px; }
.swcap .n { font-size: 15px; font-weight: 500; }
.swcap .n.hover { color: var(--text-2); }
.swcap .n::first-letter { text-transform: uppercase; }
.swcap .pr { font-size: 14px; color: var(--muted); white-space: nowrap; }
.opts.dots { display: flex; flex-wrap: wrap; gap: 6px; }
.opt.dot { width: 48px; height: 48px; min-height: 0; padding: 0; gap: 0; border-radius: 50%; background: transparent; border: 1.5px solid transparent; display: grid; place-items: center; }
.opt.dot:hover { border-color: var(--line-2); }
.opt.dot[aria-pressed="true"] { border-color: var(--accent); box-shadow: none; }
.opt.dot .sw { width: 38px; height: 38px; transition: transform .15s; }
.opt.dot:hover .sw { transform: scale(1.06); }
.opt .sw, .opt .th { overflow: hidden; }
.opt .sw img, .opt .th img { display: block; width: 100%; height: 100%; object-fit: cover; }
.opt.dot.pill .sw img { transform: scale(4.2, 1.35); }
.opt.dot[aria-disabled="true"] .sw { opacity: .4; }
.opt.dot.busy::after { border-radius: 50%; background: none; border: 2px solid var(--accent); border-right-color: transparent; inset: 2px; animation: spin .8s linear infinite; }
.vh { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* окна: итог, характеристики, оснащение */
.sheet.wide { width: min(860px, calc(100% - 24px)); }
.sheet .dh { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; }
.sheet .dh h3 { margin: 0 0 4px; }
.sheet .x { flex: none; width: 38px; height: 38px; border-radius: 50%; border: 0; background: var(--surface); color: var(--text); font-size: 15px; line-height: 1; }
.sheet .viewer.static { margin: -26px -26px 18px; border-radius: 0; cursor: default; } /* 16:9 как в окне — иначе слои Land Rover съезжают */
.kv { display: grid; grid-template-columns: 1fr 1fr; gap: 0 32px; margin: 14px 0 0; background: var(--panel); border-radius: var(--radius); padding: 6px 22px 10px; }
.kv > div { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding: 11px 0; border-bottom: 1px solid var(--line-2); font-size: 14px; }
.kv dt { color: var(--muted); }
.kv dd { margin: 0; text-align: right; font-weight: 600; }
.stdg h4 { margin: 20px 0 8px; font: 600 16px/1.3 var(--font-d); color: var(--accent); }
.std { columns: 2; column-gap: 32px; margin: 0; padding-left: 18px; }
.std li { break-inside: avoid; font-size: 14px; padding: 3px 0; }
.std li::marker { color: var(--muted); }
.std li::first-letter { text-transform: uppercase; }
.grp .gname { margin-top: 16px; font: 600 15px/1.3 var(--font-d); color: var(--muted-2); }
.grp .lines { margin: 6px 0 0; }
.lines .gl { display: block; font-size: 12px; color: var(--muted); margin-bottom: 1px; } /* подпись раздела над цветом: «Кожа салона — основной цвет» */
.lines .gl::first-letter { text-transform: uppercase; }
.lines.totals { margin-top: 18px; }
.acts { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.acts .btn { flex: 1 1 180px; }
@media (max-width: 640px) { .kv { grid-template-columns: 1fr; padding: 4px 16px 8px; } .std { columns: 1; } .sheet .in { padding: 20px; } .sheet .viewer.static { margin: -20px -20px 16px; } }

/* подвал — тёмный, как на сайте */
.foot { margin-top: 40px; background: var(--text); color: #e4dfdb; border-radius: var(--radius-lg) var(--radius-lg) 0 0; padding: 36px var(--gutter) calc(30px + env(safe-area-inset-bottom)); }
.foot-in { max-width: 1328px; margin: 0 auto; display: grid; gap: 16px; }
.foot img { width: min(320px, 70vw); height: auto; opacity: .95; }
.foot-c { display: flex; flex-wrap: wrap; gap: 8px 28px; font-size: 15px; }
.foot-c a:hover { color: #fff; }
.foot-n { font-size: 13px; color: #8f8579; max-width: 720px; }
body.in-build .foot { display: none; }

/* Телефон вертикально: под закреплённой машиной — сразу варианты, а не стена из названия, 8 плашек характеристик и ссылок */
@media (max-width: 960px) and (orientation: portrait) {
  .vtitle { margin-top: 10px; }
  .vtitle .name { font-size: 22px; }
  .specs { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-top: 8px; -webkit-mask-image: linear-gradient(to right, #000 85%, transparent); mask-image: linear-gradient(to right, #000 85%, transparent); }
  .specs::-webkit-scrollbar { display: none; }
  .specs span { flex: none; font-size: 13px; padding: 6px 9px; }
  .links .link { margin-top: 8px; font-size: 14px; padding: 6px 0; } /* выше — удобнее попасть пальцем */
  .views { margin-top: 10px; }
  .views button { height: 36px; }
  .search { height: 40px; margin: 2px 0 2px; }
  .section { margin-top: 12px; }
}
@media (max-width: 640px) {
  .bar .big { font-size: 18px; }
  .bar .btn { height: 46px; padding: 0 20px; }
}
/* Телефон боком: машина слева (закреплена), варианты справа; шапка уезжает — на высоте 390 px каждая строка на счету */
@media (max-width: 960px) and (orientation: landscape) and (max-height: 520px) {
  .top { position: relative; }
  .build { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 14px; }
  .stage { position: sticky; top: 8px; }
  .tabs { top: 0; }
  .vtitle { margin-top: 8px; }
  .vtitle .name { font-size: 18px; }
  .specs, .links { display: none; }
  .views { margin-top: 8px; }
  .views button { height: 32px; font-size: 13px; }
  .bar { padding: 8px 8px 8px 16px; border-radius: 18px; }
  .bar .big { font-size: 16px; }
  .bar .btn { height: 40px; }
}
/* цвета без выбора на сенсорном экране — без пустой строки подписи (наведения там нет) */
@media (hover: none) { .swcap:empty { min-height: 0; margin: 0; } }

/* печать спецификации (кнопка «Сохранить PDF») */
#print { display: none; }
@media print {
  @page { size: A4; margin: 14mm 14mm 16mm; }
  html, body { background: #fff !important; color: #111 !important; min-height: 0; display: block; }
  body > *:not(#print) { display: none !important; }
  #print { display: block !important; font: 10.5pt/1.4 var(--font); color: #111; }
  #print .ph { display: flex; justify-content: space-between; align-items: center; border-bottom: 2px solid var(--accent); padding-bottom: 6px; font-size: 10pt; color: #555; }
  #print .ph img { height: 14pt; width: auto; }
  #print .ph b { color: #111; letter-spacing: .04em; text-transform: uppercase; }
  #print .pic .viewer { position: relative; aspect-ratio: 16/9; width: 120mm; background: none; border-radius: 0; margin: 2mm auto 0; }
  #print .pic .viewer img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; }
  #print .pic .viewer.cover img { object-fit: cover; }
  #print .pic .viewer .layers { position: absolute; inset: 0; }
  #print .pic .viewer img.layer { inset: auto; object-fit: fill; }
  #print .pic .viewer .swatch-big { position: absolute; left: 50%; top: 50%; height: 80%; aspect-ratio: 1; transform: translate(-50%, -50%); border-radius: 50%; print-color-adjust: exact; -webkit-print-color-adjust: exact; }
  #print .pic .viewer .hint { display: none; }
  #print h1 { font: 600 18pt/1.2 var(--font-d); margin: 4px 0 2px; }
  #print .sub { color: #555; font-size: 9.5pt; }
  #print h2 { font: 600 11.5pt/1.3 var(--font-d); color: var(--accent); margin: 14px 0 4px; break-after: avoid; }
  #print .grp { break-inside: avoid; }
  #print .grp .gname { color: #777; margin-top: 8px; font-size: 9pt; }
  #print .lines { border-top: 1px solid #ddd; margin: 4px 0; }
  #print .lines li { border-bottom: 1px solid #e5e5e5; padding: 4px 0; font-size: 10pt; font-family: var(--font); }
  #print .lines li span:last-child { color: #333; }
  #print .lines li.sum span:last-child { color: #111; }
  #print .note { color: #555; font-size: 9pt; margin: 4px 0 0; padding: 0; background: none; border: 0; }
  #print .kv { gap: 0 24px; margin-top: 4px; break-inside: avoid; background: none; padding: 0; border-radius: 0; } /* характеристики — одним блоком, без оторванной строки */
  #print .kv > div { border-bottom: 1px solid #e5e5e5; padding: 3px 0; font-size: 9.5pt; break-inside: avoid; }
  #print .lines li { break-inside: avoid; }
  #print .stdg h4 { break-after: avoid; }
  #print .kv dt { color: #555; }
  #print .stdcols .stdg h4 { color: var(--accent); margin: 6px 0 1px; font-size: 8.5pt; }
  #print .std { columns: 3; column-gap: 16px; padding-left: 12px; }
  #print .std li { font-size: 8pt; line-height: 1.3; padding: 0; }
  #print .foot { margin-top: 12px; padding: 6px 0 0; border-top: 1px solid #ddd; font-size: 8.5pt; color: #777; word-break: break-all; background: none; border-radius: 0; display: block !important; }
}
.empty { padding: 40px 0; text-align: center; color: var(--muted); }
.loading { padding: 60px 0; text-align: center; color: var(--muted); }
