/* ==========================================================================
   Фаркоп52 — расширение дизайн-системы (каталог + формы)
   Базовые токены совместимы с существующим style.css сайта
   ========================================================================== */

:root {
  --bg: #0b0e12;
  --bg-2: #10151c;
  --surface: #161c25;
  --surface-2: #1d242f;
  --surface-3: #232b38;
  --line: #29323f;
  --line-soft: #1e2632;
  --text: #e9eef5;
  --text-2: #b6c2d2;
  --muted: #8d9aad;
  --accent: #ff7a1a;
  --accent-2: #ffa451;
  --accent-ink: #14181f;
  --success: #3cc48c;
  --danger: #ff5f56;
  --font-head: "Oswald", "Roboto Condensed", "Arial Narrow", sans-serif;
  --font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --maxw: 1200px;
  --gutter: 20px;
  --radius: 16px;
  --radius-sm: 10px;
  --radius-lg: 24px;
  --header-h: 76px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4 {
  font-family: var(--font-head);
  font-weight: 600;
  line-height: 1.12;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2.1rem, 1.2rem + 3.6vw, 3.4rem); font-weight: 700; text-transform: uppercase; }
h2 { font-size: clamp(1.65rem, 1.1rem + 2.1vw, 2.4rem); text-transform: uppercase; }
h3 { font-size: clamp(1.15rem, 1rem + 0.6vw, 1.35rem); }
a { color: var(--accent-2); text-decoration: none; transition: color .18s; }
a:hover { color: var(--accent); }
p { margin: 0 0 1.1em; }
.muted { color: var(--muted); }

.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.container--narrow { max-width: 720px; }
.section { padding: clamp(48px, 6vw, 80px) 0; }
.section--tight { padding: clamp(32px, 4vw, 52px) 0; }
.section--alt { background: var(--bg-2); }
.section-head { max-width: 760px; margin-bottom: clamp(24px, 3vw, 40px); }
.section-head--center { margin-left: auto; margin-right: auto; text-align: center; }
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--font-head); font-size: 0.82rem; font-weight: 600;
  letter-spacing: 0.14em; text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.eyebrow::before { content: ""; width: 26px; height: 3px; background: var(--accent); border-radius: 2px; }
.lead { font-size: clamp(1.02rem, 0.96rem + 0.35vw, 1.15rem); color: var(--text-2); max-width: 62ch; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 14px 26px; border: 1px solid transparent; border-radius: 999px;
  font-family: var(--font-body); font-size: 0.98rem; font-weight: 700; line-height: 1.2;
  cursor: pointer; transition: transform .16s, background .16s, color .16s, border-color .16s;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 10px 24px -14px rgba(255,122,26,.95); }
.btn--primary:hover { background: var(--accent-2); color: var(--accent-ink); }
.btn--ghost { background: transparent; color: var(--text); border-color: var(--line); }
.btn--ghost:hover { border-color: var(--accent); color: var(--accent); }
.btn--sm { padding: 10px 18px; font-size: 0.9rem; }
.btn--lg { padding: 17px 34px; font-size: 1.04rem; }
.btn--block { width: 100%; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* Header */
.header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(11,14,18,.82); backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
}
.header__inner { display: flex; align-items: center; gap: 18px; min-height: var(--header-h); }
.logo { display: inline-flex; align-items: center; gap: 11px; color: var(--text); flex: none; }
.logo:hover { color: var(--text); }
.logo__mark {
  width: 40px; height: 40px; border-radius: 11px; background: var(--surface-2);
  border: 1px solid var(--line); display: grid; place-items: center;
}
.logo__mark svg { width: 24px; height: 24px; color: var(--accent); }
.logo__text { display: flex; flex-direction: column; line-height: 1; }
.logo__name { font-family: var(--font-head); font-weight: 700; font-size: 1.22rem; letter-spacing: .06em; text-transform: uppercase; }
.logo__sub { font-size: 0.68rem; letter-spacing: .13em; text-transform: uppercase; color: var(--muted); margin-top: 3px; }
.nav { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.nav__link { padding: 9px 13px; border-radius: 8px; color: var(--text-2); font-size: 0.94rem; font-weight: 500; white-space: nowrap; }
.nav__link:hover { color: var(--text); background: var(--surface-2); }
.header__aside { display: flex; align-items: center; gap: 14px; margin-left: auto; }
.header__phone { display: flex; flex-direction: column; line-height: 1.15; text-align: right; color: var(--text); }
.header__phone b { font-size: 1.02rem; }
.header__phone span { font-size: 0.74rem; color: var(--muted); }
.burger { display: none; width: 44px; height: 44px; border: 1px solid var(--line); background: var(--surface-2); border-radius: 10px; cursor: pointer; }
.skip-link { position: absolute; left: -9999px; }
.skip-link:focus { left: 0; z-index: 999; background: var(--accent); color: var(--accent-ink); padding: 12px 20px; }

@media (max-width: 980px) {
  .nav { display: none; }
  .burger { display: grid; place-items: center; }
  .header__phone { display: none; }
}

/* Catalog */
.catalog-filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; margin-bottom: 8px; }
.filters-row { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr 1fr auto; gap: 12px; align-items: end; }
.filters-row label { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; color: var(--muted); }
.filters-row input, .filters-row select {
  padding: 11px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 0.95rem;
}
@media (max-width: 900px) {
  .filters-row { grid-template-columns: 1fr 1fr; }
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.product-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  display: flex;
  flex-direction: column;
  transition: border-color .2s, transform .2s;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.product-card__badges { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.badge {
  display: inline-block; padding: 3px 10px; border-radius: 999px;
  font-size: 0.72rem; font-weight: 600; background: var(--surface-3); color: var(--text-2);
}
.badge--ok { background: rgba(60,196,140,.15); color: var(--success); }
.badge--warn { background: rgba(255,122,26,.15); color: var(--accent); }
.product-card__title { font-size: 1.1rem; margin-bottom: 6px; }
.product-card__title a { color: var(--text); }
.product-card__title a:hover { color: var(--accent); }
.product-card__meta { font-size: 0.85rem; margin-bottom: 8px; }
.product-card__desc { font-size: 0.9rem; color: var(--text-2); flex: 1; margin-bottom: 10px; }
.product-card__load { font-size: 0.85rem; margin-bottom: 12px; }
.product-card__footer { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: auto; }
.product-card__price { font-family: var(--font-head); font-size: 1.35rem; font-weight: 700; color: var(--accent); }

.pagination { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 32px; justify-content: center; }
.pagination__item {
  min-width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 10px; border: 1px solid var(--line); color: var(--text-2); font-weight: 600;
}
.pagination__item.is-active, .pagination__item:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* Product detail */
.breadcrumbs { font-size: 0.9rem; margin-bottom: 20px; }
.breadcrumbs a { color: var(--muted); }
.product-detail { display: grid; gap: 32px; }
.product-specs {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px; margin: 24px 0;
}
.spec {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm);
  padding: 14px 16px;
}
.spec__label { display: block; font-size: 0.8rem; color: var(--muted); margin-bottom: 4px; }
.spec__value { font-weight: 600; }
.product-price-block {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; margin-top: 8px;
}
.product-price-block__price {
  font-family: var(--font-head); font-size: 2.2rem; font-weight: 700; color: var(--accent); margin-bottom: 6px;
}

/* Forms */
.lead-form {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 28px; max-width: 640px; margin: 0 auto;
}
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-bottom: 14px; }
.form-row label { display: flex; flex-direction: column; gap: 6px; font-size: 0.88rem; color: var(--muted); }
.form-row input {
  padding: 12px 14px; border-radius: 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font-size: 1rem;
}
.form-note { font-size: 0.8rem; margin-top: 12px; text-align: center; }
.form-msg { margin-top: 14px; padding: 12px; border-radius: 10px; text-align: center; font-weight: 600; }
.form-msg.ok { background: rgba(60,196,140,.15); color: var(--success); }
.form-msg.err { background: rgba(255,95,86,.15); color: var(--danger); }
@media (max-width: 600px) { .form-row { grid-template-columns: 1fr; } }

/* Footer */
.footer { border-top: 1px solid var(--line-soft); }
.footer__grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 32px; margin-bottom: 32px; }
.footer__links { list-style: none; padding: 0; margin: 0; }
.footer__links li { margin-bottom: 8px; }
.footer__links a { color: var(--text-2); }
.footer__links a:hover { color: var(--accent); }
.footer__bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; padding-top: 20px; border-top: 1px solid var(--line-soft); font-size: 0.88rem; }
@media (max-width: 700px) { .footer__grid { grid-template-columns: 1fr; } }

.empty-state { background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius); padding: 40px; text-align: center; }

/* ===== Model landing + product table (как на макете Haval H9) ===== */
.model-hero { margin-bottom: 28px; max-width: 820px; }
.model-hero h1 {
  font-size: clamp(2rem, 1.2rem + 3vw, 3.2rem);
  margin-bottom: 12px;
}
.model-hero__lead {
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.15rem);
  color: var(--text-2);
  max-width: 62ch;
  margin: 0;
}
.model-hero__lead strong { color: var(--text); }
.model-hero__checks {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  list-style: none;
  padding: 0;
  margin: 22px 0 0;
  font-size: 0.92rem;
  color: var(--text-2);
}
.model-hero__checks li {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}
.model-hero__checks li::before {
  content: "✓";
  color: var(--success);
  font-weight: 700;
}

.list-head { margin: 28px 0 16px; }
.list-head h2 {
  font-size: clamp(1.35rem, 1rem + 1.2vw, 1.75rem);
  margin-bottom: 14px;
  text-transform: none;
}
.list-head__controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 16px;
  margin-bottom: 10px;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text-2);
  font-weight: 600;
  font-size: 0.9rem;
  transition: .15s;
}
.chip:hover { border-color: var(--accent); color: var(--accent); }
.chip.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-ink);
}
.sort-select select {
  padding: 9px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  font-size: 0.9rem;
  font-weight: 600;
}
.ball-legend { font-size: 0.85rem; margin: 0; }

.product-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
}
.product-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 820px;
}
.product-table th {
  text-align: left;
  padding: 14px 16px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  border-bottom: 1px solid var(--line);
  background: var(--surface-2);
  white-space: nowrap;
}
.product-table td {
  padding: 16px;
  border-bottom: 1px solid var(--line-soft);
  vertical-align: middle;
  font-size: 0.95rem;
}
.product-table tr:last-child td { border-bottom: 0; }
.product-table tr:hover td { background: rgba(255,122,26,0.04); }

.pt-manu { display: flex; flex-direction: column; gap: 3px; }
.pt-manu strong { font-size: 1rem; color: var(--text); }
.pt-manu .muted { font-size: 0.82rem; }
.pt-years { font-weight: 600; color: var(--text); white-space: nowrap; }
.pt-ball { display: flex; flex-direction: column; gap: 2px; }
.ball-code {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 28px;
  padding: 2px 8px;
  border-radius: 6px;
  background: var(--surface-3);
  font-weight: 700;
  font-size: 0.85rem;
  width: fit-content;
}
.pt-load { font-weight: 600; font-variant-numeric: tabular-nums; }
.cut { font-weight: 600; font-size: 0.9rem; }
.cut--no { color: var(--success); }
.cut--yes { color: var(--accent); }
.pt-price { display: flex; flex-direction: column; gap: 2px; }
.pt-price strong {
  font-family: var(--font-head);
  font-size: 1.2rem;
  color: var(--text);
  white-space: nowrap;
}
.pt-price .muted { font-size: 0.8rem; }

@media (max-width: 760px) {
  .product-table { min-width: 0; }
  .product-table thead { display: none; }
  .product-table tr {
    display: block;
    padding: 16px;
    border-bottom: 1px solid var(--line);
  }
  .product-table td {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 6px 0;
    border: 0;
  }
  .product-table td::before {
    content: attr(data-label);
    color: var(--muted);
    font-size: 0.8rem;
    font-weight: 600;
    flex: none;
    min-width: 90px;
  }
  .product-table td:last-child {
    justify-content: stretch;
    padding-top: 12px;
  }
  .product-table td:last-child::before { display: none; }
  .product-table td:last-child .btn { width: 100%; }
}
