/* ==========================================================================
   components.css — шапка, подвал, кнопки, карточки каталога, модалки.
   ========================================================================== */

/* --- Демо-полоса --- */
.demo-note {
  background: var(--brass-soft);
  border-bottom: 1px solid var(--brass);
  color: var(--brass);
  font-size: var(--fs-label);
  text-align: center;
  padding: 8px var(--gutter);
  position: relative; z-index: 200;
}
.opt-no-demo-banner .demo-note { display: none; }

/* --- Шапка --- */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  z-index: 100;
}
.header__inner {
  height: 100%;
  display: flex;
  align-items: center;
  gap: 32px;
}
.logo {
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1.15;
  flex-shrink: 0;
}
.logo span { color: var(--green); }
/* Логотип-картинка из CRM. height задаётся атрибутом, ширина тянется сама —
   иначе широкий логотип сплющит. */
.logo--img { display: inline-flex; align-items: center; padding: 0; }
.logo--img img { display: block; height: 44px; width: auto; max-width: 260px; }
@media (max-width: 575.98px) { .logo--img img { max-width: 170px; } }
.logo small {
  display: block;
  font-family: var(--font-text);
  font-size: var(--fs-micro);
  font-weight: 400;
  letter-spacing: .02em;
  color: var(--ink-muted);
  margin-top: 1px;
}
.nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-right: auto;
}
.nav a {
  color: var(--ink-muted);
  text-decoration: none;
  font-size: var(--fs-small);
  padding: 8px 12px;
  border-radius: var(--radius-sm);
  transition: color var(--dur) var(--ease), background var(--dur) var(--ease);
}
.nav a:hover { color: var(--ink); background: var(--surface-soft); }
.nav a.is-active { color: var(--green); font-weight: 600; }
.header__phone {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: var(--ink);
  font-size: var(--fs-small);
  font-weight: 600;
  flex-shrink: 0;
  padding: 8px 0;
}
.header__phone .icon { color: var(--green); }
.header__phone small {
  display: block;
  font-weight: 400;
  font-size: var(--fs-label);
  color: var(--ink-muted);
}
.header__phone:hover { color: var(--green); }
.burger {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
  color: var(--ink);
  margin-left: auto;
}

/* --- Подвал --- */
/* Подвал живёт в chrome.css — здесь остались только те свойства, которые
   он не переопределяет. Отступ сверху убран: 80 пикселей мёртвой полосы
   между последней секцией и подвалом на каждой странице. Полосы сайта
   стыкуются встык, подвал — такая же полоса. */
.footer {
  color: rgba(255,255,255,.7);
  font-size: var(--fs-small);
}
.footer__grid {
  display: grid;
  grid-template-columns: 1.6fr repeat(2, 1fr);
  gap: 40px 48px;
  margin-bottom: 48px;
}
.footer__brand .logo { color: #fff; margin-bottom: 12px; }
.footer__brand .logo span { color: var(--green-soft); }
.footer__brand .logo small { color: rgba(255,255,255,.45); }
/* Логотип в подвале — без фильтра: файл подходит для тёмного фона как есть.
   Если логотип тёмный и нужно осветление — раскомментировать:
   .footer__brand .logo--img img { filter: brightness(0) invert(1); } */
.footer__tagline { color: rgba(255,255,255,.55); line-height: 1.6; max-width: 32ch; }
.footer__contact { margin-top: 20px; display: flex; flex-direction: column; gap: 4px; }
.footer__contact a { color: rgba(255,255,255,.75); text-decoration: none; }
.footer__contact a:hover { color: #fff; }
.footer__col h4 {
  font-family: var(--font-text);
  font-size: var(--fs-label);
  font-weight: 700;
  color: rgba(255,255,255,.4);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 16px;
}
.footer__col ul { display: flex; flex-direction: column; gap: 8px; }
.footer__col a { color: rgba(255,255,255,.7); text-decoration: none; }
.footer__col a:hover { color: #fff; }
.footer__bottom {
  border-top: 1px solid rgba(255,255,255,.1);
  padding-top: 24px;
  color: rgba(255,255,255,.35);
  font-size: var(--fs-label);
}
@media (max-width: 900px) { .nav, .header__phone { display: none; } .burger { display: block; } .header__inner { gap: 0; } }
@media (max-width: 720px) { .footer__grid { grid-template-columns: 1fr 1fr; } .footer__brand { grid-column: 1/-1; } }
@media (max-width: 480px) { .footer__grid { grid-template-columns: 1fr; } }

/* --- Кнопки --- */
/* ── Кнопки ────────────────────────────────────────────────────────────────
   Одна форма (--radius-btn), три высоты, один шрифт на подписи действий.
   Правило типографики сайта: ПОДПИСЬ действия — Source Sans, ЧИСЛО
   (цена, телефон) — Bitter. До этого в первом экране рядом стояли две
   кнопки, набранные разными гарнитурами, и это было видно.

   Движение: при наведении кнопка приподнимается и набирает тень, при
   нажатии садится обратно. Осадка на :active важнее hover — на телефоне
   курсора нет, и только она подтверждает, что нажатие прошло. */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: var(--h-btn); padding: 0 20px;
  border: 1px solid transparent; border-radius: var(--radius-btn);
  font: 600 var(--fs-small)/1 var(--font-text); letter-spacing: .01em;
  cursor: pointer; text-decoration: none; white-space: nowrap;
  transition: background var(--dur) var(--ease),
              border-color var(--dur) var(--ease),
              color var(--dur) var(--ease),
              box-shadow var(--dur-slow) var(--ease),
              transform var(--dur-slow) var(--ease);
}
.btn:active { transform: translateY(1px) !important; box-shadow: none; }
.btn:focus-visible { outline: 3px solid var(--brass); outline-offset: 3px; box-shadow: none; }

.btn--primary { background: var(--green); color: #fff; border-color: var(--green); box-shadow: var(--shadow-btn); }
.btn--primary:hover { background: var(--green-dark); border-color: var(--green-dark); color: #fff;
                      transform: translateY(-2px); box-shadow: 0 6px 18px rgba(29,74,53,.32); }
.btn--outline { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn--outline:hover { background: var(--surface-soft); border-color: var(--ink-muted);
                      transform: translateY(-2px); box-shadow: var(--shadow); }
/* На тёмной полосе .btn--outline красит текст в --ink (34,31,26) поверх
   ночного фона (22,19,15): контраст 1.1, кнопки просто нет. Правило жило
   в home.css как модификатор .btn--night — то есть страница, которая
   home.css не подключает, получала невидимую кнопку, а поставить
   модификатор надо было не забыть. Теперь кнопка подстраивается под
   полосу сама; модификатор оставлен для разметки, где он уже проставлен. */
.band--night .btn--outline,
.btn--night { background: transparent; color: #fff; border-color: rgba(245,240,230,.34); }
.band--night .btn--outline:hover,
.btn--night:hover { background: rgba(245,240,230,.12); border-color: rgba(245,240,230,.6); color: #fff; }

.btn--ghost { background: transparent; color: var(--green); border-color: transparent; }
.btn--ghost:hover { background: var(--green-soft); }
.btn--full { width: 100%; }
.btn--lg { min-height: var(--h-btn-lg); padding: 0 28px; font-size: var(--fs-base); }
.btn--sm { min-height: var(--h-btn-sm); padding: 0 16px; font-size: var(--fs-label); }
/* Иконка внутри кнопки чуть уезжает вперёд — движение подсказывает, что
   кнопка ведёт дальше, а не просто подсвечивается. */
.btn svg { transition: transform var(--dur-slow) var(--ease); }
.btn:hover svg { transform: translateX(2px); }
@media (prefers-reduced-motion: reduce) {
  .btn, .btn:hover, .btn:active { transform: none !important; }
}

/* --- Карточка каталога --- */
.car-card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; display: flex; flex-direction: column; transition: box-shadow var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); }
.car-card:hover { box-shadow: var(--shadow-lift); transform: translateY(-2px); }
.car-card__img { position: relative; aspect-ratio: 16/10; overflow: hidden; background: var(--surface-soft); }
.car-card__img img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ease); }
.car-card:hover .car-card__img img { transform: scale(1.03); }
.car-card__badge { position: absolute; top: 12px; left: 12px; background: var(--green); color: #fff; font-size: var(--fs-label); font-weight: 700; padding: 4px 8px; border-radius: var(--radius-sm); }
/* Sold и Pending Sale — на красной подложке: это срочные пометки,
   зелёный (цвет обычных кнопок) их не выделял. */
.car-card__badge--sale     { background: var(--brick); }
.car-card__badge--pending  { background: var(--brick); }
.car-card__badge--reserved { background: var(--brick);  }
.car-card__body { padding: 20px 20px 20px; display: flex; flex-direction: column; flex: 1; }
.car-card__name { font-family: var(--font-display); font-size: var(--fs-h3); font-weight: 700; color: var(--ink); margin-bottom: 4px; text-decoration: none; display: block; }
.car-card__name:hover { color: var(--green); }
.car-card__meta { display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: var(--fs-label); color: var(--ink-muted); margin-bottom: 16px; }
.car-card__meta span { display: flex; align-items: center; gap: 4px; }
/* Характеристики столбиком: коробка и пробег на отдельных строках. */
.car-card__meta--stack { flex-direction: column; gap: 4px; margin-bottom: 0; }
.car-card__price { margin-top: 16px; display: flex; align-items: baseline; gap: 8px; }
.car-card__price-now { font-size: var(--fs-title); font-weight: 700; color: var(--ink); font-family: var(--font-display); }
.car-card__price-was { font-size: var(--fs-small); color: var(--ink-soft); text-decoration: line-through; }
.car-card__footer { padding: 12px 20px; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: flex-end; gap: 12px; margin-top: auto; }
.empty-state { grid-column: 1/-1; text-align: center; padding: 80px 20px; color: var(--ink-muted); }
.empty-state h3 { font-family: var(--font-display); margin-bottom: 12px; }

/* --- Тост --- */
.toast { position: fixed; bottom: 24px; right: 24px; background: var(--ink); color: #fff; font-size: var(--fs-small); padding: 12px 20px; border-radius: var(--radius-md); box-shadow: var(--shadow-lift); z-index: 9999; opacity: 0; transform: translateY(8px); transition: opacity var(--dur-slow) var(--ease), transform var(--dur-slow) var(--ease); pointer-events: none; max-width: 320px; }
.toast.is-visible { opacity: 1; transform: translateY(0); }


/* --- Модалка --- */
.modal { display: none; position: fixed; inset: 0; background: rgba(34,31,26,.6); z-index: 1000; align-items: center; justify-content: center; padding: var(--gutter); }
.modal.is-open { display: flex; }
.modal__box { background: var(--surface); border-radius: var(--radius-lg); width: 100%; max-width: 520px; max-height: calc(100vh - 48px); overflow-y: auto; position: relative; box-shadow: var(--shadow-lift); }
.modal__head { padding: 28px 28px 20px; border-bottom: 1px solid var(--line); }
.modal__title { font-size: var(--fs-h3); margin: 0 40px 8px 0; }
.modal__lead { font-size: var(--fs-small); color: var(--ink-muted); margin: 0; }
.modal__body { padding: 24px 28px 28px; }
.modal__close { position: absolute; top: 20px; right: 20px; background: none; border: none; cursor: pointer; color: var(--ink-muted); padding: 4px; border-radius: var(--radius-sm); }
.modal__close:hover { color: var(--ink); background: var(--surface-soft); }

/* --- Поля формы --- */
.field { margin-bottom: 16px; }
.field label { display: block; font-size: var(--fs-label); font-weight: 600; color: var(--ink-muted); margin-bottom: 8px; }
.field input, .field select, .field textarea { width: 100%; min-height: 50px; padding: 12px 12px; font: 400 var(--fs-small)/1.4 var(--font-text); color: var(--ink); background: var(--surface); border: 1px solid var(--line-strong); border-radius: var(--radius-sm); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease); }
.field textarea { min-height: 100px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--green); box-shadow: var(--focus); }

/* --- Subbar (хлебные крошки) --- */
.subbar { background: var(--surface); border-bottom: 1px solid var(--line); padding: 12px 0; }
.subbar .container { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.breadcrumb { display: flex; align-items: center; gap: 4px; font-size: var(--fs-label); color: var(--ink-muted); flex: 1; }
.breadcrumb li+li::before { content: '/'; margin-right: 4px; color: var(--line-strong); }
.breadcrumb a { color: var(--ink-muted); text-decoration: none; }
.breadcrumb a:hover { color: var(--green); }
.breadcrumb li:last-child { color: var(--ink-soft); }
.subbar__actions { display: flex; gap: 8px; flex-wrap: wrap; }

/* --- Секции страниц --- */
.page-section { padding: 64px 0; }
.page-section + .page-section { padding-top: 0; }
.section-title { font-size: var(--fs-h2); margin-bottom: 8px; }
.section-lead { font-size: var(--fs-small); color: var(--ink-muted); max-width: 64ch; margin-bottom: 40px; }

/* --- Звёзды --- */
.stars { color: var(--brass); letter-spacing: .05em; font-size: var(--fs-small); }


/* ── Валидация форм ── */
.field input.is-invalid,
.field select.is-invalid,
.field textarea.is-invalid {
  border-color: #d93025;
  box-shadow: 0 0 0 3px rgba(217, 48, 37, .12);
}
.field input.is-valid,
.field select.is-valid,
.field textarea.is-valid {
  border-color: var(--green);
}
.field-error {
  display: none;
  margin-top: 4px;
  font-size: 12px;
  line-height: 1.4;
  color: #d93025;
}


/* ── Consent-чекбокс в формах ── */
.field--consent { margin-top: 4px; }
.consent-label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  cursor: pointer;
  font-size: 11px;
  line-height: 1.5;
  color: var(--ink-muted);
}
.consent-label input[type="checkbox"] {
  flex-shrink: 0;
  width: 16px;
  height: 16px;
  margin-top: 2px;
  accent-color: var(--green);
  cursor: pointer;
}
.consent-label a {
  color: var(--green);
  text-decoration: underline;
}
.consent-label a:hover { opacity: .8; }
.field--consent .field-error { margin-top: 4px; }


/* --- FOUC guard: скрываем блоки пока JS их не заполнил --- */
.demo-note { display: none; }
header.header:empty,
nav.mobile-menu:empty,
footer.footer:empty { visibility: hidden; }
/* Neutral catalog state: never substitute a different vehicle photograph. */
.photo-empty {
  display: grid;
  width: 100%;
  min-height: 160px;
  place-items: center;
  padding: 24px;
  background: color-mix(in srgb, var(--ink) 7%, var(--surface));
  color: var(--ink-muted);
  font: 600 var(--fs-label)/1.3 var(--font-body);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
}
