/* ============================================================
   Barsupply.com — Product Catalog Stylesheet
   ============================================================ */

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --navy:        #1b3a5c;
  --navy-dark:   #122740;
  --navy-mid:    #264d7a;
  --gold:        #c9a84c;
  --gold-light:  #e8c96a;
  --gold-bg:     #fdf6e3;
  --bg:          #eef1f6;
  --white:       #ffffff;
  --text:        #1a2636;
  --text-mid:    #4a5568;
  --text-muted:  #8a9ab0;
  --border:      #e0e6f0;
  --sidebar-w:   272px;
  --header-h:    68px;
  --shadow-sm:   0 2px 6px rgba(0,0,0,.06), 0 1px 2px rgba(0,0,0,.04);
  --shadow-md:   0 8px 24px rgba(0,0,0,.11), 0 2px 6px rgba(0,0,0,.06);
  --shadow-card: 0 1px 4px rgba(27,58,92,.07), 0 4px 16px rgba(27,58,92,.06);
  --radius:      12px;
  --radius-sm:   8px;
}

html { scroll-behavior: smooth; }

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 14px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

/* ===== HEADER ===== */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 20px;
  padding: 0 32px;
  z-index: 200;
  box-shadow: 0 1px 0 #e0e6f0, 0 4px 20px rgba(27,58,92,.08);
  border-bottom: 3px solid var(--gold);
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 11px;
  flex-shrink: 0;
  text-decoration: none;
  cursor: pointer;
}

.brand-logo {
  height: 56px;
  width: auto;
  max-width: 220px;
  object-fit: contain;
  flex-shrink: 0;
}

.brand-text {
  display: none;
}

.brand-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: .01em;
}

.brand-tagline {
  font-size: 10px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 1px;
}

.header-search {
  flex: 1;
  max-width: 580px;
  position: relative;
  display: flex;
  align-items: center;
}

.header-search svg {
  position: absolute;
  left: 14px;
  width: 15px; height: 15px;
  color: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.header-search input {
  width: 100%;
  padding: 10px 40px 10px 40px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  background: var(--bg);
  color: var(--text);
  font-size: 13.5px;
  font-family: inherit;
  outline: none;
  transition: border-color .2s, background .2s;
}
.header-search input::placeholder { color: var(--text-muted); }
.header-search input:focus {
  background: #fff;
  border-color: var(--navy);
}

.clear-btn {
  position: absolute;
  right: 10px;
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 16px;
  cursor: pointer;
  padding: 0 2px;
  line-height: 1;
  transition: color .15s;
}
.clear-btn:hover { color: var(--text); }

.search-kbd {
  position: absolute;
  right: 10px;
  font-size: 11px;
  color: var(--text-muted);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 5px;
  pointer-events: none;
  font-family: inherit;
  line-height: 1.4;
  transition: opacity .15s;
}
.header-search:focus-within .search-kbd,
.header-search input:not(:placeholder-shown) ~ .search-kbd {
  opacity: 0;
}

.contact-nav-link {
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  padding: 8px 18px;
  border: 1.5px solid var(--border);
  border-radius: 24px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: border-color .15s, background .15s;
}
.contact-nav-link:hover {
  background: var(--bg);
  border-color: var(--navy);
}

.header-meta {
  margin-left: auto;
  font-size: 12.5px;
  color: var(--text-muted);
  flex-shrink: 0;
  white-space: nowrap;
}
.header-meta span {
  font-weight: 700;
  color: var(--navy);
}

/* ===== HERO ===== */
.hero {
  background: linear-gradient(140deg, #0f2236 0%, #1b3a5c 55%, #1f4870 100%);
  padding: 24px 40px 20px;
  margin-top: var(--header-h);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}


.hero-region {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .18em;
  color: var(--gold);
  border: 1px solid rgba(201,168,76,.4);
  border-radius: 20px;
  padding: 5px 16px;
  margin-bottom: 20px;
}

.hero-title {
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  letter-spacing: -.02em;
  margin-bottom: 16px;
  line-height: 1.22;
}

.hero-sub {
  font-size: 15.5px;
  color: rgba(255,255,255,.58);
  font-weight: 400;
  line-height: 1.7;
  max-width: 580px;
  margin: 0 auto;
}

.hero-segs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  max-width: 960px;
  margin: 0 auto;
}

.hero-seg {
  background: rgba(255,255,255,.07);
  border: 1px solid rgba(255,255,255,.13);
  border-radius: 10px;
  padding: 12px 14px 10px;
  cursor: pointer;
  transition: background .2s, border-color .22s, transform .2s, box-shadow .2s;
  user-select: none;
}
.hero-seg:hover {
  background: rgba(255,255,255,.13);
  border-color: var(--gold);
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.25);
}

.hero-seg-icon {
  font-size: 22px;
  margin-bottom: 4px;
  line-height: 1;
}

.hero-seg-name {
  font-size: 14px;
  font-weight: 600;
  color: #fff;
  margin-bottom: 5px;
  line-height: 1.3;
}

.hero-seg-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--gold);
  letter-spacing: .02em;
}

/* ===== LAYOUT ===== */
.layout {
  display: flex;
  min-height: calc(100vh - var(--header-h) - 52px);
}

/* ===== SIDEBAR ===== */
.sidebar {
  width: var(--sidebar-w);
  flex-shrink: 0;
  position: sticky;
  top: var(--header-h);
  height: calc(100vh - var(--header-h));
  overflow-y: auto;
  background: var(--white);
  border-right: 1px solid var(--border);
}

.sidebar::-webkit-scrollbar { width: 4px; }
.sidebar::-webkit-scrollbar-track { background: transparent; }
.sidebar::-webkit-scrollbar-thumb { background: #c8d0db; border-radius: 4px; }

.sidebar-inner { padding: 4px 0 24px; }

.filter-section { padding-bottom: 6px; }
.filter-section + .filter-section {
  border-top: 1px solid var(--border);
  padding-top: 6px;
  margin-top: 4px;
}

.filter-label {
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--text-muted);
  padding: 16px 18px 8px;
}

/* Segment list */
.seg-list { list-style: none; }

.seg-item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 8px 16px 8px 14px;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition: background .13s;
  user-select: none;
}
.seg-item:hover { background: #f5f7fa; }
.seg-item.active {
  background: #edf3fb;
  border-left-color: var(--navy);
}

.seg-icon { font-size: 15px; flex-shrink: 0; }
.seg-name  { flex: 1; font-size: 13px; font-weight: 500; color: var(--text-mid); }
.seg-item.active .seg-name { color: var(--navy); font-weight: 600; }

.seg-count {
  font-size: 11px;
  font-weight: 600;
  background: #e8edf5;
  color: var(--text-muted);
  padding: 1px 7px;
  border-radius: 20px;
  min-width: 28px;
  text-align: center;
}
.seg-item.active .seg-count {
  background: var(--navy);
  color: #fff;
}

/* Category list */
.cat-list { list-style: none; }

.cat-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
  padding: 6px 16px 6px 17px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-mid);
  border-left: 3px solid transparent;
  transition: background .13s;
  user-select: none;
}
.cat-item:hover { background: #f5f7fa; }
.cat-item.active {
  background: #fff9ec;
  border-left-color: var(--gold);
  color: var(--text);
  font-weight: 600;
}

.cat-name { flex: 1; }
.cat-count {
  font-size: 11px;
  color: var(--text-muted);
  flex-shrink: 0;
}
.cat-item.active .cat-count { color: var(--gold); }

/* ===== MAIN CONTENT ===== */
.main {
  flex: 1;
  min-width: 0;
  padding: 22px 26px 40px;
}

/* Toolbar */
.toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
  position: sticky;
  top: var(--header-h);
  background: var(--bg);
  z-index: 100;
  padding: 12px 0 10px;
  margin-bottom: 8px;
  border-bottom: 1px solid var(--border);
  box-shadow: 0 2px 8px rgba(0,0,0,.05);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 13px;
  flex-wrap: wrap;
}
.bc-link {
  color: var(--navy);
  cursor: pointer;
  font-weight: 500;
}
.bc-link:hover { text-decoration: underline; }
.bc-sep { color: var(--text-muted); font-size: 12px; }
.bc-current { color: var(--text-muted); }

.toolbar-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

.result-count {
  font-size: 12.5px;
  color: var(--text-muted);
  white-space: nowrap;
}

.sort-sel {
  padding: 6px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  background: var(--white);
  color: var(--text);
  cursor: pointer;
  outline: none;
  transition: border-color .15s;
}
.sort-sel:hover { border-color: #b0bac8; }
.sort-sel:focus { border-color: var(--navy); }

.cat-sel { min-width: 160px; }

/* ===== PRODUCT GRID ===== */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 20px;
  margin-bottom: 36px;
}

.product-card {
  background: var(--white);
  border-radius: var(--radius);
  padding: 0;
  box-shadow: var(--shadow-card);
  display: flex;
  flex-direction: column;
  border: 1px solid var(--border);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
}
.product-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}

.card-cat {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--navy);
  background: var(--gold-bg);
  border: 1px solid #f0dcab;
  border-radius: 20px;
  padding: 2px 9px;
  align-self: flex-start;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-name {
  font-size: 13.5px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.45;
  flex: 1;
  margin-top: 2px;
}

.card-code {
  font-size: 11px;
  color: var(--text-muted);
  font-family: 'Courier New', Courier, monospace;
  letter-spacing: .02em;
}

.card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid var(--border);
}

.card-price.no-price {
  color: var(--text-muted);
  font-weight: 400;
  font-size: 12.5px;
  font-style: italic;
}

/* ===== CARD IMAGE ===== */
.card-img-wrap {
  position: relative;
  width: 100%;
  overflow: hidden;
  background: #f4f6fa;
  aspect-ratio: 4 / 3;
  border-bottom: 1px solid var(--border);
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  padding: 10px;
  transition: transform .25s ease;
}
.product-card:hover .card-img {
  transform: scale(1.04);
}

.card-img-placeholder {
  width: 100%;
  background: linear-gradient(135deg, #edf1f8 0%, #e0e6f0 100%);
  aspect-ratio: 4 / 3;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c0cad8;
  font-size: 36px;
  border-bottom: 1px solid var(--border);
}

/* ===== CARD DESCRIPTION ===== */
.card-desc {
  font-size: 12px;
  color: var(--text-muted);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ===== SEARCH HIGHLIGHT ===== */
mark.search-hl {
  background: #fef3c7;
  color: inherit;
  border-radius: 2px;
  padding: 0 1px;
  font-style: normal;
}

/* ===== EMPTY STATE ===== */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 72px 24px;
  color: var(--text-muted);
}
.empty-state h3 { font-size: 18px; font-weight: 600; margin-bottom: 8px; color: var(--text-mid); }
.empty-state p  { font-size: 14px; margin-bottom: 18px; }
.empty-state button {
  padding: 9px 20px;
  background: var(--navy);
  color: #fff;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-family: inherit;
  font-weight: 500;
  cursor: pointer;
  transition: background .15s;
}
.empty-state button:hover { background: var(--navy-mid); }

/* ===== PAGINATION ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  padding: 12px 0 20px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--white);
  color: var(--text-mid);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  transition: background .13s, border-color .13s, color .13s;
  white-space: nowrap;
  font-weight: 500;
}
.page-btn:hover:not([disabled]) { background: var(--bg); border-color: #a0aec0; color: var(--navy); }
.page-btn.active {
  background: var(--navy);
  color: #fff;
  border-color: var(--navy);
  font-weight: 700;
  cursor: default;
  box-shadow: 0 2px 8px rgba(27,58,92,.25);
}
.page-btn[disabled] { opacity: .35; cursor: not-allowed; }
.page-ellipsis { color: var(--text-muted); padding: 0 3px; font-size: 14px; }

/* ===== FOOTER ===== */
.footer {
  background: var(--navy-dark);
  color: rgba(255,255,255,.42);
  text-align: center;
  padding: 16px 24px;
  font-size: 12px;
  line-height: 1.6;
}

/* ===== PRODUCT CARD LINK ===== */
.product-card-link {
  text-decoration: none;
  display: block;
  color: inherit;
}
.product-card-link:hover .product-card {
  box-shadow: var(--shadow-md);
  transform: translateY(-2px);
  border-color: #c5d0e0;
}
.product-card-link .product-card { transition: box-shadow .18s, transform .18s, border-color .18s; }

/* ===== PRODUCT DETAIL PAGE ===== */
.pd-page {
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h) - 52px);
  background: var(--bg);
  padding: 32px 0 48px;
}

.pd-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.pd-back-link {
  display: inline-block;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
  margin-bottom: 24px;
  padding: 7px 16px;
  border: 1.5px solid var(--border);
  border-radius: 20px;
  background: var(--white);
  transition: border-color .15s, background .15s;
}
.pd-back-link:hover { border-color: var(--navy); background: var(--bg); }

.pd-detail {
  display: grid;
  grid-template-columns: 420px 1fr;
  gap: 40px;
  align-items: start;
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  border: 1px solid var(--border);
  overflow: hidden;
}

.pd-gallery {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pd-img-wrap {
  background: #f4f6fa;
  display: flex;
  align-items: center;
  justify-content: center;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  border-radius: var(--radius) var(--radius) 0 0;
}

.pd-thumbs {
  display: flex;
  gap: 8px;
  padding: 0 12px 12px;
  overflow-x: auto;
  background: #f4f6fa;
  border-radius: 0 0 var(--radius) var(--radius);
  scrollbar-width: none;
}
.pd-thumbs::-webkit-scrollbar { display: none; }

.pd-thumb {
  width: 64px;
  height: 64px;
  object-fit: contain;
  border-radius: 6px;
  border: 2px solid transparent;
  background: #fff;
  cursor: pointer;
  flex-shrink: 0;
  padding: 4px;
  transition: border-color .15s;
  opacity: .7;
}
.pd-thumb:hover { opacity: 1; border-color: #c8d0db; }
.pd-thumb.active { border-color: var(--navy); opacity: 1; }

.pd-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 24px;
}

.pd-img-placeholder {
  font-size: 72px;
  color: #c8d0db;
}

.pd-info {
  padding: 36px 36px 36px 0;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.pd-cat-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .1em;
  color: var(--gold);
  background: #fff8e7;
  border: 1px solid #f0dfa0;
  border-radius: 20px;
  padding: 4px 12px;
  width: fit-content;
}

.pd-name {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
  margin: 0;
}

.pd-code {
  font-size: 13px;
  color: var(--text-muted);
  font-family: 'Courier New', monospace;
}

.pd-supplier {
  font-size: 13px;
  color: var(--text-muted);
}

.pd-desc {
  font-size: 14px;
  color: var(--text-mid);
  line-height: 1.7;
  margin: 4px 0;
}

.pd-price {
  font-size: 28px;
  font-weight: 700;
  color: var(--navy);
  margin-top: 4px;
}

.pd-price.pd-price-call {
  font-size: 16px;
  font-weight: 400;
  color: var(--text-muted);
  font-style: italic;
}

.pd-cat-link {
  display: inline-block;
  margin-top: 8px;
  font-size: 13px;
  font-weight: 500;
  color: var(--navy);
  text-decoration: none;
}
.pd-cat-link:hover { text-decoration: underline; }

.pd-notfound {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-muted);
}
.pd-notfound h2 { font-size: 22px; margin-bottom: 10px; color: var(--text-mid); }

.pd-related-wrap {
  background: var(--bg);
  padding: 40px 0 48px;
  border-top: 1px solid var(--border);
}

.pd-related-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 32px;
}

.pd-related-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 20px;
}

.pd-loading {
  text-align: center;
  padding: 80px;
  color: var(--text-muted);
  font-size: 15px;
}

/* Product detail mobile */
@media (max-width: 768px) {
  .pd-detail { grid-template-columns: 1fr; }
  .pd-info { padding: 20px; }
  .pd-name { font-size: 18px; }
  .pd-price { font-size: 22px; }
  .pd-container { padding: 0 16px; }
  .pd-related-inner { padding: 0 16px; }
}

/* ===== LOADING SPINNER ===== */
.loading {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px;
  color: var(--text-muted);
}

/* ===== MOBILE FILTER BUTTON (hidden on desktop) ===== */
.mobile-filter-btn {
  display: none;
}

/* ===== SIDEBAR CLOSE ROW (hidden on desktop) ===== */
.sidebar-close-row { display: none; }

/* ===== SIDEBAR OVERLAY (hidden on desktop) ===== */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 190;
  -webkit-tap-highlight-color: transparent;
}
.sidebar-overlay.show { display: block; }

/* ===== TABLET (≤ 1024px) ===== */
@media (max-width: 1024px) {
  :root { --sidebar-w: 230px; }
  .product-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
}

/* ===== MOBILE (≤ 768px) ===== */
@media (max-width: 768px) {
  /* Disable hover transforms on touch — reduces freezes */
  .product-card:hover { transform: none; }
  .product-card-link:hover .product-card { transform: none; }
  .hero-seg:hover { transform: none; box-shadow: none; }
  /* Fast tap response */
  button, a, .seg-item, .cat-item, .hero-seg, .product-card-link {
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* Header: 2-row layout */
  .header {
    flex-wrap: wrap;
    height: auto;
    padding: 10px 16px;
    gap: 8px;
    row-gap: 8px;
  }

  .header-brand { flex: 1; min-width: 0; }

  .brand-name { font-size: 13px; }
  .brand-tagline { font-size: 9px; }

  .header-search {
    order: 3;
    flex-basis: 100%;
    max-width: 100%;
  }

  .header-meta { display: none; }
  .search-kbd { display: none; }

  /* Filter button — shown on mobile */
  .mobile-filter-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    background: rgba(255,255,255,.12);
    border: 1px solid rgba(255,255,255,.2);
    border-radius: var(--radius);
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    font-weight: 500;
    cursor: pointer;
    flex-shrink: 0;
    transition: background .15s;
  }
  .mobile-filter-btn:hover { background: rgba(255,255,255,.2); }
  .mobile-filter-btn svg { width: 15px; height: 15px; }
  .mobile-filter-btn.active { background: var(--gold); color: var(--navy); border-color: var(--gold); }

  /* Layout: account for taller header (~108px) */
  .layout { margin-top: 108px; }

  /* Sidebar: slide-in drawer */
  .sidebar {
    position: fixed;
    top: 0;
    left: calc(-1 * var(--sidebar-w) - 10px);
    height: 100vh;
    z-index: 200;
    transition: left .25s cubic-bezier(.4,0,.2,1);
    box-shadow: none;
    padding-top: 0;
  }
  .sidebar.mobile-open {
    left: 0;
    box-shadow: 4px 0 24px rgba(0,0,0,.2);
  }

  /* Close button inside sidebar */
  .sidebar-close-row {
    display: flex;
    justify-content: flex-end;
    padding: 12px 14px 4px;
    border-bottom: 1px solid var(--border);
    margin-bottom: 4px;
  }
  .sidebar-close-btn {
    background: none;
    border: none;
    font-size: 13px;
    color: var(--text-muted);
    cursor: pointer;
    font-family: inherit;
    padding: 4px 8px;
    border-radius: 4px;
  }
  .sidebar-close-btn:hover { background: var(--bg); color: var(--text); }

  /* Main content: full width */
  .main { padding: 14px 14px 32px; }

  /* Toolbar: stack on small screens, adjust sticky top for taller mobile header */
  .toolbar {
    gap: 8px;
    flex-direction: column;
    align-items: stretch;
    top: 108px;
    padding: 10px 0 8px;
  }
  .toolbar-right { flex-wrap: wrap; gap: 8px; }
  .toolbar-right .sort-sel,
  .toolbar-right .cat-sel { flex: 1; min-width: 0; font-size: 14px; padding: 10px 12px; }
  .result-count { font-size: 12px; }

  /* Product grid: 2 columns */
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

  /* Slightly smaller card text */
  .card-name { font-size: 12px; }
  .card-price { font-size: 13px; }
  .card-desc { -webkit-line-clamp: 2; }

  /* Pagination: smaller */
  .page-btn { min-width: 32px; height: 32px; font-size: 12px; }

  /* Footer */
  .footer { font-size: 11px; padding: 14px 16px; }

  /* Hero: margin-top set dynamically by JS, fallback here */
  .hero {
    margin-top: 120px;
    padding: 20px 16px 18px;
  }
  .hero-segs {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px;
    width: 100%;
  }
  .hero-seg { padding: 14px 12px 12px; }
  .hero-seg-icon { font-size: 24px; margin-bottom: 6px; }
  .hero-seg-name { font-size: 13px; }
  .hero-seg-count { font-size: 11px; }
}

/* ===== VERY SMALL (≤ 400px) ===== */
@media (max-width: 400px) {
  .product-grid { grid-template-columns: 1fr; }
  .brand-name { font-size: 12px; }
}
