/* ==========================================================================
   EL AUTO — main.css
   Базовые стили, дизайн-токены, типографика, сетка, шапка, подвал
   ========================================================================== */

/* --- Manrope (локальные woff2, latin + cyrillic в одном файле) ---------- */
@font-face {
  font-family: 'Manrope';
  src: url('../assets/fonts/manrope-400.woff2') format('woff2');
  font-weight: 400; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../assets/fonts/manrope-500.woff2') format('woff2');
  font-weight: 500; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../assets/fonts/manrope-600.woff2') format('woff2');
  font-weight: 600; font-style: normal; font-display: swap;
}
@font-face {
  font-family: 'Manrope';
  src: url('../assets/fonts/manrope-700.woff2') format('woff2');
  font-weight: 700; font-style: normal; font-display: swap;
}

/* --- Токены -------------------------------------------------------------- */
:root {
  /* Цвет: база логотипа EL AUTO — чёрный, белый, красный акцент, бирюза точечно */
  --c-bg:        #0A0A0B;
  --c-bg-alt:    #0E0F11;
  --c-surface:   #121316;
  --c-surface-2: #191B1F;
  --c-line:      rgba(255, 255, 255, .10);
  --c-line-soft: rgba(255, 255, 255, .06);
  --c-text:      #F3F4F5;
  --c-text-2:    #B9BDC4;
  --c-muted:     #838890;
  --c-red:       #DC2A2B;
  --c-red-hi:    #F13C3D;
  --c-red-dim:   rgba(220, 42, 43, .14);
  --c-teal:      #44CFCE;
  --c-white:     #FFFFFF;

  /* Сетка и ритм */
  --container: 1464px;
  --gutter: 24px;
  --gap: 24px;
  --sec-pad: clamp(64px, 7vw, 128px);
  --r: 2px;
  --r-lg: 4px;

  /* Типографика */
  --ff: 'Manrope', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --fs-h1: clamp(38px, 4vw, 64px);
  --fs-h2: clamp(28px, 3vw, 48px);
  --fs-h3: clamp(21px, 1.7vw, 30px);
  --fs-h4: clamp(18px, 1.2vw, 21px);
  --fs-body: 17px;
  --fs-small: 15px;
  --fs-cap: 13px;
  --fs-label: 12px;

  --ease: cubic-bezier(.22, .61, .36, 1);
  --hdr-h: 84px;
}

/* --- Сброс --------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; 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;
  font-family: var(--ff);
  font-size: var(--fs-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--c-text-2);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
}
img, picture, svg, video { max-width: 100%; display: block; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, p, figure, blockquote { margin: 0; }
table { border-collapse: collapse; width: 100%; }
:focus-visible { outline: 2px solid var(--c-teal); outline-offset: 3px; }
::selection { background: var(--c-red); color: #fff; }
main { display: block; }

/* --- Типографика --------------------------------------------------------- */
h1, .h1, h2, .h2, h3, .h3, h4, .h4 {
  color: var(--c-white);
  font-weight: 700;
  letter-spacing: -.02em;
  text-wrap: balance;
}
h1, .h1 { font-size: var(--fs-h1); line-height: 1.05; }
h2, .h2 { font-size: var(--fs-h2); line-height: 1.1; letter-spacing: -.025em; }
h3, .h3 { font-size: var(--fs-h3); line-height: 1.2; font-weight: 600; }
h4, .h4 { font-size: var(--fs-h4); line-height: 1.3; font-weight: 600; letter-spacing: -.01em; }

.lead { font-size: clamp(17px, 1.35vw, 20px); line-height: 1.55; color: var(--c-text-2); }
.muted { color: var(--c-muted); }
.small { font-size: var(--fs-small); }
.cap { font-size: var(--fs-cap); line-height: 1.5; color: var(--c-muted); }

.label {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: var(--fs-label); font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--c-muted);
}
.label::before {
  content: ''; width: 22px; height: 1px; background: var(--c-red); flex: none;
}
.label--plain::before { display: none; }

.prose p { margin: 0 0 18px; max-width: 74ch; }
.prose p:last-child { margin-bottom: 0; }
.prose h2 { margin: 44px 0 18px; font-size: clamp(24px, 2.2vw, 34px); }
.prose h3 { margin: 32px 0 14px; }
.prose ul { margin: 0 0 20px; }
.prose ul li {
  position: relative; padding-left: 22px; margin-bottom: 9px; max-width: 74ch;
}
.prose ul li::before {
  content: ''; position: absolute; left: 0; top: .68em;
  width: 8px; height: 1px; background: var(--c-red);
}
.prose ol { counter-reset: n; margin: 0 0 20px; }
.prose ol li { counter-increment: n; position: relative; padding-left: 30px; margin-bottom: 9px; max-width: 74ch; }
.prose ol li::before {
  content: counter(n, decimal-leading-zero);
  position: absolute; left: 0; top: 0;
  font-size: 13px; font-weight: 600; color: var(--c-red);
}
.prose a { color: var(--c-white); border-bottom: 1px solid var(--c-red); }
.prose a:hover { color: var(--c-red-hi); }
.prose strong { color: var(--c-white); font-weight: 600; }

/* --- Раскладка ----------------------------------------------------------- */
.container {
  width: min(100% - (var(--gutter) * 2), var(--container));
  margin-inline: auto;
}
.grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: var(--gap);
}
.section { padding-block: var(--sec-pad); position: relative; }
.section--tight { padding-block: clamp(48px, 5vw, 88px); }
.section--line { border-top: 1px solid var(--c-line-soft); }
.section--alt { background: var(--c-bg-alt); }

.sec-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 32px; margin-bottom: clamp(32px, 3.5vw, 56px);
}
.sec-head__text { max-width: 720px; }
.sec-head__text .label { margin-bottom: 18px; }
.sec-head__text p { margin-top: 16px; color: var(--c-text-2); max-width: 62ch; }
.sec-head__aside { flex: none; padding-bottom: 6px; }

.stack > * + * { margin-top: 16px; }
.col-6 { grid-column: span 6; }
.col-5 { grid-column: span 5; }
.col-7 { grid-column: span 7; }
.col-8 { grid-column: span 8; }
.col-4 { grid-column: span 4; }
.col-12 { grid-column: span 12; }

/* --- Шапка --------------------------------------------------------------- */
.header {
  position: sticky; top: 0; z-index: 90;
  background: rgba(10, 10, 11, .86);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--c-line-soft);
}
.header__inner {
  display: flex; align-items: center; justify-content: space-between;
  gap: 28px; height: var(--hdr-h);
}
.logo { display: flex; align-items: center; gap: 12px; flex: none; }
.logo img { width: 46px; height: 46px; border-radius: var(--r); }
.logo__txt { display: flex; flex-direction: column; line-height: 1.05; }
.logo__name {
  font-size: 17px; font-weight: 700; color: var(--c-white); letter-spacing: .16em;
}
.logo__sub {
  font-size: 10px; font-weight: 500; letter-spacing: .1em;
  text-transform: uppercase; color: var(--c-muted); margin-top: 4px;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav__item { position: relative; }
.nav__link {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 10px 14px; font-size: 15px; font-weight: 500;
  color: var(--c-text-2); border-radius: var(--r);
  transition: color .2s var(--ease), background-color .2s var(--ease);
}
.nav__link:hover, .nav__item:hover > .nav__link { color: var(--c-white); }
.nav__link[aria-current="page"] { color: var(--c-white); }
.nav__link[aria-current="page"]::after {
  content: ''; position: absolute; left: 14px; right: 14px; bottom: 2px;
  height: 1px; background: var(--c-red);
}
.nav__chev { width: 9px; height: 9px; opacity: .55; transition: transform .2s var(--ease); }
.nav__item:hover .nav__chev { transform: rotate(180deg); }

.nav__drop {
  position: absolute; top: 100%; left: 0; min-width: 268px;
  background: var(--c-surface); border: 1px solid var(--c-line);
  border-radius: var(--r-lg); padding: 8px;
  opacity: 0; visibility: hidden; transform: translateY(6px);
  transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55);
}
.nav__item:hover .nav__drop, .nav__item:focus-within .nav__drop {
  opacity: 1; visibility: visible; transform: translateY(0);
}
.nav__drop a {
  display: flex; align-items: baseline; justify-content: space-between; gap: 14px;
  padding: 9px 12px; font-size: 15px; color: var(--c-text-2); border-radius: var(--r);
  transition: background-color .16s var(--ease), color .16s var(--ease);
}
.nav__drop a:hover { background: var(--c-surface-2); color: var(--c-white); }
.nav__drop a span { font-size: 12px; color: var(--c-muted); }
.nav__drop hr { border: 0; border-top: 1px solid var(--c-line-soft); margin: 8px 4px; }

.header__cta { display: flex; align-items: center; gap: 10px; flex: none; }
.header__phone {
  font-size: 16px; font-weight: 600; color: var(--c-white); white-space: nowrap;
  padding: 10px 4px;
}
.header__phone:hover { color: var(--c-red-hi); }

.burger {
  display: none; width: 44px; height: 44px; align-items: center; justify-content: center;
  border: 1px solid var(--c-line); border-radius: var(--r); flex: none;
}
.burger span {
  display: block; width: 18px; height: 1.5px; background: var(--c-white); position: relative;
  transition: background-color .2s var(--ease);
}
.burger span::before, .burger span::after {
  content: ''; position: absolute; left: 0; width: 18px; height: 1.5px; background: var(--c-white);
  transition: transform .24s var(--ease), top .2s var(--ease);
}
.burger span::before { top: -6px; }
.burger span::after { top: 6px; }
.burger[aria-expanded="true"] span { background: transparent; }
.burger[aria-expanded="true"] span::before { top: 0; transform: rotate(45deg); }
.burger[aria-expanded="true"] span::after { top: 0; transform: rotate(-45deg); }

/* --- Мобильное меню ------------------------------------------------------ */
.mmenu {
  position: fixed; inset: var(--hdr-h) 0 0; z-index: 88;
  background: var(--c-bg); overflow-y: auto;
  padding: 8px 0 calc(120px + env(safe-area-inset-bottom));
  transform: translateX(100%); visibility: hidden;
  transition: transform .3s var(--ease), visibility .3s;
  overscroll-behavior: contain;
}
.mmenu.is-open { transform: translateX(0); visibility: visible; }
.mmenu__group { border-bottom: 1px solid var(--c-line-soft); }
.mmenu__top {
  display: flex; align-items: center; justify-content: space-between;
  width: 100%; padding: 18px 0; font-size: 19px; font-weight: 600; color: var(--c-white);
  text-align: left;
}
.mmenu__top svg { width: 12px; height: 12px; opacity: .6; transition: transform .22s var(--ease); flex: none; }
.mmenu__top[aria-expanded="true"] svg { transform: rotate(180deg); }
.mmenu__sub { display: none; padding: 0 0 16px; }
.mmenu__sub.is-open { display: block; }
.mmenu__sub a {
  display: block; padding: 10px 0 10px 16px; font-size: 16px; color: var(--c-text-2);
  border-left: 1px solid var(--c-line);
}
.mmenu__sub a:hover, .mmenu__sub a:active { color: var(--c-white); border-left-color: var(--c-red); }
.mmenu__contacts { padding: 26px 0 0; }
.mmenu__contacts .btn { width: 100%; margin-bottom: 10px; }
.mmenu__meta { margin-top: 20px; font-size: 14px; color: var(--c-muted); }
.mmenu__meta a { color: var(--c-text-2); }
body.is-locked { overflow: hidden; }

/* --- Подвал -------------------------------------------------------------- */
.footer {
  border-top: 1px solid var(--c-line);
  background: var(--c-bg-alt);
  padding-top: clamp(52px, 5vw, 88px);
  margin-bottom: 0;
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.35fr;
  gap: 40px var(--gap);
  padding-bottom: 56px;
}
.footer__brandtxt { margin-top: 20px; font-size: 15px; color: var(--c-muted); max-width: 34ch; }
.footer__title {
  font-size: var(--fs-label); font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; color: var(--c-white); margin-bottom: 20px;
}
.footer__list li { margin-bottom: 11px; }
.footer__list a { font-size: 15px; color: var(--c-muted); transition: color .16s var(--ease); }
.footer__list a:hover { color: var(--c-white); }
.footer__contacts { font-size: 15px; }
.footer__contacts dt {
  font-size: var(--fs-label); letter-spacing: .1em; text-transform: uppercase;
  color: var(--c-muted); margin-bottom: 5px;
}
.footer__contacts dd { margin: 0 0 18px; color: var(--c-text-2); }
.footer__contacts dd a:hover { color: var(--c-red-hi); }
.footer__contacts .big { font-size: 20px; font-weight: 600; color: var(--c-white); }
.footer__bottom {
  border-top: 1px solid var(--c-line-soft);
  padding: 26px 0 32px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 28px;
}
.footer__legal { display: flex; flex-wrap: wrap; gap: 10px 24px; font-size: 14px; }
.footer__legal a, .footer__legal button { color: var(--c-muted); transition: color .16s var(--ease); font-size: 14px; }
.footer__legal a:hover, .footer__legal button:hover { color: var(--c-white); }
.footer__copy { font-size: 14px; color: var(--c-muted); }
.footer__requisites {
  border-top: 1px solid var(--c-line-soft);
  padding: 22px 0 32px; font-size: 13px; line-height: 1.7; color: var(--c-muted);
}
.footer__requisites summary {
  cursor: pointer; color: var(--c-text-2); font-size: 14px; list-style: none;
  display: inline-flex; align-items: center; gap: 8px;
}
.footer__requisites summary::-webkit-details-marker { display: none; }
.footer__requisites summary::after { content: '+'; color: var(--c-red); font-weight: 600; }
.footer__requisites[open] summary::after { content: '–'; }
.footer__requisites dl {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 6px 32px; margin: 18px 0 0;
}
.footer__requisites dt { color: var(--c-muted); }
.footer__requisites dd { margin: 0 0 8px; color: var(--c-text-2); }

/* --- Служебное ----------------------------------------------------------- */
.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 200;
  background: var(--c-red); color: #fff; padding: 10px 16px; border-radius: var(--r);
  transition: top .2s var(--ease);
}
.skip:focus { top: 12px; }
.nowrap { white-space: nowrap; }
