/* ═══════════════════════════════════════════════════════════════
   PRODUCTS — page-specific styles only. Page header, sidebar shell,
   search, filter pills, topbar, and empty-state live in catalog.css.
   ═══════════════════════════════════════════════════════════════ */

/* ─── SIDEBAR HEADER (Products-only "Our Suppliers" panel) ─── */
.sidebar-header {
  background: linear-gradient(135deg, var(--primary), var(--accent));
  padding: 0.7rem 1.1rem;
  display: flex; align-items: center; gap: 8px;
}
.sidebar-header i { color: rgba(255,255,255,0.8); font-size: calc(0.78rem * var(--km-scale, 1)); }
.sidebar-header h6 {
  font-family: var(--font-heading); font-weight: 700; font-size: calc(0.72rem * var(--km-scale, 1));
  color: white; margin: 0; letter-spacing: 1.2px; text-transform: uppercase;
}
.supplier-list { list-style: none; padding: 0.25rem 0; margin: 0; max-height: 360px; overflow-y: auto; }
.supplier-list li { border-bottom: 1px solid var(--border); }
.supplier-list li:last-child { border-bottom: none; }
.supplier-btn {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.5rem 1.1rem;
  font-size: calc(0.74rem * var(--km-scale, 1));
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all 0.2s;
  background: none; border: none; width: 100%; text-align: left;
  font-family: var(--font-body);
}
.supplier-btn:hover { background: var(--primary-light); color: var(--primary); }
.supplier-btn.active { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.supplier-btn .s-flag {
  font-size: calc(0.6rem * var(--km-scale, 1)); color: var(--text-light); font-weight: 400;
  background: var(--bg);
  padding: 0.1rem 0.4rem;
  border-radius: 99px;
  border: 1px solid var(--border);
  white-space: nowrap;
}
.supplier-btn.active .s-flag { background: var(--primary-light); border-color: rgba(13,110,253,0.2); color: var(--primary); }

/* ─── TOPBAR EXTRAS (Products-only) ─── */
.supplier-tag-active {
  display: inline-flex; align-items: center; gap: 6px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  color: white;
  padding: 0.35rem 0.85rem;
  border-radius: 99px;
  font-size: calc(0.78rem * var(--km-scale, 1));
  font-weight: 600;
}
.view-toggle { display: flex; gap: 6px; }
.view-btn {
  width: 34px; height: 34px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(0.85rem * var(--km-scale, 1));
  cursor: pointer;
  transition: all 0.2s;
}
.view-btn.active, .view-btn:hover { background: var(--primary); border-color: var(--primary); color: white; }

/* ─── PRODUCT CARD ─── */
.product-card {
  background: white;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  overflow: hidden;
  transition: all 0.35s ease;
  height: 100%;
  display: flex; flex-direction: column;
  position: relative;
}
.product-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: rgba(13,110,253,0.15);
}
.product-card-img {
  width: 100%; height: 200px;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
  position: relative;
}
.product-card-img img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 1.2rem;
  transition: transform 0.4s ease, filter 0.4s ease;
  filter: grayscale(20%);
}
.product-card:hover .product-card-img img { transform: scale(1.07); filter: grayscale(0%); }
.product-card-img .img-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, rgba(13,110,253,0.06), rgba(108,99,255,0.06));
  opacity: 0;
  transition: opacity 0.3s;
}
.product-card:hover .img-overlay { opacity: 1; }
.quick-view-btn {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%) translateY(8px);
  opacity: 0;
  background: white;
  border: none;
  padding: 0.35rem 1rem;
  border-radius: 99px;
  font-size: calc(0.72rem * var(--km-scale, 1));
  font-weight: 600;
  color: var(--primary);
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: all 0.25s;
  white-space: nowrap;
  cursor: pointer;
  font-family: var(--font-body);
  display: flex; align-items: center; gap: 5px;
}
.product-card:hover .quick-view-btn { opacity: 1; transform: translateX(-50%) translateY(0); }
.supplier-badge {
  position: absolute; top: 10px; left: 10px;
  z-index: 2;
  background: white;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 0.2rem 0.55rem;
  font-size: calc(0.65rem * var(--km-scale, 1));
  font-weight: 700;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  box-shadow: var(--shadow-sm);
}
.product-card-body { padding: 1.2rem 1.3rem 1.4rem; flex: 1; display: flex; flex-direction: column; }
.product-cat {
  font-size: calc(0.68rem * var(--km-scale, 1)); font-weight: 700;
  color: var(--primary);
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.4rem;
}
.product-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: calc(0.92rem * var(--km-scale, 1));
  color: var(--text);
  margin-bottom: 0.4rem;
  line-height: 1.35;
}
.product-desc { font-size: calc(0.8rem * var(--km-scale, 1)); color: var(--text-muted); line-height: 1.6; flex: 1; margin-bottom: 1rem; }
.product-footer {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: auto;
  padding-top: 0.85rem;
  border-top: 1px solid var(--border);
}
.enquire-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--primary-light);
  color: var(--primary);
  border: none;
  padding: 0.45rem 1rem;
  border-radius: 8px;
  font-size: calc(0.78rem * var(--km-scale, 1));
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  font-family: var(--font-body);
  text-decoration: none;
}
.enquire-btn:hover { background: var(--primary); color: white; }
.detail-link {
  color: var(--text-light);
  font-size: calc(0.78rem * var(--km-scale, 1));
  text-decoration: none;
  display: flex; align-items: center; gap: 4px;
  transition: color 0.2s;
}
.detail-link:hover { color: var(--primary); }

/* ─── LIST VIEW ─── */
.product-card.list-view { flex-direction: row; height: auto; border-radius: var(--radius); }
.product-card.list-view .product-card-img { width: 180px; min-width: 180px; height: 140px; border-radius: 0; }
.product-card.list-view .product-card-body { padding: 1.2rem; }
.product-card.list-view .product-footer { border-top: none; padding-top: 0.5rem; }

/* ─── PAGINATION ─── */
.pager { display: flex; justify-content: center; gap: 6px; margin-top: 3rem; flex-wrap: wrap; }
.page-btn {
  width: 38px; height: 38px;
  border-radius: 9px;
  border: 1.5px solid var(--border);
  background: white;
  color: var(--text-muted);
  display: flex; align-items: center; justify-content: center;
  font-size: calc(0.82rem * var(--km-scale, 1));
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: var(--font-heading);
}
.page-btn:hover, .page-btn.active { background: var(--primary); border-color: var(--primary); color: white; }
.page-btn.wide { width: auto; padding: 0 1rem; }

/* ─── MODAL ─── */
.modal-product .modal-content { border-radius: var(--radius-lg); border: none; overflow: hidden; }
.modal-product .modal-header { background: linear-gradient(135deg, var(--primary), var(--accent)); border: none; padding: 1.3rem 1.8rem; }
.modal-product .modal-title { color: white; font-family: var(--font-heading); font-weight: 700; font-size: calc(1rem * var(--km-scale, 1)); }
.modal-product .btn-close { filter: invert(1); }
.modal-product .modal-body { padding: 2rem; }
.modal-img-wrap {
  background: var(--bg);
  border-radius: var(--radius);
  padding: 2rem;
  display: flex; align-items: center; justify-content: center;
  height: 260px;
  margin-bottom: 1.5rem;
}
.modal-img-wrap img { max-height: 100%; max-width: 100%; object-fit: contain; }
.spec-table { width: 100%; }
.spec-table tr td { padding: 0.5rem 0.75rem; font-size: calc(0.83rem * var(--km-scale, 1)); border-bottom: 1px solid var(--border); }
.spec-table tr td:first-child { color: var(--text-muted); font-weight: 500; width: 45%; }
.spec-table tr td:last-child { color: var(--text); font-weight: 600; }
.spec-table tr:last-child td { border: none; }

@media (max-width: 991px) {
  .product-card.list-view { flex-direction: column; }
  .product-card.list-view .product-card-img { width: 100%; }
}
