/* Вводная часть страницы эпохи. Токены — в style.css. Сетка 4px. */
.lp { padding: 48px 0; }
.lp + .lp { border-top: 1px solid var(--line); }
.lp__title { font-size: clamp(24px, 2.4vw, 32px); font-weight: 500; line-height: 1.2; letter-spacing: -.01em; }
.lp__sub { margin-top: 8px; font-size: 17px; line-height: 1.5; color: var(--text-2); max-width: 40rem; }
.lp-link { padding: 0; font: inherit; font-weight: 500; color: var(--text); text-decoration: underline; text-decoration-color: var(--line-strong); text-underline-offset: 4px; transition: text-decoration-color var(--t-fast) var(--ease); }
.lp-link:hover { text-decoration-color: var(--text); }


/* 1. Какой у вас BMW? */
.lp-pick { padding-top: 32px; }
/* Модели — горизонтальная лента (как карусель на главной): компактно, услуги эпохи видны сразу под ней */
.lp-carsbox { position: relative; margin-top: 20px; }
.lp-cars {
  display: flex; flex-wrap: nowrap; gap: 8px; overflow-x: auto; scroll-snap-type: x proximity;
  overscroll-behavior-x: contain; scrollbar-width: none; padding-bottom: 2px;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
}
.lp-cars::-webkit-scrollbar { display: none; }
.lp-carsbox.is-end .lp-cars { -webkit-mask-image: none; mask-image: none; }
.lp-carsbox .esvc__nav--prev { left: -12px; }
.lp-carsbox .esvc__nav--next { right: -12px; }
.lp-car {
  flex: none; scroll-snap-align: start;
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px; padding: 10px 16px; min-height: 44px;
  text-align: left; border-radius: 16px; background: var(--surface); border: 1px solid var(--line);
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.lp-car:hover { border-color: var(--line-strong); background: var(--raised); }
.lp-car b { font-size: 16px; font-weight: 500; }
.lp-car__line { display: flex; align-items: baseline; gap: 8px; }
.lp-car__code { font-family: var(--mono); font-size: 14px; color: var(--text-3); }
.lp-car__meta { font-size: 13px; color: var(--text-3); }

/* «Ваш BMW» — сохранённая машина */
.lp-own {
  display: flex; align-items: center; gap: 12px; margin-top: 20px; padding: 12px 20px; border-radius: 16px;
  background: var(--raised); border: 1px solid var(--accent); transition: background-color var(--t-fast) var(--ease);
}
.lp-own span { font-size: 15px; color: var(--text-2); }
.lp-own b { font-size: 18px; font-weight: 500; }
.lp-own i { margin-left: auto; font-style: normal; color: var(--accent); font-size: 20px; }
.lp-car.is-active { border-color: var(--accent); background: var(--raised); }
.lp-car.is-active span { color: var(--accent); }
.lp-pick__hint { margin-top: 20px; font-size: 17px; color: var(--text-2); }

/* 1a. Двигатели и чип-тюнинг: инфографика */
.lp-legend { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 20px; font-size: 15px; color: var(--text-2); }
.lp-legend span { display: inline-flex; align-items: center; gap: 8px; }
.lp-legend i { width: 16px; height: 8px; border-radius: 4px; background: var(--text-3); }
.lp-legend i.is-gain { background: var(--accent); }
.lp-eng-list { margin-top: 16px; border: 1px solid var(--line); border-radius: 16px; overflow: hidden; background: var(--surface); }
.lp-eng {
  display: grid; grid-template-columns: 240px minmax(0, 1fr) 360px; align-items: center; gap: 8px 24px;
  padding: 16px 20px; border-top: 1px solid var(--line);
  transition: background-color var(--t-fast) var(--ease);
}
.lp-eng:first-child { border-top: 0; }
button.lp-eng { width: 100%; text-align: left; font: inherit; color: inherit; cursor: pointer; }
button.lp-eng:hover { background: var(--raised); }
button.lp-eng:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.lp-eng.is-own { box-shadow: inset 0 0 0 1px var(--accent); }
.lp-eng__name { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.lp-eng__name b { font-size: 18px; font-weight: 500; }
.lp-eng__name > span { font-family: var(--mono); font-size: 14px; color: var(--text-3); }
.lp-eng__bar { display: flex; height: 12px; border-radius: 6px; background: var(--bg-deep); overflow: hidden; }
.lp-eng__bar i { display: block; height: 100%; background: var(--text-3); }
.lp-eng__bar i.is-gain { background: var(--accent); }
.lp-eng__nums { display: flex; align-items: baseline; justify-content: flex-end; flex-wrap: wrap; gap: 4px 16px; font-variant-numeric: tabular-nums; }
.lp-eng__hp { font-family: var(--mono); font-size: 16px; white-space: nowrap; }
.lp-eng__hp i { font-style: normal; color: var(--text-3); }
.lp-eng__gain { font-family: var(--mono); font-size: 16px; font-weight: 500; color: var(--accent); }
.lp-eng__price { min-width: 7.5em; text-align: right; font-size: 16px; font-weight: 500; white-space: nowrap; }
.lp-eng__tag { font-size: 15px; color: var(--text-3); }



/* 3. Акция */
.lp-offer-wrap { padding: 0 0 48px; border-top: 0 !important; }
.lp-offer {
  display: flex; align-items: center; justify-content: space-between; gap: 24px 48px; padding: 32px;
  border-radius: 20px; background: var(--raised); border: 1px solid var(--line-strong);
}
.lp-offer__kicker { font-size: 15px; color: var(--accent); }
.lp-offer__title { margin-top: 8px; font-size: clamp(22px, 2.2vw, 28px); font-weight: 500; line-height: 1.2; }
.lp-offer__text { margin-top: 8px; font-size: 17px; line-height: 1.5; color: var(--text-2); max-width: 40rem; }
.lp-offer .btn { flex: none; }

/* 4. С чем приезжают */
.lp-issue-list { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.lp-issue { display: flex; flex-direction: column; gap: 8px; padding: 24px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); }
.lp-issue__num { font-family: var(--mono); font-size: 14px; color: var(--text-3); }
.lp-issue h3 { font-size: 19px; font-weight: 500; line-height: 1.3; }
.lp-issue p { font-size: 16px; line-height: 1.5; color: var(--text-2); }
.lp-issue .lp-link { margin-top: auto; padding-top: 8px; text-align: left; font-size: 16px; }

/* 5. Чип-тюнинг */
.lp-chip {
  display: grid; grid-template-columns: 1fr auto; align-items: end; gap: 24px 48px; margin-top: 24px; padding: 32px;
  border-radius: 20px; background: var(--surface); border: 1px solid var(--line);
}
.lp-chip__car { font-family: var(--mono); font-size: 15px; color: var(--text-2); }
.lp-chip__power { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 16px; margin-top: 12px; font-variant-numeric: tabular-nums; }
.lp-chip__power span { font-size: clamp(40px, 5vw, 64px); font-weight: 500; letter-spacing: -.03em; line-height: 1; }
.lp-chip__power span:first-child { color: var(--text-3); }
.lp-chip__power i { font-style: normal; font-size: 32px; color: var(--text-3); }
.lp-chip__power small { font-size: 17px; color: var(--text-2); }
.lp-chip__bars { display: grid; gap: 6px; margin-top: 16px; max-width: 520px; }
.lp-chip__bars div { height: 10px; border-radius: 5px; background: var(--bg-deep); overflow: hidden; }
.lp-chip__bars i { display: block; height: 100%; border-radius: 5px; background: var(--text-3); }
.lp-chip__bars .is-stage i { background: var(--accent); }
.lp-chip__gain { margin-top: 12px; text-wrap: balance; font-family: var(--mono); font-size: 16px; color: var(--accent); }
.lp-chip__price { margin-top: 16px; font-size: 22px; font-weight: 500; }
.lp-chip__price small { font-size: 15px; font-weight: 400; color: var(--text-3); }
.lp-chip__text { margin-top: 8px; font-size: 17px; line-height: 1.5; color: var(--text-2); max-width: 36rem; }
.lp-chip__side { display: flex; flex-direction: column; align-items: stretch; gap: 8px; }
.lp-chip__note { grid-column: 1 / -1; font-size: 14px; line-height: 1.5; color: var(--text-3); }

/* 6. Этапы визита */
.lp-steps { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin-top: 24px; counter-reset: none; }
.lp-step { padding: 24px; border-radius: 16px; border: 1px solid var(--line); }
.lp-step__num { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 50%; background: var(--raised); font-family: var(--mono); font-size: 15px; }
.lp-step h3 { margin-top: 16px; font-size: 19px; font-weight: 500; }
.lp-step p { margin-top: 8px; font-size: 16px; line-height: 1.5; color: var(--text-2); }

/* ---------- Страница модели ---------- */
.mhead { position: relative; isolation: isolate; overflow: hidden; padding-top: calc(var(--header-h) + 20px); }
.mhead__img, .mhead__img img { position: absolute; inset: 0; width: 100%; height: 100%; }
.mhead__img { z-index: -2; }
.mhead__img img { object-fit: cover; }
.mhead__shade { position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, var(--bg) 8%, rgba(17,18,20,.78) 55%, rgba(17,18,20,.4) 100%); }
.mhead__content { padding-bottom: 32px; }
.mhead__content .crumbs { margin-bottom: 40px; }
.mhead__title { font-size: clamp(36px, 4.4vw, 56px); font-weight: 500; letter-spacing: -.02em; line-height: 1.08; }
.mhead__codes { margin-top: 8px; font-family: var(--mono); font-size: 15px; color: var(--text-2); white-space: pre-wrap; }
.mhead__row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: 8px 12px; margin-top: 20px; }
.mhead__engine { display: grid; gap: 4px; min-width: min(100%, 360px); }
.mhead__engine span { font-size: 14px; color: var(--text-2); }
.mhead__engine select {
  height: 44px; padding: 0 36px 0 12px; border-radius: 10px; background: var(--bg-deep); border: 1px solid var(--line-strong);
  color: var(--text); font: inherit; font-size: 16px; appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-3) 50%), linear-gradient(135deg, var(--text-3) 50%, transparent 50%);
  background-position: calc(100% - 18px) 20px, calc(100% - 14px) 20px; background-size: 4px 4px; background-repeat: no-repeat;
}
.mhead__row .btn { height: 44px; }

/* Сводка-инфографика */
.mstats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1px; margin-top: 28px; border-radius: 16px; overflow: hidden; background: var(--line); border: 1px solid var(--line); max-width: 880px; }
.mstat { display: flex; flex-direction: column; gap: 4px; padding: 16px 20px; background: rgba(24, 25, 28, .92); }
.mstat b { font-size: 28px; font-weight: 500; letter-spacing: -.02em; line-height: 1.1; font-variant-numeric: tabular-nums; }
.mstat span { font-size: 14px; color: var(--text-2); }
.mstat:nth-child(2) b { color: var(--accent); }

/* Липкое меню разделов */
.snav { position: sticky; top: var(--header-h); z-index: 12; background: rgba(17, 18, 20, .94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); border-bottom: 1px solid var(--line); }
.snav__in { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.snav__in::-webkit-scrollbar { display: none; }
.snav a { flex: none; display: flex; align-items: center; height: 52px; padding: 0 14px; font-size: 16px; font-weight: 500; color: var(--text-2); box-shadow: inset 0 -2px 0 transparent; transition: color var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.snav a:hover { color: var(--text); }
.snav a.is-active { color: var(--text); box-shadow: inset 0 -2px 0 var(--accent); }

/* Разделы */
.sec { padding: 48px 0 16px; scroll-margin-top: calc(var(--header-h) + 52px); }
.sec + .sec { border-top: 1px solid var(--line); margin-top: 32px; }
.sec__title { font-size: clamp(24px, 2.4vw, 32px); font-weight: 500; line-height: 1.2; margin-bottom: 20px; }
.sec__sub { margin: 28px 0 12px; font-size: 17px; font-weight: 500; color: var(--text-2); }
.sec__title + .sec__sub { margin-top: 0; }
.sec .note { margin-top: 4px; }
.sec .lp-legend { margin-top: 0; }
.page-epoch .results__legal { margin: 40px auto 48px; }

/* Фото и видео работ */
.lp-media-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px; }
.lp-media { border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.lp-media img, .lp-media video { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.lp-media figcaption { padding: 12px 16px; font-size: 15px; color: var(--text-2); }

/* ---------- Планшет ---------- */
@media (max-width: 1100px) {
  .lp-issue-list, .lp-steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Телефон ---------- */
@media (max-width: 760px) {
  .lp { padding: 40px 0; }
  .lp-pick { padding-top: 24px; }
  .lp__title { font-size: 26px; }
  /* Модели — горизонтальная лента */
  .lp-cars {
    margin: 0 calc(-1 * clamp(16px, 4vw, 32px)); padding: 0 clamp(16px, 4vw, 32px) 4px;
    scroll-padding-inline: clamp(16px, 4vw, 32px);
  }
  .lp-car { min-width: 132px; min-height: 64px; padding: 12px 16px; }
  .mhead__content .crumbs { margin-bottom: 28px; }
  .mhead__title { font-size: 36px; }
  .mhead__row .chip-btn { flex: none; }
  .mhead__bodies { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; margin-inline: calc(-1 * clamp(16px, 4vw, 32px)); padding-inline: clamp(16px, 4vw, 32px); }
  .mhead__engine { flex: 1 1 100%; }
  .mhead__engine select { height: 48px; }
  .mhead__row--end .btn { flex: 1 1 100%; height: 48px; }
  .mstats { grid-template-columns: 1fr 1fr; }
  .mstat { padding: 14px 16px; }
  .mstat b { font-size: 24px; }
  .snav a { height: 48px; padding: 0 12px; }
  .sec { padding-top: 36px; scroll-margin-top: calc(var(--header-h) + 48px); }
  .lp-media-list { grid-template-columns: 1fr; }
  .lp-eng { grid-template-columns: 1fr auto; gap: 8px 12px; padding: 16px; }
  .lp-eng__name { grid-column: 1; }
  .lp-eng__bar { grid-column: 1 / -1; grid-row: 2; }
  .lp-eng__nums { grid-column: 1 / -1; grid-row: 3; justify-content: flex-start; }
  .lp-eng__price { margin-left: auto; min-width: 0; }
  .lp-offer { flex-direction: column; align-items: stretch; padding: 24px; }
  .lp-chip { grid-template-columns: 1fr; padding: 24px; }
  .lp-chip__power i { font-size: 28px; }
  .lp-issue-list, .lp-steps { grid-template-columns: 1fr; }
}

/* ---------- Каталог эпохи: липкая панель «разделы → кузов → двигатель» ---------- */
.hub-sub { margin-top: 8px; font-size: 16px; color: var(--text-2); }
.cfilters {
  position: sticky; top: var(--header-h); z-index: 12; margin-top: 16px;
  background: rgba(17, 18, 20, .95); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.cfilters .snav { position: static; background: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.cfilters .snav a { font-size: 17.5px; }
.cfilters .snav__in { padding-right: 32px; }
.frow-box { position: relative; padding-top: 8px; }
.frow-box:last-child { padding-bottom: 10px; }
.frow {
  display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; overscroll-behavior-x: contain;
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
  mask-image: linear-gradient(to right, #000 calc(100% - 40px), transparent);
}
.frow::-webkit-scrollbar { display: none; }
.frow-box.is-end .frow { -webkit-mask-image: none; mask-image: none; }
.frow-box .esvc__nav { width: 34px; height: 34px; margin-top: -13px; }
.frow-box .esvc__nav--prev { left: 4px; }
.frow-box .esvc__nav--next { right: 4px; }
.fchip {
  flex: none; display: inline-flex; align-items: baseline; gap: 7px; height: 40px; padding: 0 16px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text-2);
  font-size: 16.5px; white-space: nowrap;
  transition: border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
  align-items: center;
}
.fchip b { font-weight: 500; }
.fchip span { font-size: 14.5px; color: var(--text-3); }
.fchip:hover { color: var(--text); border-color: var(--line-strong); }
.fchip.is-active { color: var(--text); background: var(--raised); border-color: var(--accent); }
.fchip.is-active span { color: var(--accent); }
.fchip.is-own::after { content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); align-self: center; }
.fchip:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fsel-row { padding-top: 8px; padding-bottom: 10px; }
.fsel { display: flex; align-items: center; gap: 10px; }
.fsel span { font-size: 15.5px; color: var(--text-3); }
.fsel select {
  height: 40px; min-width: 0; max-width: 460px; flex: 1; padding: 0 38px 0 16px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--surface); color: var(--text); font: inherit; font-size: 16.5px;
  appearance: none; -webkit-appearance: none; cursor: pointer;
  background-image: linear-gradient(45deg, transparent 50%, var(--text-2) 50%), linear-gradient(135deg, var(--text-2) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%; background-size: 5px 5px; background-repeat: no-repeat;
}
.fsel select:hover:not(:disabled) { border-color: var(--line-strong); }
.fsel select:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.fsel select:disabled { color: var(--text-3); cursor: default; }
.fsel select.is-set { border-color: var(--accent); }
.cat .sec { scroll-margin-top: calc(var(--header-h) + var(--filters-h, 140px) + 8px); }
@media (max-width: 760px) {
  .cfilters .snav a { height: 46px; font-size: 17.5px; }
  .fchip { height: 38px; padding: 0 14px; font-size: 16.5px; }
  .fchip span { font-size: 14.5px; }
  .frow-box { padding-top: 6px; }
  .fsel-row { padding-top: 6px; padding-bottom: 8px; }
  .fsel select { max-width: none; height: 42px; font-size: 17.5px; }
  .frow { margin-inline: calc(-1 * clamp(16px, 4vw, 32px)); padding-inline: clamp(16px, 4vw, 32px); }
}
