:root {
  --header-bg: #8a8d95;
  --accent: #ff4757;
  --text-main: #ffffff;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif; background: #f5f7fa; color: #111; }

/* Шапка */
header {
  background: var(--header-bg);
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Ccircle cx='40' cy='60' r='12' fill='%23ffffff' fill-opacity='0.04'/%3E%3Ccircle cx='160' cy='140' r='10' fill='%23000000' fill-opacity='0.05'/%3E%3C/svg%3E");
  background-size: 40px 40px;
  position: sticky; top: 0; z-index: 100;
}
.header-container {
  max-width: 1400px; margin: 0 auto;
  display: grid; grid-template-columns: 220px 1fr 180px; align-items: center;
  padding: 1rem 1.5rem; gap: 1rem;
}
.logo { font-size: 1.6rem; font-weight: 700; color: var(--text-main); text-transform: uppercase; letter-spacing: 1px; text-decoration: none; }
.car-svg { display: block; width: 100%; max-width: 560px; margin: 0 auto; }
.cart-area { text-align: right; }
.cart-btn {
  display: inline-flex; align-items: center; gap: .5rem;
  background: rgba(255,255,255,.12); padding: .6rem 1rem; border-radius: 8px;
  color: var(--text-main); text-decoration: none; font-weight: 500; cursor: pointer;
}
.cart-btn:hover { background: rgba(255,255,255,.22); }
.cart-badge { background: var(--accent); border-radius: 10px; padding: 0 .45rem; font-size: .8rem; }

.search-bar {
  max-width: 1400px; margin: 0 auto; padding: .75rem 1.5rem;
  background: rgba(255,255,255,.95); border: 1px solid rgba(0,0,0,.15);
}
.search-input { width: 100%; padding: .85rem 1.2rem; border: none; background: transparent; font-size: 1rem; outline: none; }

main { max-width: 1400px; margin: 2rem auto; padding: 0 1.5rem; }
.breadcrumbs { color: #6b7280; margin-bottom: 1.5rem; font-size: .9rem; }
.breadcrumbs a { color: #3b82f6; text-decoration: none; }

/* Плитки категорий */
.tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 1.5rem; }
.tile {
  background: #fff; border-radius: 12px; padding: 1.5rem; box-shadow: 0 4px 12px rgba(0,0,0,.04);
  text-decoration: none; color: inherit; display: flex; flex-direction: column; align-items: center;
  transition: transform .2s, box-shadow .2s; cursor: pointer;
}
.tile:hover { transform: translateY(-4px); box-shadow: 0 8px 20px rgba(0,0,0,.08); }
.tile-icon { font-size: 2.4rem; margin-bottom: .75rem; }
.tile h3 { font-size: 1.1rem; }
.tile .count { margin-top: 1rem; padding-top: .75rem; border-top: 1px solid #e5e7eb; color: #6b7280; font-size: .9rem; }

/* Карточки товаров */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 1.5rem; }
.card {
  background: #fff; border-radius: 12px; padding: 1.2rem; box-shadow: 0 2px 6px rgba(0,0,0,.05);
  cursor: pointer; transition: transform .15s, box-shadow .15s; display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 8px 16px rgba(0,0,0,.08); }
.card-img {
  height: 140px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  font-size: 3rem; margin-bottom: .8rem; background: #eceff3;
}
.card h3 { font-size: 1rem; margin-bottom: .4rem; }
.card .art { font-size: .8rem; color: #6b7280; margin-bottom: .6rem; font-family: monospace; }
.card .price { font-weight: 700; font-size: 1.1rem; margin-top: auto; }
.card .card-bottom { display: flex; justify-content: space-between; align-items: center; margin-top: .6rem; }
.badges { display: flex; gap: .4rem; margin-bottom: .6rem; flex-wrap: wrap; }
.badge { font-size: .7rem; padding: .2rem .5rem; border-radius: 4px; color: #fff; background: #374151; }
.stock-ok { color: #16a34a; font-size: .85rem; }
.stock-low { color: #f59e0b; font-size: .85rem; }
.stock-order { color: #6b7280; font-size: .85rem; }

/* Фильтры */
.controls { display: flex; gap: 1rem; flex-wrap: wrap; margin-bottom: 2rem; }
.controls select, .controls input { padding: .7rem .9rem; border: 1px solid #d1d5db; border-radius: 8px; background: #fff; }

/* Подбор по авто */
.steps { display: flex; gap: .7rem; flex-wrap: wrap; margin-bottom: 2rem; }
.step-chip { padding: .4rem .8rem; border-radius: 20px; background: #e5e7eb; color: #4b5563; font-size: .85rem; cursor: pointer; }
.step-chip.active { background: var(--accent); color: #fff; }
.grid-select { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.2rem; margin-bottom: 2.5rem; }
.option-card {
  background: #fff; border: 1px solid #e5e7eb; border-radius: 12px; padding: 1.4rem;
  cursor: pointer; text-align: center; transition: all .2s;
}
.option-card:hover { border-color: #9ca3af; transform: translateY(-2px); }
.option-card.selected { border-color: var(--accent); background: #fff5f6; }
.option-icon { font-size: 2rem; margin-bottom: .7rem; }
.option-title { font-weight: 600; margin-bottom: .3rem; }
.option-desc { color: #6b7280; font-size: .9rem; }

/* Карточка товара */
.product-layout { display: grid; grid-template-columns: 380px 1fr; gap: 2rem; }
@media (max-width: 900px) { .product-layout { grid-template-columns: 1fr; } }
.product-photo {
  height: 320px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  font-size: 6rem; background: #eceff3;
}
.product-title { font-size: 1.5rem; margin-bottom: .5rem; }
.product-art { color: #6b7280; margin-bottom: 1rem; }
.variant-row {
  display: flex; justify-content: space-between; align-items: center;
  border: 1px solid #e5e7eb; border-radius: 8px; padding: .7rem 1rem;
  margin-bottom: .4rem; cursor: pointer; background: #fff;
}
.variant-row:hover { border-color: #9ca3af; }
.variant-row.selected { border-color: var(--accent); background: #fff5f6; }
.variant-name { font-size: .95rem; }
.variant-art { color: #6b7280; font-size: .8rem; font-family: monospace; }
.variant-price { font-weight: 700; }
.buy-row { display: flex; gap: 1rem; align-items: center; margin: 1.2rem 0; flex-wrap: wrap; }
.qty-input { width: 70px; padding: .7rem; border: 1px solid #d1d5db; border-radius: 8px; text-align: center; }
.btn-primary { background: var(--accent); color: #fff; border: none; padding: .8rem 2rem; border-radius: 8px; font-weight: 600; cursor: pointer; }
.btn-blue { background: #3b82f6; color: #fff; border: none; padding: .65rem 1.2rem; border-radius: 8px; font-weight: 600; cursor: pointer; }
.specs { width: 100%; border-collapse: collapse; margin-top: 1rem; }
.specs td { padding: .5rem .8rem; border-bottom: 1px solid #eef0f2; font-size: .9rem; }
.specs td:first-child { color: #6b7280; width: 40%; }
.description { margin-top: 1.5rem; line-height: 1.6; color: #374151; }
.related { margin-top: 3rem; }
.related-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 1rem; }
.related-card { background: #fff; border-radius: 10px; padding: .8rem; box-shadow: 0 2px 5px rgba(0,0,0,.04); cursor: pointer; }
.related-card .rimg { height: 90px; border-radius: 6px; margin-bottom: .5rem; display: flex; align-items: center; justify-content: center; font-size: 2rem; background: #eceff3; }

/* Корзина */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.5); display: none; align-items: center; justify-content: center; z-index: 1000; }
.modal.open { display: flex; }
.modal-content { background: #fff; padding: 2rem; border-radius: 12px; min-width: 360px; width: 90%; max-width: 520px; max-height: 90vh; overflow-y: auto; }
.cart-list { list-style: none; margin-top: 1rem; max-height: 300px; overflow-y: auto; }
.cart-item { display: flex; justify-content: space-between; align-items: center; padding: .5rem 0; border-bottom: 1px solid #f3f4f6; gap: .6rem; }
.cart-total { margin-top: 1.2rem; font-size: 1.2rem; font-weight: 700; text-align: right; }
.btn-checkout { width: 100%; background: var(--accent); color: #fff; border: none; padding: .8rem; border-radius: 8px; font-weight: 600; cursor: pointer; margin-top: .8rem; }
.link-close { display: block; margin-top: .8rem; text-align: center; color: #6b7280; cursor: pointer; }
