/* ==========================================================================
   АвтоДеталь — дизайн-система
   Чистый CSS, без фреймворков. Брендовый красный #E01F26, шрифт Inter.
   ========================================================================== */

/* ---------- 1. Токены ---------- */
:root {
  --brand:        #E01F26;
  --brand-dark:   #C2151B;
  --brand-darker: #B71C22;
  --ink:          #16181C;
  --ink-2:        #1C1C1E;
  --text:         #16181C;
  --muted:        #6E7378;
  --muted-2:      #9AA0A6;
  --line:         #ECECEE;
  --line-2:       #E0E1E4;
  --bg:           #EBECEE;
  --surface:      #F3F4F6;
  --surface-2:    #E9EAEC;
  --white:        #ffffff;
  --green:        #1E9E4A;
  --green-2:      #30C158;
  --green-bg:     #E8F8EE;
  --amber:        #FF9F0A;
  --amber-bg:     #FFF1E0;

  --r-sm: 8px;
  --r-md: 10px;
  --r-lg: 14px;
  --r-xl: 18px;
  --r-2xl: 22px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.04);
  --shadow-md: 0 8px 24px rgba(0,0,0,.06);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.12);

  --container: 1280px;
  --header-h: 50px;
}

/* ---------- 2. Reset / база ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'Inter', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  line-height: 1.45;
  min-height: 100vh;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; }
::placeholder { color: var(--muted-2); }
svg { display: block; }
h1, h2, h3, h4 { margin: 0; letter-spacing: -.02em; color: var(--ink); }

@keyframes dropIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes toastIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 3. Лейаут ---------- */
.container { max-width: var(--container); margin: 0 auto; padding-left: 20px; padding-right: 20px; }
.page { padding-top: 24px; padding-bottom: 64px; min-height: 60vh; }
.row { display: flex; }
.col { display: flex; flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.gap-8 { gap: 8px; } .gap-12 { gap: 12px; } .gap-16 { gap: 16px; } .gap-20 { gap: 20px; } .gap-24 { gap: 24px; }
.flex-1 { flex: 1; }
.hidden { display: none !important; }
.mt-8{margin-top:8px}.mt-12{margin-top:12px}.mt-16{margin-top:16px}.mt-20{margin-top:20px}.mt-24{margin-top:24px}.mt-32{margin-top:32px}

.grid { display: grid; gap: 18px; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-4 { grid-template-columns: repeat(4, 1fr); }
.expert-grid { grid-template-columns: 1fr 1.15fr; }
.expert-copy { flex: 1; padding: 28px 0 28px 30px; }
.expert-photo { width: 230px; height: 200px; flex-shrink: 0; }

/* ---------- 4. Типографика ---------- */
.h1 { font-size: 34px; font-weight: 800; }
.h2 { font-size: 24px; font-weight: 700; }
.h3 { font-size: 19px; font-weight: 700; }
.section-title { font-size: 23px; font-weight: 700; color: var(--ink); }
.text-muted { color: var(--muted); }
.text-muted-2 { color: var(--muted-2); }
.text-brand { color: var(--brand); }
.text-green { color: var(--green); }
.fw-600 { font-weight: 600; } .fw-700 { font-weight: 700; } .fw-800 { font-weight: 800; }
.fs-13 { font-size: 13px; } .fs-14 { font-size: 14px; } .fs-15 { font-size: 15px; }

/* ---------- 5. Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  height: 50px; padding: 0 24px; border: none; border-radius: var(--r-md);
  font-size: 16px; font-weight: 600; line-height: 1; white-space: nowrap;
  transition: background .15s, border-color .15s, color .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-dark); }
.btn-ghost { background: #fff; color: var(--ink); border: 1.5px solid var(--line-2); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-soft { background: var(--surface); color: var(--ink); }
.btn-soft:hover { background: var(--surface-2); }
.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover { background: #000; }
.btn-sm { height: 44px; font-size: 15px; padding: 0 18px; }
.btn-lg { height: 52px; font-size: 16px; }
.btn-block { width: 100%; }
.btn-icon { width: 44px; height: 44px; padding: 0; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- 6. Поля ввода ---------- */
.input {
  width: 100%; height: 50px; border: 1px solid var(--line-2); border-radius: var(--r-md);
  background: #fff; outline: none; font-size: 15px; padding: 0 16px; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 3px rgba(224,31,38,.12); }
.input-sm { height: 42px; font-size: 14px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field-label { font-size: 13px; font-weight: 600; color: var(--ink); }
.field-error { font-size: 12px; color: var(--brand); min-height: 14px; }
.input.invalid { border-color: var(--brand); }

/* ---------- 7. Карточки / поверхности ---------- */
.card { background: #fff; border-radius: var(--r-2xl); padding: 28px 30px; }
.panel { background: #fff; border-radius: var(--r-xl); padding: 24px 26px; }
.surface { background: var(--surface); border-radius: var(--r-lg); }

/* ---------- 8. Бейджи / чипы ---------- */
.badge { display: inline-flex; align-items: center; justify-content: center;
  min-width: 16px; height: 16px; padding: 0 4px; border-radius: 9999px;
  background: var(--brand); color: #fff; font-size: 10px; font-weight: 700; }
.chip { display: inline-flex; align-items: center; gap: 6px; font-size: 13px;
  color: #4A4F55; background: var(--surface); padding: 6px 12px; border-radius: 9999px; }
.stock { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 600;
  padding: 4px 8px; border-radius: 7px; }
.stock-in { background: var(--green-bg); color: var(--green); }
.stock-out { background: #FBEDED; color: var(--brand); }
.stock-dot { width: 6px; height: 6px; border-radius: 9999px; background: var(--green-2); }
.tag-sale { background: var(--brand); color: #fff; font-size: 11px; font-weight: 700;
  padding: 4px 8px; border-radius: 7px; }

/* ---------- 9. Хедер ---------- */
.promo-bar { background: #fff; border-bottom: 1px solid var(--line); text-align: center;
  padding: 7px 16px; font-size: 13px; color: var(--ink); }
.header { background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-main { display: flex; align-items: center; gap: 20px; padding: 14px 0 8px; }
.logo { display: flex; align-items: center; gap: 11px; cursor: pointer; flex-shrink: 0; }
.logo-mark { width: 42px; height: 42px; border-radius: 11px; background: var(--brand);
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.logo-text { font-size: 25px; font-weight: 800; letter-spacing: -.03em; color: var(--ink); }
.logo-text span { color: var(--brand); }

.cat-btn { display: flex; align-items: center; gap: 9px; background: var(--brand); color: #fff;
  border: none; border-radius: var(--r-md); height: var(--header-h); padding: 0 22px;
  font-size: 16px; font-weight: 600; flex-shrink: 0; }
.cat-btn:hover { background: var(--brand-dark); }

.search { flex: 1; display: flex; align-items: stretch; height: var(--header-h); min-width: 180px; position: relative; }
.search-box { position: relative; flex: 1; display: flex; align-items: center;
  background: #EFEFF1; border-radius: var(--r-md) 0 0 var(--r-md); }
.search-box .lucide { position: absolute; left: 16px; color: var(--muted-2); }
.search input { width: 100%; height: 100%; border: none; background: transparent; outline: none;
  font-size: 16px; color: var(--ink); padding: 0 16px 0 46px; }
.search-btn { width: 64px; background: var(--brand); border: none;
  border-radius: 0 var(--r-md) var(--r-md) 0; display: flex; align-items: center; justify-content: center; }
.search-btn:hover { background: var(--brand-dark); }

.header-actions { display: flex; align-items: center; gap: 26px; flex-shrink: 0; }
.h-action { display: flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer;
  position: relative; color: var(--ink); transition: color .15s; }
.h-action:hover { color: var(--brand); }
.h-action span { font-size: 12px; color: var(--muted); }
.h-action .badge { position: absolute; top: -5px; right: 4px; }

.subnav { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; }
.subnav-links { display: flex; align-items: center; gap: 26px; }
.subnav-links a { font-size: 14px; color: var(--ink); transition: color .15s; }
.subnav-links a:hover { color: var(--brand); }
.subnav-info { display: flex; align-items: center; gap: 24px; font-size: 14px; }
.subnav-phone { font-weight: 600; color: var(--ink); }
.subnav-addr { display: flex; align-items: center; gap: 6px; color: var(--brand); cursor: pointer; }

.burger { display: none; background: none; border: none; color: var(--ink); }

/* ---------- 10. Хлебные крошки ---------- */
.crumbs { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted-2);
  margin-bottom: 14px; flex-wrap: wrap; }
.crumbs a { color: var(--muted); transition: color .15s; }
.crumbs a:hover { color: var(--brand); }
.crumbs .current { color: var(--ink); }

/* ---------- 11. Категории-плитки ---------- */
.cat-tile { background: var(--surface); border-radius: var(--r-lg); padding: 18px 16px;
  display: flex; flex-direction: column; align-items: center; gap: 12px; cursor: pointer;
  transition: background .15s, transform .1s; text-align: center; }
.cat-tile:hover { background: #ECEEF1; transform: translateY(-2px); }
.cat-tile img { width: 100%; height: 110px; object-fit: cover; border-radius: var(--r-md); }
.cat-tile .name { font-size: 15px; font-weight: 600; color: var(--ink); }

/* ---------- 12. Карточка товара ---------- */
.product-card { background: #fff; border-radius: var(--r-xl); padding: 16px; display: flex;
  flex-direction: column; transition: box-shadow .15s, transform .1s; }
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card .thumb { position: relative; height: 170px; background: var(--surface);
  border-radius: 12px; overflow: hidden; cursor: pointer; }
.product-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.product-card .thumb .stock { position: absolute; top: 10px; left: 10px; }
.product-card .fav { position: absolute; top: 10px; right: 10px; width: 32px; height: 32px;
  border-radius: 9999px; background: rgba(255,255,255,.92); border: none; display: flex;
  align-items: center; justify-content: center; color: var(--muted-2); transition: color .15s; }
.product-card .fav:hover { color: var(--brand); }
.product-card .fav.active { color: var(--brand); }
.product-card .meta { font-size: 13px; color: var(--muted-2); margin-top: 12px; }
.product-card .title { font-size: 15px; font-weight: 600; color: var(--ink); margin-top: 4px;
  line-height: 1.3; min-height: 40px; cursor: pointer; }
.product-card .rating { display: flex; align-items: center; gap: 5px; margin-top: 8px; font-size: 13px; }
.product-card .rating .star { color: var(--amber); }
.product-card .prices { margin-top: 14px; min-height: 46px; }
.product-card .old-price { font-size: 13px; color: var(--muted-2); text-decoration: line-through; }
.product-card .price { font-size: 22px; font-weight: 800; color: var(--ink); margin-top: 2px; }

/* ---------- 13. Звёзды ---------- */
.stars { display: inline-flex; gap: 2px; }
.stars .star { color: #E0E1E4; }
.stars .star.on { color: var(--amber); }

/* ---------- 14. Фильтры (сайдбар) ---------- */
.filters { width: 262px; flex-shrink: 0; background: #fff; border-radius: var(--r-xl); padding: 22px; align-self: flex-start; }
.filters .f-title { font-size: 17px; font-weight: 700; margin-bottom: 18px; color: var(--ink); }
.filters .f-group-label { font-size: 14px; font-weight: 600; margin-bottom: 10px; color: var(--ink); }
.filters .f-divider { height: 1px; background: var(--line); margin: 18px 0; }
.check { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: 14px; color: var(--ink); user-select: none; }
.check .box { width: 18px; height: 18px; border-radius: 5px; border: 1.5px solid #C7CACE;
  display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: #fff; transition: background .12s, border-color .12s; }
.check input { display: none; }
.check input:checked + .box { background: var(--brand); border-color: var(--brand); }
.check input:not(:checked) + .box .lucide { display: none; }
.check .count { color: var(--muted-2); margin-left: auto; font-size: 13px; }
.radio { display: flex; align-items: center; gap: 10px; padding: 6px 0; cursor: pointer; font-size: 14px; color: var(--ink); user-select: none; }
.radio .dot { width: 18px; height: 18px; border-radius: 9999px; border: 1.5px solid #C7CACE; flex-shrink: 0; transition: border .12s; }
.radio input { display: none; }
.radio input:checked + .dot { border: 5px solid var(--brand); box-shadow: inset 0 0 0 2px #fff; }
.price-range { display: flex; gap: 10px; }
/* мобильный drawer фильтров — на десктопе скрыт */
.filters-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.filters-close { display: none; width: 38px; height: 38px; align-items: center; justify-content: center;
  border: none; background: var(--surface); border-radius: 9999px; color: var(--ink); }
.mobile-filter-btn { display: none; }
.filters-overlay { display: none; }

/* ---------- 15. Тулбар сортировки ---------- */
.toolbar { display: flex; align-items: center; justify-content: space-between; background: #fff;
  border-radius: var(--r-lg); padding: 14px 18px; margin-bottom: 18px; }
.sort { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--ink); cursor: pointer; position: relative; }
.sort select { border: none; background: transparent; font-size: 14px; font-weight: 600; color: var(--ink); outline: none; cursor: pointer; }

/* ---------- 16. Каунтер количества ---------- */
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-2); border-radius: var(--r-md); overflow: hidden; }
.qty button { width: 42px; height: 48px; display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: var(--muted); background: #fff; border: none; }
.qty button:hover { background: var(--surface); }
.qty .val { width: 42px; text-align: center; font-size: 16px; font-weight: 600; }

/* ---------- 17. Баннеры / промо ---------- */
.hero { position: relative; height: 320px; border-radius: var(--r-xl); overflow: hidden; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .hero-overlay { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(22,24,28,.82) 0%, rgba(22,24,28,.45) 45%, rgba(22,24,28,0) 75%); }
.hero .hero-content { position: relative; z-index: 2; max-width: 540px; padding: 48px; height: 100%; display: flex; flex-direction: column; justify-content: center; }
.hero h1 { color: #fff; font-size: 40px; font-weight: 800; line-height: 1.05; }
.hero p { color: rgba(255,255,255,.85); font-size: 17px; margin: 14px 0 26px; }

.promo-card { border: 1px solid var(--line); border-radius: var(--r-xl); padding: 20px; position: relative;
  cursor: pointer; overflow: hidden; transition: border-color .15s; display: flex; flex-direction: column; }
.promo-card:hover { border-color: var(--brand); }
.promo-card .p-title { font-size: 18px; font-weight: 700; color: var(--ink); padding-right: 30px; }
.promo-card .p-desc { font-size: 13px; color: var(--muted); margin: 8px 0 16px; line-height: 1.4; }
.promo-card .p-img { height: 110px; border-radius: 12px; overflow: hidden; margin-top: auto; }
.promo-card .p-img img { width: 100%; height: 100%; object-fit: cover; }
.promo-icon { position: absolute; top: 16px; right: 16px; width: 30px; height: 30px; border-radius: 9999px;
  background: var(--amber-bg); display: flex; align-items: center; justify-content: center; color: var(--amber); }

/* dark VIN card */
.vin-card { background: var(--ink-2); border-radius: var(--r-2xl); padding: 28px 30px; }
.vin-card h3 { color: #fff; font-size: 24px; }
.vin-card .sub { color: var(--muted-2); font-size: 15px; margin: 6px 0 22px; }
.vin-row { display: flex; gap: 12px; }

/* ---------- 18. Чат-мок ---------- */
.chat { width: 250px; flex-shrink: 0; background: #F7F7F9; border-radius: var(--r-xl); padding: 14px;
  box-shadow: var(--shadow-md); display: flex; flex-direction: column; gap: 8px; }
.chat .bubble { font-size: 13px; padding: 8px 12px; max-width: 85%; }
.chat .bubble.in { align-self: flex-start; background: var(--surface-2); color: var(--ink); border-radius: 14px 14px 14px 4px; }
.chat .bubble.out { align-self: flex-end; background: var(--ink); color: #fff; border-radius: 14px 14px 4px 14px; }

/* ---------- 19. Сетка категорий каталога ---------- */
.cat-sidebar-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  cursor: pointer; transition: background .12s; color: var(--ink); }
.cat-sidebar-item:hover, .cat-sidebar-item.active { background: var(--surface-2); }
.cat-sidebar-item .ic { width: 30px; height: 30px; display: flex; align-items: center; justify-content: center; color: var(--muted); }
.cat-sidebar-item .label { flex: 1; font-size: 15px; font-weight: 500; }
.cat-sidebar-item.active .label { font-weight: 600; }

/* ---------- 20. Таблица характеристик ---------- */
.spec-row { display: flex; justify-content: space-between; padding: 9px 0; border-bottom: 1px solid #F0F0F2; font-size: 14px; }
.spec-row:last-child { border-bottom: none; }
.spec-row .k { color: var(--muted-2); }
.spec-row .v { color: var(--ink); font-weight: 500; }

/* ---------- 21. Галерея товара ---------- */
.gallery-main { height: 400px; background: #fff; border-radius: var(--r-xl); overflow: hidden; position: relative; }
.gallery-main img { width: 100%; height: 100%; object-fit: cover; }
.gallery-main .stock { position: absolute; top: 16px; left: 16px; font-size: 12px; padding: 5px 10px; }
.gallery-thumbs { display: flex; gap: 12px; margin-top: 12px; }
.gallery-thumbs .gt { width: 78px; height: 78px; background: #fff; border-radius: 12px; overflow: hidden;
  border: 2px solid transparent; cursor: pointer; }
.gallery-thumbs .gt.active { border-color: var(--brand); }
.gallery-thumbs .gt img { width: 100%; height: 100%; object-fit: cover; }

/* ---------- 22. Корзина / заказы ---------- */
.cart-item { display: flex; align-items: center; gap: 18px; padding: 20px 0; border-bottom: 1px solid #F0F0F2; }
.cart-item:last-child { border-bottom: none; }
.cart-item .ci-img { width: 84px; height: 84px; background: var(--surface); border-radius: 12px; overflow: hidden; flex-shrink: 0; }
.cart-item .ci-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .ci-sum { width: 120px; text-align: right; font-size: 18px; font-weight: 700; color: var(--ink); }
.cart-item .ci-remove { width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: #B6BBC0; border-radius: var(--r-sm); border: none; background: none; transition: .12s; }
.cart-item .ci-remove:hover { color: var(--brand); background: #FBEDED; }
.summary { width: 330px; flex-shrink: 0; background: #fff; border-radius: var(--r-2xl); padding: 24px; align-self: flex-start; position: sticky; top: 90px; }
.summary-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px; }
.summary-row .k { color: var(--muted); }
.summary-row .v { color: var(--ink); font-weight: 500; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 20px; }
.summary-total .t-label { font-size: 16px; font-weight: 700; }
.summary-total .t-val { font-size: 26px; font-weight: 800; letter-spacing: -.02em; }
.hr { height: 1px; background: var(--line); margin: 14px 0; }

/* ---------- 23. Радио-опции (доставка/оплата) ---------- */
.option { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1.5px solid #E8E9EB;
  border-radius: 12px; cursor: pointer; margin-bottom: 10px; transition: border-color .12s; }
.option:last-child { margin-bottom: 0; }
.option.active { border-color: var(--brand); }
.option .dot { width: 20px; height: 20px; border-radius: 9999px; border: 1.5px solid #C7CACE; flex-shrink: 0; }
.option.active .dot { border: 6px solid var(--brand); box-shadow: inset 0 0 0 2px #fff; }
.option .o-label { flex: 1; font-size: 15px; font-weight: 500; color: var(--ink); }

/* ---------- 24. Пустые состояния ---------- */
.empty { background: #fff; border-radius: var(--r-2xl); padding: 64px; display: flex;
  flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.empty .e-ic { width: 90px; height: 90px; border-radius: 9999px; background: var(--surface);
  display: flex; align-items: center; justify-content: center; color: #B6BBC0; }
.empty .e-title { font-size: 20px; font-weight: 700; color: var(--ink); }

/* ---------- 25. ЛК (аккаунт) ---------- */
.account-grid { display: grid; grid-template-columns: 260px 1fr; gap: 24px; align-items: start; }
.account-nav { background: #fff; border-radius: var(--r-xl); padding: 12px; }
.account-nav a { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-radius: 12px;
  font-size: 15px; color: var(--ink); transition: background .12s; }
.account-nav a:hover { background: var(--surface); }
.account-nav a.active { background: var(--surface-2); font-weight: 600; }
.account-nav a.danger { color: var(--brand); }
.user-head { display: flex; align-items: center; gap: 14px; padding: 16px 14px 18px; border-bottom: 1px solid var(--line); margin-bottom: 8px; }
.avatar { width: 46px; height: 46px; border-radius: 9999px; background: var(--brand); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 18px; flex-shrink: 0; }

.order-card { background: #fff; border-radius: var(--r-xl); padding: 22px 24px; margin-bottom: 16px; }
.order-head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 16px; border-bottom: 1px solid var(--line); }
.order-status { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 7px; }
.status-new { background: var(--amber-bg); color: var(--amber); }
.status-way { background: #E6F0FF; color: #2563EB; }
.status-done { background: var(--green-bg); color: var(--green); }

.car-card { background: #fff; border-radius: var(--r-xl); padding: 20px 22px; display: flex;
  align-items: center; gap: 16px; margin-bottom: 14px; }
.car-card .c-ic { width: 54px; height: 54px; border-radius: 12px; background: var(--surface);
  display: flex; align-items: center; justify-content: center; color: var(--brand); flex-shrink: 0; }

/* ---------- 26. Авторизация ---------- */
.auth-wrap { max-width: 440px; margin: 60px auto 0; }
.auth-card { background: #fff; border-radius: var(--r-2xl); padding: 40px 36px; }
.auth-tabs { display: flex; background: var(--surface); border-radius: var(--r-md); padding: 4px; margin-bottom: 24px; }
.auth-tabs button { flex: 1; height: 42px; border: none; background: none; border-radius: 8px; font-size: 15px; font-weight: 600; color: var(--muted); }
.auth-tabs button.active { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }

/* ---------- 27. Тост ---------- */
.toast-wrap { position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%); z-index: 200;
  display: flex; flex-direction: column; gap: 10px; align-items: center; }
.toast { display: flex; align-items: center; gap: 10px; background: var(--ink); color: #fff;
  padding: 13px 20px; border-radius: 12px; font-size: 14px; font-weight: 500; box-shadow: var(--shadow-lg);
  animation: toastIn .25s ease; }
.toast .lucide { color: var(--green-2); }

/* ---------- 28. Футер ---------- */
.footer { background: #fff; border-top: 1px solid var(--line); margin-top: 48px; }
.footer-main { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 32px; padding: 44px 0 32px; }
.footer h4 { font-size: 15px; font-weight: 700; margin-bottom: 16px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { font-size: 14px; color: var(--muted); }
.footer ul a:hover { color: var(--brand); }
.footer-bottom { border-top: 1px solid var(--line); padding: 20px 0; display: flex;
  align-items: center; justify-content: space-between; font-size: 13px; color: var(--muted-2); }
.pay-icons { display: flex; gap: 10px; align-items: center; }
.pay-icons span { width: 44px; height: 28px; border: 1px solid var(--line-2); border-radius: 6px;
  display: flex; align-items: center; justify-content: center; font-size: 10px; font-weight: 700; color: var(--muted); }

/* ---------- 29. Мега-меню каталога (выпадашка) ---------- */
.mega { position: absolute; top: 100%; left: 0; right: 0; background: #fff; border-bottom: 1px solid var(--line);
  box-shadow: var(--shadow-lg); z-index: 49; animation: dropIn .18s ease; display: none; }
.mega.open { display: block; }
.mega-inner { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 28px 0; }
.mega-nav { display: none; }
.mega-nav a { display: flex; align-items: center; gap: 12px; padding: 13px 6px; font-size: 16px;
  font-weight: 500; color: var(--ink); border-top: 1px solid var(--line); }
.mega-nav a .lucide { color: var(--muted); }

/* ---------- 30. Спиннер / скелетон ---------- */
.spinner { width: 20px; height: 20px; border: 2.5px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 9999px; animation: spin .7s linear infinite; }

/* ---------- 31. Адаптив ---------- */
@media (max-width: 1100px) {
  .grid-4 { grid-template-columns: repeat(3, 1fr); }
  .footer-main { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 900px) {
  .subnav { display: none; }
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .account-grid { grid-template-columns: 1fr; }
  .summary { width: 100%; position: static; }
  .hero { height: 260px; }
  .hero h1 { font-size: 30px; }
  .mega-inner { grid-template-columns: repeat(2, 1fr); }
  .mega-nav { display: flex; flex-direction: column; padding-bottom: 10px; }
}
@media (max-width: 720px) {
  .header-main { flex-wrap: wrap; gap: 12px 14px; padding-top: 12px; }
  .header-actions .h-action span { display: none; }
  .header-actions { gap: 20px; margin-left: auto; }
  .header-actions .h-action.hide-mobile { display: none; }
  .search { order: 10; flex-basis: 100%; min-width: 0; }
  .cat-btn span.cat-label { display: none; }
  .cat-btn { padding: 0 16px; }
  .h1 { font-size: 26px; }
  .row.responsive { flex-direction: column; }
  .catalog-card { align-items: stretch !important; }
  .catalog-card img { width: 100% !important; height: 170px; }
  .grid-2 { grid-template-columns: 1fr; }
  .vin-row { flex-direction: column; }
  .chat { display: none; }

  /* VIN+эксперт: секция в один столбец, карточка эксперта — фото-баннером сверху */
  .expert-grid { grid-template-columns: 1fr; }
  .expert-card { flex-direction: column-reverse; align-items: stretch; }
  .expert-copy { padding: 22px 22px 24px; }
  .expert-photo { width: 100%; height: 150px; }
  /* листинг категории: контентная колонка тянется на всю ширину при схлопывании */
  .row.responsive > .flex-1 { width: 100%; min-width: 0; }
  /* тулбар (фильтры + сортировка) переносится, чтобы select не вылезал */
  .toolbar { flex-wrap: wrap; gap: 10px 14px; }

  /* Фильтры → выезжающая панель (drawer) */
  .filters {
    position: fixed; top: 0; left: 0; bottom: 0;
    width: 300px; max-width: 86vw; z-index: 130;
    border-radius: 0; overflow-y: auto;
    transform: translateX(-100%); transition: transform .25s ease;
    box-shadow: var(--shadow-lg); align-self: stretch;
  }
  .filters.open { transform: none; }
  .filters-close { display: flex; }
  .mobile-filter-btn { display: inline-flex; }
  .filters-overlay {
    display: block; position: fixed; inset: 0; background: rgba(0,0,0,.45);
    z-index: 120; opacity: 0; pointer-events: none; transition: opacity .2s;
  }
  .filters-overlay.open { opacity: 1; pointer-events: auto; }
  body.drawer-open { overflow: hidden; }
}
@media (max-width: 560px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .subnav-info { display: none; }
  .footer-main { grid-template-columns: 1fr; }
  .container { padding-left: 14px; padding-right: 14px; }
  /* строка корзины в 2 ряда: [фото][инфо] / [кол-во ... сумма][удалить] */
  .cart-item { flex-wrap: wrap; gap: 12px 14px; }
  .cart-item > .flex-1 { flex-basis: calc(100% - 98px); }
  .cart-item .ci-sum { width: auto; margin-left: auto; }
}
@media (max-width: 380px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .product-card { padding: 12px; }
  .product-card .title { font-size: 14px; }
  .product-card .price { font-size: 19px; }
  .logo-text { font-size: 21px; }
  .logo-mark { width: 38px; height: 38px; }
}
