/* Дизайн-система конфигураторов ALUMINANTE.
   Токены сняты с экспорта страницы Acura Q25 Premium из Тильды. */

:root {
  --font-body: 'Heebo', Arial, Helvetica, sans-serif;
  --font-display: 'Prata', Georgia, serif;

  --ink: #000000;          /* заголовки, цифры */
  --text: #494949;         /* основной текст */
  --muted: #949494;        /* подписи, единицы */
  --line: #c9c9c9;         /* рамки, разделители */
  --line-soft: #ededed;
  --bg: #ffffff;
  --bg-soft: #f2f2f2;      /* панели, невыбранные плитки */
  --accent: #a7282a;       /* единственный акцент */
  --accent-soft: #fbf1f1;  /* тот же акцент, разбавленный — фон выделения */

  --gap: 24px;
  --radius: 2px;
  --maxw: 1200px;
}

.ac * { box-sizing: border-box; }
.ac {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 20px 40px;
}

/* — типографика — */
.ac__eyebrow {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--muted); margin: 0 0 8px;
}
.ac__title {
  font-family: var(--font-display); font-weight: 400;
  font-size: 37px; line-height: 1.2; color: var(--ink); margin: 0 0 28px;
}
.ac__legend {
  font-size: 10px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink); margin: 0 0 14px; padding: 0;
}
.ac__note { font-size: 12px; color: var(--muted); margin: 6px 0 0; }
.ac__legend--sub { margin: 18px 0 8px; color: var(--muted); }

/* — раскладка — */
.ac__panel { padding: 22px 0 4px; margin: 0 0 var(--gap); }
.ac__panel + .ac__panel { border-top: 1px solid var(--line); }

/* — поля — */
.ac__row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 6px; }
.ac__label { font-size: 13px; color: var(--text); }
.ac__value { font-family: var(--font-body); font-size: 18px; color: var(--ink); }
.ac__value span { font-family: var(--font-body); font-size: 12px; color: var(--muted); }

input[type=range].ac__range {
  -webkit-appearance: none; appearance: none; width: 100%; height: 1px;
  background: var(--line); margin: 10px 0 18px; cursor: pointer;
}
input[type=range].ac__range::-webkit-slider-thumb {
  -webkit-appearance: none; width: 16px; height: 16px; border-radius: 50%;
  background: var(--ink); cursor: pointer;
}
input[type=range].ac__range::-moz-range-thumb {
  width: 16px; height: 16px; border: 0; border-radius: 50%; background: var(--ink); cursor: pointer;
}
input[type=range].ac__range:focus-visible { outline: 2px solid var(--accent); outline-offset: 6px; }

/* — числовой ввод размеров — */
.ac__unit { font-size: 12px; color: var(--muted); }
.ac__num {
  width: 100%; margin: 0 0 18px; padding: 11px 12px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
  font-family: var(--font-body); font-size: 18px; color: var(--ink);
}
.ac__num:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* — переключатель мм / футы: в заголовке блока размеров — */
.ac__units { display: inline-flex; gap: 0; margin-left: 12px; vertical-align: middle; }
.ac__unit-btn {
  padding: 3px 9px; border: 1px solid var(--line); background: var(--bg); color: var(--muted);
  font-family: var(--font-body); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
  cursor: pointer; transition: border-color .2s, color .2s, background .2s;
}
.ac__unit-btn:first-child { border-radius: var(--radius) 0 0 var(--radius); }
.ac__unit-btn:last-child { border-radius: 0 var(--radius) var(--radius) 0; margin-left: -1px; }
.ac__unit-btn:hover { border-color: var(--ink); color: var(--ink); }
.ac__unit-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }

/* — ручной оттенок, когда стандартного RAL не хватает — */
.ac__custom-text {
  flex: 1 1 auto; min-width: 0; padding: 5px 8px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
  font-family: var(--font-body); font-size: 12px; color: var(--ink);
}
.ac__custom-hex {
  flex: 0 0 auto; width: 28px; height: 24px; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}

/* — плитки выбора — */
.ac__tiles { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 4px; }
.ac__tile {
  flex: 1 1 auto; min-width: 96px; padding: 11px 14px; text-align: center;
  border: 1px solid var(--line); background: var(--bg); color: var(--text);
  font-family: var(--font-body); font-size: 13px; cursor: pointer;
  border-radius: var(--radius); transition: border-color .2s, color .2s;
}
.ac__tile:hover { border-color: var(--ink); color: var(--ink); }
.ac__tile[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.ac__tile small { display: block; font-size: 11px; opacity: .65; margin-top: 2px; }

/* — счётчики пультов — */
.ac__stepper { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px solid var(--line-soft); }
.ac__stepper-name { font-size: 13px; }
.ac__stepper-name small { color: var(--muted); }
.ac__stepper-ctl { display: flex; align-items: center; gap: 4px; }
.ac__stepper-ctl button {
  width: 28px; height: 28px; border: 1px solid var(--line); background: var(--bg);
  font-family: var(--font-body); font-size: 15px; color: var(--ink); cursor: pointer; border-radius: var(--radius);
}
.ac__stepper-ctl button:hover { border-color: var(--ink); }
.ac__stepper-ctl output { min-width: 24px; text-align: center; font-family: var(--font-body); font-size: 16px; color: var(--ink); }


/* — сцена: 3D слева, визуальные опции справа — */
.ac__stage {
  display: grid; grid-template-columns: 1fr 340px; gap: 0;
  border: 1px solid var(--line); border-radius: var(--radius);
  margin: 0 0 40px; overflow: hidden;
}
.ac__viewer { position: relative; background: #eceae6; min-height: 480px; }
.ac__canvas { position: absolute; inset: 0; }
.ac__canvas canvas { display: block; width: 100%; height: 100%; }
.ac__viewer-hint {
  position: absolute; left: 16px; top: 16px; margin: 0;
  font-size: 11px; letter-spacing: .04em; color: var(--muted); pointer-events: none;
}
.ac__viewer-reset {
  position: absolute; right: 14px; top: 14px;
  padding: 7px 12px; font-family: var(--font-body); font-size: 11px;
  letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--line); background: rgba(255,255,255,.85); color: var(--ink);
  border-radius: var(--radius); cursor: pointer;
}
.ac__viewer-reset:hover { border-color: var(--ink); }
.ac__rail {
  border-left: 1px solid var(--line); background: var(--bg);
  padding: 22px 22px 6px;
}
.ac__rail .ac__panel:first-child { padding-top: 0; }
.ac__rail .ac__tile { min-width: 72px; padding: 9px 10px; font-size: 12px; }

/* — плашка опций поверх 3D — */
.ac__overlay {
  position: absolute; left: 14px; bottom: 14px;
  width: min(430px, calc(100% - 28px));
  display: flex; flex-direction: column; gap: 8px;
  padding: 12px 14px;
  background: rgba(255, 255, 255, .88);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--line); border-radius: var(--radius);
}
.ac__overlay-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
/* С открытой таблицей RAL плашке нужно больше места, иначе образцы в три колонки. */
.ac__overlay:has(.ac__picker:not([hidden])) { width: min(560px, calc(100% - 28px)); }
.ac__overlay-row[hidden] { display: none; }
.ac__overlay-label {
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); flex: 0 0 62px;
}
.ac__overlay-name { font-size: 11px; color: var(--muted); }
.ac__overlay .ac__tiles { gap: 6px; margin: 0; }
.ac__overlay .ac__tile { flex: 0 0 auto; min-width: 0; padding: 6px 10px; font-size: 11px; }
.ac__overlay .ac__swatches { gap: 6px; }
.ac__overlay .ac__swatch { width: 24px; height: 24px; }
.ac__overlay .ac__swatch i { inset: 2px; }

/* — образцы цвета — */
.ac__swatches { display: flex; flex-wrap: wrap; gap: 8px; }
/* display:flex перебивает браузерное [hidden] — гасим явно */
.ac__swatches[hidden] { display: none; }
.ac__swatch {
  width: 34px; height: 34px; padding: 0; cursor: pointer;
  border: 1px solid var(--line); border-radius: 50%; background: transparent;
  position: relative;
}
.ac__swatch i { position: absolute; inset: 3px; border-radius: 50%; display: block; }
.ac__swatch[aria-pressed="true"] { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.ac__swatch-name { font-size: 12px; color: var(--muted); margin: 8px 0 0; }

/* — кнопка «вся палитра RAL» на месте прежнего серого кружка — */
.ac__swatch--more i {
  background: conic-gradient(#c1121f, #f9a800, #2e7d32, #1565c0, #6a1b9a, #c1121f);
}
.ac__swatch--more::after {
  content: "+"; position: absolute; inset: 0; display: grid; place-items: center;
  color: #fff; font-size: 15px; line-height: 1; text-shadow: 0 0 2px rgba(0,0,0,.6);
}

/* — таблица RAL Classic: поиск + сетка образцов с кодами — */
.ac__picker {
  flex: 1 1 100%; margin-top: 8px; padding: 10px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg);
}
.ac__picker[hidden] { display: none; }
.ac__picker-search {
  width: 100%; padding: 7px 10px; margin-bottom: 8px;
  border: 1px solid var(--line); border-radius: var(--radius);
  font-family: var(--font-body); font-size: 12px; color: var(--ink);
}
.ac__picker-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr));
  gap: 6px; max-height: 220px; overflow-y: auto;
}
.ac__chip {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  padding: 6px 2px; cursor: pointer; text-align: center;
  border: 1px solid transparent; border-radius: var(--radius); background: var(--bg);
}
.ac__chip[hidden] { display: none; }
.ac__chip i { width: 26px; height: 26px; border-radius: 50%; box-shadow: inset 0 0 0 1px rgba(0,0,0,.15); }
.ac__chip b { font-family: var(--font-body); font-weight: 500; font-size: 10px; color: var(--ink); }
.ac__chip small { font-size: 9px; line-height: 1.2; color: var(--muted); }
.ac__chip:hover { border-color: var(--line); }
.ac__chip[aria-pressed="true"] { border-color: var(--ink); }
.ac__picker-custom {
  display: flex; align-items: center; gap: 6px; margin-top: 10px;
  padding-top: 10px; border-top: 1px solid var(--line-soft);
}
.ac__picker-custom > span { font-size: 11px; color: var(--muted); white-space: nowrap; }

/* — кружок оттенка RGB: тот же цветной плюсик, клик открывает спектр — */
.ac__swatch--wheel { display: inline-block; }
.ac__swatch--wheel[hidden] { display: none; }
.ac__swatch--wheel i { background: none; }
.ac__swatch--wheel input {
  position: absolute; inset: 0; width: 100%; height: 100%;
  opacity: 0; border: 0; padding: 0; cursor: pointer;
}

/* — выделение редкой возможности: вылет до 9 м одним рядом — */
.ac__flag {
  margin-top: 20px; padding: 14px 16px;
  border: 1px solid var(--line); border-left: 3px solid var(--accent);
  border-radius: var(--radius); background: var(--bg);
}
.ac__flag--on { background: var(--accent-soft); border-color: var(--accent); }
.ac__flag p { margin: 0; }
.ac__flag-eyebrow {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 6px;
}
.ac__flag-title {
  /* Heebo жирным — решение Ники 14.09.2026, Prata здесь спорила с заголовком страницы */
  font-family: var(--font-body); font-weight: 700; font-size: 17px; line-height: 1.35;
  color: var(--ink); margin-bottom: 6px;
}
.ac__flag-text { font-size: 13px; color: var(--text); }
.ac__flag-active {
  margin-top: 8px; font-size: 13px; color: var(--accent);
}
.ac__flag-active[hidden] { display: none; }

/* — размеры: строкой над конфигуратором — */
.ac__sizes { margin-bottom: 28px; }
.ac__sizes .ac__panel { padding-top: 0; margin-bottom: 0; }
.ac__sizes .ac__fields {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 20px;
}
.ac__sizes .ac__num { margin-bottom: 0; }
.ac__sizes .ac__note { margin-top: 12px; }

/* — чертёж — */
.ac__draw {
  background: var(--bg-soft); padding: 20px; border-radius: var(--radius);
  overflow-x: auto; display: flex; justify-content: center;
  /* Размеры уехали наверх, чертёж остался один на всю ширину — не даём ему расплываться. */
  max-width: 860px; margin: 0 auto 40px;
}
/* Чертёж не растягиваем на всю колонку — держим по высоте, иначе он выше блока размеров. */
.ac__draw svg { display: block; width: auto; max-width: 100%; max-height: 360px; height: auto; }

/* — итог: строкой во всю ширину под размерами и чертежом — */
.ac__total { border-top: 1px solid var(--ink); padding-top: 22px; }
.ac__price {
  font-family: var(--font-display); font-size: 34px; line-height: 1.2; color: var(--ink); margin: 0;
}
.ac__price-unit { font-family: var(--font-body); font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.ac__price-row {
  display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap;
  gap: 20px 40px; margin-top: 24px; padding-top: 20px; border-top: 1px solid var(--line);
}
.ac__actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
/* Строка про размер дилерской скидки — под кнопками, во всю их ширину. */
.ac__actions-note { flex: 1 1 100%; margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.ac__summary {
  list-style: none; margin: 14px 0 0; padding: 0; font-size: 13px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 0 40px;
}
.ac__summary li { display: flex; justify-content: space-between; gap: 12px; padding: 7px 0; border-bottom: 1px solid var(--line-soft); }
.ac__summary li span:last-child { color: var(--ink); text-align: right; }

.ac__warn {
  border-left: 2px solid var(--accent); padding: 8px 0 8px 12px; margin: 14px 0 0;
  font-size: 13px; color: var(--accent);
}
.ac__disclaimer { font-size: 12px; line-height: 1.5; color: var(--muted); margin: 18px 0 0; }

/* — кнопки — */
.ac__btn {
  /* Heebo вместо Prata — решение Ники 14.09.2026 */
  display: inline-block; padding: 16px 24px;
  font-family: var(--font-body); font-weight: 500; font-size: 13px;
  letter-spacing: .1em; text-transform: uppercase;
  border: 1px solid var(--ink); background: var(--ink); color: #fff;
  cursor: pointer; border-radius: var(--radius); transition: background .2s, color .2s;
}
.ac__btn:hover { background: var(--bg); color: var(--ink); }
.ac__btn--ghost { background: var(--bg); color: var(--ink); border-color: var(--line); }
/* Размер скидки — акцентом: единственное место, где акцент стоит внутри кнопки. */
.ac__btn-accent { color: var(--accent); margin-left: .5em; }
.ac__btn--ghost:hover .ac__btn-accent { color: var(--accent); }
.ac__btn--ghost:hover { border-color: var(--ink); background: var(--bg); }

/* — брейкпоинты Тильды: 960 / 640 / 480 / 360 — */
@media (max-width: 960px) {
  .ac__stage { grid-template-columns: 1fr; }
  .ac__rail { border-left: 0; border-top: 1px solid var(--line); max-height: none; }
  .ac__title { font-size: 30px; }
}
@media (max-width: 700px) {
  .ac__sizes .ac__fields { grid-template-columns: 1fr; gap: 0; }
}
@media (max-width: 640px) {
  .ac { padding: 0 16px 32px; font-size: 14px; }
  .ac__title { font-size: 25px; margin-bottom: 20px; }
  .ac__price { font-size: 25px; }
  .ac__tile { min-width: calc(50% - 4px); }
  .ac__summary { grid-template-columns: 1fr; }
  .ac__price { font-size: 28px; }
  .ac__actions { width: 100%; }
  .ac__btn { flex: 1 1 100%; text-align: center; }
  /* На телефоне плашка не висит поверх модели, а встаёт под ней. */
  .ac__viewer { min-height: 0; padding-top: 320px; }
  .ac__canvas { inset: 0 0 auto 0; height: 320px; }
  .ac__overlay {
    position: static; width: auto; padding: 14px 16px; gap: 8px;
    background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none;
    border: 0; border-top: 1px solid var(--line);
  }
  .ac__overlay-label { flex-basis: 100%; }
  .ac__rail { padding: 18px 16px 4px; }
  /* Уже 520 px подписи размеров на чертеже перестают читаться:
     не сжимаем его дальше, а даём прокрутку внутри блока. */
  .ac__draw svg { min-width: 520px; }
}
@media (max-width: 480px) {
  .ac__tile { min-width: 100%; }
}

/* Вставка в чужую страницу (?embed=1): у блока сайта свой заголовок,
   второй тут же под ним читается как ошибка вёрстки. Знак в шапке остаётся. */
.ac-embed .ac__eyebrow,
.ac-embed .ac__title { display: none; }
.ac-embed .ac__sizes { margin-top: 28px; }

/* — фирменный слой —
   Бренд держат рамка страницы, знак поверх сцены и гравировка на стойках в 3D.
   Логотип-файл кладётся в assets/brand/logo.svg; пока его нет, знак набирается
   типографикой — тот же светлый гротеск вразрядку, см. engine/brand.js. */
.brand-mark { display: block; height: 18px; width: auto; }
.brand-mark--type {
  font-family: var(--font-body); font-weight: 300; font-size: 15px;
  letter-spacing: .3em; text-transform: uppercase; color: var(--ink);
  line-height: 18px; height: auto;
}
.ac__brand {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0 14px; border-bottom: 1px solid var(--line-soft); margin-bottom: 26px;
}
.ac__brand-note {
  font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--muted);
}
/* Знак поверх сцены. Лежит в контейнере канваса, поэтому и на телефоне,
   где плашка опций уходит вниз, остаётся в кадре модели. */
.ac__stamp {
  position: absolute; right: 16px; bottom: 14px; z-index: 1;
  pointer-events: none; opacity: .3; mix-blend-mode: multiply;
}
.ac__stamp .brand-mark { height: 13px; }
.ac__stamp .brand-mark--type { font-size: 11px; line-height: 13px; letter-spacing: .3em; }
.ac__foot {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  flex-wrap: wrap;
  margin-top: 34px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.ac__serial { font-variant-numeric: tabular-nums; }
@media (max-width: 640px) {
  .ac__brand { padding: 16px 0 12px; margin-bottom: 20px; }
  .ac__stamp { right: 12px; bottom: 10px; }
}
