/* ===================================================================
   BestDealz — All Categories Page  (bd-alibaba-allcategories.css)
   Inherits CSS variables from bd-alibaba-subcategory.css (loaded first)
=================================================================== */

/* ── Variables (fallbacks if subcategory CSS not loaded) ────────── */
:root {
  --ac-navy:      #023f87;
  --ac-navy-dk:   #012d60;
  --ac-orange:    #ea5c0e;
  --ac-green:     #16a34a;
  --ac-cls-a:     #16a34a;
  --ac-cls-b:     #023f87;
  --ac-cls-c:     #ea5c0e;
  --ac-ink-900:   #0f172a;
  --ac-ink-700:   #334155;
  --ac-ink-500:   #64748b;
  --ac-ink-400:   #94a3b8;
  --ac-ink-200:   #e2e8f0;
  --ac-line:      #f1f5f9;
  --ac-bg:        #f8fafc;
  --ac-radius:    10px;
  --ac-radius-lg: 16px;
  --ac-shadow:    0 2px 12px rgba(0,0,0,.07);
  --ac-shadow-hv: 0 8px 32px rgba(0,0,0,.13);
  --ac-trans:     .18s ease;
}

/* ── Breadcrumb ─────────────────────────────────────────────────── */
/* reuses .bj-breadcrumb from subcategory CSS */

/* ── HERO ───────────────────────────────────────────────────────── */
.ac-hero {
  background: linear-gradient(135deg, #012d60 0%, #023f87 40%, #0957c3 100%);
  padding: 52px 0 44px;
  position: relative;
  overflow: hidden;
}
.ac-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.03'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}
.ac-hero-inner {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  flex-wrap: wrap;
}
.ac-hero-left h1 {
  font-size: 36px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -.5px;
  line-height: 1.15;
  margin: 0 0 8px;
}
.ac-hero-left h1 span { color: #fbbf24; }
.ac-hero-left p {
  font-size: 15px;
  color: rgba(255,255,255,.75);
  margin: 0 0 18px;
}
.ac-hero-stats {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: 4px;
}
.ac-hero-stat {
  text-align: center;
}
.ac-hero-stat .val {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  line-height: 1;
  display: block;
}
.ac-hero-stat .lbl {
  font-size: 11px;
  color: rgba(255,255,255,.6);
  text-transform: uppercase;
  letter-spacing: .5px;
  display: block;
  margin-top: 3px;
}
.ac-hero-stat .divider {
  width: 1px;
  height: 36px;
  background: rgba(255,255,255,.2);
  align-self: center;
}
.ac-hero-cls {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 20px;
}
.ac-hero-cls-pill {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,.1);
  border: 1px solid rgba(255,255,255,.2);
  backdrop-filter: blur(4px);
  border-radius: 20px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 700;
  color: #fff;
}
.ac-hero-cls-pill .dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.ac-hero-cls-pill .dot.a { background: var(--ac-cls-a); }
.ac-hero-cls-pill .dot.b { background: #60a5fa; }
.ac-hero-cls-pill .dot.c { background: var(--ac-cls-c); }
.ac-hero-search {
  display: flex;
  align-items: center;
  background: #fff;
  border-radius: 8px;
  padding: 0 4px 0 14px;
  max-width: 340px;
  width: 100%;
  gap: 8px;
  box-shadow: 0 4px 24px rgba(0,0,0,.2);
}
.ac-hero-search svg {
  width: 16px; height: 16px; color: var(--ac-ink-400); flex-shrink: 0;
}
.ac-hero-search input {
  border: 0; outline: 0; flex: 1; font-size: 13.5px;
  color: var(--ac-ink-900); background: transparent; padding: 11px 0;
}
.ac-hero-search input::placeholder { color: var(--ac-ink-400); }
.ac-hero-search-btn {
  background: var(--ac-orange);
  border: 0; border-radius: 6px;
  padding: 8px 14px;
  color: #fff; font-size: 12.5px; font-weight: 700;
  cursor: pointer; white-space: nowrap;
}

/* ── SECTION NAV PILLS ──────────────────────────────────────────── */
.ac-section-nav {
  background: #fff;
  border-bottom: 1px solid var(--ac-ink-200);
  position: sticky;
  top: 0;
  z-index: 90;
  box-shadow: 0 2px 8px rgba(0,0,0,.06);
}
.ac-nav-inner {
  display: flex;
  align-items: center;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  padding: 0;
}
.ac-nav-inner::-webkit-scrollbar { display: none; }
.ac-nav-pill {
  display: flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  padding: 13px 18px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ac-ink-500);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color var(--ac-trans), border-color var(--ac-trans);
  flex-shrink: 0;
}
.ac-nav-pill:hover { color: var(--ac-navy); border-bottom-color: var(--ac-navy); }
.ac-nav-pill.active { color: var(--ac-navy); border-bottom-color: var(--ac-orange); font-weight: 700; }
.ac-nav-pill .ct {
  background: var(--ac-line);
  color: var(--ac-ink-500);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 20px;
}

/* ── MAIN SHELL ─────────────────────────────────────────────────── */
.ac-main {
  padding: 40px 0 60px;
  background: var(--ac-bg);
}

/* ── CATEGORY LIVE FILTER message ──────────────────────────────── */
.ac-filter-empty {
  text-align: center;
  padding: 60px 20px;
  display: none;
}
.ac-filter-empty.show { display: block; }
.ac-filter-empty svg { width: 48px; height: 48px; color: var(--ac-ink-400); margin-bottom: 12px; }
.ac-filter-empty p { font-size: 15px; color: var(--ac-ink-500); }

/* ── SECTION BLOCK ──────────────────────────────────────────────── */
.ac-section-block {
  margin-bottom: 48px;
  scroll-margin-top: 56px;
}

/* Section head bar */
.ac-section-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 18px 22px;
  background: #fff;
  border: 1px solid var(--ac-ink-200);
  border-radius: var(--ac-radius-lg) var(--ac-radius-lg) 0 0;
  border-bottom: 0;
}
.ac-section-bar-left {
  display: flex;
  align-items: center;
  gap: 14px;
}
.ac-section-icon {
  width: 46px; height: 46px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--ac-navy), #0957c3);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.ac-section-icon svg { width: 22px; height: 22px; color: #fff; }
.ac-section-icon img { width: 28px; height: 28px; object-fit: contain; }
.ac-section-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--ac-ink-900);
  margin: 0 0 2px;
  line-height: 1.2;
}
.ac-section-desc {
  font-size: 12.5px;
  color: var(--ac-ink-500);
  margin: 0;
  max-width: 480px;
}
.ac-section-count-pill {
  background: #dbeafe;
  color: var(--ac-navy);
  font-size: 11.5px;
  font-weight: 800;
  padding: 3px 10px;
  border-radius: 20px;
  white-space: nowrap;
  flex-shrink: 0;
}
.ac-section-browse {
  display: flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  font-size: 13px;
  font-weight: 700;
  color: var(--ac-navy);
  text-decoration: none;
  padding: 9px 16px;
  border: 1.5px solid var(--ac-navy);
  border-radius: 8px;
  transition: background var(--ac-trans), color var(--ac-trans);
  flex-shrink: 0;
}
.ac-section-browse:hover {
  background: var(--ac-navy);
  color: #fff;
}
.ac-section-browse svg { width: 14px; height: 14px; }

/* Category card grid */
.ac-cats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--ac-ink-200);
  border: 1px solid var(--ac-ink-200);
  border-top: 0;
  border-radius: 0 0 var(--ac-radius-lg) var(--ac-radius-lg);
  overflow: hidden;
}

/* Individual category card */
.ac-cat-card {
  background: #fff;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  transition: background var(--ac-trans), transform var(--ac-trans);
  padding: 20px 18px 18px;
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.ac-cat-card::after {
  content: '';
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--ac-navy), #0957c3);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--ac-trans);
}
.ac-cat-card:hover { background: #f8fafc; }
.ac-cat-card:hover::after { transform: scaleX(1); }
.ac-cat-card:hover .ac-cat-name { color: var(--ac-navy); }

/* Thumbnail area */
.ac-cat-thumb {
  width: 64px; height: 64px;
  border-radius: 10px;
  background: var(--ac-line);
  overflow: hidden;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.ac-cat-thumb img {
  width: 100%; height: 100%; object-fit: cover;
  transition: transform .3s ease;
}
.ac-cat-card:hover .ac-cat-thumb img { transform: scale(1.06); }
.ac-cat-thumb-placeholder {
  width: 100%; height: 100%;
  background: linear-gradient(135deg, #dbeafe, #ede9fe);
  display: flex; align-items: center; justify-content: center;
}
.ac-cat-thumb-placeholder svg { width: 28px; height: 28px; color: #818cf8; }

/* Card content */
.ac-cat-name {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ac-ink-900);
  line-height: 1.35;
  margin: 0 0 6px;
  transition: color var(--ac-trans);
}
.ac-cat-count {
  font-size: 11.5px;
  color: var(--ac-ink-500);
  font-weight: 600;
  margin-bottom: 8px;
}
.ac-cat-subs {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: auto;
}
.ac-cat-sub-chip {
  font-size: 10.5px;
  color: var(--ac-ink-500);
  background: var(--ac-line);
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100px;
}

/* "View all" more card */
.ac-cat-more-card {
  background: linear-gradient(135deg, #f8fafc, #fff);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  gap: 8px;
  padding: 20px;
  color: var(--ac-navy);
  font-weight: 700;
  font-size: 13px;
  transition: background var(--ac-trans);
}
.ac-cat-more-card:hover { background: #dbeafe; }
.ac-cat-more-card svg { width: 24px; height: 24px; color: var(--ac-navy); }
.ac-cat-more-num {
  font-size: 22px;
  font-weight: 900;
  color: var(--ac-navy);
  line-height: 1;
}

/* ── NO-RESULTS state ────────────────────────────────────────────── */
.ac-section-block[data-hidden="true"] { display: none; }

/* ── RFQ CTA BAND ────────────────────────────────────────────────── */
.ac-rfq-band {
  background: linear-gradient(135deg, var(--ac-navy) 0%, #0957c3 100%);
  padding: 52px 0;
  text-align: center;
}
.ac-rfq-band h2 {
  font-size: 28px;
  font-weight: 900;
  color: #fff;
  margin: 0 0 10px;
  letter-spacing: -.3px;
}
.ac-rfq-band p {
  font-size: 15px;
  color: rgba(255,255,255,.75);
  margin: 0 0 24px;
  max-width: 500px;
  margin-left: auto;
  margin-right: auto;
}
.ac-rfq-actions {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}
.ac-rfq-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
  transition: opacity var(--ac-trans), transform var(--ac-trans);
}
.ac-rfq-btn:hover { opacity: .9; transform: translateY(-1px); }
.ac-rfq-btn.primary { background: var(--ac-orange); color: #fff; }
.ac-rfq-btn.ghost   { background: rgba(255,255,255,.12); color: #fff; border: 1.5px solid rgba(255,255,255,.35); }
.ac-rfq-btn svg { width: 18px; height: 18px; }

/* ── TRUST STRIP ─────────────────────────────────────────────────── */
.ac-trust {
  background: #fff;
  border-top: 1px solid var(--ac-ink-200);
  padding: 28px 0;
}
.ac-trust-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.ac-trust-item {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}
.ac-trust-item svg {
  width: 24px; height: 24px;
  color: var(--ac-navy);
  flex-shrink: 0;
  margin-top: 2px;
}
.ac-trust-item strong {
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ac-ink-900);
  display: block;
  margin-bottom: 2px;
}
.ac-trust-item span {
  font-size: 12px;
  color: var(--ac-ink-500);
  line-height: 1.4;
}

/* ── RESPONSIVE ──────────────────────────────────────────────────── */
@media (max-width: 1200px) {
  .ac-cats-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .ac-hero-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .ac-hero-left h1 { font-size: 28px; }
  .ac-hero-search { max-width: 100%; }
  .ac-hero-stats { gap: 18px; }
  .ac-trust-row { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 768px) {
  .ac-hero { padding: 36px 0 32px; }
  .ac-hero-left h1 { font-size: 24px; }
  .ac-hero-stat .val { font-size: 22px; }
  .ac-section-bar { flex-wrap: wrap; gap: 10px; }
  .ac-section-browse { width: 100%; justify-content: center; }
  .ac-cats-grid { grid-template-columns: repeat(2, 1fr); }
  .ac-cat-thumb { width: 52px; height: 52px; }
  .ac-cat-name { font-size: 13px; }
  .ac-rfq-band h2 { font-size: 22px; }
}
@media (max-width: 480px) {
  .ac-hero-cls { gap: 6px; }
  .ac-hero-cls-pill { padding: 5px 10px; font-size: 11px; }
  .ac-cats-grid { grid-template-columns: repeat(2, 1fr); }
  .ac-trust-row { grid-template-columns: 1fr; }
}
