:root {
  --bg: #f5f6f8;
  --bg-alt: #ffffff;
  --card: #ffffff;
  --border: #dfe2e8;
  --text: #1f2430;
  --text-dim: #6b7280;
  --accent: #ff6a1a;
  --accent-dark: #d9560f;
  --ok: #1f9d5c;
  --danger: #d92d3a;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.container {
  max-width: 100%;
  margin: 0 auto;
  padding: 0 40px;
}
@media (max-width: 700px) {
  .container { padding: 0 16px; }
}

/* Header */
.site-header {
  background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 50;
}
.site-header .inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  gap: 20px;
}
.logo {
  font-weight: 800;
  font-size: 22px;
  letter-spacing: -0.5px;
  white-space: nowrap;
}
.logo span { color: var(--accent); }

.main-nav {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.main-nav a {
  color: var(--text-dim);
  font-size: 15px;
  transition: color .15s;
}
.main-nav a:hover, .main-nav a.active { color: var(--text); }

.cart-link {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--card);
  border: 1px solid var(--border);
  padding: 8px 14px;
  border-radius: 999px;
  font-size: 14px;
  white-space: nowrap;
}

.header-search {
  display: flex;
  align-items: center;
  flex: 1 1 260px;
  max-width: 420px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 4px 4px 4px 16px;
}
.header-search input {
  flex: 1;
  border: none;
  background: transparent;
  color: var(--text);
  font-size: 14px;
  outline: none;
  min-width: 0;
}
.header-search input::placeholder { color: var(--text-dim); }
.header-search button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border: none;
  border-radius: 999px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  flex-shrink: 0;
}
.header-search button:hover { opacity: .9; }
.header-search-clear {
  background: transparent !important;
  color: var(--text-dim) !important;
  width: 26px !important;
  height: 26px !important;
  font-size: 18px;
  line-height: 1;
}
.header-search-clear:hover { color: var(--text) !important; }

@media (max-width: 860px) {
  .site-header .inner { flex-wrap: wrap; }
  .header-search { order: 3; flex: 1 1 100%; max-width: none; }
}
.cart-badge {
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  min-width: 20px;
  height: 20px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Hero */
.hero {
  background: linear-gradient(135deg, #fff3ea 0%, #f5f6f8 70%);
  border-bottom: 1px solid var(--border);
  padding: 18px 0;
}
.hero h1 {
  font-size: 22px;
  margin: 0 0 6px;
  max-width: 620px;
}
.hero p {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 0 14px;
  font-size: 13px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: none;
  cursor: pointer;
  border-radius: var(--radius);
  padding: 12px 22px;
  font-size: 15px;
  font-weight: 600;
  transition: transform .1s, background .15s, opacity .15s;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-dark); }
.btn-outline { background: transparent; border: 1px solid var(--border); color: var(--text); }
.btn-outline:hover { border-color: var(--accent); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-sm { padding: 7px 14px; font-size: 13px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* Layout: catalog with sidebar */
.catalog-layout {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 22px;
  padding: 18px 0 40px;
}
@media (max-width: 800px) {
  .catalog-layout { grid-template-columns: 1fr; }
}

.sidebar {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px 14px;
  align-self: start;
}
.sidebar h3 { margin: 0 0 6px; font-size: 12px; text-transform: uppercase; letter-spacing: .3px; color: var(--text-dim); }
.sidebar ul { list-style: none; padding: 0; margin: 0; }
.sidebar li { margin-bottom: 1px; }
.sidebar a {
  display: block;
  padding: 5px 8px;
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 13px;
}
.sidebar a:hover, .sidebar a.active { background: var(--card); color: var(--text); }

.cat-group-item { margin-bottom: 4px; }
.cat-group summary {
  list-style: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  border-radius: 6px;
}
.cat-group summary::-webkit-details-marker { display: none; }
.cat-group summary::before {
  content: '▸';
  font-size: 10px;
  color: var(--text-dim);
  width: 18px;
  flex-shrink: 0;
  text-align: center;
}
.cat-group[open] > summary::before { content: '▾'; }
.cat-group summary a { flex: 1; padding: 8px 4px 8px 0; }
.cat-subtree { list-style: none; margin: 0; padding: 0 0 4px 18px; }
.cat-subtree a { font-size: 13px; padding: 6px 10px; }

.filters-clear {
  display: block;
  color: var(--accent);
  font-size: 13px;
  margin: 14px 0 6px;
}
.facet-form { margin-top: 8px; }

.car-catalog-breadcrumb { color: var(--text-dim); font-size: 13px; margin: 4px 0 12px; }
.car-catalog-breadcrumb a { color: var(--text-dim); }
.car-catalog-breadcrumb a.active, .car-catalog-breadcrumb .active { color: var(--accent); font-weight: 700; }
.car-catalog-search { max-width: 420px; margin-bottom: 12px; }
.car-catalog-search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 10px 12px;
  color: var(--text);
  font-size: 14px;
}
.car-catalog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
}
.car-catalog-chip {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  color: var(--text);
  font-size: 14px;
  transition: border-color .15s;
}
.car-catalog-chip:hover { border-color: var(--accent); }
.car-catalog-chip span { display: block; color: var(--text-dim); font-size: 12px; margin-top: 2px; }

.car-catalog-list { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
@media (max-width: 1200px) { .car-catalog-list { grid-template-columns: repeat(4, 1fr); } }
@media (max-width: 900px) { .car-catalog-list { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .car-catalog-list { grid-template-columns: 1fr; } }
.car-catalog-list .car-catalog-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
}
.car-catalog-list .car-catalog-chip span { margin-top: 0; }
.car-catalog-mod-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.car-catalog-mod-table th {
  text-align: left;
  color: var(--text-dim);
  font-weight: 600;
  font-size: 12px;
  text-transform: uppercase;
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.car-catalog-mod-table td {
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}
.car-catalog-mod-table td:first-child { white-space: normal; }
.car-catalog-mod-row { cursor: pointer; transition: background .15s; }
.car-catalog-mod-row:hover { background: var(--bg-alt); }
.car-catalog-mod-arrow { color: var(--text-dim); text-align: right; font-size: 16px; }
@media (max-width: 900px) {
  .car-catalog-mod-table { display: block; overflow-x: auto; white-space: nowrap; }
}
.car-catalog-item-filters { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.car-catalog-item-filters select {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 6px 10px;
  color: var(--text);
  font-size: 13px;
}
.facet-group {
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 6px;
}
.facet-form .facet-group:first-of-type { border-top: none; padding-top: 0; margin-top: 0; }
.facet-title {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .3px;
  color: var(--text-dim);
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 3px 0;
}
.facet-title::-webkit-details-marker { display: none; }
.facet-title::after { content: '▾'; font-size: 11px; }
.facet-group[open] > .facet-title::after { content: '▴'; }
.facet-group > .facet-checkbox:first-of-type { margin-top: 8px; }
.facet-checkbox {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text);
  padding: 4px 0;
  cursor: pointer;
}
.facet-checkbox input { flex-shrink: 0; width: 15px; height: 15px; }

/* Product grid */
.view-switch { display: flex; gap: 4px; flex-shrink: 0; }
.view-switch a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text-dim);
}
.view-switch a.active { color: var(--accent); border-color: var(--accent); }
.view-switch a:hover { color: var(--text); }

.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 18px;
}

.list-with-preview { display: grid; grid-template-columns: 1.3fr 1fr; gap: 20px; align-items: start; }
.list-with-preview > * { min-width: 0; }
@media (max-width: 900px) {
  .list-with-preview { grid-template-columns: 1fr; }
  .product-preview-panel { display: none; }
}
.product-list { display: flex; flex-direction: column; gap: 6px; }
.product-row {
  display: flex;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 6px 10px;
  transition: border-color .15s, background .15s;
  cursor: pointer;
}
.product-row:hover { border-color: var(--accent); }
.product-row.active { border-color: var(--accent); background: rgba(255,106,26,.08); }
.product-row-thumb {
  width: 46px;
  height: 46px;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-row-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.product-row-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.product-row-top { display: flex; align-items: baseline; gap: 8px; }
.product-row-brand { font-size: 11px; color: var(--text-dim); text-transform: uppercase; }
.product-row-sku { font-size: 12px; color: var(--text-dim); font-weight: 700; }
.product-row-name {
  display: block;
  font-size: 14px;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-row-name:hover { color: var(--accent); text-decoration: underline; }
.product-row-fitment {
  font-size: 12px;
  color: var(--text-dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.product-row-stock { font-size: 11px; color: var(--text-dim); white-space: nowrap; flex-shrink: 0; }
.product-row-stock.out { color: var(--danger); }
.product-row-actions { display: flex; flex-direction: column; align-items: flex-end; gap: 4px; flex-shrink: 0; }
.product-row-price { font-size: 16px; font-weight: 800; color: var(--accent); white-space: nowrap; text-align: right; }
.product-row-cart { display: flex; align-items: center; gap: 4px; }
.product-row-cart input[type=number] {
  width: 40px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 5px;
  color: var(--text);
  text-align: center;
  font-size: 12px;
  padding: 3px 2px;
}
.product-row-cart button {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border: none;
  border-radius: 5px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
}
.product-row-cart button:hover { opacity: .9; }
.product-row-cart.cart-added button { background: var(--ok); }
@media (max-width: 700px) {
  .product-row-stock { display: none; }
}

.product-preview-panel {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px;
  position: sticky;
  top: 20px;
  max-height: calc(100vh - 40px);
  overflow-y: auto;
}
.preview-title-link { display: block; }
.preview-title { font-size: 17px; margin: 0 0 4px; color: var(--text); }
.preview-sub { font-size: 13px; color: var(--text-dim); display: flex; gap: 8px; margin-bottom: 12px; }
.preview-photo {
  background: #ffffff;
  border-radius: 8px;
  height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 12px;
  overflow: hidden;
}
.preview-photo img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 8px; }
.preview-thumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.preview-thumb {
  width: 42px;
  height: 42px;
  background: #ffffff;
  border-radius: 6px;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 3px; }
.preview-price { font-size: 22px; font-weight: 800; color: var(--accent); margin-bottom: 4px; }
.preview-cart-form { display: flex; gap: 8px; margin: 12px 0; }
.preview-cart-form input[type=number] { width: 56px; background: var(--bg-alt); border: 1px solid var(--border); border-radius: 6px; color: var(--text); text-align: center; }
.preview-section { margin-top: 10px; border-top: 1px solid var(--border); padding-top: 10px; }
.preview-h3 {
  font-size: 13px;
  color: var(--accent);
  letter-spacing: .2px;
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.preview-h3::-webkit-details-marker { display: none; }
.preview-h3::after { content: '▾'; font-size: 10px; color: var(--text-dim); }
.preview-section[open] > .preview-h3::after { content: '▴'; }
.preview-section > table, .preview-section > .compact-list { margin-top: 8px; }
.preview-analogs { display: flex; flex-direction: column; gap: 6px; margin-top: 8px; }
.preview-analog-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
}
.preview-analog-row:hover { border-color: var(--accent); }
.preview-analog-thumb {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  background: #ffffff;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.preview-analog-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; padding: 3px; }
.preview-analog-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.preview-analog-price { font-size: 13px; font-weight: 700; color: var(--accent); white-space: nowrap; flex-shrink: 0; }

.hover-zoom-preview {
  display: none;
  position: fixed;
  z-index: 999;
  width: 320px;
  height: 320px;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
  padding: 12px;
  pointer-events: none;
}
.hover-zoom-preview img { width: 100%; height: 100%; object-fit: contain; }
.product-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: border-color .15s, transform .15s;
}
.product-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.product-card-link { display: flex; flex-direction: column; flex: 1; color: inherit; text-decoration: none; }
.product-thumb {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aab2bd;
  font-size: 13px;
}
.product-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 8px; box-sizing: border-box; display: block; }
.product-info { padding: 14px 14px 16px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.product-card-brandline {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 2px 8px;
  font-size: 12px;
  color: var(--text-dim);
  min-height: 1.2em;
}
.product-card-brand { text-transform: uppercase; }
.product-card-sku { white-space: nowrap; }
@media (max-width: 480px) {
  .product-card-brandline { flex-direction: column; gap: 0; }
}
.product-info h3 {
  font-size: 15px;
  margin: 0;
  font-weight: 600;
  line-height: 1.3;
  height: 2.6em;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-price { font-size: 18px; font-weight: 800; color: var(--accent); }
.product-stock { font-size: 12px; color: var(--text-dim); }
.product-stock.out { color: var(--danger); }
.product-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 14px 14px;
}
.product-grid-analogs { grid-column: 1 / -1; }

.category-tile-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
  margin-bottom: 26px;
}
.category-tile {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  transition: border-color .15s, transform .15s;
}
.category-tile:hover { border-color: var(--accent); transform: translateY(-2px); }
.category-tile-thumb {
  aspect-ratio: 4/3;
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aab2bd;
  font-size: 12px;
}
.category-tile-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 10px; box-sizing: border-box; display: block; }
.category-tile-name { font-size: 13px; font-weight: 600; padding: 10px 12px 2px; line-height: 1.3; }
.category-tile-count { font-size: 11px; color: var(--text-dim); padding: 0 12px 12px; }

.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-dim);
}

/* Product page */
.product-view {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  padding: 36px 0 60px;
}
@media (max-width: 800px) {
  .product-view { grid-template-columns: 1fr; }
}
.product-photo {
  position: relative;
  aspect-ratio: 4/3;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #aab2bd;
  overflow: hidden;
  touch-action: pan-y;
}
.product-photo img { width: 100%; height: 100%; object-fit: contain; padding: 16px; transition: opacity .15s; }

.photo-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: rgba(30,34,41,.55);
  color: #fff;
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s, border-color .15s;
}
.photo-nav:hover { background: var(--accent); border-color: var(--accent); }
.photo-nav-prev { left: 12px; }
.photo-nav-next { right: 12px; }

.photo-thumbs {
  display: flex;
  gap: 10px;
  margin-top: 12px;
  padding: 4px 2px 10px;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: thin;
  scrollbar-color: var(--border) transparent;
}
.photo-thumbs::-webkit-scrollbar { height: 6px; }
.photo-thumbs::-webkit-scrollbar-thumb { background: var(--border); border-radius: 999px; }
.photo-thumbs::-webkit-scrollbar-track { background: transparent; }

.photo-thumb {
  flex: 0 0 auto;
  width: 68px;
  height: 68px;
  padding: 0;
  border-radius: 10px;
  border: 2px solid var(--border);
  background: #ffffff;
  cursor: pointer;
  overflow: hidden;
  transition: border-color .15s, transform .15s, box-shadow .15s;
}
.photo-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.photo-thumb:hover { border-color: var(--accent); transform: translateY(-2px); }
.photo-thumb.active {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(255,106,26,.18);
}
.product-detail h1 { font-size: 26px; margin: 0 0 8px; }
.product-detail .price { font-size: 28px; font-weight: 800; color: var(--accent); margin: 16px 0; }
.product-detail .desc { color: var(--text-dim); margin-bottom: 20px; white-space: pre-line; }
.qty-row { display: flex; align-items: center; gap: 12px; margin-bottom: 20px; }
.qty-row input {
  width: 64px;
  padding: 10px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  text-align: center;
}

/* Forms */
.form-box {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 26px;
  max-width: 520px;
}
.field { margin-bottom: 16px; }
.field label { display: block; font-size: 13px; color: var(--text-dim); margin-bottom: 6px; }
.field input, .field textarea, .field select {
  width: 100%;
  padding: 11px 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent);
}
.alert {
  padding: 12px 16px;
  border-radius: 8px;
  margin-bottom: 18px;
  font-size: 14px;
}
.alert-error { background: rgba(229,72,77,.12); border: 1px solid var(--danger); color: #ff9a9d; }
.alert-ok { background: rgba(47,191,113,.12); border: 1px solid var(--ok); color: #7ee7ac; }

/* Cart table */
.cart-table { width: 100%; border-collapse: collapse; margin-bottom: 24px; }
.cart-table th, .cart-table td {
  padding: 12px 10px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 14px;
}
.cart-table th { color: var(--text-dim); font-weight: 600; font-size: 12px; text-transform: uppercase; }

.specs-table { width: 100%; border-collapse: collapse; margin-bottom: 10px; }
.specs-table td {
  padding: 3px 8px;
  border-bottom: 1px solid var(--border);
  text-align: left;
  font-size: 12px;
  line-height: 1.25;
  vertical-align: top;
}
.compact-list { font-size: 12px; line-height: 1.25; margin-bottom: 10px; }
.compact-list-row { padding: 3px 0; border-bottom: 1px solid var(--border); }
.cart-table input[type=number] {
  width: 56px;
  padding: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text);
  text-align: center;
}
.cart-total-row { text-align: right; font-size: 18px; font-weight: 800; padding: 16px 0; }

.cart-rows { display: flex; flex-direction: column; gap: 8px; }
.cart-row {
  display: grid;
  grid-template-columns: 64px 1fr 90px 110px 100px 36px;
  align-items: center;
  gap: 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 8px 12px;
}
.cart-row-thumb {
  width: 64px;
  height: 64px;
  border-radius: 6px;
  background: #ffffff;
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.cart-row-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 4px; }
.cart-row-info { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.cart-row-price { font-size: 14px; color: var(--text-dim); white-space: nowrap; }
.qty-stepper { display: flex; align-items: center; gap: 0; justify-self: start; }
.qty-stepper input[type=number] {
  width: 44px;
  text-align: center;
  padding: 6px 2px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-left: none;
  border-right: none;
  color: var(--text);
  -moz-appearance: textfield;
}
.qty-stepper input[type=number]::-webkit-outer-spin-button,
.qty-stepper input[type=number]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty-btn {
  width: 28px;
  height: 30px;
  border: 1px solid var(--border);
  background: var(--bg-alt);
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}
.qty-minus { border-radius: 6px 0 0 6px; }
.qty-plus { border-radius: 0 6px 6px 0; }
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }
.cart-row-total { font-size: 16px; font-weight: 800; color: var(--accent); white-space: nowrap; text-align: right; }
.cart-row-remove {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: none;
  background: transparent;
  color: var(--text-dim);
  cursor: pointer;
  border-radius: 6px;
}
.cart-row-remove:hover { background: rgba(217,45,58,.1); color: var(--danger); }
.cart-row-summary {
  background: var(--bg);
  border-style: dashed;
  grid-template-columns: 1fr 90px 110px;
  font-weight: 700;
}
.cart-row-summary-label { grid-column: 1; }
.cart-row-summary-qty { text-align: center; }
.cart-row-summary-total { color: var(--accent); font-size: 18px; text-align: right; }
@media (max-width: 700px) {
  .cart-row { grid-template-columns: 52px 1fr auto; }
  .cart-row-price, .cart-row-total { display: none; }
}

/* Car search widget */
.car-search {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  margin-top: 28px;
}
.vin-search-row {
  display: flex;
  gap: 10px;
}
.vin-search-row input {
  flex: 1;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 15px;
}
.vin-search-row input:focus { outline: none; border-color: var(--accent); }
@media (max-width: 600px) {
  .vin-search-row { flex-direction: column; }
}

.car-search-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 20px;
}
.car-search-divider::before,
.car-search-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--border);
}

.car-search-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 16px;
}
@media (max-width: 800px) {
  .car-search-row { grid-template-columns: 1fr; }
}
.car-search select:disabled { opacity: .5; cursor: not-allowed; }

footer.site-footer {
  border-top: 1px solid var(--border);
  padding: 30px 0;
  color: var(--text-dim);
  font-size: 13px;
  margin-top: 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  margin-bottom: 24px;
}
.footer-col h4 { color: var(--text); font-size: 14px; margin: 0 0 10px; }
.footer-col p { margin: 0; line-height: 1.7; }
.footer-col a { color: var(--text-dim); }
.footer-col a:hover { color: var(--accent); }
.footer-bottom {
  border-top: 1px solid var(--border);
  padding-top: 16px;
  text-align: center;
}

.fitment-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 10px 6px 14px;
  font-size: 13px;
  margin: 0 6px 6px 0;
}
.fitment-tag-remove {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
  padding: 0 2px;
}
.fitment-tag-remove:hover { color: var(--danger); }
.fitment-picker-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr) auto;
  gap: 10px;
  align-items: end;
  margin-bottom: 14px;
}
@media (max-width: 900px) { .fitment-picker-row { grid-template-columns: 1fr; } }

/* Admin */
.admin-body { background: var(--bg); }
.admin-shell { display: grid; grid-template-columns: 220px 1fr; min-height: 100vh; }
.admin-sidebar {
  background: var(--bg-alt);
  border-right: 1px solid var(--border);
  padding: 20px 0;
}
.admin-sidebar .brand { padding: 0 20px 20px; font-weight: 800; font-size: 18px; border-bottom: 1px solid var(--border); margin-bottom: 12px; }
.admin-sidebar a {
  display: block;
  padding: 11px 20px;
  color: var(--text-dim);
  font-size: 14px;
}
.admin-sidebar a:hover, .admin-sidebar a.active { background: var(--card); color: var(--text); border-left: 3px solid var(--accent); }
.admin-content { padding: 28px 32px; }
.admin-topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.admin-topbar h1 { font-size: 22px; margin: 0; }

.data-table { width: 100%; border-collapse: collapse; background: var(--bg-alt); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: 12px 14px; border-bottom: 1px solid var(--border); font-size: 14px; text-align: left; }
.data-table th { background: var(--card); color: var(--text-dim); font-size: 12px; text-transform: uppercase; }
.data-table tr:last-child td { border-bottom: none; }
.data-table .actions { display: flex; gap: 8px; }

.badge { display: inline-block; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; }
.badge-new { background: rgba(255,106,26,.15); color: var(--accent); }
.badge-processing { background: rgba(47,132,191,.15); color: #5db5f0; }
.badge-completed { background: rgba(47,191,113,.15); color: var(--ok); }
.badge-cancelled { background: rgba(229,72,77,.15); color: var(--danger); }

.login-shell {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg);
}

/* TecDoc tree */
.tecdoc-tree {
  list-style: none;
  margin: 0;
  padding-left: 16px;
  font-size: 12px;
}
.tecdoc-tree > li:first-child { margin-top: 2px; }
.tecdoc-tree li { margin: 1px 0; }
.tecdoc-tree a {
  color: var(--text);
  padding: 2px 0;
  display: inline-block;
  font-size: 12px;
}
.tecdoc-tree a:hover { color: var(--accent); }
.tecdoc-tree summary {
  cursor: pointer;
  color: var(--text-dim);
  font-weight: 600;
  padding: 6px 0;
}
.tecdoc-tree summary:hover { color: var(--text); }
.tecdoc-tree details { border-bottom: 1px solid var(--border); }
.tecdoc-tree details[open] > summary { color: var(--accent); }
.tecdoc-tree a.active { color: var(--accent); font-weight: 700; }
.tecdoc-tree summary.tecdoc-active-path { color: var(--text); }

.tecdoc-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 20px;
  align-items: start;
}
@media (max-width: 800px) {
  .tecdoc-layout { grid-template-columns: 1fr; }
}
.tecdoc-sidebar {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  max-height: 720px;
  overflow-y: auto;
}
.tecdoc-sidebar-title {
  font-weight: 700;
  color: var(--accent);
  padding: 6px 4px 12px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 8px;
}
.tecdoc-tabs {
  display: flex;
  border-bottom: 1px solid var(--border);
  margin-bottom: 12px;
}
.tecdoc-tabs a {
  flex: 1;
  text-align: center;
  padding: 8px 4px;
  color: var(--text-dim);
  font-size: 13px;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
}
.tecdoc-tabs a.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
  font-weight: 700;
}
.tecdoc-oe-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 14px;
}
.tecdoc-oe-card {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  cursor: zoom-in;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.tecdoc-oe-card .tecdoc-unit-image { max-height: 140px; overflow: hidden; display:flex; align-items:center; justify-content:center; }
.tecdoc-oe-card .tecdoc-unit-image img { max-width: 100%; max-height: 130px; width: auto; height: auto; object-fit: contain; }
.tecdoc-oe-card-title { font-size: 12px; color: var(--text-dim); text-align: center; }
.tecdoc-node-search {
  position: relative;
  margin-bottom: 12px;
}
.tecdoc-node-search input {
  width: 100%;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 8px 10px;
  color: var(--text);
  font-size: 13px;
}
.tecdoc-node-search-results {
  display: none;
}
.tecdoc-node-search-results a {
  display: block;
  padding: 6px 4px;
}
.tecdoc-node-search-results a:hover .tecdoc-node-search-name { text-decoration: underline; }
.tecdoc-node-search-name { color: var(--accent); display: block; }
.tecdoc-node-search-path { color: var(--text-dim); font-size: 11px; display: block; }
.tecdoc-node-search-empty { padding: 6px 4px; color: var(--text-dim); font-size: 13px; }
.tecdoc-content {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.tecdoc-vehicle-info {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}
.tecdoc-vehicle-info span { color: var(--text-dim); margin-right: 8px; display:inline-block; min-width: 170px; }
.tecdoc-unit {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 16px;
}
@media (max-width: 600px) {
  .tecdoc-unit { grid-template-columns: 1fr; }
}
.tecdoc-unit-image {
  background: #ffffff;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px;
  max-height: 320px;
  overflow: hidden;
}
.tecdoc-unit-image img { max-width: 100%; max-height: 300px; width: auto; height: auto; object-fit: contain; }
.tecdoc-unit-body h4 { margin: 0 0 10px; font-size: 15px; }

.tecdoc-more { margin-top: 8px; }
.tecdoc-more summary {
  cursor: pointer;
  list-style: none;
  background: var(--card);
  color: var(--text-dim);
  font-size: 13px;
  padding: 10px 14px;
  border-radius: 6px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.tecdoc-more summary::-webkit-details-marker { display: none; }
.tecdoc-more summary::after { content: '▾'; }
.tecdoc-more[open] summary::after { content: '▴'; }
.tecdoc-more summary:hover { color: var(--text); }
.tecdoc-more table { margin-top: 8px; }

.tecdoc-unit-image img { cursor: zoom-in; }

.tecdoc-modal {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.7);
  z-index: 200;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.tecdoc-modal.open { display: flex; }
.tecdoc-modal-inner {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  width: 100%;
  max-width: 1600px;
  max-height: 92vh;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  padding: 20px;
  position: relative;
  overflow-y: auto;
}
@media (max-width: 700px) {
  .tecdoc-modal-inner { grid-template-columns: 1fr; }
}
.tecdoc-modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  padding: 6px 12px;
  cursor: pointer;
  font-size: 13px;
}
.tecdoc-modal-close:hover { border-color: var(--accent); color: var(--accent); }
.tecdoc-modal-image {
  background: #ffffff;
  border-radius: 8px;
  padding: 10px;
  align-self: start;
}
.tecdoc-zoom-controls {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.tecdoc-zoom-controls button {
  background: var(--card);
  border: 1px solid var(--border);
  color: var(--text);
  border-radius: 6px;
  width: 28px;
  height: 28px;
  cursor: pointer;
  font-size: 16px;
  line-height: 1;
}
.tecdoc-zoom-controls .tecdoc-zoom-reset { width: auto; padding: 0 10px; font-size: 12px; }
.tecdoc-zoom-controls button:hover { border-color: var(--accent); color: var(--accent); }
.tecdoc-zoom-level { color: var(--text-dim); font-size: 12px; min-width: 42px; text-align: center; }
.tecdoc-hotspot-note { color: var(--text-dim); font-size: 12px; font-style: italic; margin-left: 10px; }

.tecdoc-modal-image-viewport {
  height: 80vh;
  overflow: hidden;
  background: #f4f4f4;
  border-radius: 6px;
  cursor: grab;
  position: relative;
}
.tecdoc-modal-image-viewport.dragging { cursor: grabbing; user-select: none; }
.tecdoc-modal-image-wrap { position: absolute; top: 0; left: 0; width: 100%; }
.tecdoc-modal-image-wrap img { width: 100%; height: auto; display: block; pointer-events: none; }
.tecdoc-modal-list { max-height: 75vh; overflow-y: auto; }

.tecdoc-hotspot {
  position: absolute;
  border: 1px solid rgba(255,106,26,.55);
  background: rgba(255,106,26,.12);
  cursor: pointer;
  border-radius: 2px;
}
.tecdoc-hotspot:hover, .tecdoc-hotspot.active {
  background: rgba(255,106,26,.35);
  border-color: var(--accent);
}
.tecdoc-row-active { background: rgba(255,106,26,.15); }

/* Акт рекламації */
.reclamation-form { font-size: 14px; line-height: 1.9; }
.reclamation-form h3 { font-size: 14px; margin: 18px 0 4px; }
.reclamation-field-right { text-align: right; font-style: italic; color: var(--text-dim); font-size: 13px; }
.reclamation-form .fill {
  display: inline-block;
  min-width: 140px;
  border-bottom: 1px solid var(--text-dim);
  margin: 0 4px;
}
.reclamation-form .fill.wide { min-width: 220px; }
.reclamation-form .fill.short { min-width: 40px; }
.reclamation-form .fill-line {
  border-bottom: 1px solid var(--text-dim);
  height: 1.6em;
  margin: 0 0 4px;
}
.reclamation-signatures { margin-top: 24px; }
@media print {
  @page { size: A4 portrait; margin: 12mm; }
  html, body { background: #fff; width: 210mm; }
  .site-header, .site-footer, .btn { display: none !important; }
  .container {
    padding: 0 !important;
    margin: 0 !important;
    max-width: none !important;
    width: 100% !important;
  }
  .reclamation-form { font-size: 12px; line-height: 1.6; }
  .reclamation-form h1 { font-size: 18px; }
  .reclamation-form h2 { font-size: 16px; margin: 10px 0 6px; }
  .reclamation-form h3 { font-size: 12px; margin: 10px 0 2px; }
  .reclamation-form .fill-line { height: 1.3em; }
  .reclamation-signatures { margin-top: 14px; }
  a { color: inherit !important; text-decoration: none !important; }
}
