/* Api China Systems — Category listing (Turbo) */
.acs-catpage {
  --lime: #8DC63F;
  --lime-dark: #6FA52B;
  --lime-bg: #F2F9E8;
  --charcoal: #2B2F33;
  --charcoal-2: #3A3F44;
  --ink: #23272B;
  --muted: #8A9199;
  --line: #E7EAED;
  --bg: #F5F6F8;
  --white: #fff;
  --amber: #F5A623;
  --blue: #3B82F6;
  background: var(--bg);
  color: var(--ink);
  padding: 22px 0 56px;
  font-family: 'Noto Sans Thai', sans-serif;
}
.acs-catpage .acs-container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; }

.acs-cat-crumb {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  font-size: 13px; color: var(--muted); margin-bottom: 16px;
}
.acs-cat-crumb a { color: var(--charcoal); font-weight: 600; text-decoration: none; }
.acs-cat-crumb a:hover { color: var(--lime-dark); }
.acs-cat-crumb .is-now { color: var(--muted); }

.acs-cat-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}

/* Sidebar */
.acs-cat-side {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 10px 28px -22px rgba(35,39,43,.35);
  position: sticky;
  /* header = topbar(~32) + mainbar(72) + nav(48) + gap */
  top: calc(var(--header-h, 72px) + var(--nav-h, 48px) + 44px);
  z-index: 40;
  max-height: calc(100vh - var(--header-h, 72px) - var(--nav-h, 48px) - 56px);
  display: flex;
  flex-direction: column;
}
.acs-cat-side-head {
  background: var(--charcoal);
  color: #fff;
  padding: 14px 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  flex-shrink: 0;
}
.acs-cat-side-head h2 {
  margin: 0; font-size: 14px; font-weight: 800;
  display: flex; align-items: center; gap: 8px;
}
.acs-cat-side-head h2 i { color: var(--lime); }
.acs-cat-side-toggle {
  display: none;
  border: 1px solid rgba(255,255,255,.25);
  background: rgba(255,255,255,.08);
  color: #fff; border-radius: 8px; width: 34px; height: 34px; cursor: pointer;
}
.acs-cat-nav { padding: 8px; overflow: auto; flex: 1; min-height: 0; }
.acs-cat-link {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px; border-radius: 10px; text-decoration: none;
  color: var(--ink); font-size: 13.5px; font-weight: 600;
  transition: background .15s, color .15s;
}
.acs-cat-link:hover { background: var(--lime-bg); color: var(--charcoal); }
.acs-cat-link.is-active {
  background: var(--lime-bg);
  color: var(--charcoal);
  box-shadow: inset 3px 0 0 var(--lime);
  font-weight: 800;
}
.acs-cat-link .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--line); flex-shrink: 0;
}
.acs-cat-link.is-active .dot { background: var(--lime); }
.acs-cat-sub { padding: 0 0 4px 18px; display: none; }
.acs-cat-sub.is-open { display: block; }
.acs-cat-sub .acs-cat-link { font-size: 13px; font-weight: 500; padding: 8px 10px; }
.acs-cat-parent { display: flex; align-items: stretch; gap: 2px; }
.acs-cat-parent .acs-cat-link { flex: 1; }
.acs-cat-expand {
  width: 36px; border: 0; background: transparent; color: var(--muted);
  border-radius: 8px; cursor: pointer; font-size: 12px;
}
.acs-cat-expand:hover { background: var(--bg); color: var(--charcoal); }

/* Main */
.acs-cat-main { min-width: 0; }
.acs-cat-hero {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 20px;
  margin-bottom: 16px;
  display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 12px;
  box-shadow: 0 10px 28px -22px rgba(35,39,43,.28);
}
.acs-cat-hero .tag {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--lime-bg); color: var(--lime-dark);
  border: 1px solid rgba(141,198,63,.35); border-radius: 999px;
  padding: 4px 10px; font-size: 11.5px; font-weight: 800; margin-bottom: 8px;
}
.acs-cat-hero h1 {
  margin: 0; font-size: clamp(20px, 2.6vw, 28px); font-weight: 800; color: var(--charcoal); line-height: 1.25;
}
.acs-cat-hero p { margin: 6px 0 0; color: var(--muted); font-size: 13.5px; max-width: 52ch; }
.acs-cat-count {
  display: inline-flex; align-items: center; gap: 8px;
  background: var(--charcoal); color: #fff;
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 700; white-space: nowrap;
}
.acs-cat-count i { color: var(--lime); }

/* Product grid */
.acs-cat-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}
.acs-cat-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  display: flex; flex-direction: column;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.acs-cat-card:hover {
  border-color: var(--lime);
  box-shadow: 0 14px 32px -22px rgba(35,39,43,.4);
  transform: translateY(-2px);
}
.acs-cat-card-media {
  position: relative;
  aspect-ratio: 1;
  background: #f0f2f4;
  overflow: hidden;
}
.acs-cat-card-media img {
  width: 100%; height: 100%; object-fit: cover; display: block;
  transition: transform .35s ease;
}
.acs-cat-card:hover .acs-cat-card-media img { transform: scale(1.04); }
.acs-cat-badge {
  position: absolute; top: 10px; left: 10px;
  padding: 4px 10px; border-radius: 999px;
  font-size: 11px; font-weight: 800; letter-spacing: .02em;
  color: #fff; background: var(--charcoal);
  box-shadow: 0 4px 10px rgba(0,0,0,.18);
}
.acs-cat-badge.is-1688 { background: #ff6a00; }
.acs-cat-badge.is-taobao { background: #ff5000; }
.acs-cat-badge.is-tmall { background: #e4002b; }
.acs-cat-badge.is-store { background: var(--amber); color: var(--charcoal); }
.acs-cat-card-body {
  padding: 12px 14px 14px;
  display: flex; flex-direction: column; gap: 8px; flex: 1;
}
.acs-cat-card-title {
  margin: 0; font-size: 13.5px; font-weight: 700; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.8em;
}
.acs-cat-card-title a { color: inherit; text-decoration: none; }
.acs-cat-card-title a:hover { color: var(--lime-dark); }
.acs-cat-card-meta {
  margin: 0; font-size: 12px; color: var(--muted);
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.acs-cat-card-foot {
  margin-top: auto;
  display: flex; align-items: flex-end; justify-content: space-between; gap: 10px;
}
.acs-cat-price-wrap { min-width: 0; }
.acs-cat-price {
  display: block; font-size: 16px; font-weight: 800; color: var(--charcoal); line-height: 1.2;
}
.acs-cat-price-cny {
  display: block; font-size: 11.5px; color: var(--muted); margin-top: 2px;
}
.acs-cat-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 36px; padding: 0 12px; border-radius: 9px; border: 0;
  background: var(--lime); color: var(--charcoal);
  font: inherit; font-size: 12.5px; font-weight: 800;
  text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: background .15s, transform .15s;
}
.acs-cat-btn:hover { background: var(--lime-dark); color: #fff; transform: translateY(-1px); }
.acs-cat-btn-ghost {
  background: transparent; border: 1.5px solid var(--line); color: var(--charcoal);
}
.acs-cat-btn-ghost:hover { border-color: var(--lime); color: var(--lime-dark); background: var(--lime-bg); }

/* Empty / all categories */
.acs-cat-empty {
  background: var(--white); border: 1px dashed var(--line); border-radius: 14px;
  padding: 40px 20px; text-align: center;
}
.acs-cat-empty i { font-size: 36px; color: var(--muted); margin-bottom: 10px; }
.acs-cat-empty h3 { margin: 0 0 6px; font-size: 18px; color: var(--charcoal); }
.acs-cat-empty p { margin: 0 0 16px; color: var(--muted); font-size: 14px; }

.acs-cat-pick {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px;
}
.acs-cat-pick-item {
  display: flex; align-items: center; gap: 12px;
  background: var(--white); border: 1px solid var(--line); border-radius: 12px;
  padding: 14px; text-decoration: none; color: var(--ink);
  transition: border-color .15s, box-shadow .15s;
}
.acs-cat-pick-item:hover { border-color: var(--lime); box-shadow: 0 10px 24px -20px rgba(35,39,43,.35); }
.acs-cat-pick-item .ico {
  width: 40px; height: 40px; border-radius: 10px; flex-shrink: 0;
  background: var(--lime-bg); color: var(--lime-dark);
  display: flex; align-items: center; justify-content: center;
}
.acs-cat-pick-item span { font-size: 13.5px; font-weight: 700; }

@media (max-width: 980px) {
  .acs-cat-layout { grid-template-columns: 1fr; }
  .acs-cat-side { position: static; }
  .acs-cat-side-toggle { display: inline-flex; align-items: center; justify-content: center; }
  .acs-cat-nav { display: none; max-height: none; }
  .acs-cat-side.is-open .acs-cat-nav { display: block; }
  .acs-cat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .acs-cat-pick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
  .acs-cat-grid { grid-template-columns: 1fr; }
  .acs-cat-pick { grid-template-columns: 1fr; }
  .acs-cat-hero { padding: 14px; }
  .acs-cat-card-foot { flex-direction: column; align-items: stretch; }
  .acs-cat-btn { width: 100%; }
}
