/* ==========================================================================
   BMW Автодом — сервисный лендинг
   Палитра и типографика по «Базовым принципам дизайна бренда BMW» v1.0
   ========================================================================== */

@font-face {
  font-family: "BMW Type Next";
  src: url("../fonts/BMWTypeNext-Thin.woff2") format("woff2"),
       url("../fonts/BMWTypeNextTT-Thin.woff") format("woff");
  font-weight: 200; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "BMW Type Next";
  src: url("../fonts/BMWTypeNext-Light.woff2") format("woff2"),
       url("../fonts/BMWTypeNextTT-Light.woff") format("woff");
  font-weight: 300; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "BMW Type Next";
  src: url("../fonts/BMWTypeNext-Regular.woff2") format("woff2"),
       url("../fonts/BMWTypeNextTT-Regular.woff") format("woff");
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: "BMW Type Next";
  src: url("../fonts/BMWTypeNext-Bold.woff2") format("woff2"),
       url("../fonts/BMWTypeNextTT-Bold.woff") format("woff");
  font-weight: 700; font-style: normal; font-display: swap;
}

:root {
  --white: #ffffff;
  --blue: #007AFF;          /* BMW Light Blue, sRGB 0/122/255 */
  --blue-dark: #0037A6;     /* BMW Dark Blue */
  --grey: #4D4D4D;
  --grey-light: #C7C7C7;
  --ink: #111111;
  --deep: #0A1621;          /* тёмное поле для крупных секций */

  --shell: 1360px;
  --gutter: clamp(20px, 5vw, 64px);
  --unit: clamp(14px, 1.6vw, 22px); /* базовая единица ритма */
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

body {
  margin: 0;
  background: var(--white);
  color: var(--ink);
  font-family: "BMW Type Next", "Helvetica Neue", Arial, sans-serif;
  font-weight: 300;
  font-size: clamp(16px, 1.05vw, 18px);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }
sup { font-size: .6em; vertical-align: super; }

:focus-visible {
  outline: 2px solid var(--blue);
  outline-offset: 3px;
}

/* --------------------------------------------------------------- Кнопки */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 26px;
  border: 1px solid transparent;
  border-radius: 0;
  font: inherit;
  font-weight: 700;              /* интерактивные элементы — Bold */
  font-size: .94rem;
  line-height: 1.1;
  text-decoration: none;
  cursor: pointer;
  transition: background-color .18s ease, color .18s ease, border-color .18s ease;
}
.btn--primary { background: var(--blue); color: var(--white); }
.btn--primary:hover { background: var(--blue-dark); }
.btn--outline { background: transparent; color: var(--blue-dark); border-color: var(--blue-dark); }
.btn--outline:hover { background: var(--blue-dark); color: var(--white); }
.btn--ghost { background: transparent; color: var(--white); border-color: rgba(255,255,255,.55); }
.btn--ghost:hover { background: var(--white); color: var(--deep); }
.btn--lg { min-height: 56px; padding: 0 34px; }
.btn--block { width: 100%; }

/* --------------------------------------------------------------- Шапка */
.header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--deep);
  color: var(--white);
}
.header__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: 18px var(--gutter);
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}
.header__logo img { width: 160px; }
.header__phone {
  justify-self: center;
  color: var(--white);
  text-decoration: none;
  font-size: 1.15rem;
  letter-spacing: .01em;
  white-space: nowrap;
}
.header__phone:hover { color: var(--grey-light); }
.header__actions { display: flex; gap: 12px; }
.header__burger { display: none; }

/* --------------------------------------------------------------- Баннер */
.hero {
  position: relative;
  min-height: clamp(420px, 44vw, 720px);
  display: flex;
  align-items: flex-end;
  background: var(--deep);
  overflow: hidden;
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center right;
}
.hero__inner {
  position: relative;
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: var(--gutter);
  padding-block: clamp(48px, 8vw, 96px);
  color: var(--white);
}
.hero__title {
  margin: 0;
  font-weight: 300;
  font-size: clamp(2.6rem, 6.4vw, 5.4rem);
  line-height: .96;
  letter-spacing: -.005em;
  text-transform: uppercase;
}
.hero__subtitle {
  margin: calc(var(--unit) * .8) 0 0;
  max-width: 32ch;
  font-weight: 300;
  font-size: clamp(.95rem, 1.5vw, 1.25rem);
  line-height: 1.3;
  text-transform: uppercase;
  color: rgba(255,255,255,.88);
}
.hero__slogan {
  margin: calc(var(--unit) * 1.6) 0 0;
  font-size: 1rem;
  font-weight: 300;
}
.hero__slogan b { font-weight: 700; }

/* --------------------------------------------------------------- Акция */
.offer { background: var(--white); }
.offer__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(56px, 7vw, 112px) var(--gutter);
}
.offer__lead {
  margin: 0;
  max-width: 26ch;
  font-size: clamp(1.4rem, 2.8vw, 2.4rem);
  line-height: 1.14;
  font-weight: 300;
}

.price {
  list-style: none;
  margin: clamp(32px, 4vw, 56px) 0 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--grey-light);
}
.price__item {
  padding: calc(var(--unit) * 1.2) 0;
  border-bottom: 1px solid var(--grey-light);
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.price__item + .price__item { border-left: 1px solid var(--grey-light); padding-left: var(--unit); }
.price__value {
  font-size: clamp(2.4rem, 5.4vw, 4.2rem);
  line-height: 1;
  font-weight: 300;
  color: var(--blue-dark);
}
.price__label { font-size: .92rem; color: var(--grey); }

.offer__grid {
  margin-top: clamp(40px, 5vw, 72px);
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(24px, 4vw, 64px);
  align-items: center;
}
.offer__media img { width: 100%; }
.offer__gift {
  margin: 0;
  font-size: clamp(1.05rem, 1.7vw, 1.4rem);
  line-height: 1.3;
  border-left: 3px solid var(--blue);
  padding-left: var(--unit);
}
.offer__list {
  margin: var(--unit) 0 0;
  padding: 0;
  list-style: none;
  color: var(--grey);
  font-size: .96rem;
}
.offer__list li { padding: 10px 0; border-bottom: 1px solid #E6E6E6; }

.offer__actions {
  margin-top: clamp(36px, 5vw, 64px);
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
}

/* --------------------------------------------------------- Заголовки секций */
.section-title {
  margin: 0 0 clamp(24px, 3vw, 44px);
  font-weight: 300;
  font-size: clamp(1.8rem, 3.6vw, 3rem);
  line-height: 1.05;
  text-transform: uppercase;
}

/* --------------------------------------------------------------- WebDMS */
.record { background: #F2F4F6; }
.record__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(56px, 7vw, 104px) var(--gutter);
}
.record .container { background: var(--white); }
.WebDMSServiceWidget { width: 100%; }

/* --------------------------------------------------------------- Контакты */
.contacts { background: var(--deep); color: var(--white); }
.contacts__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(56px, 7vw, 104px) var(--gutter);
}
.contacts__layout {
  display: grid;
  grid-template-columns: minmax(0, 4fr) minmax(0, 8fr);
  gap: clamp(24px, 3vw, 48px);
  align-items: start;
}
.dealers { list-style: none; margin: 0; padding: 0; }
.dealer {
  padding: var(--unit) 0;
  border-top: 1px solid rgba(255,255,255,.22);
  cursor: pointer;
}
.dealer:last-child { border-bottom: 1px solid rgba(255,255,255,.22); }
.dealer[aria-current="true"] { border-left: 3px solid var(--blue); padding-left: 14px; }
.dealer__name { font-size: 1.2rem; margin: 0 0 4px; font-weight: 400; }
.dealer__address { margin: 0; color: rgba(255,255,255,.72); font-size: .95rem; }
.dealer__phone { display: inline-block; margin-top: 8px; color: var(--white); text-decoration: none; border-bottom: 1px solid rgba(255,255,255,.4); }
.map__canvas {
  width: 100%;
  aspect-ratio: 16 / 10;
  min-height: 340px;
  background: #16222E;
}
.map__fallback { color: rgba(255,255,255,.7); padding: var(--unit); }

/* --------------------------------------------------------------- Дисклеймеры */
.disclaimers { background: var(--white); }
.disclaimers__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) var(--gutter);
  color: var(--grey);
  font-size: .78rem;
  line-height: 1.45;
}
.disclaimers p { margin: 0 0 12px; }

/* --------------------------------------------------------------- Футер */
.footer { background: #F2F4F6; }
.footer__inner {
  max-width: var(--shell);
  margin: 0 auto;
  padding: clamp(32px, 4vw, 56px) var(--gutter);
  display: grid;
  gap: 16px;
}
.footer__logo { filter: invert(1) brightness(.35); width: 160px; }
.footer__phone { color: var(--ink); text-decoration: none; font-size: 1.1rem; }
.footer__copy { margin: 0; color: var(--grey); font-size: .78rem; line-height: 1.45; }

/* --------------------------------------------------------------- Модальное окно */
.modal { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 20px; }
.modal[hidden] { display: none; }
.modal__backdrop { position: absolute; inset: 0; background: rgba(10,22,33,.72); }
.modal__dialog {
  position: relative;
  width: min(460px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: var(--white);
  padding: clamp(24px, 4vw, 40px);
}
.modal__close {
  position: absolute; top: 10px; right: 14px;
  background: none; border: 0; font-size: 30px; line-height: 1;
  color: var(--grey); cursor: pointer;
}
.modal__title { margin: 0 0 8px; font-weight: 300; font-size: 1.7rem; text-transform: uppercase; }
.modal__lead { margin: 0 0 24px; color: var(--grey); font-size: .95rem; }

.field { display: block; margin-bottom: 18px; }
.field__label { display: block; margin-bottom: 6px; font-size: .85rem; color: var(--grey); }
.field__input {
  width: 100%;
  min-height: 48px;
  padding: 0 14px;
  border: 1px solid var(--grey-light);
  border-radius: 0;
  background: var(--white);
  font: inherit;
  color: var(--ink);
}
.field__input:focus { border-color: var(--blue); outline: none; }
.field__input[aria-invalid="true"] { border-color: #FA110C; }
.field__select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--grey) 50%), linear-gradient(135deg, var(--grey) 50%, transparent 50%); background-position: calc(100% - 20px) 21px, calc(100% - 14px) 21px; background-size: 6px 6px; background-repeat: no-repeat; }

.check { display: flex; gap: 10px; align-items: flex-start; margin-bottom: 14px; font-size: .8rem; line-height: 1.4; color: var(--grey); cursor: pointer; }
.check:last-of-type { margin-bottom: 24px; }
.check input { margin-top: 3px; flex: 0 0 auto; accent-color: var(--blue); width: 16px; height: 16px; }
.check a { color: var(--blue-dark); text-decoration: underline; }
.check a:hover { color: var(--blue); }

.form__status { margin: 14px 0 0; font-size: .9rem; min-height: 1.2em; }
.form__status--error { color: #FA110C; }
.form__status--ok { color: var(--blue-dark); }

/* --------------------------------------------------------------- Адаптив */
@media (max-width: 1024px) {
  .offer__grid { grid-template-columns: 1fr; }
  .contacts__layout { grid-template-columns: 1fr; }
}

@media (max-width: 860px) {
  .header__inner { grid-template-columns: auto 1fr auto; gap: 12px; row-gap: 14px; }
  .header__phone { justify-self: end; font-size: 1rem; }
  .header__actions {
    grid-column: 1 / -1;
    display: none;
  }
  .header__actions.is-open { display: flex; }
  .header__actions .btn { flex: 1 1 auto; }
  .header__burger {
    display: inline-flex; flex-direction: column; justify-content: center; gap: 5px;
    width: 44px; height: 44px; background: none; border: 0; cursor: pointer;
  }
  .header__burger span { display: block; height: 2px; background: var(--white); }
  .price { grid-template-columns: 1fr; }
  .price__item + .price__item { border-left: 0; padding-left: 0; }
  .offer__actions .btn { width: 100%; }
}

/* --------------------------------------------------- Правовые страницы */
.page-legal .header { position: static; }

.legal { background: var(--white); }
.legal__inner {
  max-width: 820px;
  margin: 0 auto;
  padding: clamp(36px, 5vw, 72px) var(--gutter) clamp(48px, 6vw, 88px);
}
.legal__back {
  display: inline-block;
  margin-bottom: clamp(20px, 3vw, 36px);
  color: var(--blue-dark);
  text-decoration: none;
  font-size: .9rem;
  border-bottom: 1px solid currentColor;
}
.legal__back:hover { color: var(--blue); }
.legal__title {
  margin: 0 0 clamp(24px, 3vw, 40px);
  font-weight: 300;
  font-size: clamp(1.7rem, 3.4vw, 2.6rem);
  line-height: 1.08;
  text-transform: uppercase;
}
.legal__h2 {
  margin: clamp(32px, 4vw, 52px) 0 14px;
  padding-top: 14px;
  border-top: 1px solid var(--grey-light);
  font-weight: 400;
  font-size: clamp(1.15rem, 1.9vw, 1.45rem);
  line-height: 1.2;
}
.legal__h3 {
  margin: clamp(24px, 3vw, 36px) 0 10px;
  font-weight: 700;
  font-size: 1.02rem;
  line-height: 1.3;
}
.legal p {
  margin: 0 0 14px;
  font-size: .95rem;
  line-height: 1.6;
  color: #2A2A2A;
}
.legal__list { margin: 0 0 18px; padding-left: 20px; }
.legal__list li { margin-bottom: 8px; font-size: .95rem; line-height: 1.6; color: #2A2A2A; }
.legal a { color: var(--blue-dark); word-break: break-word; }
.legal a:hover { color: var(--blue); }

.footer__nav { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.footer__nav a { color: var(--grey); font-size: .82rem; text-decoration: none; border-bottom: 1px solid var(--grey-light); }
.footer__nav a:hover { color: var(--blue-dark); }
