/* ─────────────────────────────────────────────────────────────
   TechMart Electronics - Premium Shop & Filter Design System
───────────────────────────────────────────────────────────── */

:root {
  --primary:     #0098D9;
  --primary-dk:  #0077b6;
  --secondary:   #1A7AC4;
  --dark:        #0d2a45;
  --white:       #ffffff;
  --off:         #f8fafc;
  --g50:         #f8fafc;
  --g100:        #f1f5f9;
  --g150:        #e2e8f0;
  --g200:        #cbd5e1;
  --g300:        #94a3b8;
  --g400:        #64748b;
  --g500:        #475569;
  --g600:        #334155;
  --g800:        #1e293b;
  --danger:      #ef4444; 
  --success:     #16a34a; 
  --warn:        #f97316;
  --heading:     'Poppins', sans-serif; 
  --body:        'Manrope', sans-serif;
  /* --hh = announcement-bar (~38px) + sticky header (70px) + 2px border */
  --hh:          110px;
  --max:         1260px; 
  --px:          24px; 
  --radius:      14px;
  --sidebar:     270px;
  --card-shadow: 0 2px 10px rgba(15, 23, 42, 0.05);
  --card-shadow-hover: 0 12px 30px rgba(0, 152, 217, 0.15);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; -webkit-text-size-adjust: 100%; }
body { font-family: var(--body); background: #f8fafc; color: var(--g800); -webkit-font-smoothing: antialiased; line-height: 1.6; }
img { display: block; max-width: 100%; }
a { text-decoration: none; color: inherit; }
ul { list-style: none; }
button { cursor: pointer; border: none; background: none; font-family: inherit; }
input, button, select, textarea { font-family: inherit; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--px); }

/* ── Breadcrumb ── */
.breadcrumb { padding: 24px 0 16px; text-align: center; }
.breadcrumb nav { display: flex; align-items: center; justify-content: center; gap: 8px; flex-wrap: wrap; }
.breadcrumb a { font-size: 0.85rem; color: var(--g400); transition: color .2s; font-weight: 500; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb .sep { color: var(--g300); font-size: 0.8rem; }
.breadcrumb .cur { font-size: 0.85rem; color: var(--g600); font-weight: 600; }

/* ── Shop Layout ── */
.shop-wrap { padding: 8px 0 80px; }
.shop-layout { display: grid; grid-template-columns: var(--sidebar) 1fr; gap: 28px; align-items: start; }

/* ═════════════════════════════════════════════════════════════
   FILTER OPTIONS SIDEBAR (Refined Modern Design)
═════════════════════════════════════════════════════════════ */
.sidebar {
  background: var(--white);
  border: 1.5px solid var(--g150);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: var(--card-shadow);
  position: sticky;
  top: calc(var(--hh) + 16px);
}
.sb-top-hd {
  padding: 18px 20px;
  border-bottom: 1px solid var(--g150);
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.sb-top-hd h2 {
  font-family: var(--heading);
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--g800);
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.sb-top-hd h2 svg { color: var(--primary); }

.sb-reset-link {
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--primary);
  text-decoration: underline;
  transition: color 0.18s;
}
.sb-reset-link:hover { color: var(--primary-dk); }

.sb-section {
  border-bottom: 1px solid var(--g100);
  padding: 16px 20px;
}
.sb-section:last-child { border-bottom: none; }
.sb-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  user-select: none;
  margin-bottom: 12px;
}
.sb-hd h3 {
  font-family: var(--heading);
  font-weight: 600;
  font-size: 0.86rem;
  color: var(--g800);
}
.sb-hd svg { color: var(--g300); transition: transform .25s; }
.sb-hd.collapsed svg { transform: rotate(-90deg); }
.sb-hd.collapsed + .sb-body { display: none; }

/* Category List */
.cat-list { display: flex; flex-direction: column; gap: 3px; }
.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--g600);
  transition: all .18s;
  font-weight: 500;
  gap: 8px;
}
.cat-item:hover { background: var(--g50); color: var(--secondary); }
.cat-item.active { background: rgba(0, 152, 217, 0.08); color: var(--primary); font-weight: 700; }
.cat-item.is-empty { opacity: 0.65; }
.cat-item.is-empty:hover { opacity: 1; }

.cat-ct {
  font-size: 0.72rem;
  color: var(--g400);
  font-weight: 700;
  background: var(--g100);
  padding: 2px 8px;
  border-radius: 12px;
  margin-left: auto;
  flex-shrink: 0;
  min-width: 24px;
  text-align: center;
  display: inline-block;
}
.cat-item.active .cat-ct {
  background: var(--primary);
  color: #ffffff;
}

/* Brands & Promo Checkboxes */
.brand-list, .chk-filters { display: flex; flex-direction: column; gap: 4px; }
.brand-item, .promo-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 10px;
  border-radius: 8px;
  font-size: 0.85rem;
  color: var(--g600);
  transition: all .18s;
  font-weight: 500;
}
.brand-item:hover, .promo-item:hover { background: var(--g50); color: var(--g800); }
.brand-item.active, .promo-item.active { color: var(--primary); font-weight: 700; }

.chk-box {
  width: 17px;
  height: 17px;
  border: 1.5px solid var(--g300);
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: all .18s;
  background: var(--white);
}
.chk-box.checked {
  background: var(--primary);
  border-color: var(--primary);
}
.chk-box.checked::after {
  content: '';
  width: 4px;
  height: 8px;
  border: solid var(--white);
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
  margin-top: -2px;
}

/* Price Range Filter & Presets */
.price-range-display {
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--g800);
  margin-bottom: 10px;
  background: var(--g50);
  padding: 8px 12px;
  border-radius: 8px;
  text-align: center;
  border: 1px solid var(--g150);
}
.price-presets {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
}
.price-chip {
  font-size: 0.73rem;
  font-weight: 600;
  padding: 4px 9px;
  border-radius: 20px;
  background: var(--g100);
  color: var(--g600);
  text-decoration: none;
  transition: all 0.18s;
  border: 1px solid transparent;
}
.price-chip:hover {
  background: rgba(0, 152, 217, 0.1);
  color: var(--primary);
}
.price-chip.active {
  background: var(--primary);
  color: #ffffff;
}

.price-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}
.price-inputs input {
  width: 100%;
  height: 38px;
  padding: 0 10px;
  border: 1.5px solid var(--g200);
  border-radius: 8px;
  font-size: 0.82rem;
  color: var(--g800);
  outline: none;
  background: var(--white);
}
.price-inputs input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(0,152,217,0.12); }
.price-sep { font-size: 0.8rem; color: var(--g400); font-weight: 600; }
.price-apply-btn {
  width: 38px;
  height: 38px;
  background: var(--primary);
  color: var(--white);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: background .2s, transform 0.18s;
}
.price-apply-btn:hover { background: var(--primary-dk); transform: translateY(-1px); }

/* Rating Filter */
.rating-filter-list { display: flex; flex-direction: column; gap: 4px; }
.rating-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 8px;
  border-radius: 6px;
  transition: background .18s;
}
.rating-item:hover { background: var(--g50); }
.rating-item.active { background: rgba(0, 152, 217, 0.08); font-weight: 700; }
.stars-row { display: flex; gap: 2px; }
.star-filled { fill: #f59e0b; color: #f59e0b; }
.star-empty { fill: var(--g200); color: var(--g200); }
.rating-label { font-size: 0.78rem; color: var(--g600); font-weight: 500; }

.promo-badge-text { font-size: 0.83rem; font-weight: 600; }

/* Clear All Button */
.clear-all-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  padding: 10px;
  border: 1.5px solid var(--g200);
  border-radius: 8px;
  color: var(--g600);
  font-size: 0.82rem;
  font-weight: 600;
  transition: all .2s;
}
.clear-all-btn:hover { border-color: var(--danger); color: var(--danger); background: #fef2f2; }

/* ── Main Toolbar ── */
.shop-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
  background: var(--white);
  padding: 12px 18px;
  border-radius: 12px;
  border: 1.5px solid var(--g150);
}
.result-count { font-size: 0.88rem; color: var(--g400); }
.result-count strong { color: var(--secondary); font-weight: 700; }
.toolbar-right { display: flex; align-items: center; gap: 8px; }
.sort-label { font-size: 0.84rem; color: var(--g600); font-weight: 600; }
.sort-select {
  height: 38px;
  padding: 0 32px 0 12px;
  background: var(--g50);
  border: 1.5px solid var(--g200);
  border-radius: 8px;
  font-size: 0.84rem;
  color: var(--g800);
  outline: none;
  cursor: pointer;
  transition: border-color .2s;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%2364748b' stroke-width='2'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 14px;
}
.sort-select:focus { border-color: var(--primary); }

/* Active Filter Pills Bar */
.active-filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-bottom: 20px; }
.filter-tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--g800);
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 500;
  padding: 5px 14px;
  border-radius: 20px;
}
.filter-tag a { color: rgba(255, 255, 255, 0.7); font-weight: 700; transition: color .2s; margin-left: 2px; }
.filter-tag a:hover { color: var(--white); }

/* ═════════════════════════════════════════════════════════════
   PRODUCT GRID & CARDS — Identical to Home Page
═════════════════════════════════════════════════════════════ */
.prod-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

/* Card shell */
.prod-card {
  background: #ffffff;
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: 0 2px 10px rgba(0,0,0,0.03);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  cursor: pointer;
}
.prod-card:hover {
  border-color: #0098D9;
  box-shadow: 0 12px 24px rgba(0,152,217,0.12);
  transform: translateY(-4px);
}

/* Image wrapper */
.prod-img-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  background: #ffffff;
  aspect-ratio: 1 / 1;
  width: 100%;
  max-height: 220px;
  overflow: hidden;
  padding: 16px;
  box-sizing: border-box;
}
.prod-img-link {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  text-decoration: none;
}
.prod-img-link:hover .prod-img-photo { transform: scale(1.05); }
.prod-img-photo {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  object-fit: contain;
  padding: 8px;
  transition: transform 0.35s ease;
  display: block;
  margin: 0 auto;
}

/* Wishlist heart — top right, always visible */
.prod-img-wrap .wish-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  z-index: 4;
  transition: all 0.2s;
}
.prod-img-wrap .wish-btn:hover { color: #ef4444; background: #fee2e2; border-color: #fca5a5; }
.prod-img-wrap .wish-btn.active svg { fill: #ef4444; stroke: #ef4444; }

/* Badge — top left */
.prod-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: .7rem;
  font-weight: 800;
  padding: 4px 10px;
  border-radius: 50px;
  z-index: 4;
  color: #ffffff;
  line-height: 1.4;
  letter-spacing: 0.02em;
}
.b-sale { background: #ef4444; }
.b-new  { background: #0098D9; }
.b-hot  { background: #f59e0b; }
.b-oos  { background: #94a3b8; }

/* Card body */
.prod-body {
  padding: 16px 18px 18px;
  display: flex;
  flex-direction: column;
  flex: 1;
  border-top: 1px solid #f1f5f9;
  background: #ffffff;
}

/* Brand */
.prod-brand {
  font-size: .7rem;
  color: #94a3b8;
  margin-bottom: 4px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Name */
.prod-name {
  font-size: .95rem;
  font-weight: 700;
  color: #0f172a;
  line-height: 1.4;
  margin-bottom: 8px;
  min-height: 2.6em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
}
.prod-name a { color: inherit; text-decoration: none; }
.prod-card:hover .prod-name a { color: #0098D9; }

/* Stars */
.stars { display: flex; gap: 2px; color: #0098D9; }
.stars svg { width: 13px; height: 13px; fill: currentColor; flex-shrink: 0; }
.stars svg.emp { color: #dde2e8; }
.rat-row { display: flex; align-items: center; gap: 5px; margin-bottom: 10px; }
.rat-ct { font-size: .74rem; color: #64748b; font-weight: 600; }

/* Price row */
.price-row {
  display: flex;
  align-items: baseline;
  gap: 7px;
  margin-bottom: 14px;
  margin-top: auto;
}
.price-main {
  font-size: 1.1rem;
  font-weight: 800;
  color: #0f172a;
  font-family: var(--heading);
}
.price-old {
  font-size: .8rem;
  color: #94a3b8;
  text-decoration: line-through;
}

/* Add to Cart button */
.qadd {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  height: 44px;
  background: #0098D9;
  color: #ffffff;
  border: none;
  border-radius: 10px;
  font-size: .86rem;
  font-weight: 700;
  font-family: var(--heading);
  padding: 0 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0,152,217,0.22);
}
.qadd:hover { background: #1A7AC4; transform: translateY(-1px); }
.qadd:active { background: #1565c0; transform: translateY(0); }
.qadd--oos { background: #94a3b8; box-shadow: none; }
.qadd--oos:hover { background: #64748b; }

/* ── Pagination ── */
.pagination { display: flex; align-items: center; justify-content: center; gap: 6px; margin-top: 40px; }
.pg-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: 8px;
  font-family: var(--heading);
  font-weight: 600;
  font-size: 0.85rem;
  color: var(--g600);
  background: var(--white);
  border: 1.5px solid var(--g200);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .2s;
}
.pg-btn:hover { border-color: var(--secondary); color: var(--secondary); }
.pg-btn.active { background: var(--secondary); border-color: var(--secondary); color: var(--white); }

/* Empty state */
.empty-state {
  padding: 60px 24px;
  text-align: center;
  background: var(--white);
  border-radius: var(--radius);
  border: 1.5px dashed var(--g200);
}
.empty-ic {
  width: 72px;
  height: 72px;
  background: var(--g100);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 20px;
}
.empty-ic svg { width: 32px; height: 32px; color: var(--g400); }
.empty-state h3 { font-size: 1.2rem; font-weight: 700; color: var(--secondary); margin-bottom: 8px; }
.empty-state p { font-size: .875rem; color: var(--g400); max-width: 320px; margin: 0 auto 20px; }

@media(max-width: 1100px) {
  .prod-grid { grid-template-columns: repeat(2, 1fr); }
}
@media(max-width: 900px) {
  .shop-layout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media(max-width: 640px) {
  .prod-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .prod-img-wrap { max-height: 140px !important; padding: 10px !important; }
  .prod-body { padding: 10px 12px 12px !important; }
  .prod-name { font-size: .82rem; min-height: 0; margin-bottom: 6px; }
  .prod-brand { font-size: .65rem; margin-bottom: 2px; }
  .rat-row { margin-bottom: 6px; }
  .price-row { margin-bottom: 8px; flex-wrap: wrap; gap: 4px; }
  .price-main { font-size: .92rem; }
  .qadd { height: 36px; font-size: .78rem; border-radius: 8px; }
  .prod-img-wrap .wish-btn { width: 28px !important; height: 28px !important; top: 8px !important; right: 8px !important; }
  .prod-badge { font-size: .6rem; padding: 2px 7px; top: 8px; left: 8px; }
}
