/* ============================================================
   CORSA MOTORS — базовый слой v2.
   Палитра: тёплая нейтраль + графит + ОДИН американский красный.
   Логотип — единственное цветное пятно, интерфейс ему не мешает.
   Аудитория 55+: кегль 18px, тап-цели 48px+, контраст AA.
   Анимации мягкие, всё гаснет под prefers-reduced-motion.
   ============================================================ */

@font-face {
  font-family: 'Archivo';
  font-style: normal;
  font-weight: 100 900;
  font-stretch: 62% 125%;
  font-display: swap;
  src: url(../fonts/Archivo-n1.woff2) format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: italic;
  font-weight: 400;
  font-display: swap;
  src: url(../fonts/SourceSans3-i2.woff2) format('woff2');
}
@font-face {
  font-family: 'Source Sans 3';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url(../fonts/SourceSans3-n3.woff2) format('woff2');
}

:root {
  /* палитра v2 */
  --paper:      #F6F4EE;   /* тёплый светлый фон страницы */
  --paper-tint: #EFECE3;   /* тонированные секции */
  --card:       #FFFFFF;
  --ink:        #15181C;   /* графит */
  --ink-soft:   #5A6169;   /* вторичный текст */
  --deep:       #14171B;   /* подвал, тёмные блоки */
  --deep-2:     #1C2026;   /* приподнятые поверхности на тёмном */
  --red:        #C8102E;   /* единственный акцент: CTA, цены, телефон */
  --red-hover:  #A20D25;
  --line:       #E4E2DB;
  --line-dark:  rgba(255,255,255,.12);
  --shadow:     0 14px 40px rgba(20, 23, 27, .14);
  --shadow-sm:  0 4px 14px rgba(20, 23, 27, .10);

  --r-card: 8px;
  --r-btn:  8px;

  --display: 'Archivo', 'Arial Narrow', sans-serif;
  --body: 'Source Sans 3', 'Helvetica Neue', Arial, sans-serif;

  --section: clamp(64px, 9vw, 112px);
  --wrap: 1200px;

  --ease: cubic-bezier(.22, .8, .3, 1);
}

*, *::before, *::after { box-sizing: border-box; }

/* [hidden] обязан прятать элемент, даже если у него задан display —
   грабля, знакомая по прошлым проектам */
[hidden] { display: none !important; }

html {
  scroll-behavior: smooth;
  /* липкая шапка 67px перекрывала верх блока при переходе к якорю —
     страница «уезжала» под неё (баг ловится только скроллом к форме) */
  scroll-padding-top: 80px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--body);
  font-size: 18px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: var(--ink); text-underline-offset: 3px; transition: color .18s var(--ease); }
a:hover { color: var(--red); }

h1, h2, h3 {
  font-family: var(--display);
  font-stretch: 112%;
  line-height: 1.06;
  letter-spacing: -0.015em;
  margin: 0 0 .5em;
  color: var(--ink);
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5vw, 3.6rem); font-weight: 820; }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.55rem); font-weight: 780; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); font-weight: 720; }

p { margin: 0 0 1em; }
.muted { color: var(--ink-soft); }

/* фирменные микро-детали */
::selection { background: var(--red); color: #fff; }
:focus-visible { outline: 3px solid var(--red); outline-offset: 2px; }
h1 .dot, h2 .dot { color: var(--red); }

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 clamp(18px, 4vw, 32px); }

/* ---------- появление при скролле ----------
   Элементы с [data-reveal] всплывают, когда входят в кадр.
   Без JS (и при reduced-motion) всё видно сразу. */
@media (prefers-reduced-motion: no-preference) {
  .js [data-reveal] {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity .65s var(--ease), transform .65s var(--ease);
    transition-delay: calc(var(--rv, 0) * 90ms);
  }
  .js [data-reveal].in { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ---------- кнопки ---------- */
.btn {
  position: relative;
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 52px; padding: 12px 28px;
  border-radius: var(--r-btn); border: 2px solid transparent;
  font-family: var(--display); font-stretch: 108%; font-weight: 700;
  font-size: 17px; letter-spacing: .01em; text-decoration: none;
  cursor: pointer; white-space: nowrap;
  transition: background .2s var(--ease), color .2s var(--ease),
              transform .15s var(--ease), border-color .2s var(--ease),
              box-shadow .2s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(1px) scale(.99); }
.btn .ic { width: 20px; height: 20px; flex: none; }

.btn-red { background: var(--red); color: #fff; box-shadow: 0 6px 18px rgba(200, 16, 46, .25); }
.btn-red:hover { background: var(--red-hover); color: #fff; box-shadow: 0 10px 24px rgba(200, 16, 46, .32); }

.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--paper); }

.btn-ink { background: var(--ink); color: #fff; border-color: var(--ink); }
.btn-ink:hover { background: var(--red); border-color: var(--red); color: #fff; }

.btn-light { background: #fff; color: var(--ink); border-color: #fff; }
.btn-light:hover { background: var(--paper-tint); border-color: var(--paper-tint); }

/* иконка-маска, красится в currentColor */
.ic {
  display: inline-block; width: 22px; height: 22px;
  background: currentColor;
  -webkit-mask: var(--icon) center / contain no-repeat;
          mask: var(--icon) center / contain no-repeat;
}

/* ---------- шапка v5: белый слой (лого/поиск/телефон) + графитовая нав-полоса ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40;
  border-top: 3px solid var(--red);   /* гоночная полоска — фирменный кант */
  box-shadow: 0 1px 0 rgba(20,23,27,.06);
  transition: box-shadow .25s var(--ease);
}
.site-header.compact { box-shadow: 0 10px 30px rgba(20,23,27,.16); }

/* слой 1: белый */
.masthead { background: #fff; overflow: visible; max-height: 160px; transition: max-height .35s var(--ease), opacity .25s var(--ease); }
.masthead .wrap {
  display: flex; align-items: center; gap: clamp(16px, 2.4vw, 36px);
  min-height: 88px;
}
.logo { display: flex; align-items: center; flex: none; position: relative; z-index: 3; }
.logo img {
  height: 88px; width: auto;
  margin: 8px 0 -28px;
  filter: drop-shadow(0 8px 16px rgba(20,23,27,.22));
  transition: transform .25s var(--ease);
}
.logo:hover img { transform: translateY(-3px) rotate(-1deg); }
/* вход шапки каскадом при загрузке */
@media (prefers-reduced-motion: no-preference) {
  .js .logo img { animation: hd-drop .55s var(--ease) both; }
  .js .h-search { animation: hd-fade .5s var(--ease) .12s both; }
  .js .call-block { animation: hd-fade .5s var(--ease) .22s both; }
  .js .navbar { animation: hd-fade .45s var(--ease) .1s both; }
}
@keyframes hd-drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
@keyframes hd-fade { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }

/* поиск по инвентарю */
.h-search { flex: 1; max-width: 460px; display: none; margin: 0 auto; transition: max-width .3s var(--ease); }
.h-search:focus-within { max-width: 520px; }
.h-search form { display: flex; align-items: center; position: relative; }
.h-search .ic {
  position: absolute; left: 16px; width: 20px; height: 20px;
  color: var(--ink-soft); pointer-events: none;
}
.h-search input {
  font: inherit; font-size: 16.5px; color: var(--ink);
  width: 100%; min-height: 52px; padding: 10px 16px 10px 48px;
  background: var(--paper); border: 2px solid #D8D5CC; border-radius: 999px;
  transition: border-color .2s var(--ease), background .2s var(--ease);
}
.h-search input::placeholder { color: var(--ink-soft); }
.h-search input:focus { outline: none; background: #fff; border-color: var(--ink); }
@media (min-width: 900px) { .h-search { display: block; } }

/* телефон справа: строгий каптал + красная кнопка-иконка с пульсом */
.call-block { display: none; margin-left: auto; text-align: right; text-decoration: none; flex: none; }
.call-block .cb-label {
  font-family: var(--display); font-stretch: 110%; font-weight: 700;
  font-size: 13.5px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-soft); margin-bottom: 5px;
}
.call-block .cb-num {
  display: flex; align-items: center; justify-content: flex-end; gap: 11px;
  font-family: var(--display); font-stretch: 116%; font-weight: 830;
  font-size: 27px; line-height: 1.15; color: var(--ink);
  transition: color .18s var(--ease);
}
.call-block:hover .cb-num { color: var(--red); }
.cb-ic {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 50%;
  background: var(--red); color: #fff; flex: none;
  transition: background .18s var(--ease);
}
.cb-ic .ic { width: 20px; height: 20px; }
.call-block:hover .cb-ic { background: var(--red-hover); }
@media (prefers-reduced-motion: no-preference) {
  .cb-ic { animation: cb-pulse 2.2s var(--ease) 3; animation-delay: .8s; }
}
@keyframes cb-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(200, 16, 46, .38); }
  55%      { box-shadow: 0 0 0 10px rgba(200, 16, 46, 0); }
}
@media (min-width: 1120px) { .call-block { display: block; } }

/* мобильные действия в белом слое */
.m-actions { display: flex; align-items: center; gap: 12px; margin-left: auto; }
@media (min-width: 1120px) { .m-actions { display: none; } }
.m-call {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 48px; padding: 8px 16px;
  background: var(--red); color: #fff; border-radius: var(--r-btn);
  font-family: var(--display); font-stretch: 110%; font-weight: 800; font-size: 16px;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(200, 16, 46, .25);
}
.m-call:hover { background: var(--red-hover); color: #fff; }
.menu-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 50px; height: 50px; border: 2px solid var(--ink); border-radius: var(--r-btn);
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background .2s var(--ease), color .2s var(--ease);
}
.menu-btn:hover { background: var(--ink); color: #fff; }
.menu-btn .ic { width: 26px; height: 26px; }

/* слой 2: графитовая нав-полоса */
.navbar { background: var(--deep); display: none; }
.navbar .wrap { display: flex; align-items: center; min-height: 56px; gap: 8px; }
.nav { display: flex; margin: 0 auto; }
.nav a {
  position: relative;
  font-family: var(--display); font-stretch: 110%; font-weight: 700;
  font-size: 15.5px; letter-spacing: .07em; text-transform: uppercase;
  color: #E6E8EA; text-decoration: none;
  padding: 18px 15px; white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 15px; right: 15px; bottom: 10px;
  height: 3px; background: var(--red); border-radius: 2px;
  transform: scaleX(0); transform-origin: left center;
  transition: transform .25s var(--ease);
}
.nav a:hover { color: #fff; }
.nav a:hover::after, .nav a[aria-current="page"]::after { transform: scaleX(1); }

/* компакт: белый слой складывается, в полосу въезжает подпись и телефон */
.nav-mini { display: none; align-items: center; }
.nav-mini.brand {
  margin-right: 22px; white-space: nowrap;
  font-family: var(--display); font-stretch: 120%; font-weight: 830;
  font-size: 17px; letter-spacing: .06em; color: #fff; text-decoration: none;
}
.nav-mini.brand .dot { color: var(--red); }
.nav-mini.call {
  margin-left: 22px; white-space: nowrap;
  display: none; align-items: center; gap: 8px;
  font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 16.5px;
  color: #fff; text-decoration: none;
}
.nav-mini.call .ic { width: 17px; height: 17px; color: #FF5A70; }
.nav-mini.call:hover { color: #FF5A70; }

@media (min-width: 1120px) {
  .navbar { display: block; }
  .site-header.compact .masthead { max-height: 0; opacity: 0; overflow: hidden; }
  .site-header.compact .nav-mini.brand { display: inline-flex; opacity: 0; animation: navside-in .3s var(--ease) forwards; }
  /* телефон в компакт-навбар влезает только с 1360px: ниже бренд+меню+номер шире wrap,
     и номер выталкивало за край экрана (горизонтальный скролл 19px на 1280) */
}
@media (min-width: 1360px) {
  .site-header.compact .nav-mini.call { display: inline-flex; opacity: 0; animation: navside-in .3s var(--ease) forwards; }
}

@keyframes navside-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

@media (max-width: 1119px) {
  .masthead { transition: background .3s var(--ease); }
  .site-header.compact .masthead { background: var(--deep); }
  .site-header.compact .menu-btn { border-color: #fff; color: #fff; }
  .site-header.compact .menu-btn:hover { background: #fff; color: var(--ink); }
  .masthead .wrap { min-height: 64px; gap: 10px; }
  .logo img { height: 46px; margin: 0; filter: none; }
  .m-call { min-height: 44px; padding: 7px 13px; font-size: 15.5px; letter-spacing: .01em; }
  .m-call .ic { width: 16px !important; height: 16px !important; }
  .menu-btn { width: 44px; height: 44px; }
  .menu-btn .ic { width: 22px; height: 22px; }
}

/* мобильное меню: тёмное, ссылки заезжают каскадом */
.mobile-menu {
  position: fixed; inset: 0; z-index: 50;
  background:
    linear-gradient(180deg, rgba(12, 14, 17, .94) 0%, rgba(12, 14, 17, .97) 100%),
    url(/assets/img/site/hero-poster.jpg) center 30% / cover no-repeat var(--deep);
  color: #fff;
  padding: 16px clamp(18px, 5vw, 32px) 36px;
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu > * { max-width: 560px; margin-left: auto; margin-right: auto; }
.mobile-menu .mm-top { display: flex; align-items: center; justify-content: space-between; min-height: 56px; }
.mobile-menu .mm-top img { height: 48px; }
.mobile-menu .menu-btn { border-color: #fff; color: #fff; }
.mobile-menu .menu-btn:hover { background: #fff; color: var(--ink); }
.mm-search { position: relative; margin-top: 24px; }
.mm-search .ic { position: absolute; left: 16px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: #8b939c; pointer-events: none; }
.mm-search input {
  font: inherit; font-size: 17px; color: #fff; width: 100%;
  min-height: 54px; padding: 10px 16px 10px 48px;
  background: var(--deep-2); border: 2px solid rgba(255,255,255,.16); border-radius: 999px;
}
.mm-search input::placeholder { color: #9aa2ab; }
.mm-search input:focus { outline: none; border-color: #fff; }
.mobile-menu nav { display: grid; margin: 14px auto; }
.mm-cap {
  font-family: var(--display); font-stretch: 112%; font-weight: 750;
  font-size: 11.5px; letter-spacing: .16em; text-transform: uppercase;
  color: #6E767F; margin: 18px 0 4px;
}
.mm-cap:first-child { margin-top: 0; }
.mm-badge {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 26px; height: 26px; padding: 0 7px; margin-left: 8px;
  border-radius: 999px; background: var(--red); color: #fff;
  font-size: 13.5px; font-weight: 800; vertical-align: 3px;
}
.mobile-menu nav a {
  display: flex; align-items: center; justify-content: space-between;
  font-family: var(--display); font-stretch: 112%; font-weight: 760;
  font-size: 20px; color: #fff; text-decoration: none;
  padding: 11px 2px; border-bottom: 1px solid var(--line-dark);
}
.mobile-menu nav a.mm-main { font-size: 24px; }
.mobile-menu nav a .ic { width: 17px; height: 17px; color: #6E767F; transition: color .18s var(--ease), transform .18s var(--ease); }
.mobile-menu nav a:hover { color: #FF5A70; }
.mobile-menu nav a:hover .ic { color: #FF5A70; transform: translateX(3px); }

@media (prefers-reduced-motion: no-preference) {
  .mobile-menu:not([hidden]) nav a {
    opacity: 0; transform: translateY(14px);
    animation: mm-in .4s var(--ease) forwards;
    animation-delay: calc(var(--mi, 0) * 55ms);
  }
}
@keyframes mm-in { to { opacity: 1; transform: none; } }
.mm-call { width: 100%; margin: 6px auto 18px; }
.mobile-menu .mm-info { color: #B9BEC5; font-size: 15px; line-height: 1.7; }
.mobile-menu .mm-info a { color: #DDE1E6; }
.mobile-menu .open-status { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; margin-right: 8px; }
.mobile-menu .open-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.mobile-menu .open-status.is-open { color: #4CC06A; }
.mobile-menu .open-status.is-open::before { background: #4CC06A; }
.mobile-menu .open-status.is-closed { color: #8B939C; }
.mobile-menu .open-status.is-closed::before { background: #8B939C; }
.mobile-menu .mm-info a { color: #fff; }

/* ---------- подвал ---------- */
.site-footer {
  background: var(--deep); color: #A7AEB6;
  border-top: 3px solid var(--red); /* закольцовка с кантом шапки */
  font-size: 16.5px;
  /* отступ сверху дают сами страницы; на главной тёмный финал
     перетекает в подвал без светлой щели */
}
.site-footer a { color: #DDE1E6; text-decoration: none; transition: color .18s var(--ease); }
.site-footer a:hover { color: #fff; text-decoration: underline; }
/* кнопки в подвале не наследуют серый цвет ссылок футера */
.site-footer a.btn-red, .site-footer a.btn-red:hover { color: #fff; text-decoration: none; }

/* фирменная строка-подпись */
.footer-sign { border-bottom: 1px solid var(--line-dark); }
.fs-left { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.fs-cars { display: flex; }
.fs-cars img {
  width: 64px; height: 48px; object-fit: cover;
  border-radius: 6px; border: 3px solid #fff;
  box-shadow: 0 4px 12px rgba(0, 0, 0, .35);
}
.fs-cars img:nth-child(1) { transform: rotate(-4deg); }
.fs-cars img:nth-child(2) { margin-left: -16px; transform: rotate(2deg); z-index: 1; }
.fs-cars img:nth-child(3) { margin-left: -16px; transform: rotate(-1.5deg); }
.footer-sign .wrap {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
  gap: 16px 40px; padding-top: 30px; padding-bottom: 30px;
}
.footer-sign .fs-line {
  font-family: var(--display); font-stretch: 114%; font-weight: 800;
  font-size: clamp(20px, 2.4vw, 27px); line-height: 1.15; letter-spacing: -0.01em;
  color: #fff; margin: 0; text-wrap: balance;
}
.footer-sign .fs-line .dot { color: var(--red); }
.footer-sign .btn { flex: none; }

.footer-grid {
  display: grid; gap: 40px;
  padding: 44px 0 38px;
  grid-template-columns: 1fr;
}
@media (min-width: 700px)  { .footer-grid { grid-template-columns: 1.3fr 1fr 1fr; } }
@media (min-width: 1000px) { .footer-grid { grid-template-columns: 1.4fr .9fr .9fr 1.15fr; } }

.footer-brand img { height: 84px; margin-bottom: 16px; }
.footer-brand p { margin: 0; line-height: 1.65; }

.site-footer h4 {
  font-family: var(--display); font-stretch: 112%;
  font-size: 14px; font-weight: 750; letter-spacing: .14em; text-transform: uppercase;
  color: #8B939C; margin: 0 0 16px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }

.footer-contact li { display: flex; gap: 10px; align-items: flex-start; }
.footer-contact .ic { width: 20px; height: 20px; margin-top: 4px; color: var(--red); flex: none; }
.site-footer .open-status { display: inline-flex; align-items: center; gap: 7px; font-weight: 700; margin-right: 9px; }
.site-footer .open-status::before { content: ""; width: 8px; height: 8px; border-radius: 50%; }
.site-footer .open-status.is-open { color: #4CC06A; }
.site-footer .open-status.is-open::before { background: #4CC06A; }
.site-footer .open-status.is-closed { color: #8B939C; }
.site-footer .open-status.is-closed::before { background: #8B939C; }
.footer-contact .phone-big {
  font-family: var(--display); font-stretch: 112%; font-weight: 800; font-size: 21px; color: #fff;
}

.footer-bottom {
  border-top: 1px solid var(--line-dark);
  padding: 20px 0 30px;
  display: flex; flex-wrap: wrap; gap: 10px 26px; align-items: center;
  font-size: 15px; color: #8B939C;
}
.footer-bottom a { color: #A7AEB6; }
.footer-bottom .foot-legal { margin-left: auto; display: flex; gap: 22px; }

/* ---------- формы ---------- */
.field { display: grid; gap: 7px; margin-bottom: 16px; }
.field label { font-weight: 600; font-size: 16.5px; }
.field input, .field select, .field textarea {
  font: inherit; color: var(--ink);
  background: #fff; border: 2px solid #C2C4C0; border-radius: var(--r-btn);
  min-height: 52px; padding: 12px 14px; width: 100%;
  transition: border-color .18s var(--ease), box-shadow .18s var(--ease);
}
.field textarea { min-height: 96px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--ink);
  box-shadow: 0 0 0 3px rgba(20, 23, 27, .14);
}
.field .hint { font-size: 15px; color: var(--ink-soft); }
.field .error { font-size: 15px; color: var(--red); display: none; }
.field.is-bad input { border-color: var(--red); }
.field.is-bad .error { display: block; }


/* ---------- утилиты ---------- */
.center { text-align: center; }
.section { padding-top: var(--section); }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* iOS зумит страницу при фокусе на поле мельче 16px — открытые списки
   и клавиатура «уводят» экран. Страховка для всех видимых полей. */
@media (max-width: 760px) {
  input:not([type="hidden"]):not([type="range"]):not([type="checkbox"]),
  select, textarea { font-size: max(16px, 1em); }
}
