/* AutoParts - Main Styles */
:root {
  --primary: #e63946;
  --primary-dark: #c1121f;
  --secondary: #1d3557;
  --accent: #457b9d;
  --light: #f8f9fa;
  --dark: #212529;
  --gray: #6c757d;
  --border: #dee2e6;
  --success: #28a745;
  --warning: #ffc107;
  --danger: #dc3545;
  --radius: 8px;
  --shadow: 0 2px 12px rgba(0,0,0,.08);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: 'Segoe UI', Arial, sans-serif; font-size: 15px; color: var(--dark); background: #f4f5f7; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; }

/* Header */
.site-header {
  background: var(--secondary);
  color: #fff;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}
.site-logo {
  font-size: 22px;
  font-weight: 800;
  color: #fff;
  display: flex;
  align-items: center;
  gap: 8px;
}
.site-logo span { color: var(--primary); }
.header-search {
  flex: 1;
  display: flex;
  gap: 8px;
}
.header-search input {
  flex: 1;
  padding: 10px 16px;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  outline: none;
}
.header-search button {
  padding: 10px 20px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  font-weight: 600;
  transition: background .2s;
}
.header-search button:hover { background: var(--primary-dark); }
.header-nav a {
  color: rgba(255,255,255,.85);
  margin-left: 16px;
  font-size: 14px;
}
.header-nav a:hover { color: #fff; }

/* Layout */
.main-layout {
  max-width: 1280px;
  margin: 0 auto;
  padding: 24px 20px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 24px;
}

/* Sidebar */
.sidebar-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  margin-bottom: 20px;
}
.sidebar-card h3 {
  background: var(--secondary);
  color: #fff;
  padding: 12px 16px;
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .5px;
}
.filter-body { padding: 16px; }
.filter-group { margin-bottom: 16px; }
.filter-group label {
  display: block;
  font-size: 12px;
  font-weight: 600;
  color: var(--gray);
  margin-bottom: 6px;
  text-transform: uppercase;
}
.filter-group select,
.filter-group input[type=text],
.filter-group input[type=number] {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  outline: none;
  transition: border-color .2s;
}
.filter-group select:focus,
.filter-group input:focus { border-color: var(--accent); }
.price-range { display: flex; gap: 8px; align-items: center; }
.price-range span { color: var(--gray); font-size: 12px; }
.filter-btn {
  width: 100%;
  padding: 10px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 6px;
  cursor: pointer;
  font-weight: 600;
  font-size: 14px;
  transition: background .2s;
  margin-top: 4px;
}
.filter-btn:hover { background: var(--primary-dark); }
.filter-reset {
  width: 100%;
  padding: 8px;
  background: none;
  color: var(--gray);
  border: 1px solid var(--border);
  border-radius: 6px;
  cursor: pointer;
  font-size: 13px;
  margin-top: 8px;
}
.filter-reset:hover { border-color: var(--gray); color: var(--dark); }

/* Category list */
.cat-list { list-style: none; }
.cat-list li a {
  display: flex;
  justify-content: space-between;
  padding: 10px 16px;
  color: var(--dark);
  border-bottom: 1px solid var(--border);
  font-size: 14px;
  transition: background .15s;
}
.cat-list li a:hover { background: var(--light); color: var(--primary); }
.cat-list li.active a { background: var(--primary); color: #fff; }
.cat-list li a .cnt {
  background: var(--light);
  color: var(--gray);
  border-radius: 20px;
  padding: 1px 8px;
  font-size: 12px;
}
.cat-list li.active a .cnt { background: rgba(255,255,255,.2); color: #fff; }

/* Products grid */
.products-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 16px;
}
.products-header h2 { font-size: 20px; font-weight: 700; }
.sort-select {
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 14px;
  background: #fff;
}
.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}
.product-card {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
}
.product-card-img {
  aspect-ratio: 4/3;
  overflow: hidden;
  background: #f0f2f5;
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.product-card:hover .product-card-img img { transform: scale(1.05); }
.product-card-img .no-img {
  font-size: 48px;
  color: var(--border);
}
.product-card-body { padding: 12px; flex: 1; display: flex; flex-direction: column; }
.product-card-brand {
  font-size: 11px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  margin-bottom: 4px;
}
.product-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--dark);
  margin-bottom: 8px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.product-card-oem {
  font-size: 11px;
  color: var(--gray);
  margin-bottom: 8px;
}
.product-card-price {
  font-size: 18px;
  font-weight: 700;
  color: var(--primary);
  margin-top: auto;
}
.product-card-price small { font-size: 12px; font-weight: 400; color: var(--gray); }
.product-card-footer {
  padding: 10px 12px;
  border-top: 1px solid var(--border);
  display: flex;
  gap: 8px;
}
.btn-detail {
  flex: 1;
  padding: 8px;
  background: var(--secondary);
  color: #fff;
  border: none;
  border-radius: 6px;
  text-align: center;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background .2s;
  display: block;
}
.btn-detail:hover { background: var(--accent); color: #fff; }

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
}
.pagination a, .pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 6px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--dark);
  transition: all .2s;
}
.pagination a:hover { border-color: var(--primary); color: var(--primary); }
.pagination .active { background: var(--primary); border-color: var(--primary); color: #fff; }

/* Product detail page */
.product-detail {
  background: #fff;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 32px;
}
.product-gallery { position: relative; }
.main-image { width: 100%; aspect-ratio: 4/3; object-fit: contain; border-radius: 8px; background: #f8f9fa; margin-bottom: 12px; }
.thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.thumbs img {
  width: 70px;
  height: 70px;
  object-fit: cover;
  border-radius: 6px;
  border: 2px solid transparent;
  cursor: pointer;
  transition: border-color .2s;
}
.thumbs img.active, .thumbs img:hover { border-color: var(--primary); }
.product-info h1 { font-size: 24px; font-weight: 700; margin-bottom: 16px; }
.product-specs { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin: 20px 0; }
.spec-item { background: var(--light); border-radius: 6px; padding: 10px 12px; }
.spec-label { font-size: 11px; color: var(--gray); text-transform: uppercase; margin-bottom: 2px; }
.spec-value { font-weight: 600; font-size: 14px; }
.product-price-box { background: var(--light); border-radius: 8px; padding: 20px; margin: 20px 0; }
.product-price { font-size: 32px; font-weight: 800; color: var(--primary); }
.product-desc { margin-top: 24px; line-height: 1.7; }
.product-desc h3 { margin-bottom: 12px; }

/* Breadcrumb */
.breadcrumb { font-size: 13px; color: var(--gray); margin-bottom: 16px; }
.breadcrumb a { color: var(--gray); }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb span { margin: 0 6px; }

/* No results */
.no-results { text-align: center; padding: 60px 20px; color: var(--gray); }
.no-results .icon { font-size: 64px; margin-bottom: 16px; }
.no-results h3 { font-size: 20px; margin-bottom: 8px; color: var(--dark); }

/* Footer */
.site-footer {
  background: var(--secondary);
  color: rgba(255,255,255,.7);
  text-align: center;
  padding: 24px;
  margin-top: 40px;
  font-size: 13px;
}

/* Responsive */
@media (max-width: 900px) {
  .main-layout { grid-template-columns: 1fr; }
  .sidebar { order: -1; }
  .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .header-inner { flex-wrap: wrap; }
  .product-detail { padding: 16px; }
}
@media (max-width: 600px) {
  .header-search { order: 3; width: 100%; }
  .products-grid { grid-template-columns: 1fr 1fr; }
  .product-specs { grid-template-columns: 1fr; }
}
