/* =========================================================
   AUTOPARTS — design system (mobile-first)
   ========================================================= */
:root {
  --navy: #0b1526;
  --navy-2: #13213a;
  --navy-3: #1c2d4b;
  --blue: #1e6fd9;
  --blue-hover: #1557ad;
  --blue-soft: #eaf2fd;
  --bg: #f4f6fa;
  --card: #ffffff;
  --text: #16243a;
  --muted: #64748b;
  --border: #e3e8f0;
  --border-strong: #cfd7e3;
  --green: #138a4b;
  --green-soft: #e6f6ec;
  --orange: #b45309;
  --orange-soft: #fff4e5;
  --red: #dc2626;
  --accent: #0b1526;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 14px;
  --shadow-sm: 0 1px 2px rgba(15, 30, 60, .06);
  --shadow: 0 6px 20px rgba(15, 30, 60, .08);
  --gap: 16px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}

*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { font-family: var(--font); color: var(--text); background: var(--bg); line-height: 1.5; font-size: 15px; -webkit-font-smoothing: antialiased; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { line-height: 1.25; font-weight: 700; letter-spacing: -.01em; }
h1 { font-size: 26px; }
b, strong { font-weight: 700; }
.container { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.site-main { min-height: 50vh; padding-bottom: 8px; }
.muted { color: var(--muted); }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* ---------- Forms (global) ---------- */
input[type="text"], input[type="email"], input[type="password"], input[type="number"],
input[type="tel"], input[type="search"], input[type="url"], input[type="date"], input[type="file"],
select, textarea {
  width: 100%; padding: 10px 12px; font: inherit; font-size: 14px; color: var(--text);
  background: #fff; border: 1px solid var(--border-strong); border-radius: var(--r-sm);
  transition: border-color .15s, box-shadow .15s;
}
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(30, 111, 217, .15); }
textarea { resize: vertical; font-family: inherit; }
label { font-size: 13px; font-weight: 600; color: var(--text); }
label.checkbox { display: flex !important; align-items: center; gap: 8px; font-weight: 500; cursor: pointer; }
input[type="checkbox"], input[type="radio"] { width: 16px; height: 16px; accent-color: var(--blue); flex-shrink: 0; }

/* ---------- Buttons ---------- */
.btn-add, .btn-buy, .btn-filter, .btn-outline, .btn-remove {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  font: inherit; font-size: 14px; font-weight: 600; line-height: 1.2; cursor: pointer;
  border-radius: var(--r-sm); padding: 10px 16px; border: 1px solid transparent;
  transition: background .15s, border-color .15s, color .15s; white-space: nowrap; text-align: center;
}
.btn-add, .btn-filter { background: var(--blue); color: #fff; }
.btn-add:hover, .btn-filter:hover { background: var(--blue-hover); }
.btn-buy { background: var(--navy); color: #fff; padding: 14px 28px; font-size: 15px; border-radius: var(--r); }
.btn-buy:hover { background: var(--navy-3); }
.btn-outline { background: #fff; color: var(--text); border-color: var(--border-strong); }
.btn-outline:hover { border-color: var(--blue); color: var(--blue); }
.btn-remove { background: transparent; color: var(--muted); border-color: var(--border); padding: 8px 11px; }
.btn-remove:hover { color: var(--red); border-color: var(--red); background: #fef2f2; }

/* ---------- Header ---------- */
.site-header { background: #fff; border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 50; }
.topbar { display: none; background: var(--navy); color: #c3cee0; font-size: 13px; }
.topbar-inner { display: flex; justify-content: space-between; align-items: center; padding-top: 7px; padding-bottom: 7px; gap: 12px; }
.topbar-links { display: flex; gap: 20px; flex-wrap: wrap; }
.topbar-contacts { display: flex; gap: 20px; }
.topbar a { color: #c3cee0; transition: color .15s; }
.topbar a:hover { color: #fff; }

.mainbar { background: #fff; }
.mainbar-inner { display: grid; grid-template-columns: auto 1fr auto; grid-template-areas: "burger logo actions" "search search search"; align-items: center; gap: 10px 12px; padding-top: 10px; padding-bottom: 10px; }
.burger { grid-area: burger; display: flex; flex-direction: column; justify-content: center; gap: 4px; width: 40px; height: 40px; padding: 10px; border: 1px solid var(--border); border-radius: var(--r-sm); cursor: pointer; }
.burger span { display: block; height: 2px; background: var(--navy); border-radius: 2px; }
.logo { grid-area: logo; font-size: 22px; font-weight: 800; letter-spacing: -.5px; color: var(--navy); white-space: nowrap; }
.logo span, .footer-logo span { color: var(--blue); }

.searchbar { grid-area: search; position: relative; display: flex; min-width: 0; }
.searchbar-icon { position: absolute; left: 13px; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.searchbar input { flex: 1; min-width: 0; padding: 11px 12px 11px 40px; border: 1px solid var(--border-strong); border-right: 0; border-radius: var(--r) 0 0 var(--r); font-size: 15px; background: var(--bg); }
.searchbar input:focus { background: #fff; box-shadow: none; }
.searchbar button { padding: 0 20px; background: var(--blue); color: #fff; border: 0; border-radius: 0 var(--r) var(--r) 0; font: inherit; font-weight: 600; cursor: pointer; }
.searchbar button:hover { background: var(--blue-hover); }

.header-actions { grid-area: actions; display: flex; align-items: center; gap: 8px; }
.hdr-link { display: none; font-weight: 600; font-size: 14px; color: var(--blue); padding: 8px 4px; white-space: nowrap; }
.hdr-link:hover { color: var(--blue-hover); }
.cart-btn { position: relative; display: inline-flex; align-items: center; gap: 8px; height: 42px; padding: 0 11px; border: 1px solid var(--border); border-radius: var(--r); font-weight: 600; font-size: 14px; white-space: nowrap; color: var(--navy); transition: border-color .15s, color .15s, background .15s; }
.cart-btn:hover { border-color: var(--blue); color: var(--blue); }
.cart-btn svg { flex-shrink: 0; }
.cart-btn-text { display: none; }
.cart-btn-primary { background: var(--navy); border-color: var(--navy); color: #fff; }
.cart-btn-primary:hover { background: var(--navy-3); border-color: var(--navy-3); color: #fff; }
.cart-count { background: var(--blue); color: #fff; border-radius: 999px; min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.cart-btn-primary .cart-count { position: absolute; top: -7px; right: -7px; border: 2px solid #fff; }

/* nav: mobile drawer (CSS-only toggle) */
.nav-toggle { display: none; }
.navmenu { display: none; background: var(--navy); }
.nav-toggle:checked + .navmenu { display: block; }
.navmenu-inner { display: flex; flex-direction: column; padding-top: 6px; padding-bottom: 10px; }
.navmenu-inner a { display: block; padding: 11px 4px; color: #d3dcea; font-size: 15px; font-weight: 500; border-bottom: 1px solid var(--navy-2); }
.navmenu-inner a:hover { color: #fff; }
.dropdown { position: relative; }
.dropbtn { display: flex !important; align-items: center; gap: 6px; }
.caret { font-size: 11px; opacity: .7; }
.dropdown-content { display: none; padding-left: 14px; }
.dropdown:hover .dropdown-content, .dropdown:focus-within .dropdown-content { display: block; }
.dropdown-content a { font-size: 14px; color: #aebbd0; }

/* ---------- Hero ---------- */
.hero { position: relative; overflow: hidden; margin: 0 -16px; color: #fff; background: radial-gradient(1200px 400px at 85% -10%, rgba(30, 111, 217, .55), transparent 60%), linear-gradient(160deg, #0b1526 0%, #13213a 70%, #18305a 100%); }
.hero-inner { max-width: 1240px; margin: 0 auto; padding: 40px 16px 44px; }
.hero h1 { font-size: 26px; font-weight: 800; line-height: 1.2; margin-bottom: 12px; max-width: 760px; }
.hero-sub { font-size: 16px; color: #b6c4da; margin-bottom: 24px; max-width: 620px; }
.hero-search { display: flex; flex-direction: column; gap: 8px; max-width: 680px; }
.hero-search input { flex: 1; padding: 15px 18px; border: 0; border-radius: var(--r); font-size: 16px; }
.hero-search button { padding: 15px 26px; background: var(--blue); color: #fff; border: 0; border-radius: var(--r); font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.hero-search button:hover { background: var(--blue-hover); }

/* ---------- Sections ---------- */
.section { margin: 36px 0; }
.section-title { font-size: 21px; font-weight: 700; margin-bottom: 16px; letter-spacing: -.01em; }
.service-grid, .stats-grid, .brand-grid, .cat-grid, .partner-grid, .testimonial-grid, .news-grid { display: grid; gap: 12px; }
.service-grid { grid-template-columns: 1fr; }
.service-card { position: relative; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.service-card h3 { font-size: 16px; margin-bottom: 6px; color: var(--navy); }
.service-card p { font-size: 14px; color: var(--muted); }

.stats-grid { grid-template-columns: repeat(2, 1fr); background: var(--navy); border-radius: var(--r-lg); padding: 8px; gap: 0; }
.stat { padding: 18px 12px; text-align: center; }
.stat-num { font-size: 28px; font-weight: 800; color: #fff; line-height: 1.1; }
.stat-label { font-size: 13px; color: #9fb0c9; margin-top: 4px; }
.about-strip .stats-grid { margin-top: 0; }
.stats-compact .stat-num { font-size: 26px; }

.brand-grid { grid-template-columns: repeat(2, 1fr); }
.brand-card { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 120px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px 12px; text-align: center; transition: border-color .15s, box-shadow .15s, transform .15s; }
.brand-card:hover { border-color: var(--blue); box-shadow: var(--shadow); transform: translateY(-2px); }
.brand-badge { display: inline-flex; align-items: center; justify-content: center; min-width: 56px; height: 56px; padding: 0 10px; border-radius: 50%; background: var(--blue-soft); color: var(--navy); font-weight: 800; font-size: 15px; letter-spacing: .02em; }
.brand-name { font-weight: 600; font-size: 14px; }

.cat-grid { grid-template-columns: repeat(2, 1fr); }
.cat-card { display: flex; align-items: center; justify-content: space-between; gap: 8px; min-height: 60px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 14px 16px; font-weight: 600; font-size: 14px; transition: border-color .15s, color .15s; }
.cat-card::after { content: "→"; color: var(--muted); transition: transform .15s, color .15s; }
.cat-card:hover { border-color: var(--blue); color: var(--blue); }
.cat-card:hover::after { color: var(--blue); transform: translateX(3px); }

.partner-grid { grid-template-columns: repeat(2, 1fr); }
.partner-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r); padding: 20px; text-align: center; font-weight: 600; }
.testimonial-grid { grid-template-columns: 1fr; }
.testimonial-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; display: flex; flex-direction: column; justify-content: space-between; gap: 12px; }
.testimonial-card p { font-size: 15px; }
.testimonial-card .muted { font-size: 13px; }
.seo-block { font-size: 14px; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; }
.seo-block .section-title { font-size: 17px; color: var(--text); }

/* ---------- Product card ---------- */
.product-grid { display: grid; grid-template-columns: 1fr; gap: 12px; }
.product-card { display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; transition: border-color .15s, box-shadow .15s; }
.product-card:hover { border-color: var(--border-strong); box-shadow: var(--shadow); }
.product-photo { margin: -4px -4px 12px; }
.product-photo img { width: 100%; height: 170px; object-fit: contain; background: #f8fafc; border-radius: var(--r); }
.product-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.article { display: inline-block; font-family: var(--mono); font-size: 12.5px; font-weight: 600; color: var(--navy); background: var(--bg); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 2px 8px; letter-spacing: .02em; }
.badge-discount { font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; color: var(--orange); background: var(--orange-soft); border-radius: 999px; padding: 3px 9px; }
.product-name { font-size: 15px; font-weight: 600; line-height: 1.35; margin-bottom: 4px; }
.product-name a:hover { color: var(--blue); }
.product-meta { font-size: 13px; margin-bottom: 12px; }
.product-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-top: auto; }
.price { font-size: 20px; font-weight: 800; color: var(--navy); white-space: nowrap; }
.old-price { font-size: 14px; color: var(--muted); text-decoration: line-through; }
.product-stock { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 500; margin: 6px 0 12px; }
.product-stock::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
.in-stock { color: var(--green); }
.out-stock { color: var(--orange); }
.product-actions { display: flex; gap: 8px; }
.product-actions .btn-add { flex: 1; }

/* ---------- Catalog ---------- */
.catalog-layout { display: grid; grid-template-columns: 1fr; gap: 20px; margin-top: 20px; }
.filters { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; align-self: start; }
.filters h3 { font-size: 16px; margin-bottom: 4px; }
.filters label { display: block; margin: 14px 0 6px; color: var(--muted); font-size: 12px; text-transform: uppercase; letter-spacing: .04em; }
.filters label.checkbox { margin-top: 16px; text-transform: none; letter-spacing: 0; font-size: 14px; color: var(--text); }
.btn-filter { width: 100%; margin-top: 18px; padding: 12px; }
.catalog-head { display: flex; align-items: center; gap: 8px 14px; flex-wrap: wrap; }
.catalog-head h2 { font-size: 22px; }
.sort-form { margin-left: auto; }
.sort-form select { width: auto; padding: 8px 32px 8px 10px; font-size: 13px; }
.catalog-tools { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; margin: 14px 0 16px; padding-bottom: 14px; border-bottom: 1px solid var(--border); }
.catalog-tools a { color: var(--blue); font-size: 14px; font-weight: 600; }
.catalog-tools a:hover { color: var(--blue-hover); }
.catalog-tools .btn-outline { margin-left: auto; color: var(--text); padding: 8px 14px; font-size: 13px; }

.pagination { display: flex; align-items: center; justify-content: center; gap: 10px; margin-top: 28px; flex-wrap: wrap; }
.page-link { border: 1px solid var(--border-strong); background: #fff; padding: 9px 16px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; color: var(--text); }
.page-link:hover { border-color: var(--blue); color: var(--blue); }
.page-link.disabled { color: var(--muted); opacity: .5; pointer-events: none; }
.page-info { color: var(--muted); font-size: 14px; padding: 0 6px; }
.empty { text-align: center; padding: 56px 20px; color: var(--muted); background: var(--card); border: 1px dashed var(--border-strong); border-radius: var(--r-lg); }
.empty a { color: var(--blue); font-weight: 600; }

/* ---------- Product page ---------- */
.product-page { margin-top: 20px; }
.product-main { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin-bottom: 32px; }
.product-info h1 { font-size: 22px; margin: 10px 0 6px; }
.article.big { font-size: 14px; padding: 4px 10px; }
.big-photo { margin: 0 0 16px; }
.big-photo img { height: auto; max-height: 360px; width: 100%; object-fit: contain; }
.desc { margin: 14px 0; color: var(--text); font-size: 15px; max-width: 720px; }
.big-price { margin: 18px 0 4px; }
.big-price .price { font-size: 30px; }
.big-actions { margin-top: 8px; }
.big-actions .btn-add { padding: 14px 32px; font-size: 16px; border-radius: var(--r); }
.compat { margin-top: 16px; font-size: 13px; padding: 12px 14px; background: var(--blue-soft); border-radius: var(--r); color: var(--navy-3); }

/* ---------- Tables (div-grid) / cart / admin ---------- */
.cart-table { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 6px 16px; margin-top: 16px; }
.cart-row { display: grid; grid-auto-flow: row; grid-template-columns: 1fr 1fr; gap: 6px 12px; align-items: center; padding: 14px 0; border-bottom: 1px solid var(--border); font-size: 14px; }
.cart-row:last-of-type { border-bottom: 0; }
.cart-row > * { min-width: 0; overflow-wrap: anywhere; }
.cart-head { display: none; font-weight: 600; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); }
.cart-row form { display: flex !important; align-items: center; gap: 6px; }
.cart-row input[type="number"] { width: 70px !important; padding: 7px 8px; }
.cart-total { display: flex; justify-content: flex-end; align-items: baseline; gap: 14px; padding: 18px 0; font-size: 16px; border-top: 1px solid var(--border); }
.cart-table > .btn-buy { width: 100%; margin-bottom: 14px; }
.checkout-form { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; margin-top: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr; gap: 0 24px; }
.form-grid label { display: block; margin: 14px 0 6px; }
.checkout-form .btn-buy { width: 100%; }
.done-block { text-align: center; padding: 56px 20px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); margin-top: 24px; }
.done-block h1 { margin-bottom: 12px; }
.done-block p { margin-bottom: 8px; }
.done-block .btn-add { margin-top: 16px; }

/* ---------- Auth / ЛК / VIN ---------- */
.auth-wrap { display: flex; justify-content: center; margin: 32px 0; }
.auth-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 24px; width: 100%; max-width: 460px; box-shadow: var(--shadow-sm); }
.auth-card h1, .auth-card h2 { margin-bottom: 8px; }
.auth-card label { display: block; margin: 14px 0 6px; }
.auth-card .btn-add { width: 100%; margin-top: 20px; padding: 12px; }
.alert, .alert-error, .alert-ok { padding: 11px 14px; border-radius: var(--r-sm); margin-bottom: 14px; font-size: 14px; border: 1px solid var(--border); background: var(--blue-soft); }
.alert-error { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }
.alert-ok { background: var(--green-soft); color: #15803d; border-color: #bbf7d0; }
.profile-form { max-width: 640px; }
.profile-form .btn-add { margin-top: 16px; }

.lk-head { display: flex; justify-content: space-between; align-items: center; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.lk-grid { display: grid; grid-template-columns: 1fr; gap: 16px; margin-top: 16px; }
.lk-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.lk-card h3 { font-size: 16px; margin-bottom: 12px; }
.lk-card label { display: block; margin: 12px 0 6px; }
.vin-add { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.vin-add input { flex: 1; min-width: 90px; }
.garage-list { list-style: none; }
.garage-list li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: 14px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.garage-list li:last-child { border-bottom: 0; }
.vin-result { margin-top: 28px; }
.vin-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 20px; }
.vin-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 14px; font-size: 14px; }

.order-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 16px; margin-bottom: 12px; }
.order-head { display: flex; gap: 8px 16px; align-items: center; flex-wrap: wrap; }
.order-items { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; font-size: 13px; color: var(--muted); }
.admin-links { display: flex; gap: 10px; margin-top: 20px; flex-wrap: wrap; }
.admin-bar { margin-bottom: 16px; }
.admin-bar input, .admin-bar select { width: auto; }

/* ---------- Content pages / news ---------- */
.page-block { margin-top: 24px; min-height: 40vh; }
.page-content { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 22px; max-width: 860px; }
.page-content h2 { font-size: 18px; margin: 20px 0 8px; }
.page-content h2:first-child { margin-top: 0; }
.page-content p { margin: 8px 0; font-size: 15px; line-height: 1.65; }
.page-content ul { margin: 8px 0 8px 20px; }
.page-content li { margin: 4px 0; font-size: 15px; }
.page-content a { color: var(--blue); }
.news-grid { grid-template-columns: 1fr; }
.news-list { display: grid; grid-template-columns: 1fr; gap: 12px; max-width: 860px; }
.news-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); padding: 18px; }
.news-card h3 { font-size: 16px; margin-bottom: 4px; }
.news-card .muted { font-size: 13px; margin-bottom: 8px; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy); color: #b6c4da; margin-top: 56px; }
.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 20px; padding-top: 40px; padding-bottom: 32px; }
.footer-grid > div:first-child { grid-column: 1 / -1; }
.footer-logo { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 10px; }
.site-footer .muted { color: #8496b3; font-size: 14px; }
.site-footer h4 { color: #fff; margin-bottom: 12px; font-size: 14px; text-transform: uppercase; letter-spacing: .05em; }
.site-footer a { display: block; color: #b6c4da; padding: 4px 0; font-size: 14px; }
.site-footer a:hover { color: #fff; }
.footer-phone { font-size: 17px !important; font-weight: 700; color: #fff !important; }
.footer-bottom { display: flex; justify-content: space-between; padding-top: 16px; padding-bottom: 20px; border-top: 1px solid var(--navy-3); font-size: 13px; flex-wrap: wrap; gap: 8px; }
.footer-bottom a { display: inline; }

/* =========================================================
   Breakpoints: ≥640 (large phone) · ≥768 (tablet) · ≥1024 (desktop)
   ========================================================= */
@media (min-width: 640px) {
  .container { padding: 0 20px; }
  .hero { margin: 0 -20px; }
  .hero-inner { padding: 56px 20px 60px; }
  .hero h1 { font-size: 32px; }
  .hero-search { flex-direction: row; gap: 0; background: #fff; border-radius: var(--r); padding: 5px; box-shadow: 0 10px 30px rgba(0, 0, 0, .25); }
  .hero-search input { padding: 12px 14px; }
  .hero-search button { border-radius: var(--r-sm); }
  .service-grid { grid-template-columns: repeat(2, 1fr); }
  .brand-grid { grid-template-columns: repeat(3, 1fr); }
  .cat-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
  .testimonial-grid { grid-template-columns: repeat(2, 1fr); }
  .news-grid { grid-template-columns: repeat(2, 1fr); }
  .form-grid { grid-template-columns: 1fr 1fr; }
  .cart-btn-text { display: inline; }
  .cart-btn { padding: 0 14px; }
  .cart-btn-primary .cart-count { position: static; border: 0; }
}

@media (min-width: 768px) {
  .stats-grid { grid-template-columns: repeat(4, 1fr); padding: 12px; }
  .stat + .stat { border-left: 1px solid var(--navy-3); }
  .cart-row { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: minmax(0, 1fr); padding: 12px 0; }
  .cart-head { display: grid; padding: 12px 0; border-bottom: 1px solid var(--border-strong) !important; }
  .cart-table > .btn-buy { width: auto; float: right; }
  .cart-table::after { content: ""; display: block; clear: both; }
  .checkout-form .btn-buy { width: auto; }
  .lk-grid { grid-template-columns: 1fr 1fr; }
  .product-main { padding: 28px; }
  .product-info h1 { font-size: 26px; }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .footer-grid > div:first-child { grid-column: auto; padding-right: 24px; }
  .section { margin: 48px 0; }
  .section-title { font-size: 24px; }
}

@media (min-width: 1024px) {
  h1 { font-size: 30px; }
  .topbar { display: block; }
  .mainbar-inner { grid-template-columns: auto 1fr auto; grid-template-areas: "logo search actions"; gap: 28px; padding-top: 14px; padding-bottom: 14px; }
  .burger { display: none; }
  .logo { font-size: 26px; }
  .hdr-link { display: inline-block; }
  .navmenu, .nav-toggle:checked + .navmenu { display: block; }
  .navmenu-inner { flex-direction: row; align-items: stretch; gap: 2px; padding-top: 0; padding-bottom: 0; }
  .navmenu-inner a { padding: 12px 16px; font-size: 14px; border-bottom: 0; white-space: nowrap; transition: background .15s, color .15s; }
  .navmenu-inner a:hover { background: var(--navy-2); }
  .dropdown > .dropbtn { background: var(--blue); color: #fff; font-weight: 600; padding-left: 20px; padding-right: 20px; }
  .dropdown > .dropbtn:hover { background: var(--blue-hover); }
  .dropdown-content { position: absolute; top: 100%; left: 0; min-width: 240px; padding: 6px 0; background: #fff; border: 1px solid var(--border); border-radius: 0 0 var(--r) var(--r); box-shadow: var(--shadow); z-index: 60; }
  .dropdown-content a { color: var(--text); padding: 10px 18px; }
  .dropdown-content a:hover { background: var(--bg); color: var(--blue); }

  .hero { margin: 0; border-radius: 0 0 var(--r-lg) var(--r-lg); }
  .hero-inner { padding: 72px 48px 80px; }
  .hero h1 { font-size: 40px; }
  .hero-sub { font-size: 18px; }
  .service-grid { grid-template-columns: repeat(4, 1fr); }
  .brand-grid { grid-template-columns: repeat(5, 1fr); }
  .cat-grid { grid-template-columns: repeat(4, 1fr); }
  .partner-grid { grid-template-columns: repeat(4, 1fr); }
  .testimonial-grid { grid-template-columns: repeat(3, 1fr); }
  .news-grid { grid-template-columns: repeat(3, 1fr); }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .catalog-layout { grid-template-columns: 260px 1fr; gap: 28px; margin-top: 28px; }
  .filters { position: sticky; top: 140px; }
  .catalog-main .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (min-width: 1240px) {
  .product-grid { grid-template-columns: repeat(4, 1fr); }
  .catalog-main .product-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}

/* ---------- Home extras ---------- */
.hero-links { display: flex; flex-wrap: wrap; gap: 8px 20px; margin-top: 16px; font-size: 14px; }
.hero-links a { color: #cfe0fb; font-weight: 600; }
.hero-links a:hover { color: #fff; }
.hero-brands { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }
.hero-brands span { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: #c3cee0; border: 1px solid rgba(255, 255, 255, .18); border-radius: 999px; padding: 5px 12px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.section-head .section-title { margin-bottom: 0; }
.section-more { font-size: 14px; font-weight: 600; color: var(--blue); white-space: nowrap; }
.section-more:hover { color: var(--blue-hover); }
.section-lead { margin: -6px 0 16px; }
.step-num { display: inline-block; font-size: 13px; font-weight: 800; color: var(--blue); background: var(--blue-soft); border-radius: var(--r-sm); padding: 3px 8px; margin-bottom: 12px; }

/* ---------- Catalog extras ---------- */
.breadcrumbs { display: flex; flex-wrap: wrap; gap: 6px; font-size: 13px; color: var(--muted); margin-top: 18px; }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs + .catalog-layout, .breadcrumbs + .product-page { margin-top: 12px; }
.found-count { font-size: 13px; font-weight: 600; color: var(--muted); background: var(--card); border: 1px solid var(--border); border-radius: 999px; padding: 3px 10px; }
.filters-toggle { width: 100%; }
.filters form { display: none; }
.filters h3 { display: none; }
.filters { padding: 0; border: 0; background: none; }
.filters-cb:checked ~ .filters { background: var(--card); border: 1px solid var(--border); padding: 4px 18px 18px; }
.filters-cb:checked ~ .filters form { display: block; }
@media (min-width: 1024px) {
  .filters-toggle { display: none; }
  .filters, .filters-cb:checked ~ .filters { background: var(--card); border: 1px solid var(--border); padding: 18px; }
  .filters h3 { display: block; }
  .filters form { display: block; }
}

/* ---------- Product page extras ---------- */
.product-main { display: grid; grid-template-columns: 1fr; gap: 20px; }
.product-media { display: flex; flex-direction: column; gap: 12px; }
.product-media .big-photo { margin: 0; }
.product-placeholder { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; min-height: 180px; background: var(--bg); border: 1px dashed var(--border-strong); border-radius: var(--r); color: #9aa8bd; font-size: 13px; font-weight: 600; }
.product-media .big-photo + .product-placeholder { display: none; }
.buy-box { margin-top: 16px; padding: 18px; border: 1px solid var(--border); border-radius: var(--r-lg); background: #fbfcfe; }
.buy-box .big-price { margin-top: 0; }
.buy-box .big-actions form { width: 100%; }
.buy-box .big-actions .btn-add { width: 100%; }
@media (min-width: 768px) {
  .product-main { grid-template-columns: minmax(240px, 2fr) 3fr; gap: 32px; }
  .product-placeholder { min-height: 320px; }
  .buy-box .big-actions .btn-add { width: auto; }
}

/* ---------- Cart extras ---------- */
.page-title { margin-top: 8px; font-size: 24px; }
.cart-table-cart .cart-row { grid-template-columns: auto 1fr; }
.cart-table-cart .cart-row:not(.cart-head) .cart-name { grid-column: 1 / -1; order: -1; font-weight: 600; }
.cart-table-cart .cart-sum { font-weight: 700; color: var(--navy); }
.cart-del { justify-content: flex-end; }
@media (min-width: 768px) {
  .cart-table-cart .cart-row { grid-template-columns: 1.1fr 2.4fr 1fr 1.6fr 1fr 48px; grid-auto-flow: row; }
  .cart-table-cart .cart-row:not(.cart-head) .cart-name { grid-column: auto; order: 0; }
}

/* ---------- Account extras ---------- */
.inline-form { display: inline-flex; }
.lk-forms { margin-top: 16px; }
.lk-forms .form-grid { grid-template-columns: 1fr; }
.profile-form label input { margin-top: 6px; font-weight: 400; }
.cart-table .price { font-size: 15px; }
.status-pill { display: inline-block; font-size: 12px; font-weight: 600; color: var(--navy-3); background: var(--blue-soft); border-radius: 999px; padding: 3px 10px; }

/* ---------- Auth extras ---------- */
.auth-title { font-size: 22px; margin-bottom: 14px; }
.auth-foot { margin-top: 16px; font-size: 14px; text-align: center; }
.auth-foot a, .auth-card a { color: var(--blue); font-weight: 600; }

/* ---------- Admin extras ---------- */
.admin-nav { display: flex; gap: 4px; overflow-x: auto; margin-top: 18px; padding: 4px; background: var(--card); border: 1px solid var(--border); border-radius: var(--r); -webkit-overflow-scrolling: touch; }
.admin-nav a { padding: 8px 14px; border-radius: var(--r-sm); font-size: 14px; font-weight: 600; color: var(--muted); white-space: nowrap; }
.admin-nav a:hover { background: var(--bg); color: var(--blue); }
.admin-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.admin-bar .searchbar { flex: 1; max-width: 420px; min-width: 220px; }
.admin-bar .searchbar input { padding-left: 12px; background: #fff; }
.admin-bar .searchbar button { padding: 0 16px; }
.admin-actions { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin-top: 4px; }
.admin-actions .btn-outline { padding: 7px 12px; font-size: 13px; }
.admin-pagination a, .admin-pagination > .muted { border: 1px solid var(--border-strong); background: #fff; padding: 8px 14px; border-radius: var(--r-sm); font-weight: 600; font-size: 14px; }
.admin-pagination a:hover { border-color: var(--blue); color: var(--blue); }
.admin-pagination > .muted { opacity: .5; }
.admin-form { max-width: 720px; margin-top: 8px; }
.admin-sync { margin-top: 14px; }
.admin-msg { margin-top: 12px; }
.admin-news .news-card .admin-actions { justify-content: flex-start; margin-top: 10px; }
.order-status select { width: auto; padding: 6px 10px; font-size: 13px; }
.order-card .price { font-size: 16px; }
.site-main > .stats-grid { margin-top: 8px; }

/* ---------- VIN / search / 404 / done ---------- */
.mt-16 { margin-top: 16px; } .mt-20 { margin-top: 20px; } .mt-24 { margin-top: 24px; }
.vin-panel { margin-top: 20px; padding: 28px 20px; border-radius: var(--r-lg); color: #fff; background: radial-gradient(800px 300px at 90% -20%, rgba(30, 111, 217, .5), transparent 60%), linear-gradient(160deg, #0b1526, #13213a); }
.vin-panel .section-title { color: #fff; }
.vin-panel .muted { color: #b6c4da; margin-bottom: 18px; }
.vin-panel .hero-search { max-width: 600px; }
.vin-panel .hero-search input { font-family: var(--mono); letter-spacing: .04em; text-transform: uppercase; }
.vin-note { margin: 14px 0 0; }
.search-form { max-width: 640px; margin-top: 16px; }
.search-form .btn-add { width: 100%; }
.notfound { text-align: center; padding: 56px 0; }
.notfound-code { font-size: 88px; font-weight: 800; line-height: 1; color: var(--navy); letter-spacing: -.04em; margin-bottom: 8px; }
.notfound-code + .section-title { margin-bottom: 8px; }
.notfound-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 22px; }
.done-icon { width: 64px; height: 64px; margin: 0 auto 16px; border-radius: 50%; background: var(--green-soft); color: var(--green); font-size: 32px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
@media (min-width: 768px) { .vin-panel { padding: 40px; } }

/* ---------- Order composition (account) ---------- */
details.order-details { border-bottom: 1px solid var(--border); }
details.order-details:last-of-type { border-bottom: 0; }
summary.order-summary { cursor: pointer; list-style: none; }
summary.order-summary::-webkit-details-marker { display: none; }
details.order-details > summary.cart-row { border-bottom: 0; }
.order-chev { color: var(--muted); font-size: 12px; text-align: right; transition: transform .15s; }
details[open] > summary .order-chev { transform: rotate(180deg); }
.order-detail { padding: 2px 0 10px; }
.order-detail-row { display: grid; grid-template-columns: 1fr auto; gap: 2px 12px; align-items: center; padding: 8px 0; border-bottom: 1px dotted var(--border); font-size: 13px; }
.order-detail-row:last-child { border-bottom: 0; }
.order-detail-name { overflow-wrap: anywhere; }
.order-detail-meta { color: var(--muted); font-size: 12px; font-family: var(--mono); }
.order-detail-sum { grid-column: 2; grid-row: 1 / span 2; font-weight: 700; color: var(--navy); white-space: nowrap; }


/* ---------- Blog / микроблог ---------- */
.blog-head { max-width: 860px; margin: 0 auto 22px; text-align: center; }
.blog-head .muted { margin-top: 4px; }
.blog-feed { display: grid; gap: 22px; max-width: 860px; margin: 0 auto; }
.blog-post { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.blog-cover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; display: block; }
.blog-body { padding: 20px 22px 24px; }
.blog-meta { margin-bottom: 10px; }
.blog-date { display: inline-block; font-size: 12px; font-weight: 600; color: var(--blue); background: var(--blue-soft); padding: 4px 12px; border-radius: 999px; }
.blog-title { font-size: 20px; margin: 0 0 10px; color: var(--navy); }
.blog-text { color: var(--text); line-height: 1.7; font-size: 15px; white-space: pre-line; }


/* ---------- CSP refactor helpers ---------- */
.hidden { display: none !important; }
.inline { display: inline; }
.admin-thumb { max-width: 160px; border-radius: 8px; margin: 8px 0; }
.admin-thumb-lg { max-width: 220px; border-radius: 8px; margin: 8px 0; }
.admin-thumb-sm { max-width: 120px; border-radius: 8px; margin-bottom: 8px; }
.muted-small { font-size: 12px; margin-top: 4px; }


/* ---------- Brands slider (Марки) ---------- */
.brand-slider { display: flex; gap: 14px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; padding: 4px 2px 12px; }
.brand-slider .brand-card { flex: 0 0 calc(50% - 7px); scroll-snap-align: start; min-height: 0; padding: 0; overflow: hidden; gap: 0; }
.brand-photo { aspect-ratio: 16/10; display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy-2), var(--navy-3)); }
.brand-photo .brand-badge { min-width: 64px; height: 64px; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 22px; }
.brand-slider .brand-name { padding: 10px 12px 14px; font-size: 15px; }


/* ---------- Blog grid (карточки) ---------- */
.blog-grid { display: grid; gap: 20px; grid-template-columns: 1fr; max-width: 1080px; margin: 0 auto; }
@media (min-width: 768px) { .blog-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .blog-grid { grid-template-columns: repeat(3, 1fr); } }
.blog-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--r-lg); overflow: hidden; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; transition: box-shadow .15s, transform .15s; }
.blog-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.blog-cover { aspect-ratio: 16/9; overflow: hidden; background: #eef1f6; }
.blog-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-cover-ph { display: flex; align-items: center; justify-content: center; background: linear-gradient(135deg, var(--navy-2), var(--blue)); color: #fff; font-weight: 800; font-size: 30px; letter-spacing: .04em; }
.blog-card .blog-body { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; align-items: flex-start; }
.blog-card .blog-title { font-size: 17px; margin: 0; }
.blog-excerpt { color: var(--muted); font-size: 14px; line-height: 1.5; }
.blog-detail { max-width: 800px; margin: 0 auto; }
.back-link { display: inline-block; margin-bottom: 18px; color: var(--blue); font-weight: 600; }
.blog-detail .blog-text { margin-top: 14px; }
