/* Mcapacitor shared styles */
@font-face { font-family: 'Outfit'; src: url('./fonts/Outfit-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'Outfit'; src: url('./fonts/Outfit-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }
@font-face { font-family: 'JetBrainsMono'; src: url('./fonts/JetBrainsMono-Regular.ttf') format('truetype'); font-weight: 400; font-display: swap; }
@font-face { font-family: 'JetBrainsMono'; src: url('./fonts/JetBrainsMono-Bold.ttf') format('truetype'); font-weight: 700; font-display: swap; }

:root {
  --bg: #f8fafc; --bg2: #ffffff; --bg3: #f1f5f9;
  --ink: #0f172a; --ink-soft: #334155; --muted: #596879; --muted2: #94a3b8;
  --rule: #e2e8f0; --dark: #0f172a;
  --accent: #f97316; --accent-hover: #ea580c; --accent-soft: #fff7ed;
  --accent2: #2563eb;
  --green: #16a34a; --orange: #ea580c; --purple: #7c3aed; --price: #dc2626;
  --font: "Helvetica Neue", Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Helvetica Neue", Arial, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --transition-theme: background 0.35s ease, color 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}
[data-theme="dark"] {
  --bg: #0f172a; --bg2: #1e293b; --bg3: #172033;
  --ink: #f1f5f9; --ink-soft: #cbd5e1; --muted: #94a3b8; --muted2: #64748b;
  --rule: #334155; --dark: #020617;
  --accent-soft: #1e1105;
  --green: #22c55e; --orange: #fb923c; --price: #f87171;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; overflow-x: hidden; }
body { font-family: var(--font); background: var(--bg); color: var(--ink); font-size: 14px; line-height: 1.5; max-width: 100vw; transition: var(--transition-theme); }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: 0; }
input, select, textarea { font-family: inherit; font-size: 14px; }

/* Top bar */
.topbar { background: var(--dark); color: #cbd5e1; font-size: 12px; }
.topbar-inner { max-width: 1380px; margin: 0 auto; padding: 8px 24px; display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.topbar a { color: #cbd5e1; }
.topbar a:hover { color: #fff; }
.topbar-inner .left, .topbar-inner .right { display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }

/* Header */
header.site { background: var(--bg2); border-bottom: 1px solid var(--rule); position: sticky; top: 0; z-index: 100; box-shadow: 0 2px 8px rgba(0,0,0,0.03); }
.header-inner { max-width: 1380px; margin: 0 auto; padding: 14px 24px; display: grid; grid-template-columns: 270px minmax(420px, 1fr) auto; align-items: center; gap: 18px; min-height: 73px; position: relative; }
.header-left { display: contents; }
.logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo-mark { width: 56px; height: 56px; background: linear-gradient(135deg, var(--dark), var(--accent)); border-radius: 12px; display: flex; align-items: center; justify-content: center; color: #fff; font-weight: 700; font-size: 20px; flex-shrink: 0; }
.logo-text { display: flex; align-items: center; gap: 10px; }
.logo-text .cn { font-size: 22px; font-weight: 700; color: var(--dark); }
.logo-text .en { font-size: 12px; color: var(--muted); letter-spacing: 0.5px; }
.header-nav { display: flex; align-items: center; justify-content: center; gap: 4px; min-width: 0; flex-wrap: wrap; }
.header-nav a { padding: 6px 14px; font-size: 14px; font-weight: 400; color: var(--ink-soft); border-radius: 6px; transition: all .15s; }
.header-nav a:hover, .header-nav a.active { color: var(--accent); background: var(--accent-soft); font-weight: 500; }
.header-actions { display: flex; gap: 8px; align-items: center; justify-content: flex-end; flex-wrap: wrap; }
.btn-mobile-login { display: none; }
.btn-mobile-contact { display: none; }
/* Theme toggle */
.theme-toggle { background: transparent; border: 1px solid var(--rule); color: var(--ink-soft); width: 38px; height: 38px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 18px; cursor: pointer; transition: var(--transition-theme); flex-shrink: 0; }
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); background: var(--accent-soft); }
[data-theme="dark"] .theme-toggle .icon-light { display: inline; }
[data-theme="dark"] .theme-toggle .icon-dark { display: none; }
.theme-toggle .icon-light { display: none; }
.theme-toggle .icon-dark { display: inline; }
/* Hamburger menu */
.hamburger { display: none; background: none; border: none; font-size: 24px; color: var(--ink); cursor: pointer; padding: 4px 8px; line-height: 1; }
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 16px; border-radius: 6px; font-size: 13px; font-weight: 500; line-height: 1.25; transition: background-color .15s, border-color .15s, color .15s; cursor: pointer; }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-ghost { background: transparent; color: var(--ink-soft); border: 1px solid var(--rule); }
.btn-ghost:hover { color: var(--accent); border-color: var(--accent); }
.btn-danger { background: #dc2626; color: #fff; }
.btn-danger:hover { background: #b91c1c; }

.qr-modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,.58); z-index: 9999; display: flex; align-items: center; justify-content: center; padding: 22px; }
.qr-modal { width: min(360px, 100%); background: #fff; border-radius: 16px; box-shadow: 0 28px 80px -28px rgba(15,23,42,.65); padding: 24px; text-align: center; position: relative; }
.qr-modal .close { position: absolute; right: 14px; top: 10px; color: var(--muted); font-size: 24px; cursor: pointer; line-height: 1; }
.qr-modal h3 { margin: 0 0 8px; font-size: 18px; color: var(--ink); }
.qr-modal p { margin: 0 0 16px; color: var(--muted); font-size: 13px; }
.qr-modal img { width: 240px; max-width: 100%; aspect-ratio: 1 / 1; object-fit: contain; border: 1px solid var(--rule); border-radius: 12px; padding: 10px; background: #fff; }

/* Hero */
.search-hero { background: linear-gradient(105deg, var(--bg3) 0%, var(--bg2) 100%); border-bottom: 1px solid var(--rule); padding: 56px 0 60px; }
.hero-inner { max-width: 1380px; margin: 0 auto; padding: 0 24px; text-align: center; }
.hero-title { font-size: 36px; font-weight: 700; color: var(--ink); margin: 0 0 12px; letter-spacing: -0.5px; }
.hero-title span { color: var(--accent); }
.hero-sub { font-size: 16px; color: var(--muted); margin: 0 0 36px; }
.hero-search { max-width: 820px; margin: 0 auto 12px; display: flex; align-items: stretch; background: #fff; border: 2px solid var(--accent); border-radius: 999px; box-shadow: 0 18px 48px -12px rgba(249,115,22,0.35); position: relative; overflow: visible; }
.hero-search input { flex: 1; border: 0; outline: 0; padding: 0 22px; font-size: 17px; min-height: 64px; border-radius: 999px 0 0 999px; }
.hero-search button { padding: 0 40px; background: var(--accent); color: #fff; font-size: 17px; font-weight: 600; letter-spacing: 0; border-radius: 0 999px 999px 0; }
.hero-search button:hover { background: var(--accent-hover); }
.search-suggest { position: absolute; top: 100%; left: 0; padding-top: 6px; background: transparent; z-index: 9999; text-align: left; }
.search-suggest-inner { background: #fff; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; box-shadow: 0 8px 24px rgba(0,0,0,0.1); }
.suggest-item { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 16px; cursor: pointer; border-bottom: 1px solid #f1f5f9; font-size: 14px; }
.suggest-item:last-child { border-bottom: 0; }
.suggest-item:hover, .suggest-item.active { background: #e6f2ff; }
.suggest-mpn { color: var(--ink); font-weight: 500; }
.suggest-mpn mark { background: #fef08a; color: var(--ink); padding: 0 1px; border-radius: 2px; }
.suggest-brand { color: var(--muted); font-size: 12px; margin-left: 6px; }
.suggest-specs { color: var(--muted); font-size: 12px; white-space: nowrap; margin-left: auto; padding-left: 12px; }
.suggest-count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.suggest-tag { display: inline-block; background: #e0f2fe; color: #0369a1; font-size: 10px; font-weight: 600; padding: 1px 6px; border-radius: 3px; margin-right: 6px; text-transform: uppercase; }
.suggest-param { background: #fafafa; }
.suggest-param-row { display: flex; gap: 8px; padding: 10px 16px; border-bottom: 1px solid #f1f5f9; overflow-x: auto; flex-wrap: nowrap; white-space: nowrap; scrollbar-width: thin; }
.suggest-param-chip { display: inline-flex; align-items: center; padding: 5px 12px; background: var(--accent-soft); border: 1px solid #bfdbfe; border-radius: 999px; font-size: 13px; color: var(--accent2); cursor: pointer; white-space: nowrap; font-weight: 500; }
.suggest-param-chip:hover { background: #dbeafe; border-color: #60a5fa; }
.suggest-param-chip mark { background: #fef08a; color: var(--ink); padding: 0 1px; border-radius: 2px; }

/* 零输入下拉：搜索记录 + 热门推荐 */
.suggest-section { padding: 0; }
.suggest-section-header { display: flex; align-items: center; justify-content: space-between; padding: 10px 16px 6px; }
.suggest-section-title { font-size: 12px; color: #94a3b8; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.suggest-section-action { display: inline-flex; align-items: center; justify-content: center; color: #ef4444; cursor: pointer; border: none !important; background: transparent !important; padding: 2px; line-height: 1; -webkit-appearance: none; appearance: none; box-shadow: none !important; outline: none; }
.suggest-section-action svg { display: block; }
.suggest-section-action:hover { color: #ef4444; background: transparent !important; }

/* Ensure no button defaults leak into suggest actions */
.suggest-section-action,
.suggest-section-action:hover,
.suggest-section-action:focus,
.suggest-section-action:active { background: transparent !important; }
.suggest-history-tags { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 8px; }
.suggest-history-chip { display: inline-flex; align-items: center; padding: 4px 12px; background: #f1f5f9; border: 1px solid #e2e8f0; border-radius: 4px; font-size: 13px; color: #334155; cursor: pointer; white-space: nowrap; transition: all .12s ease; }
.suggest-history-chip:hover { background: #e2e8f0; border-color: #cbd5e1; color: #1e293b; }
.suggest-hot-row { display: flex; flex-wrap: wrap; gap: 6px; padding: 4px 16px 10px; }
.suggest-hot-chip { display: inline-flex; align-items: center; padding: 4px 12px; background: #eff6ff; border: 1px solid #bfdbfe; border-radius: 4px; font-size: 13px; color: var(--accent2); cursor: pointer; white-space: nowrap; transition: all .12s ease; }
.suggest-hot-chip:hover { background: #dbeafe; border-color: #93c5fd; }
.suggest-section-divider { height: 1px; background: #f1f5f9; margin: 0; }
.suggest-empty { padding: 12px 16px; font-size: 13px; color: #94a3b8; text-align: center; }
.hero-hot { max-width: 820px; height: 30px; margin: 14px auto 0; font-size: 13px; color: var(--muted); display: flex; gap: 10px; align-items: center; flex-wrap: nowrap; justify-content: flex-start; white-space: nowrap; overflow: hidden; }
.hero-hot b { color: var(--ink-soft); font-weight: 500; }
.hero-hot a { flex: 0 0 auto; padding: 4px 12px; border-radius: 999px; background: rgba(255,255,255,0.7); border: 1px solid var(--rule); }
.hero-hot a:hover { color: var(--accent); border-color: var(--accent); background: #fff; }
.stats-row { display: flex; justify-content: center; gap: 44px; flex-wrap: wrap; margin-top: 44px; }
.stat-card { text-align: center; min-width: 128px; }
.stat-card.wide { min-width: 220px; }
.stat-num { font-size: 28px; font-weight: 700; color: var(--accent); font-family: var(--font-mono); white-space: nowrap; }
.stat-label { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Home modules */
.home-cats { max-width: 1380px; margin: 22px auto 0; padding: 0 24px; }
.home-section-title { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--ink); font-size: 18px; }
.home-section-title span { width: 4px; height: 24px; border-radius: 3px; background: var(--accent); display: inline-block; }
.home-section-title b { font-weight: 700; }
.home-cat-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.home-cat-card { background: #fff; border: 1px solid var(--rule); border-radius: 12px; padding: 16px; display: flex; flex-direction: row; align-items: flex-start; gap: 14px; color: var(--ink); transition: all .16s ease; }
.home-cat-card:hover { transform: translateY(-2px); border-color: var(--accent); box-shadow: 0 12px 28px -18px rgba(249,115,22,.5); }
.home-cat-card .cat-img-box { width: 96px; height: 96px; background: var(--bg3); border-radius: 10px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.home-cat-card .cat-img { max-width: 100%; max-height: 100%; object-fit: contain; }
.home-cat-card .cat-info { flex: 1; min-width: 0; }
.home-cat-card h4 { font-size: 16px; font-weight: 600; color: var(--ink); margin: 0 0 6px; }
.home-cat-card p { font-size: 12px; color: var(--muted); line-height: 1.7; margin: 0 0 10px; }
.home-cat-card .cat-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.home-cat-card .cat-tags span { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 11px; }

.quote-banner { max-width: 1380px; margin: 30px auto 24px; padding: 30px 34px; border-radius: 12px; background: linear-gradient(120deg, #0f172a, #1e3a5f); color: #fff; display: grid; grid-template-columns: 1fr auto; gap: 28px; align-items: center; }
.quote-copy h3 { margin: 0 0 8px; font-size: 24px; font-weight: 700; }
.quote-copy p { margin: 0; color: #cbd5e1; font-size: 14px; }
.quote-methods { display: grid; grid-template-columns: repeat(4, 160px); gap: 14px; }
.quote-card { min-height: 92px; min-width: 0; border-radius: 8px; background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14); color: #fff; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; text-align: center; }
.quote-card:hover { background: rgba(255,255,255,.13); transform: translateY(-1px); }
.quote-card span { color: var(--accent); font-size: 24px; line-height: 1; }
.quote-card small { color: #cbd5e1; font-size: 12px; }
.quote-card b { color: #fb923c; display: block; max-width: calc(100% - 18px); font-size: clamp(11px, 1.15vw, 13px); line-height: 1.25; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; padding: 0 6px; box-sizing: border-box; }

.brand-partners, .subscribe-panel { max-width: 1380px; margin: 24px auto 0; padding: 22px 26px; border: 1px solid var(--rule); border-radius: 12px; background: #fff; }
.module-title { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; font-size: 16px; color: var(--ink); }
.module-title span { color: var(--accent); font-size: 18px; }
.module-title b { font-weight: 700; }
.brand-row { display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 18px; align-items: center; }
.brand-logo { min-height: 76px; border-radius: 12px; background: #fff; border: 1px solid var(--rule); display: flex; align-items: center; justify-content: center; padding: 12px; }
.brand-logo img { max-width: 100%; max-height: 52px; object-fit: contain; display: block; }
.brand-logo.is-empty { display: flex; opacity: 0.3; }
.brand-link { color: var(--accent2); font-weight: 500; text-decoration: none; }
.brand-link:hover { text-decoration: underline; }

/* Hide homepage hero on brand pages */
html.is-brand-page .search-hero { display: none !important; }

/* ===== Brand Page — Premium Design ===== */
.brand-hero { position: relative; border-radius: 20px; overflow: hidden; margin-bottom: 28px; }
.brand-hero-bg {
  position: absolute; inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e3a5f 40%, #0f172a 100%);
}
.brand-hero-bg::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(ellipse 80% 60% at 20% 40%, rgba(59,130,246,.18) 0%, transparent 70%),
              radial-gradient(ellipse 60% 50% at 80% 60%, rgba(249,115,22,.10) 0%, transparent 70%);
}
.brand-hero-inner {
  position: relative; z-index: 1;
  display: flex; align-items: center; justify-content: space-between;
  gap: 40px;
  padding: 36px 48px;
}
.brand-hero-left {
  display: flex; align-items: center; gap: 28px;
  flex: 1; min-width: 0;
}
.brand-hero-logo {
  width: 120px; height: 80px;
  background: #fff;
  border-radius: 14px;
  display: flex; align-items: center; justify-content: center;
  padding: 12px; flex-shrink: 0;
  box-shadow: 0 8px 32px rgba(0,0,0,.2);
}
.brand-hero-logo img { max-width: 100%; max-height: 56px; object-fit: contain; }
.brand-hero-info { flex: 1; min-width: 0; }
.brand-hero-about { margin: 8px 0 0; }
.brand-hero-about p { margin: 0; font-size: 13px; color: rgba(255,255,255,.9); line-height: 1.5; }
.brand-hero-right {
  flex-shrink: 0;
  display: flex; flex-direction: column; align-items: flex-end; gap: 16px;
}
.brand-hero-stats {
  display: flex; gap: 12px;
}
.brand-hero-stats .stat-card {
  background: rgba(255,255,255,.10);
  border: 1px solid rgba(255,255,255,.15);
  border-radius: 12px;
  padding: 12px 20px;
  min-width: 100px;
  text-align: center;
}
.brand-hero-stats .stat-num { font-size: 20px; font-weight: 400; color: #fff; line-height: 1; }
.brand-hero-stats .stat-label { font-size: 10px; font-weight: 400; color: rgba(255,255,255,.75); margin-top: 4px; letter-spacing: .05em; text-transform: uppercase; }
.brand-hero-link { display: block; font-size: 12px; color: rgba(255,255,255,.85); text-decoration: underline; text-underline-offset: 3px; word-break: break-all; text-align: right; }
.brand-hero-link:hover { color: #fff; }
.brand-hero-label {
  display: inline-block; font-size: 11px; font-weight: 400;
  letter-spacing: .15em; text-transform: uppercase;
  color: rgba(255,255,255,.8); margin-bottom: 8px;
}
.brand-hero-info h1 { margin: 0; font-size: 38px; font-weight: 400; color: #fff; letter-spacing: -0.02em; }

.brand-cat-tabs { margin-bottom: 28px; }
.brand-cat-inner { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.brand-cat-tabs a {
  position: relative; display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 400; color: var(--ink-soft);
  background: #fff; border: 1px solid var(--rule); border-radius: 10px;
  padding: 9px 18px; text-decoration: none; transition: all .18s;
}
.brand-cat-tabs a .cat-count {
  font-size: 11px; font-weight: 400; color: var(--muted);
  background: #f1f5f9; border-radius: 6px; padding: 2px 7px;
}
.brand-cat-tabs a:hover { border-color: #cbd5e1; background: #f8fafc; color: var(--ink); transform: translateY(-1px); box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.brand-cat-tabs a.on { background: var(--ink); color: #fff; border-color: var(--ink); }
.brand-cat-tabs a.on .cat-count { background: rgba(255,255,255,.15); color: rgba(255,255,255,.8); }

.brand-series-section { margin-bottom: 40px; }
.brand-series-group { margin-bottom: 36px; }
.brand-series-header { display: flex; align-items: baseline; gap: 12px; margin-bottom: 18px; }
.brand-series-title { font-size: 18px; font-weight: 400; color: var(--ink); }
.brand-series-sub { font-size: 13px; font-weight: 400; color: var(--muted); }
.brand-series-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; align-items: start; }
.brand-series-card {
  position: relative; display: flex; flex-direction: column; gap: 8px;
  background: #fff; border: 1px solid var(--rule); border-radius: 12px;
  padding: 12px 14px; text-decoration: none; transition: all .2s;
  overflow: hidden; height: 56px; box-sizing: border-box;
}
.brand-series-card:hover {
  border-color: var(--accent); background: #fffaf5;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(249,115,22,.08), 0 2px 6px rgba(0,0,0,.04);
}
.brand-series-card.empty { background: #f8fafc; border-color: #e2e8f0; }
.brand-series-card.empty .series-name { color: #94a3b8; }
.brand-series-card.empty .series-count { background: #e2e8f0; color: #cbd5e1; }
.brand-series-card.empty:hover { transform: translateY(-1px); border-color: #cbd5e1; background: #f1f5f9; box-shadow: 0 4px 12px rgba(0,0,0,.04); }
.series-card-top { display: flex; align-items: center; justify-content: space-between; }
.series-name { font-size: 13px; font-weight: 400; color: var(--ink); }
.series-count { font-size: 11px; font-weight: 400; color: var(--muted); background: #f1f5f9; border-radius: 6px; padding: 2px 7px; }
.series-card-bar {
  height: 3px; border-radius: 2px; background: linear-gradient(90deg, var(--accent) 0%, #fb923c 100%);
  transition: width .4s ease;
}
.brand-series-card.empty .series-card-bar { background: #e2e8f0; }

.subscribe-panel { display: grid; grid-template-columns: 1fr minmax(320px, 460px); gap: 24px; align-items: center; }
.subscribe-copy h3 { margin: 0 0 8px; font-size: 20px; color: var(--ink); }
.subscribe-copy p { margin: 0; font-size: 14px; color: var(--muted); }
.subscribe-form { display: flex; gap: 12px; }
.subscribe-form input { flex: 1; min-height: 46px; border: 1px solid var(--rule); border-radius: 999px; padding: 0 18px; outline: none; }
.subscribe-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.subscribe-form button { min-width: 88px; border-radius: 999px; background: var(--accent); color: #fff; font-weight: 600; font-size: 15px; padding: 0 20px; }
.subscribe-form button:hover { background: var(--accent-hover); }

@media (max-width: 1100px) {
  .header-inner { grid-template-columns: 1fr; justify-items: center; }
  .header-actions { justify-content: center; }
  .home-cat-grid { grid-template-columns: 1fr; }
  .quote-methods { grid-template-columns: 1fr; }
  .quote-card b { font-size: 13px; max-width: calc(100% - 24px); }
  .subscribe-form { flex-direction: column; }
  .home-cat-card { flex-direction: column; text-align: center; }
  .home-cat-card .cat-img-box { width: 100%; height: 80px; }
  .home-cat-card .cat-tags { justify-content: center; }
  .quote-banner { padding: 20px; grid-template-columns: 1fr; max-width: 100%; box-sizing: border-box; }
  .quote-copy h3 { font-size: 20px; }
  .brand-row { grid-template-columns: repeat(4, 1fr); gap: 10px; }
  .brand-logo { min-height: 56px; }
  .subscribe-panel { padding: 16px; grid-template-columns: 1fr; max-width: 100%; box-sizing: border-box; }
  .subscribe-form input { min-width: 0; flex: 1 1 100%; }
  .subscribe-copy h3 { font-size: 17px; }
}

/* Layout */
main { max-width: 1380px; margin: 0 auto; padding: 24px; }
.crumbs { font-size: 12px; color: var(--muted); margin-bottom: 12px; display: flex; gap: 8px; }
.crumbs a:hover { color: var(--accent); }

/* Filter & sort */
.filter-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: 8px; padding: 14px 18px; margin-bottom: 16px; display: grid; grid-template-columns: 90px minmax(0, 1fr) 115px; gap: 12px 18px; align-items: start; }
.filter-card .lbl { font-size: 13px; color: var(--muted); padding-top: 4px; }
.filter-card .opts { display: flex; flex-wrap: wrap; gap: 8px; min-height: 28px; overflow: visible; white-space: normal; min-width: 0; }
.filter-card .opts.collapsed { height: 28px; min-height: 28px; flex-wrap: nowrap; overflow: hidden; white-space: nowrap; padding-right: 20px; }
.filter-card .opts.expanded { height: auto; min-height: 28px; flex-wrap: wrap; overflow: visible; white-space: normal; }
.filter-card .opts.multi a:not([data-v=""])::before { content: "□"; margin-right: 5px; color: #94a3b8; }
.filter-card .opts.multi a.on:not([data-v=""])::before { content: "☑"; color: var(--accent); }
.filter-card .opts a { flex: 0 0 auto; padding: 4px 12px; border-radius: 4px; font-size: 13px; color: var(--ink-soft); }
.filter-card .opts a:hover, .filter-card .opts a.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.filter-actions { display: flex; gap: 6px; align-items: center; justify-content: flex-end; height: 28px; margin-left: 12px; }
.filter-actions button { border: 1px solid var(--rule); background: #fff; color: var(--accent2); border-radius: 4px; padding: 3px 7px; font-size: 12px; cursor: pointer; white-space: nowrap; }
.filter-actions button:hover, .filter-actions button.on { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
/* Dropdown panel for filter options */
.filter-dropdown { position: fixed; z-index: 1001; background: #fff; border: 1px solid var(--rule); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,0.12); padding: 10px; min-width: 320px; max-width: calc(100vw - 100px); max-height: 360px; display: none; }
.filter-dropdown.open { display: block; }
.filter-dropdown-search { width: 100%; box-sizing: border-box; padding: 6px 10px; border: 1px solid var(--rule); border-radius: 4px; font-size: 13px; margin-bottom: 8px; outline: none; }
.filter-dropdown-search:focus { border-color: var(--accent); }
.filter-dropdown-grid { display: flex; flex-wrap: wrap; gap: 6px; max-height: 280px; overflow-y: auto; }
.filter-dropdown-grid a { flex: 0 0 auto; padding: 4px 10px; border-radius: 4px; font-size: 13px; color: var(--ink-soft); text-decoration: none; cursor: pointer; white-space: nowrap; }
.filter-dropdown-grid a:hover, .filter-dropdown-grid a.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.filter-dropdown-grid a.hidden { display: none; }
.filter-dropdown-grid.multi a:not([data-v=""])::before { content: "□"; margin-right: 4px; color: #94a3b8; }
.filter-dropdown-grid.multi a.on:not([data-v=""])::before { content: "☑"; color: var(--accent); }
.results-sticky-bar { position: sticky; top: 0; z-index: 100; background: var(--bg2); }
.sort-bar { display: flex; justify-content: space-between; align-items: center; padding: 10px 16px; background: var(--bg2); border: 1px solid var(--rule); border-bottom: 0; }
.sort-tabs { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.sort-tabs a { padding: 4px 12px; font-size: 13px; color: var(--muted); border-radius: 4px; }
.sort-tabs a.on, .sort-tabs a:hover { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.sort-tabs .sort-check { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; padding: 4px 10px; font-size: 13px; color: var(--muted); border-radius: 4px; border: 1px solid var(--rule); background: var(--bg2); }

/* View toggle */
.view-toggle { display: flex; gap: 4px; align-items: center; flex-shrink: 0; margin-left: 12px; }
.view-btn { width: 32px; height: 32px; border: 1px solid var(--rule); border-radius: 6px; background: var(--bg2); color: var(--muted); font-size: 16px; cursor: pointer; display: flex; align-items: center; justify-content: center; transition: all .15s; }
.view-btn:hover { border-color: var(--accent); color: var(--accent); }
.view-btn.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.sort-tabs .sort-check:has(input:checked) { background: #ecfdf5; color: #16a34a; border-color: #86efac; font-weight: 500; }
.sort-extra { display: flex; gap: 16px; align-items: center; font-size: 13px; color: var(--muted); }
.sort-extra label { display: inline-flex; gap: 4px; align-items: center; cursor: pointer; }

/* ===== Mobile Filter Bar ===== */
.mobile-filter-bar { display: none; position: fixed; bottom: 0; left: 0; right: 0; z-index: 200; background: #fff; border-top: 1px solid var(--rule); padding: 8px 16px; gap: 10px; align-items: center; justify-content: space-between; box-shadow: 0 -2px 10px rgba(0,0,0,0.06); }
.mobile-filter-info { font-size: 13px; color: var(--muted); flex: 1; min-width: 0; }
.mobile-filter-count { font-weight: 500; }
.mobile-filter-btn, .mobile-sort-btn { display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 6px; border: 1px solid var(--rule); background: var(--bg2); color: var(--ink); font-size: 13px; cursor: pointer; font-weight: 500; }
.mobile-filter-btn:hover, .mobile-sort-btn:hover { border-color: var(--accent); color: var(--accent); }
.mobile-filter-btn svg, .mobile-sort-btn svg { flex-shrink: 0; }

/* ===== Mobile Filter Drawer ===== */
.mobile-filter-drawer { position: fixed; inset: 0; z-index: 1002; display: none; }
.mobile-filter-drawer.open { display: block; }
.mobile-filter-drawer-mask { position: absolute; inset: 0; background: rgba(15,23,42,0.45); }
.mobile-filter-drawer-sheet { position: absolute; bottom: 0; left: 0; right: 0; background: #fff; border-radius: 16px 16px 0 0; max-height: 85vh; display: flex; flex-direction: column; animation: slideUp .25s ease; }
@keyframes slideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes bell-ring { 0%, 100% { transform: rotate(0); } 20% { transform: rotate(15deg); } 40% { transform: rotate(-12deg); } 60% { transform: rotate(8deg); } 80% { transform: rotate(-4deg); } }
.mobile-filter-drawer-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.mobile-filter-drawer-header h3 { margin: 0; font-size: 16px; }
.mobile-filter-drawer-close { background: none; border: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.mobile-filter-drawer-search { padding: 10px 16px; border-bottom: 1px solid var(--rule); }
.mobile-filter-drawer-search input { width: 100%; box-sizing: border-box; padding: 8px 12px; border: 1px solid var(--rule); border-radius: 6px; font-size: 14px; outline: none; }
.mobile-filter-drawer-search input:focus { border-color: var(--accent); }
.mobile-filter-drawer-body { flex: 1; overflow-y: auto; padding: 8px 16px 80px; }
.mobile-filter-group { margin-bottom: 8px; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.mobile-filter-group.hidden { display: none; }
.mobile-filter-group-header { display: flex; align-items: center; justify-content: space-between; padding: 12px 14px; background: var(--bg2); cursor: pointer; font-size: 14px; font-weight: 600; color: var(--ink); user-select: none; }
.mobile-filter-group-toggle { font-size: 12px; color: var(--muted); transition: transform .2s; }
.mobile-filter-group.collapsed .mobile-filter-group-toggle { transform: rotate(-90deg); }
.mobile-filter-group.collapsed .mobile-filter-tags { display: none; }
.mobile-filter-tags { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 12px; background: #fff; }
.mobile-filter-tag { padding: 5px 12px; border-radius: 999px; border: 1px solid var(--rule); background: var(--bg2); color: var(--ink-soft); font-size: 13px; cursor: pointer; transition: all .15s; }
.mobile-filter-tag:hover { border-color: var(--accent); color: var(--accent); }
.mobile-filter-tag.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }
.mobile-filter-tag.hidden { display: none; }
.mobile-filter-more { display: block; width: 100%; padding: 6px 0; margin-top: 4px; background: none; border: none; color: var(--accent2); font-size: 12px; cursor: pointer; text-align: center; }
.mobile-filter-more:hover { color: var(--accent); }
.mobile-filter-drawer-footer { position: absolute; bottom: 0; left: 0; right: 0; display: flex; gap: 10px; padding: 10px 16px; background: #fff; border-top: 1px solid var(--rule); }
.mobile-filter-reset, .mobile-filter-confirm { flex: 1; padding: 10px; border-radius: 6px; font-size: 14px; font-weight: 500; cursor: pointer; border: 1px solid var(--rule); }
.mobile-filter-reset { background: var(--bg2); color: var(--ink); }
.mobile-filter-confirm { background: var(--accent); color: #fff; border-color: var(--accent); }

/* ===== Mobile Sort Sheet ===== */
.mobile-sort-sheet { position: fixed; inset: 0; z-index: 1002; display: none; }
.mobile-sort-sheet.open { display: block; }
.mobile-sort-sheet-mask { position: absolute; inset: 0; background: rgba(15,23,42,0.45); }
.mobile-sort-sheet-content { position: absolute; bottom: 0; left: 0; right: 0; background: #fff; border-radius: 16px 16px 0 0; animation: slideUp .25s ease; }
.mobile-sort-sheet-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--rule); }
.mobile-sort-sheet-header h3 { margin: 0; font-size: 16px; }
.mobile-sort-sheet-close { background: none; border: none; font-size: 24px; line-height: 1; color: var(--muted); cursor: pointer; padding: 0 4px; }
.mobile-sort-sheet-body { padding: 8px 16px 24px; display: flex; flex-direction: column; gap: 6px; }
.mobile-sort-option { width: 100%; text-align: left; padding: 12px 14px; border-radius: 8px; border: 1px solid var(--rule); background: var(--bg2); color: var(--ink); font-size: 14px; cursor: pointer; }
.mobile-sort-option:hover { border-color: var(--accent); color: var(--accent); }
.mobile-sort-option.on { background: var(--accent-soft); border-color: var(--accent); color: var(--accent); font-weight: 500; }

/* View toggle */
.result-head, .result-row { display: grid; grid-template-columns: 110px 300px 170px 170px 130px 190px 130px; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--rule); background: var(--bg2); overflow: visible; }
.result-head { background: var(--bg3); font-size: 12px; color: var(--muted); padding: 10px 16px; }
.result-row:hover { background: #fffcf7; overflow: visible; }
.result-row > .cell-img { z-index: 10; position: relative; }
.result-row > .cell:not(.cell-img) { position: relative; z-index: 1; }
/* Same-spec group divider */
.spec-group-divider { height: 1px; background: var(--rule); margin: 0 16px; opacity: 0.4; }
.alt-container { background: #fff7ed; border-left: 3px solid var(--accent); }
.result-row.is-alt { background: transparent; }
.result-row.is-alt:hover { background: #ffedd5; }
.result-card { display: none; }
.alt-group { border-left: 3px solid var(--accent2); }
.cell-img { width: 90px; height: 90px; border: 1px solid var(--rule); border-radius: 4px; background: #fff; display: flex; align-items: center; justify-content: center; position: relative; box-sizing: border-box; padding: 4px; }
.cell-img::after { content: ""; position: absolute; left: 88px; top: -14px; width: 22px; height: calc(100% + 28px); display: none; }
.cell-img:hover::after { display: block; }
.cell-thumb { width: 100%; height: 100%; overflow: hidden; display: flex; align-items: center; justify-content: center; border-radius: 3px; position: relative; z-index: 1; background: #fff; }
.cell-thumb:hover { cursor: pointer; }
.cell-thumb img { max-width: 100% !important; max-height: 100% !important; width: auto !important; height: auto !important; object-fit: contain !important; border-radius: 3px; display: block; transform: none !important; }
.cell-thumb svg, .cell-thumb .cap-svg { max-width: 100%; max-height: 100%; }
.cell-img .img-zoom { position: absolute; left: 100px; top: 50%; width: 280px; transform: translateY(-50%) scale(.96); border: 1px solid var(--rule); border-radius: 10px; background: #fff; box-shadow: 0 22px 55px -24px rgba(15,23,42,.45); display: flex; flex-direction: column; align-items: stretch; gap: 8px; padding: 12px; opacity: 0; pointer-events: none; visibility: hidden; z-index: 30; transition: opacity .15s ease, transform .15s ease, visibility .15s ease; }
.cell-img:hover .img-zoom { opacity: 1; visibility: visible; transform: translateY(-50%) scale(1); pointer-events: auto; }
/* In search results, JS handles zoom via clone — hide the original to prevent double display */
#resultList .cell-img .img-zoom { display: none !important; }
#resultList .cell-img:hover .img-zoom { display: none !important; }
.zoom-main { width: 100%; height: 220px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 10px; overflow: hidden; }
.zoom-main:hover { cursor: pointer; border-color: var(--accent); }
.zoom-main img, .zoom-main svg { max-width: 100%; max-height: 100%; object-fit: contain; }
.zoom-thumbs { display: flex; gap: 6px; justify-content: center; }
.zoom-thumb { width: 56px; height: 56px; border: 1px solid var(--rule); border-radius: 6px; background: #fff; display: flex; align-items: center; justify-content: center; padding: 4px; cursor: pointer; transition: border-color .15s ease, transform .15s ease; }
.zoom-thumb:hover, .zoom-thumb.on { border-color: var(--accent); transform: translateY(-1px); }
.zoom-thumb img { max-width: 100%; max-height: 100%; object-fit: contain; }
.img-note { width: 100%; color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 6px; padding: 5px 8px; font-size: 11px; text-align: center; line-height: 1.2; white-space: nowrap; box-sizing: border-box; }
.cell-img .ribbon { position: absolute; top: 0; left: 0; background: var(--accent); color: #fff; font-size: 10px; padding: 1px 6px; border-radius: 0 0 4px 0; }
.cell h3.mpn { font-size: 14px; font-weight: 600; margin: 0 0 6px; font-family: var(--font-mono); letter-spacing: .1px; }
.cell h3.mpn a:hover { color: var(--accent); text-decoration: underline; }
.cell .kv { font-size: 12px; color: var(--muted); line-height: 1.85; }
.cell .kv b { color: var(--ink-soft); font-weight: 400; }
.cell .kv .blue { color: var(--accent2); }
.param-match { display: inline-block; padding: 0 6px; border-radius: 4px; background: #fef3c7; }
.q-match { display: inline-block; padding: 0 6px; border-radius: 4px; background: #fef3c7; }
.q-match-title { background: #fef3c7; border-radius: 4px; padding: 0 4px; }
.pill.q-match-pill { background: #fef3c7; border-color: #fde68a; }
.stock-match { display: inline-block; padding: 0 6px; border-radius: 4px; background: #dcfce7; color: #15803d !important; font-weight: 600 !important; }
.mini-actions { display: flex; gap: 7px; margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--rule); font-size: 10.5px; color: var(--muted); flex-wrap: nowrap; white-space: nowrap; align-items: center; }
.mini-actions a:hover { color: var(--accent); }
.mini-actions a.pdf { color: var(--accent); }
.mini-actions a.alt { color: var(--accent2); }
.mini-actions a.alt b { background: var(--accent2); color: #fff; border-radius: 8px; padding: 0 5px; font-size: 10px; margin-left: 2px; }
.subst-param-match { background: #fef3c7; color: #92400e; font-weight: 500; }
.tags-col { display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.pill { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; line-height: 1.6; }
.pill.red { background: #fff1f0; color: #dc2626; border: 1px solid #fecaca; }
.pill.blue { background: #eff6ff; color: var(--accent2); border: 1px solid #bfdbfe; }
.pill.green { background: #ecfdf5; color: var(--green); border: 1px solid #bbf7d0; }
.pill.orange { background: #fff7ed; color: var(--orange); border: 1px solid #fed7aa; }
.pill.gray { background: var(--bg3); color: var(--muted); border: 1px solid var(--rule); }
.price-col .price-main { color: var(--price); font-weight: 600; font-family: var(--font-mono); font-size: 18px; line-height: 1.2; margin-bottom: 6px; letter-spacing: -.1px; }
.price-col .price-main span { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 4px; }
.price-col .stock-tags { display: flex; flex-direction: column; gap: 3px; align-items: flex-start; margin: 5px 0 4px; }
.price-col .stock-card { display: inline-flex; align-items: baseline; gap: 6px; padding: 0; border: 0; background: transparent; color: var(--green); box-shadow: none; }
.price-col .stock-card .stock-label { font-size: 11px; line-height: 1; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); }
.price-col .stock-card .stock-value { font-family: var(--font-mono); font-size: 15px; line-height: 1.15; font-weight: 600; letter-spacing: -.2px; color: var(--green); }
.price-col .stock-card .stock-unit { font-size: 11px; font-weight: 500; margin-left: 3px; opacity: .85; }
.price-col .stock-card.low .stock-value,
.price-col .stock-card.incoming .stock-value,
.price-col .stock-card.empty .stock-value { color: var(--green); }
.price-col .stock-tag { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; padding: 0; border: 0; background: transparent; font-weight: 400; }
.price-col .stock-tag.green { color: var(--green); }
.price-col .stock-tag.blue { color: var(--accent2); }
.price-col .stock-tag.muted { color: var(--muted); font-size: 11px; }
.price-col .stock-tag.gray { color: var(--muted); font-size: 11px; background: #f3f4f6; border: 1px solid #d1d5db; border-radius: 4px; padding: 1px 6px; }
.price-col .stock-tag .num { font-family: var(--font-mono); font-weight: 400; }
.price-col .cond-pill { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 400; line-height: 1.6; letter-spacing: .5px; }
.tags-col .cond-pill { display: inline-block; padding: 2px 8px; border-radius: 3px; font-size: 11px; font-weight: 400; line-height: 1.6; letter-spacing: .5px; }
.cond-pill.original { background: #ecfdf5; color: var(--green); border: 1px solid #bbf7d0; }
.cond-pill.used { background: #fef2f2; color: #dc2626; border: 1px solid #fecaca; }
.cond-pill.subst-param-match { background: #dcfce7 !important; color: #14532d !important; border-color: #86efac !important; }
.price-col .price-row { font-size: 12px; color: var(--muted); }
.price-col .price-row b { color: var(--ink-soft); font-family: var(--font-mono); }
.price-col .stock-num { color: var(--green); font-weight: 500; }
.price-col .transit { color: var(--orange); font-weight: 500; }
.detail-stock-card { display: inline-flex; align-items: baseline; gap: 8px; margin: 6px 0 8px; padding: 0; border: 0; background: transparent; color: var(--green); box-shadow: none; }
.detail-stock-card .stock-label { font-size: 13px; line-height: 1; font-weight: 500; letter-spacing: 0; text-transform: none; color: var(--muted); margin: 0; }
.detail-stock-card .stock-value { font-family: var(--font-mono); font-size: 22px; line-height: 1; font-weight: 700; letter-spacing: -.5px; color: var(--green); }
.detail-stock-card .stock-unit { font-size: 12px; font-weight: 500; margin-left: 4px; opacity: .85; }
.detail-stock-card.low .stock-value,
.detail-stock-card.incoming .stock-value,
.detail-stock-card.empty .stock-value { color: var(--green); }
.action-col { display: flex; flex-direction: column; gap: 6px; }
.btn-inquiry { background: var(--accent); color: #fff; min-height: 34px; padding: 0 14px; border-radius: 4px; font-size: 13px; font-weight: 600; line-height: 34px; text-align: center; }
.btn-inquiry:hover { background: var(--accent-hover); }
.btn-whatsapp,
.contact-btn-whatsapp {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 7px !important;
  background: #16bd57 !important;
  color: #fff !important;
  border: 1px solid #16bd57 !important;
  border-radius: 5px !important;
  min-height: 34px !important;
  padding: 0 16px !important;
  font-size: 13px !important;
  font-weight: 600 !important;
  line-height: 34px !important;
  text-align: center !important;
  box-shadow: none !important;
}
.btn-whatsapp::before,
.contact-btn-whatsapp::before {
  content: "";
  width: 17px;
  height: 17px;
  flex: 0 0 17px;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 32 32' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath fill='%23fff' d='M16.03 3C9.43 3 4.06 8.36 4.06 14.95c0 2.1.55 4.15 1.6 5.95L4 29l8.32-1.62a11.9 11.9 0 0 0 3.71.59C22.63 27.97 28 22.61 28 16.02S22.63 3 16.03 3Zm0 22.92c-1.23 0-2.44-.2-3.58-.62l-.33-.12-4.92.96.98-4.8-.18-.35a9.93 9.93 0 0 1-1.88-6.04c0-5.52 4.5-10 10.02-10s10.02 4.48 10.02 10-4.5 10.97-10.13 10.97Zm5.5-7.45c-.3-.15-1.78-.88-2.06-.98-.28-.1-.48-.15-.68.15-.2.3-.78.98-.96 1.18-.18.2-.35.22-.65.07-.3-.15-1.26-.46-2.4-1.47-.89-.79-1.49-1.77-1.66-2.07-.17-.3-.02-.46.13-.61.14-.13.3-.35.45-.53.15-.18.2-.3.3-.5.1-.2.05-.38-.03-.53-.08-.15-.68-1.65-.93-2.26-.24-.58-.49-.5-.68-.51h-.58c-.2 0-.53.08-.8.38-.28.3-1.05 1.03-1.05 2.5s1.08 2.91 1.23 3.11c.15.2 2.13 3.25 5.16 4.56.72.31 1.28.5 1.72.64.72.23 1.38.2 1.9.12.58-.09 1.78-.73 2.03-1.43.25-.7.25-1.3.18-1.43-.08-.13-.28-.2-.58-.35Z'/%3E%3C/svg%3E");
}
.btn-whatsapp:hover,
.contact-btn-whatsapp:hover {
  background: #0fa34a !important;
  border-color: #0fa34a !important;
  color: #fff !important;
}
.btn-whatsapp:active,
.contact-btn-whatsapp:active {
  background: #0b8f3a !important;
  border-color: #0b8f3a !important;
}
.btn-wechat { border: 1px solid #07c160; color: #07c160; min-height: 34px; padding: 0 14px; border-radius: 4px; font-size: 12px; line-height: 34px; text-align: center; background: var(--bg2); }
.btn-wechat:hover { background: #ecfdf5; }

/* Pagination */
.pagination { display: flex; justify-content: center; gap: 6px; padding: 24px 0; }
.pagination a, .pagination span { padding: 6px 12px; border: 1px solid var(--rule); border-radius: 4px; background: var(--bg2); font-size: 13px; color: var(--ink-soft); cursor: pointer; }
.pagination a.on, .pagination a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination span { color: var(--muted); cursor: default; }

/* Auth pages */
.auth-wrap { min-height: calc(100vh - 80px); display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: 12px; padding: 32px 36px; width: 100%; max-width: 440px; box-shadow: 0 10px 40px -20px rgba(0,0,0,0.15); }
.auth-card h1 { margin: 0 0 8px; font-size: 24px; }
.auth-card .sub { color: var(--muted); margin: 0 0 24px; font-size: 13px; }
.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 13px; color: var(--ink-soft); margin-bottom: 6px; font-weight: 400; }
.form-row input, .form-row textarea, .form-row select { width: 100%; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; outline: none; transition: border-color .15s; }
.form-row input:focus, .form-row textarea:focus, .form-row select:focus { border-color: var(--accent); }
.form-row .err { color: var(--price); font-size: 12px; margin-top: 4px; }
.form-row .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.form-actions { display: flex; gap: 10px; margin-top: 8px; flex-wrap: wrap; }
.form-actions .btn-primary { flex: 1; padding: 11px 16px; justify-content: center; font-size: 14px; font-weight: 600; line-height: 1.25; }
.form-actions .btn-ghost { flex-shrink: 0; }
.alt-link { text-align: center; font-size: 13px; color: var(--muted); margin-top: 16px; }
.alt-link a { color: var(--accent); font-weight: 500; }

/* Product detail — two-column layout */
.detail-wrap { display: grid; grid-template-columns: 1fr 420px; gap: 16px; background: transparent; border: none; border-radius: 0; padding: 0; align-items: start; overflow: visible; }
.detail-left { padding: 20px; min-width: 0; background: var(--bg2); border: 1px solid var(--rule); border-radius: 8px; }
.detail-right { padding: 20px; background: var(--bg2); border: 1px solid var(--rule); border-radius: 8px; box-sizing: border-box; align-self: start; }

/* Left top area: image + basic info side by side */
.detail-left-top { display: flex; gap: 20px; margin-bottom: 0; }
.detail-left-img { flex: 0 0 320px; width: 320px; }
.detail-left-img .detail-gallery { display: flex; flex-direction: column; gap: 8px; position: relative; }
.detail-left-img .detail-main-img { width: 320px; height: 260px; display: flex; align-items: center; justify-content: center; overflow: hidden; box-sizing: border-box; background: #fff; border: 1px solid var(--rule); border-radius: 8px; cursor: zoom-in; }
.detail-left-img .detail-main-img img, .detail-left-img .detail-main-img svg { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; }
.img-zoom-lens { display: none; position: absolute; left: 332px; top: 0; width: 480px; height: 480px; border: 2px solid var(--accent); border-radius: 8px; background: #fff no-repeat; box-shadow: 0 12px 40px rgba(0,0,0,0.18); z-index: 50; pointer-events: none; overflow: hidden; }
.detail-left-img .detail-thumbs { display: flex; gap: 8px; flex-wrap: wrap; }
.detail-left-img .detail-thumbs img { width: 56px; height: 44px; max-width: 56px; max-height: 44px; object-fit: contain; background: #fff; border: 1px solid var(--rule); border-radius: 4px; padding: 2px; cursor: pointer; box-sizing: border-box; }
.detail-left-img .detail-thumbs img.on, .detail-left-img .detail-thumbs img:hover { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft); }
.detail-left-img .detail-img-note { color: #b45309; background: #fffbeb; border: 1px solid #fde68a; border-radius: 4px; padding: 5px 8px; font-size: 11px; text-align: center; white-space: nowrap; box-sizing: border-box; }

.detail-left-info { flex: 1; min-width: 0; }
.detail-left-info h1 { font-family: var(--font-mono); font-size: 20px; margin: 0 0 4px; letter-spacing: .1px; color: var(--ink); }
.detail-left-info .key-params { font-size: 15px; color: var(--ink); font-weight: 500; margin-bottom: 10px; }
.detail-left-info .brand-line { font-size: 13px; color: var(--muted); margin-bottom: 12px; }

/* Basic info table next to image */
.detail-basic-table { width: 100%; border-collapse: collapse; font-size: 13px; margin-bottom: 8px; }
.detail-basic-table td { padding: 5px 8px 5px 0; vertical-align: top; }
.detail-basic-table .lbl { color: var(--muted); white-space: nowrap; width: 72px; font-size: 12px; }
.detail-basic-table .val { color: var(--ink-soft); font-weight: 400; font-size: 13px; }

/* Tab navigation */
.detail-tabs { display: flex; gap: 0; border-bottom: 2px solid var(--rule); margin: 16px 0 0; }
.detail-tabs button { padding: 10px 18px; border: none; background: none; font-size: 13px; font-weight: 500; color: var(--muted); cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.detail-tabs button:hover { color: var(--ink); }
.detail-tabs button.active { color: var(--accent); border-bottom-color: var(--accent); font-weight: 600; }
.detail-tab-content { padding: 14px 0; }

/* Attribute table with checkboxes */
.detail-attr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.detail-attr-table thead th { text-align: left; padding: 8px 10px; background: var(--bg3); color: var(--ink-soft); font-weight: 500; border-bottom: 1px solid var(--rule); font-size: 12px; }
.detail-attr-table thead th:last-child { text-align: center; width: 72px; }
.detail-attr-table tbody td { padding: 7px 10px; border-bottom: 1px solid var(--rule); }
.detail-attr-table tbody tr:nth-child(even) td { background: var(--bg); }
.detail-attr-table tbody tr:hover td { background: var(--accent-soft); }
.detail-attr-table .attr-name { color: var(--ink); font-weight: 500; white-space: nowrap; font-size: 13px; }
.detail-attr-table .attr-val { color: var(--ink-soft); font-size: 13px; }
.detail-attr-table .attr-chk { text-align: center; }
.detail-attr-table .attr-chk input[type="checkbox"] { width: 15px; height: 15px; cursor: pointer; accent-color: var(--accent); }
.detail-attr-search { margin-bottom: 10px; position: relative; }
.detail-attr-search input { width: 100%; padding: 8px 12px 8px 34px; border: 1px solid var(--rule); border-radius: 6px; font-size: 13px; outline: none; box-sizing: border-box; }
.detail-attr-search input:focus { border-color: var(--accent); }
.detail-attr-search svg { position: absolute; left: 10px; top: 50%; transform: translateY(-50%); color: var(--muted); }
.detail-attr-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 10px; padding: 8px 0; }
.detail-attr-footer .selected-count { font-size: 13px; color: var(--muted); }
.match-count-box { display: flex; align-items: baseline; gap: 6px; }
.match-count-box .match-label { font-size: 14px; color: var(--ink-soft); }
.match-count-box .match-num { font-size: 32px; font-weight: 700; color: var(--accent); font-family: var(--font-mono); line-height: 1; }
.match-count-box .match-unit { font-size: 14px; color: var(--muted); }

/* Right column — price box */
.detail-price-box { background: #fff; border: 1px solid var(--rule); border-radius: 8px; padding: 18px; margin-bottom: 14px; }
.detail-price-box .price-big { font-size: 28px; color: var(--price); font-weight: 700; font-family: var(--font-mono); letter-spacing: -.2px; margin: 0 0 4px; }
.detail-price-box .price-big span { font-size: 13px; color: var(--muted); margin-left: 6px; font-weight: 400; }
.detail-price-box .stock-status { display: flex; align-items: center; gap: 6px; font-size: 13px; margin-bottom: 10px; }
.detail-price-box .stock-status .dot { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.detail-price-box .stock-status .dot.in { background: var(--green); }
.detail-price-box .stock-status .dot.low { background: var(--orange); }
.detail-price-box .stock-status .dot.out { background: #dc2626; }
.detail-price-box .buy-actions { display: flex; flex-direction: column; gap: 8px; }
.detail-price-box .buy-actions .btn { width: 100%; justify-content: center; padding: 10px 16px; font-size: 14px; box-sizing: border-box; }
.detail-price-box .moq-info { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; }

/* Right column — files panel */
.detail-files-box { background: #fff; border: 1px solid var(--rule); border-radius: 8px; overflow: hidden; }
.detail-files-panel { border-bottom: 1px solid var(--rule); }
.detail-files-panel:last-child { border-bottom: 0; }
.detail-files-header { padding: 12px 16px; display: flex; align-items: center; justify-content: space-between; cursor: pointer; user-select: none; }
.detail-files-header:hover { background: var(--bg); }
.detail-files-header h4 { margin: 0; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 6px; }
.detail-files-header h4 .count { font-size: 11px; color: var(--muted); font-weight: 400; }
.detail-files-header .arrow { transition: transform .2s; font-size: 11px; color: var(--muted); }
.detail-files-header .arrow.open { transform: rotate(180deg); }
.detail-files-list { padding: 0 16px 12px; display: none; }
.detail-files-list.open { display: block; }
.detail-files-list a { display: flex; align-items: center; gap: 6px; color: var(--accent2); font-size: 12px; padding: 5px 0; text-decoration: none; }
.detail-files-list a:hover { color: var(--accent); }
.detail-files-list a .file-icon { flex-shrink: 0; }

/* Right column — share */
.detail-share-row { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.detail-share-row .share-brand-btn { transition: transform 0.15s, opacity 0.15s; }
.detail-share-row .share-brand-btn:hover { transform: scale(1.1); opacity: 0.9; }

/* Right column — tags */
.detail-right-tags { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 8px; }

/* Specs in left column */
.detail-info .specs { margin: 8px 0; }
.detail-info .specs-grid { display: grid; grid-template-columns: 100px 1fr 100px 1fr; gap: 6px 16px; font-size: 13px; }
.detail-info .specs-grid .k { color: var(--muted); }
.detail-info .specs-grid .v { color: var(--ink-soft); font-weight: 400; }
.detail-info .actions { display: flex; gap: 8px; margin-top: auto; padding-top: 10px; flex-wrap: wrap; align-items: center; }
.detail-info .actions .btn { padding: 9px 14px; font-size: 13px; height: 40px; box-sizing: border-box; }
.detail-info .actions .share-btn { padding: 0 !important; height: 40px; width: 40px; }
.detail-info .stock-row { padding: 8px 0; border-top: 1px dashed var(--rule); border-bottom: 1px dashed var(--rule); margin: 8px 0 10px; display: flex; gap: 16px; font-size: 13px; flex-wrap: wrap; }
.detail-info .stock-row b { color: var(--ink); font-family: var(--font-mono); margin-left: 4px; }
.share-btn { width: 40px; height: 40px; padding: 0 !important; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; border-radius: 8px; border: none !important; box-sizing: border-box; }
.share-btn-fb { background: #1877f2 !important; color: #fff !important; }
.share-btn-fb:hover { background: #166fe5 !important; }
.share-btn-li { background: #0a66c2 !important; color: #fff !important; }
.share-btn-li:hover { background: #084d96 !important; }
.share-btn-tw { background: #000 !important; color: #fff !important; }
.share-btn-tw:hover { background: #333 !important; }
.share-btn-ig { background: #E4405F !important; color: #fff !important; }
.share-btn-ig:hover { background: #c13584 !important; }
.share-btn-yt { background: #FF0000 !important; color: #fff !important; }
.share-btn-yt:hover { background: #cc0000 !important; }
.detail-tags { margin-top: 12px; display: flex; gap: 6px; flex-wrap: wrap; }
.detail-module { background: var(--bg2); border: 1px solid var(--rule); border-radius: 8px; margin-top: 24px; overflow: hidden; }
.detail-module-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--rule); background: #fff; }
.detail-module-title h2 { margin: 0; font-size: 18px; border-left: 4px solid var(--accent); padding-left: 12px; }
.detail-module-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.detail-module-body { padding: 18px; }
.datasheet-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.datasheet-preview { margin-top: 14px; border: 1px solid var(--rule); border-radius: 8px; background: #f8fafc; overflow: hidden; min-height: 420px; }
.datasheet-preview iframe { width: 100%; height: 520px; border: 0; display: block; background: #fff; }
.detail-alt-box { background: var(--bg2); border: 1px solid var(--rule); border-radius: 8px; margin-top: 24px; overflow: hidden; width: 100%; box-sizing: border-box; }
.detail-alt-title { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 14px 18px; border-bottom: 1px solid var(--rule); background: #fff; }
.detail-alt-title h2 { margin: 0; font-size: 18px; border-left: 4px solid var(--accent2); padding-left: 12px; }
.detail-alt-title p { margin: 4px 0 0; color: var(--muted); font-size: 13px; }
.detail-alt-content { color: var(--muted); font-size: 13px; overflow-x: auto; }
.detail-alt-head { display: grid; grid-template-columns: 1.2fr .8fr .9fr 1fr .7fr .7fr .8fr .8fr 1fr; gap: 8px; min-width: 900px; padding: 10px 18px; background: #f8fafc; color: var(--ink-soft); font-weight: 600; border-bottom: 1px solid var(--rule); }
.detail-alt-line { display: grid; grid-template-columns: 1.2fr .8fr .9fr 1fr .7fr .7fr .8fr .8fr 1fr; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid #e2e8f0; min-width: 900px; }
.detail-alt-line { padding-left: 18px; padding-right: 18px; }

/* Account / Member */
.account-grid { display: grid; grid-template-columns: 240px 1fr; gap: 24px; }
.account-side { background: var(--bg2); border: 1px solid var(--rule); border-radius: 8px; padding: 16px; }
.account-side a { display: block; padding: 10px 14px; font-size: 14px; color: var(--ink-soft); border-radius: 6px; margin-bottom: 4px; }
.account-side a:hover, .account-side a.on { background: var(--accent-soft); color: var(--accent); font-weight: 500; }
.account-main { background: var(--bg2); border: 1px solid var(--rule); border-radius: 8px; padding: 24px; }
.account-main h2 { margin: 0 0 16px; font-size: 18px; padding-bottom: 12px; border-bottom: 2px solid var(--accent); }

/* Tables (admin & lists) */
table.data { width: 100%; border-collapse: collapse; background: var(--bg2); display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
table.data thead, table.data tbody, table.data tr, table.data th, table.data td { display: block; }
table.data thead { position: absolute; left: -9999px; }
table.data tr { border-bottom: 1px solid var(--rule); padding: 8px 0; }
table.data td { border: none; padding: 4px 12px; text-align: left; font-size: 13px; white-space: normal; }
table.data td::before { content: attr(data-label); font-weight: 600; display: block; color: var(--muted); font-size: 11px; margin-bottom: 2px; }
table.data th { background: var(--bg3); color: var(--muted); font-weight: 400; font-size: 12px; }
table.data tr:hover { background: #fffcf7; }
table.data .actions { display: flex; gap: 8px; }
table.data .actions a { color: var(--accent2); font-size: 12px; }
table.data .actions a.danger { color: var(--price); }
@media (min-width: 800px) {
  table.data, table.data thead, table.data tbody, table.data tr, table.data th, table.data td { display: revert; }
  table.data thead { position: static; left: auto; }
  table.data td::before { display: none; }
}

/* Modal */
.modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,0.5); display: flex; align-items: center; justify-content: center; z-index: 1000; padding: 20px; }
.modal { background: var(--bg2); border-radius: 10px; max-width: 720px; width: 100%; max-height: 90vh; overflow: auto; padding: 24px; position: relative; }
.modal-close-btn { position: absolute; top: 12px; right: 16px; background: none; border: none; font-size: 24px; color: var(--muted); cursor: pointer; line-height: 1; padding: 4px 8px; border-radius: 4px; z-index: 1; }
.modal-close-btn:hover { color: var(--ink); background: var(--bg3); }
.modal h3 { margin: 0 0 16px; font-size: 18px; padding-bottom: 12px; border-bottom: 1px solid var(--rule); }
.modal .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

/* Footer */
footer.site { background: var(--dark); color: #94a3b8; padding: 40px 24px 20px; margin-top: 40px; }
footer.site .inner { max-width: 1380px; margin: 0 auto; }
footer.site .copy { text-align: center; padding-top: 20px; border-top: 1px solid #334155; font-size: 12px; color: #64748b; margin-top: 24px; }

/* Toast */
.toast { position: fixed; bottom: 30px; right: 30px; background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 6px; font-size: 13px; z-index: 9999; box-shadow: 0 10px 30px rgba(0,0,0,.3); }
.toast.err { background: #b91c1c; }
.toast.ok { background: #16a34a; }

/* Floating action buttons — unified white circle style */
/* ===== Collapsible FAB Container ===== */
.fab-container { position: fixed; right: 16px; bottom: 72px; z-index: 998; display: flex; flex-direction: column; align-items: center; gap: 8px; }
.fab-container .fab-items { display: flex; flex-direction: column; align-items: center; gap: 8px; transition: all .25s ease; }
.fab-container:not(.open) .fab-items { opacity: 0; pointer-events: none; transform: translateY(20px); max-height: 0; overflow: hidden; }
.fab-container.open .fab-items { opacity: 1; pointer-events: auto; transform: translateY(0); max-height: 400px; }
.fab-container .fab-toggle {
  width: 52px; height: 52px; border-radius: 50%; background: #f97316; color: #fff; border: none;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
  box-shadow: 0 4px 16px rgba(249,115,22,0.35); font-size: 28px; line-height: 1;
  transition: transform .2s, background .2s;
}
.fab-container.open .fab-toggle { transform: rotate(45deg); background: #64748b; }
.fab-container .fab-toggle:hover { transform: scale(1.08); }
.fab-container.open .fab-toggle:hover { transform: rotate(45deg) scale(1.08); }

.fab-container .wa-fab, .fab-container .fav-fab, .fab-container .cmp-fab, .fab-container .fb-fab, .fab-container .top-fab, .fab-container .cart-fab {
  position: relative;
  width: 48px; height: 48px; border-radius: 50%;
  background: #fff; border: none; display: flex; align-items: center; justify-content: center;
  cursor: pointer; box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  transition: transform .15s, box-shadow .15s; text-decoration: none;
}
.fab-container .wa-fab { background: #25D366; }
.fab-container .wa-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(37,211,102,0.45); }
.fab-container .cart-fab { background: var(--accent); }
.fab-container .cart-fab:hover { transform: scale(1.08); box-shadow: 0 6px 24px rgba(249,115,22,0.45); }
.fab-container .fav-fab:hover, .fab-container .cmp-fab:hover, .fab-container .fb-fab:hover, .fab-container .top-fab:hover {
  transform: scale(1.08); box-shadow: 0 6px 24px rgba(0,0,0,0.18);
}
.fav-fab .badge, .cmp-fab .badge, .cart-fab .badge { position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px; background: var(--accent); color: #fff; border-radius: 999px; font-size: 11px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.fb-modal-mask { position: fixed; inset: 0; background: rgba(15,23,42,0.55); z-index: 1001; display: flex; align-items: center; justify-content: center; padding: 20px; }
.fb-modal { background: #fff; border-radius: 12px; width: 100%; max-width: 460px; max-height: 90vh; overflow: auto; padding: 24px; box-shadow: 0 20px 60px rgba(0,0,0,0.25); position: relative; }
.fb-modal .close { position: absolute; top: 12px; right: 16px; font-size: 24px; cursor: pointer; color: var(--muted); }
.fb-modal h3 { margin: 0 0 8px; font-size: 18px; }
.fb-note { color: var(--muted); font-size: 13px; margin-bottom: 14px; }
.fb-rating { display: flex; justify-content: space-between; gap: 8px; margin-bottom: 14px; }
.fb-rating button { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 10px 4px; border: 1px solid var(--rule); border-radius: 8px; background: #fff; cursor: pointer; font-size: 12px; color: var(--muted); transition: border-color .15s, background .15s; }
.fb-rating button .fb-emoji { font-size: 22px; line-height: 1; }
.fb-rating button.selected { border-color: var(--accent); background: #eff6ff; color: var(--accent); font-weight: 600; }
.fb-textarea { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid var(--rule); border-radius: 6px; font-family: inherit; font-size: 14px; resize: vertical; min-height: 90px; margin-bottom: 10px; }
.fb-check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--muted); cursor: pointer; margin-bottom: 8px; }
.fb-upload { padding: 10px; border: 1px dashed var(--rule); border-radius: 6px; background: var(--bg2); margin-bottom: 10px; }
.fb-upload input { display: block; margin-bottom: 4px; }
.drawer-mask { position: fixed; inset: 0; background: rgba(15,23,42,0.5); z-index: 1000; display: flex; justify-content: flex-end; }
.drawer { background: var(--bg2); width: 100%; max-width: 720px; height: 100%; overflow: auto; padding: 0; display: flex; flex-direction: column; }
.drawer-head { padding: 16px 20px; border-bottom: 1px solid var(--rule); display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--bg2); z-index: 1; }
.drawer-head h3 { margin: 0; font-size: 16px; }
.drawer-head .close { font-size: 22px; cursor: pointer; color: var(--muted); padding: 0 8px; }
.drawer-body { padding: 16px 20px; flex: 1; }
.fav-item { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.fav-item .img { width: 60px; height: 60px; border: 1px solid var(--rule); border-radius: 4px; display: flex; align-items: center; justify-content: center; background: #fff; }
.fav-item .img img { max-width: 56px; max-height: 56px; object-fit: contain; }
.fav-item .info .mpn { font-family: var(--font-mono); font-weight: 600; font-size: 14px; letter-spacing: .1px; }
.fav-item .info .meta { font-size: 12px; color: var(--muted); margin-top: 2px; }
.cmp-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.cmp-table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; max-width: 100%; }
.cmp-table th { background: var(--bg3); padding: 10px; text-align: left; font-weight: 400; color: var(--muted); border-bottom: 1px solid var(--rule); position: sticky; left: 0; z-index: 2; min-width: 100px; }
.cmp-table td { padding: 10px; border-bottom: 1px solid var(--rule); border-left: 1px solid var(--rule); min-width: 160px; vertical-align: top; }
.cmp-table tr:hover td { background: #fffcf7; }
.cmp-table .remove { color: var(--price); cursor: pointer; font-size: 12px; }
.cmp-diff { background: #fef3c7 !important; font-weight: 600; }
.cmp-diff-row th { background: #fef9e7 !important; color: var(--accent); font-weight: 600; }
.btn-filter { padding: 6px 18px; border-radius: 6px; background: var(--accent); color: #fff; font-weight: 500; font-size: 13px; border: 0; cursor: pointer; }
.btn-filter:hover { background: var(--accent-hover); }
.btn-clear { padding: 6px 18px; border-radius: 6px; background: #0ea5e9; color: #fff; font-weight: 500; font-size: 13px; border: 0; cursor: pointer; }
.mobile-clear { display: none; }
.btn-clear:hover { background: #0284c7; }

/* Drawer cap svg */
.cap-svg { width: 62px; height: 62px; }

/* Empty state */
.empty { text-align: center; padding: 60px 20px; color: var(--muted); }

/* Responsive */

/* ===== Grid Card View ===== */
.results.grid-view .result-head { display: none; }
.results-sticky-bar:has(+ .results.grid-view) .result-head { display: none; }

/* Grid container */
.results.grid-view,
.results.grid-view #resultList {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px;
  border: none;
  border-radius: 0;
  background: transparent;
  width: 100%;
  box-sizing: border-box;
}

/* Grid card */
.results.grid-view .result-row {
  display: flex;
  flex-direction: column;
  border: 1px solid var(--rule);
  border-radius: 12px;
  padding: 0;
  margin-bottom: 0;
  background: var(--bg2);
  transition: box-shadow .2s, border-color .2s, transform .15s;
  gap: 0;
  grid-template-columns: unset !important;
  min-width: 0;
  overflow: visible;
  width: calc(25% - 10.5px);
  flex-shrink: 0;
  box-sizing: border-box;
}
.results.grid-view .result-row:hover {
  border-color: var(--accent);
  box-shadow: 0 6px 24px rgba(0,0,0,.08);
  transform: translateY(-2px);
}

/* Card image area - large */
.results.grid-view .cell-img {
  width: 100%;
  height: 200px;
  border: none;
  border-radius: 12px 12px 0 0;
  background: var(--bg3);
  padding: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  grid-row: auto !important;
  grid-column: auto !important;
}
.results.grid-view .cell-img::after { display: none !important; }
.results.grid-view .cell-img .img-zoom { display: none !important; }
.results.grid-view .cell-img .cell-thumb { width: 100%; height: 100%; display: flex; align-items: center; justify-content: center; }
.results.grid-view .cell-img .cell-thumb img,
.results.grid-view .cell-img .cell-thumb svg { max-width: 100%; max-height: 100%; object-fit: contain; }

/* Card body */
.results.grid-view .cell-card-body {
  padding: 10px 12px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
  min-width: 0;
  grid-column: auto !important;
  grid-row: auto !important;
}

/* Card title row: model left, brand right */
.results.grid-view .card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 6px;
}
.results.grid-view .cell-card-body .mpn {
  font-size: 13px;
  font-weight: 700;
  margin: 0;
  line-height: 1.3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  flex: 1;
  min-width: 0;
}
.results.grid-view .cell-card-body .mpn a {
  color: var(--accent);
  text-decoration: none;
}

/* Card brand */
.results.grid-view .card-brand {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
  flex-shrink: 0;
}

/* Card tags - single row */
.results.grid-view .card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}
.results.grid-view .card-tag {
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--bg3);
  color: var(--ink);
  font-weight: 500;
  white-space: nowrap;
  border: 1px solid var(--rule);
}
.results.grid-view .card-tag .cond-pill {
  font-size: 10px;
  padding: 0;
  margin: 0;
}

/* Card bottom: stock + price */
.results.grid-view .card-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 8px;
  border-top: 1px solid var(--rule);
  margin-top: 2px;
}
.results.grid-view .card-stock {
  font-size: 12px;
  color: var(--muted);
}
.results.grid-view .card-stock .stock-num {
  color: var(--ink);
  font-weight: 600;
}
.results.grid-view .card-price {
  font-size: 16px;
  font-weight: 700;
  color: var(--price);
  font-family: var(--font-mono);
}

/* Card actions */
.results.grid-view .card-actions {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.results.grid-view .card-actions .btn-whatsapp {
  flex: 3;
  text-align: center;
  font-size: 12px;
  padding: 7px 0;
  border-radius: 6px;
  text-decoration: none;
  font-weight: 600;
}
.results.grid-view .card-actions .btn-inquiry {
  flex: 2;
  text-align: center;
  font-size: 12px;
  padding: 7px 0;
  border-radius: 6px;
  text-decoration: none;
}

/* Grid responsive */
@media (max-width: 1400px) {
  .results.grid-view .result-row { width: calc(25% - 10.5px); }
}
/* Force desktop mode override */
/* Force desktop: keep desktop layout on small screens (only when user explicitly wants desktop) */
@media (min-width: 1101px) {
  body.force-desktop .filter-card { display: grid !important; }
  body.force-desktop .mobile-filter-bar { display: none !important; }
  body.force-desktop .mobile-filter-drawer { display: none !important; }
  body.force-desktop main { padding-bottom: 24px !important; }
  body.force-desktop .header-inner { display: grid !important; grid-template-columns: 270px minmax(420px, 1fr) auto !important; flex-direction: unset !important; padding: 14px 24px !important; }
  body.force-desktop .header-left { display: contents !important; flex-direction: unset !important; gap: unset !important; }
  body.force-desktop .hamburger { display: none !important; }
  body.force-desktop .header-nav { display: flex !important; }
  body.force-desktop .bottom-tab-bar { display: none !important; }
}

@media (max-width: 800px) {
  .results.grid-view .result-row { width: calc(50% - 7px); }
  .results.grid-view .cell-img { height: 160px; }
  main { padding-bottom: 64px; }
}
/* All pages: always show filter card + sort bar regardless of viewport */
@media (min-width: 1101px) {
  .filter-card { display: grid !important; }
  .mobile-filter-bar { display: none !important; }
}
@media (max-width: 500px) {
  .results.grid-view .result-row { width: 100%; }
  .results.grid-view .cell-img { height: 140px; }
}
@media (max-width: 600px) {
  .hamburger { font-size: 22px; }
  .logo-mark { width: 40px; height: 40px; font-size: 16px; border-radius: 8px; }
  .logo-text .cn { font-size: 18px; }
  .logo-text .en { font-size: 10px; }
  .topbar .right .hide-mobile { display: none; }
  main { padding: 12px; }
  .search-hero { padding: 28px 0 32px; }
  .hero-title { font-size: 22px; margin-bottom: 8px; }
  .hero-sub { font-size: 13px; margin-bottom: 20px; }
  .hero-search { flex-wrap: wrap; border-radius: 14px; }
  .hero-search input { width: 100%; min-height: 48px; font-size: 15px; border-radius: 14px 14px 0 0; }
  .hero-search button { width: 100%; min-height: 44px; border-radius: 0 0 14px 14px; padding: 0 20px; }
  .hero-hot { height: auto; flex-wrap: wrap; margin-top: 10px; justify-content: center; }
  .hero-hot a { font-size: 12px; padding: 3px 10px; }
  .stats-row { gap: 20px; margin-top: 28px; }
  .stat-num { font-size: 22px; }
  .stat-label { font-size: 11px; }
  .filter-card { grid-template-columns: 1fr; gap: 6px; }
  .filter-card .lbl { padding-top: 0; }
  .filter-actions { justify-content: flex-start; height: auto; }
  .result-row { grid-template-columns: 1fr; gap: 10px; padding: 12px; }
  .result-row > .cell-img { grid-row: auto; width: 100%; height: 160px; }
  .cell-img { width: 100%; height: 160px; }
  .cell h3.mpn { font-size: 15px; }
  .cell .kv { font-size: 13px; }
  .price-col .price-main { font-size: 20px; }
  .detail-wrap { padding: 0; gap: 0; }
  .detail-left { padding: 14px; }
  .detail-right { padding: 14px; }
  .detail-img { min-height: 240px; }
  .detail-main-img { height: 220px; }
  .detail-info h1 { font-size: 18px; }
  .detail-price-box .price-big { font-size: 22px; }
  .detail-info .specs-grid { grid-template-columns: 1fr; gap: 6px; }
  .detail-info .specs-grid .lbl { display: inline; }
  .detail-info .specs-grid .v { display: inline; }
  .detail-info .stock-row { flex-direction: column; gap: 8px; }
  .detail-info .actions { flex-direction: column; }
  .detail-info .actions a { width: 100%; text-align: center; justify-content: center; }
  .pagination a, .pagination span { padding: 8px 12px; min-width: 40px; text-align: center; }
  .auth-card { padding: 24px 20px; }
  .form-actions { flex-direction: column; }
  .form-actions .btn-primary { width: 100%; }
  .form-actions .btn-ghost { width: 100%; justify-content: center; }
}

/* ===== General Content Page ===== */
.page-wrap { max-width: 1380px; margin: 0 auto; padding: 32px 24px 48px; }
.page-hero { background: linear-gradient(135deg, #fff7ed 0%, #ffedd5 60%, #fff 100%); border-bottom: 1px solid var(--rule); padding: 48px 24px 40px; text-align: center; }
.page-hero h1 { font-size: 32px; font-weight: 700; color: var(--ink); margin: 0 0 10px; letter-spacing: -.5px; }
.page-hero h1 span { color: var(--accent); }
.page-hero p { font-size: 15px; color: var(--muted); margin: 0; }
.crumbs { max-width: 1380px; margin: 0 auto; padding: 14px 24px; font-size: 12px; color: var(--muted); }
.crumbs a { color: var(--muted); }
.crumbs a:hover { color: var(--accent); }

.section { margin-bottom: 36px; }
.section-title { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0 0 6px; }
.section-sub { font-size: 13px; color: var(--muted); margin: 0 0 18px; }

.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.card-panel { background: var(--bg2); border: 1px solid var(--rule); border-radius: 12px; padding: 22px; transition: all .15s ease; }
.card-panel:hover { border-color: var(--accent); box-shadow: 0 14px 32px -22px rgba(249,115,22,.5); transform: translateY(-2px); }
.card-icon { width: 44px; height: 44px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 22px; margin-bottom: 12px; }
.card-panel h4 { font-size: 16px; font-weight: 600; margin: 0 0 8px; color: var(--ink); }
.card-panel p { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0; }
.card-panel ul { margin: 8px 0 0; padding-left: 18px; font-size: 13px; color: var(--ink-soft); line-height: 1.9; }

/* about */
.about-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 28px 0 8px; }
.about-stats .stat { background: var(--bg2); border: 1px solid var(--rule); border-radius: 12px; padding: 20px; text-align: center; }
.about-stats .stat .n { font-size: 30px; font-weight: 700; color: var(--accent); font-family: var(--font-mono); }
.about-stats .stat .l { font-size: 12px; color: var(--muted); margin-top: 4px; }
.about-flow { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; }
.about-flow .step { background: var(--bg2); border: 1px solid var(--rule); border-radius: 10px; padding: 16px; position: relative; }
.about-flow .step .num { position: absolute; top: -12px; left: 16px; width: 26px; height: 26px; border-radius: 50%; background: var(--accent); color: #fff; font-weight: 700; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.about-flow .step h5 { margin: 4px 0 6px; font-size: 14px; font-weight: 600; }
.about-flow .step p { font-size: 12px; color: var(--muted); margin: 0; line-height: 1.6; }

/* contact */
.contact-grid { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; }
.contact-list { background: var(--bg2); border: 1px solid var(--rule); border-radius: 12px; padding: 22px; }
.contact-list h3 { margin: 0 0 16px; font-size: 18px; }
.contact-item { display: flex; gap: 14px; padding: 14px 0; border-bottom: 1px dashed var(--rule); }
.contact-item:last-child { border-bottom: 0; }
.contact-item .ico { width: 40px; height: 40px; border-radius: 10px; background: var(--accent-soft); color: var(--accent); display: flex; align-items: center; justify-content: center; font-size: 18px; flex-shrink: 0; }
.contact-item .info { flex: 1; min-width: 0; }
.contact-item .info b { display: block; font-size: 13px; color: var(--ink); margin-bottom: 2px; }
.contact-item .info span { font-size: 13px; color: var(--muted); word-break: break-all; }
.contact-form { background: var(--bg2); border: 1px solid var(--rule); border-radius: 12px; padding: 22px; }
.contact-form h3 { margin: 0 0 16px; font-size: 18px; }
.param-card { display: block; background: var(--bg2); border: 1px solid var(--rule); border-radius: 10px; padding: 14px; }
.param-card .hint { color: var(--muted); font-size: 12px; margin-top: 4px; }
.quote-part .form-row { margin-bottom: 0; }

/* brands page */
.brand-wall { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.brand-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: 12px; padding: 18px; text-align: center; transition: all .15s ease; }
.brand-card:hover { border-color: var(--accent); box-shadow: 0 14px 32px -22px rgba(249,115,22,.5); transform: translateY(-2px); }
.brand-card .logo-box { height: 64px; display: flex; align-items: center; justify-content: center; margin-bottom: 10px; }
.brand-card .logo-box img { max-width: 100%; max-height: 56px; object-fit: contain; }
.brand-card h4 { margin: 6px 0 4px; font-size: 16px; font-weight: 600; }
.brand-card .country { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.brand-card p { font-size: 12px; color: var(--ink-soft); line-height: 1.7; margin: 0 0 10px; min-height: 56px; }
.brand-card .pill-row { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; }

/* solutions */
.sol-card { background: var(--bg2); border: 1px solid var(--rule); border-radius: 14px; overflow: hidden; transition: all .15s ease; }
.sol-card:hover { border-color: var(--accent); box-shadow: 0 14px 32px -22px rgba(249,115,22,.5); transform: translateY(-3px); }
.sol-card .sol-head { padding: 22px; background: linear-gradient(135deg, var(--accent-soft) 0%, #fff 100%); border-bottom: 1px solid var(--rule); }
.sol-card .sol-head .ico { font-size: 28px; }
.sol-card .sol-head h4 { margin: 6px 0 4px; font-size: 18px; font-weight: 600; }
.sol-card .sol-head .tag { font-size: 12px; color: var(--accent); font-weight: 500; }
.sol-card .sol-body { padding: 18px 22px 22px; }
.sol-card .sol-body p { font-size: 13px; color: var(--muted); line-height: 1.7; margin: 0 0 10px; }
.sol-card .sol-body .kv { font-size: 12px; color: var(--ink-soft); line-height: 1.9; }
.sol-card .sol-body .kv b { color: var(--accent2); font-weight: 500; }

/* products page */
.prod-cat-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; }
.prod-cat { background: var(--bg2); border: 1px solid var(--rule); border-radius: 12px; padding: 22px; display: flex; gap: 16px; align-items: flex-start; transition: all .15s ease; color: inherit; }
.prod-cat:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 14px 32px -22px rgba(249,115,22,.5); }
.prod-cat .img { width: 96px; height: 96px; border-radius: 10px; background: var(--bg3); display: flex; align-items: center; justify-content: center; flex-shrink: 0; overflow: hidden; }
.prod-cat .img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.prod-cat .meta h4 { margin: 0 0 6px; font-size: 16px; font-weight: 600; color: var(--ink); }
.prod-cat .meta p { margin: 0 0 8px; font-size: 12px; color: var(--muted); line-height: 1.7; }
.prod-cat .meta .tag-list span { display: inline-block; padding: 2px 8px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-size: 11px; margin-right: 4px; margin-bottom: 4px; }

@media (max-width: 980px) {
  .grid-3, .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .about-stats { grid-template-columns: repeat(2, 1fr); }
  .about-flow { grid-template-columns: repeat(1, 1fr); }
  .contact-grid { grid-template-columns: 1fr; }
  .brand-wall { grid-template-columns: repeat(2, 1fr); }
  .prod-cat-grid { grid-template-columns: 1fr; }
  .page-hero { padding: 28px 0; }
  .page-hero h1 { font-size: 26px; }
}
@media (max-width: 600px) {
  .grid-3, .grid-4, .grid-2, .brand-wall, .about-stats { grid-template-columns: 1fr; }
  .page-hero { padding: 20px 0; }
  .page-hero h1 { font-size: 22px; }
  .page-hero p { font-size: 13px; }
  .section-title { font-size: 18px; }
  .brand-card { padding: 14px; }
  .brand-card h4 { font-size: 14px; }
  .sol-card { padding: 14px; }
  .sol-card .sol-head h4 { font-size: 14px; }
  .contact-info-card { padding: 16px; }
  .contact-form-card { padding: 16px; }
  .quote-steps { flex-direction: column; }
  .quote-steps .step-num { display: none; }
  .quote-form-grid { grid-template-columns: 1fr; }
  .urgency-options { flex-direction: column; }
  .urgency-options label { width: 100%; }
}

/* Plain text mode: remove visual effects that can make text look blurry */
*, *::before, *::after {
  text-shadow: none !important;
}

body,
button,
input,
select,
textarea,
a {
  font-family: Arial, Helvetica, sans-serif !important;
  -webkit-font-smoothing: auto !important;
  -moz-osx-font-smoothing: auto !important;
  text-rendering: auto !important;
}

.logo-text .cn {
  background: none !important;
  -webkit-background-clip: initial !important;
  background-clip: initial !important;
  color: var(--dark) !important;
}
[data-theme="dark"] .logo-text .cn {
  color: #fff !important;
}
[data-theme="dark"] .logo-text .en {
  color: #94a3b8 !important;
}

.btn,
.btn-primary,
.btn-ghost,
.btn-inquiry,
.btn-whatsapp,
.contact-btn-whatsapp,
.btn-wechat,
.contact-btn-wechat,
.btn-filter,
.btn-clear,
.hero-search button,
.subscribe-form button,
.form-actions .btn-primary {
  box-shadow: none !important;
  transform: none !important;
  text-shadow: none !important;
  letter-spacing: normal !important;
  font-family: Arial, Helvetica, sans-serif !important;
  -webkit-font-smoothing: auto !important;
  text-rendering: auto !important;
}

.btn:hover,
.btn-primary:hover,
.btn-ghost:hover,
.btn-inquiry:hover,
.btn-whatsapp:hover,
.contact-btn-whatsapp:hover,
.btn-wechat:hover,
.contact-btn-wechat:hover,
.btn-filter:hover,
.btn-clear:hover,
.hero-search button:hover,
.subscribe-form button:hover,
.form-actions .btn-primary:hover {
  transform: none !important;
  box-shadow: none !important;
}

.cell h3.mpn,
.price-col .price-main,
.detail-info h1,
.detail-price-box .price-big,
.fav-item .info .mpn,
.price-col .cond-pill,
.tags-col .cond-pill {
  letter-spacing: normal !important;
  font-family: Arial, Helvetica, sans-serif !important;
}

/* Stock status pills */
.stock-status-pill { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 400; line-height: 1.6; white-space: nowrap; border: 1px solid; }
.stock-status-pill.in-stock { background: #dcfce7; color: #166534; border-color: #86efac; }
.stock-status-pill.low-stock { background: #ffedd5; color: #9a3412; border-color: #fdba74; }
.stock-status-pill.in-transit { background: #dbeafe; color: var(--accent2); border-color: #93c5fd; }
.stock-status-pill.made-to-order { background: #ede9fe; color: #5b21b6; border-color: #c4b5fd; }
.stock-status-pill.out-of-stock { background: #fee2e2; color: #991b1b; border-color: #fca5a5; }

/* Lead time pill */
.lead-time { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11px; font-weight: 600; line-height: 1.6; white-space: nowrap; background: #f3f4f6; color: var(--muted); border: 1px solid #d1d5db; margin: 0; }
.lead-time::before { content: '⏱ '; }

/* Cookie Consent Banner */
.cookie-banner { position: fixed; bottom: 0; left: 0; right: 0; z-index: 10000; background: #f8f9fa; border-top: 1px solid #e5e7eb; box-shadow: 0 -4px 20px rgba(0,0,0,0.08); animation: cookieSlideUp 0.4s ease; }
@keyframes cookieSlideUp { from { transform: translateY(100%); opacity: 0; } to { transform: translateY(0); opacity: 1; } }
.cookie-banner-inner { max-width: 1200px; margin: 0 auto; padding: 16px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; flex-wrap: wrap; }
.cookie-banner-text { display: flex; flex-direction: column; gap: 4px; flex: 1; min-width: 280px; }
.cookie-banner-text strong { font-size: 15px; color: #111827; }
.cookie-banner-text span { font-size: 13px; color: #6b7280; line-height: 1.5; }
.cookie-banner-text a { color: #2563eb; text-decoration: underline; }
.cookie-banner-actions { display: flex; gap: 10px; flex-shrink: 0; }
.cookie-btn { padding: 10px 20px; border-radius: 8px; font-size: 13px; font-weight: 600; cursor: pointer; border: 1px solid #d1d5db; background: #fff; color: #374151; transition: all 0.2s; white-space: nowrap; }
.cookie-btn:hover { background: #f3f4f6; }
.cookie-btn-all { background: #2563eb; color: #fff; border-color: #2563eb; }
.cookie-btn-all:hover { background: #1d4ed8; border-color: #1d4ed8; }
@media (max-width: 1100px) {
  .cookie-banner-inner { flex-direction: column; align-items: stretch; padding: 14px 16px; gap: 12px; }
  .cookie-banner-actions { justify-content: stretch; }
  .cookie-btn { flex: 1; text-align: center; padding: 10px 12px; font-size: 12px; }
}

/* ===== Brand capsule row (group-nav) ===== */
.brand-capsule-row {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  overflow-x: auto;
  scrollbar-width: thin;
}
.brand-capsule-row::-webkit-scrollbar { height: 4px; }
.brand-capsule-row::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 4px; }

.capsule-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

.capsule {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 500;
  color: #374151;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.15s;
  cursor: pointer;
}
.capsule:hover { background: #e5e7eb; color: #111827; }
.capsule.active {
  background: #f97316;
  color: #fff;
  border-color: #f97316;
}
.capsule.active:hover { background: #ea580c; }

.capsule-label { }
.capsule-count {
  font-size: 11px;
  opacity: 0.75;
  background: rgba(0,0,0,0.08);
  border-radius: 999px;
  padding: 1px 6px;
  min-width: 18px;
  text-align: center;
}
.capsule.active .capsule-count {
  background: rgba(255,255,255,0.25);
}

/* Capsule search bar (right side) */
.capsule-search-wrap {
  margin-left: auto;
  flex-shrink: 0;
}
#capsuleSearchForm {
  display: flex;
  align-items: stretch;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  overflow: hidden;
  max-width: 280px;
  min-width: 200px;
}
#capsuleSearchForm input {
  flex: 1;
  padding: 0 14px;
  border: 0;
  outline: 0;
  font-size: 13px;
  min-height: 32px;
  background: transparent;
  color: #374151;
}
#capsuleSearchForm input::placeholder { color: #9ca3af; }
#capsuleSearchForm button {
  padding: 0 16px;
  background: #f97316;
  color: #fff;
  border: 0;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  transition: background 0.15s;
}
#capsuleSearchForm button:hover { background: #ea580c; }

/* ===== Mobile Bottom Tab Bar ===== */
.bottom-tab-bar { display: none; }
/* When mobile version is disabled, hide bottom tab bar even on small screens */
/* data-mobile-disabled no longer used - responsive design handles layout */
@media (max-width: 1100px) {
  body { padding-bottom: 56px; }
  /* Hide topbar on mobile */
  .topbar { display: none !important; }
  /* Hide Best Match / Newest / Stock checkbox sort tabs on mobile */
  .sort-tab-popular,
  .sort-tab-newest,
  .sort-check-instock { display: none !important; }
  /* Show mobile Clear in crumbs, hide desktop Clear in sort-tabs */
  .mobile-clear { display: inline-flex !important; margin-left: 8px; padding: 4px 10px; font-size: 12px; }
  .desktop-clear { display: none !important; }
  /* Stacked sort-check: label above, count below */
  .sort-check.sort-check-stack {
    flex-direction: column;
    align-items: center;
    gap: 0;
    padding: 2px 8px;
    line-height: 1.3;
  }
  .sort-check.sort-check-stack input {
    position: absolute;
    opacity: 0;
  }
  .sort-check.sort-check-stack .sort-check-line1 {
    font-size: 12px;
  }
  .sort-check.sort-check-stack .sort-check-line2 {
    font-size: 11px;
    color: var(--muted);
  }
  /* Show register in header-actions on mobile (right side next to logo) */
  .header-actions { display: flex !important; }
  .header-actions .btn-ghost { display: none !important; }
  .header-actions .btn-primary { display: inline-flex !important; }
  /* Compact header on mobile - logo + register side by side */
  .header-left { display: flex !important; flex-direction: row !important; align-items: center !important; flex-shrink: 1; min-width: 0; }
  .logo { flex: 1; min-width: 0; gap: 4px; }
  /* Hide hero-sub description text on mobile */
  .hero-sub { display: none !important; }
  .header-nav a[href="/register"] { display: none; }
  .hero-hot a:nth-child(n+4) { display: none; }
  .stats-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 20px; }
  .stats-row .stat-card.wide { grid-column: 1 / -1; min-width: 0; }
  .stats-row .stat-card:not(.wide) { min-width: 0; grid-column: auto; }
  .stats-row .stat-card:nth-child(4) { display: none; }
  .stats-row .stat-num { font-size: 26px; }
  .stats-row .stat-label { font-size: 12px; }
  .bottom-tab-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 999;
    justify-content: space-around;
    align-items: center;
    height: 56px;
    background: #fff;
    border-top: 1px solid #e2e8f0;
  }
  .bottom-tab-bar .tab-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    height: 100%;
    color: #64748b;
    font-size: 11px;
    text-decoration: none;
  }
  .bottom-tab-bar .tab-item.on { color: #f97316; }
  .bottom-tab-bar .tab-icon { font-size: 20px; line-height: 1; }
}

/* ===== Skeleton Loading ===== */
.skeleton-wrap { display: flex; flex-direction: column; gap: 12px; padding: 12px; }
.skeleton-card { display: flex; gap: 12px; padding: 12px; background: #fff; border-radius: 8px; border: 1px solid #e2e8f0; }
.skeleton-img {
  width: 80px;
  height: 80px;
  border-radius: 6px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}
.skeleton-lines { flex: 1; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.skeleton-lines div {
  height: 12px;
  border-radius: 4px;
  background: linear-gradient(90deg, #f1f5f9 25%, #e2e8f0 50%, #f1f5f9 75%);
  background-size: 200% 100%;
  animation: skeletonShimmer 1.5s infinite;
}
.skeleton-lines div:nth-child(1) { width: 70%; }
.skeleton-lines div:nth-child(2) { width: 50%; }
.skeleton-lines div:nth-child(3) { width: 40%; }
@keyframes skeletonShimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ===== Image Lightbox ===== */
.img-lightbox {
  position: fixed;
  inset: 0;
  z-index: 10000;
  background: rgba(0,0,0,0.9);
  display: flex;
  align-items: center;
  justify-content: center;
}
.img-lightbox img { max-width: 95vw; max-height: 90vh; object-fit: contain; }
.img-lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  color: #fff;
  font-size: 32px;
  background: none;
  border: none;
  cursor: pointer;
}

/* ===== Sticky Search Bar ===== */
.search-sticky {
  position: sticky;
  top: 0;
  z-index: 200;
  background: #fff;
  padding: 8px 12px;
  border-bottom: 1px solid #e2e8f0;
}
.search-sticky input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  outline: none;
}
.search-sticky input:focus { border-color: #f97316; }

.data-table { width: 100%; border-collapse: collapse; background: var(--bg2); font-size: 13px; }
.data-table thead th { background: var(--bg3); color: var(--muted); font-weight: 600; font-size: 12px; padding: 10px 12px; text-align: left; border-bottom: 1px solid var(--rule); white-space: nowrap; }
.data-table tbody td { padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.data-table tbody tr:hover { background: #fffcf7; }
@media (max-width: 1100px) {
  .data-table-wrap { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .data-table { min-width: 600px; }
  #site-header { position: sticky; top: 0; z-index: 300; }
  .search-hero { padding: 20px 16px; }
  .hero-title { font-size: 20px; }
}

/* ==========================================================================
   REDESIGN: Mobile & Tablet — Electrolytic Capacitor B2B Platform
   Desktop layout completely unchanged.
   Design language: industrial precision, trust, warm-tech, spec-first.
   ========================================================================== */

/* ===== MOBILE / TABLET (≤1100px) — Premium Capacitor B2B Experience ===== */

/* ===== MOBILE (≤640px) — Premium Capacitor B2B Experience ===== */
@media (max-width: 1100px) {
  /* ----- Font override ----- */
  :root {
    --font: "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
  }

  /* ----- Body ----- */
  body { padding-bottom: 72px; font-size: 14px; background: #f8fafc; }

  /* ----- Topbar hidden ----- */
  .topbar { display: none !important; }

  /* ----- Header: precision brand bar ----- */
  .header-inner {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    flex-wrap: nowrap !important;
    padding: 0 8px !important;
    min-height: 44px !important;
    gap: 2px !important;
    background: var(--bg2) !important;
    border-bottom: 1px solid var(--rule);
  }
  .header-left { flex: 1 1 auto; min-width: 0; max-width: 45%; }
  .hamburger { display: none !important; }
  .header-actions { flex: 0 0 auto; display: flex !important; gap: 3px !important; flex-wrap: nowrap !important; justify-content: flex-end !important; }
  .logo { display: flex; align-items: center; gap: 4px; flex-shrink: 1; min-width: 0; }
  .logo-mark { width: 26px; height: 26px; font-size: 10px; font-weight: 700; border-radius: 6px; background: linear-gradient(135deg, var(--dark), var(--accent)); color: #fff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
  .logo-text .cn { font-size: 12px; font-weight: 700; letter-spacing: -0.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; color: var(--dark); }
  .logo-text .en { display: none; }
  .header-nav { display: none !important; }
  .mobile-nav { display: none !important; }
  .header-actions .btn-ghost { display: none !important; }
  .header-actions a[href="/register"] { display: none !important; }
  .header-actions .btn-primary { padding: 5px 8px; font-size: 10px; border-radius: 6px; font-weight: 600; background: var(--accent); letter-spacing: 0.1px; white-space: nowrap; }
  .btn-mobile-login { display: inline-flex !important; padding: 5px 8px; font-size: 10px; border-radius: 6px; font-weight: 600; color: #fff; background: var(--ink); align-items: center; text-decoration: none; white-space: nowrap; }
  .btn-mobile-contact { display: inline-flex !important; padding: 5px 8px; font-size: 10px; border-radius: 6px; font-weight: 600; color: var(--accent); border: 1px solid var(--accent); background: transparent; align-items: center; text-decoration: none; white-space: nowrap; }
  .theme-toggle { width: 28px; height: 28px; font-size: 14px; flex-shrink: 0; }

  /* ----- Hero: capacitor-themed search ----- */
  .search-hero {
    padding: 18px 14px 22px;
    background: linear-gradient(165deg, var(--bg3) 0%, var(--accent-soft) 40%, var(--bg2) 100%);
    border-bottom: 1px solid var(--rule);
    position: relative;
    overflow: hidden;
  }
  .search-hero::after {
    content: '';
    position: absolute;
    top: -30px; right: -30px;
    width: 120px; height: 120px;
    background: radial-gradient(circle, rgba(249,115,22,0.06) 0%, transparent 70%);
    border-radius: 50%;
    pointer-events: none;
  }
  .hero-inner { padding: 0; position: relative; z-index: 1; }
  .hero-title {
    font-size: 17px; line-height: 1.4; margin-bottom: 0;
    font-weight: 700; letter-spacing: -0.3px;
    color: var(--ink);
  }
  .hero-title span { color: var(--accent); }
  .hero-sub { display: none; }
  .hero-search {
    max-width: 100%; margin: 12px 0 0;
    border-radius: 14px; border: 1.5px solid #cbd5e1;
    background: #fff;
    box-shadow: 0 4px 20px rgba(0,0,0,0.06);
    overflow: hidden; flex-wrap: nowrap !important;
    display: flex;
    transition: border-color 0.2s, box-shadow 0.2s;
  }
  .hero-search:focus-within { border-color: var(--accent); box-shadow: 0 6px 28px rgba(0,0,0,0.1); }
  .hero-search input {
    width: auto !important; min-height: 44px; font-size: 13px; padding: 0 14px;
    border-radius: 14px 0 0 14px; flex: 1; border: 0; background: transparent;
    min-width: 0;
  }
  .hero-search button {
    width: auto !important; padding: 0 16px; font-size: 12px; font-weight: 600;
    border-radius: 0 14px 14px 0; border: none; outline: none;
    background: var(--accent);
    color: #fff; white-space: nowrap; letter-spacing: 0.2px;
    flex-shrink: 0; min-height: auto;
  }

  /* ----- Hot tags: single line, scrollable ----- */
  .hero-hot { margin-top: 10px; display: flex; flex-wrap: nowrap; gap: 6px; align-items: center; height: auto; justify-content: flex-start; overflow-x: auto; overflow-y: hidden; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .hero-hot::-webkit-scrollbar { display: none; }
  .hero-hot b { font-size: 10px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; flex-shrink: 0; }
  .hero-hot a { font-size: 11px; padding: 4px 10px; border-radius: 20px; background: #fff; border: 1px solid #e2e8f0; color: var(--ink-soft); font-weight: 500; transition: all 0.15s; flex-shrink: 0; white-space: nowrap; }
  .hero-hot a:active { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }
  .hero-hot a:nth-child(n+4) { display: inline; }

  /* ----- Stats: only show in-stock quantity on mobile ----- */
  .stats-row { display: grid; grid-template-columns: 1fr; gap: 8px; margin-top: 16px; }
  .stats-row .stat-card {
    background: #fff; border: 1px solid #e8ecf0; border-radius: 12px;
    padding: 12px 10px; text-align: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.03);
    transition: transform 0.15s;
  }
  .stats-row .stat-card:active { transform: scale(0.98); }
  .stats-row .stat-card.wide { grid-column: 1 / -1; }
  .stats-row .stat-num { font-size: 22px; font-weight: 700; color: var(--accent); font-family: var(--font-mono); }
  .stats-row .stat-label { font-size: 10px; color: var(--muted); margin-top: 3px; font-weight: 500; text-transform: uppercase; letter-spacing: 0.3px; }
  .stats-row .stat-card:not(.wide) { display: none; }

  /* ----- Main content ----- */
  body { width: 100%; max-width: 100vw; }
  main { padding: 8px; padding-bottom: 130px; }

  /* ----- Breadcrumbs ----- */
  .crumbs { padding: 8px 4px; font-size: 11px; flex-wrap: wrap; }

  /* ----- Filter card: single-row per filter, opts + More inline ----- */
  .filter-card {
    grid-template-columns: 1fr auto; gap: 2px 6px;
    padding: 10px 12px; border-radius: 12px;
    margin-bottom: 8px; border: 1px solid var(--rule);
    box-shadow: 0 1px 3px rgba(0,0,0,0.02);
    padding-right: 56px; /* clear FAB */
  }
  .filter-card .lbl { grid-column: 1 / -1; font-size: 11px; padding-top: 0; font-weight: 600; color: var(--ink-soft); letter-spacing: 0.2px; }
  .filter-card .opts,
  .filter-card .opts.collapsed,
  .filter-card .opts.expanded { flex-wrap: nowrap !important; overflow: hidden !important; white-space: nowrap !important; height: auto !important; min-height: auto !important; padding-right: 0 !important; display: flex !important; gap: 4px; }
  .filter-card .opts.expanded { overflow-x: auto !important; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .filter-card .opts.expanded::-webkit-scrollbar { display: none; }
  .filter-card .opts.collapsed a.facet-extra { display: none; }
  .filter-card .opts.expanded a.facet-extra { display: inline-flex; }
  .filter-card .opts a,
  .filter-card .opts.collapsed a,
  .filter-card .opts.expanded a { font-size: 11px; padding: 3px 8px; border-radius: 6px; font-weight: 500; flex-shrink: 0; white-space: nowrap; }
  .filter-actions { justify-content: flex-start; flex-shrink: 0; margin-left: 0; }
  .filter-actions button { font-size: 11px; padding: 3px 6px; border-radius: 6px; white-space: nowrap; }

  /* ----- Sort bar ----- */
  .sort-bar { padding: 8px 10px; border-radius: 12px 12px 0 0; flex-wrap: wrap; gap: 6px; }
  .sort-tabs { overflow-x: auto; flex-wrap: nowrap; gap: 3px; padding-bottom: 2px; -webkit-overflow-scrolling: touch; }
  .sort-tabs a { font-size: 11px; padding: 4px 8px; white-space: nowrap; border-radius: 6px; }
  .sort-tab-popular, .sort-tab-newest, .sort-check-instock { display: none !important; }
  .sort-extra { font-size: 11px; }

  /* ----- Result cards: spec-first product cards ----- */
  .result-head { display: none; }
  .result-row { display: none !important; }
  .result-card { display: block; }
  .result-card {
    border: 1px solid #e8ecf0;
    border-radius: 14px;
    margin-bottom: 10px;
    background: #fff;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    overflow: hidden;
    transition: box-shadow 0.2s;
  }
  .result-card:active { box-shadow: 0 4px 16px rgba(0,0,0,0.08); }
  .result-card.is-alt { border-left: 4px solid var(--accent); background: #fffbf5; }
  .result-card .card-body { display: flex; gap: 10px; padding: 12px; }
  .result-card .card-thumb {
    width: 100px; height: 100px; flex-shrink: 0; order: 1;
    border: none; border-radius: 10px;
    background: transparent; display: flex; align-items: center; justify-content: center;
    overflow: hidden; text-decoration: none;
  }
  .result-card .card-thumb img, .result-card .card-thumb svg { max-width: 92px; max-height: 92px; object-fit: contain; }
  .result-card .card-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
  .result-card .card-mpn-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 6px; }
  .result-card .card-info .mpn { margin: 0; font-size: 15px; font-weight: 700; line-height: 1.3; color: var(--ink); font-family: var(--font-mono); letter-spacing: -0.1px; word-break: break-all; }
  .result-card .card-info .mpn a { color: var(--ink); text-decoration: none; }
  .result-card .card-datasheet-link { font-size: 12px; color: var(--accent2); font-weight: 400; text-decoration: none; white-space: nowrap; flex-shrink: 0; padding: 2px 0; }
  .result-card .card-spec-line { font-size: 13px; color: var(--ink-soft); font-weight: 500; line-height: 1.4; }
  .result-card .card-brand-line { font-size: 12px; color: var(--muted); font-weight: 500; }
  .result-card .card-stock-line { display: flex; flex-wrap: wrap; gap: 6px; font-size: 12px; align-items: center; }
  .result-card .cond-inline.original { color: var(--green); font-weight: 400; font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }
  .result-card .cond-inline.used { color: #dc2626; font-weight: 400; font-size: 12px; display: inline-flex; align-items: center; gap: 3px; }
  .result-card .card-bottom-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 8px; padding: 10px 12px;
    border-top: 1px solid var(--rule);
    background: linear-gradient(180deg, #fafbfd, #f8fafc);
  }
  .result-card .card-price-big { font-size: 17px; font-weight: 700; color: var(--price); font-family: var(--font-mono); }
  .result-card .card-price-big .unit { font-size: 10px; color: var(--muted); font-weight: 400; }
  .result-card .btn-whatsapp-card { padding: 7px 14px; border-radius: 20px; background: #25d366; color: #fff; font-size: 11px; font-weight: 600; letter-spacing: 0.1px; }

  /* ----- Grid view ----- */
  .results.grid-view .result-row { display: flex !important; width: 100% !important; }
  .results.grid-view .result-card { display: none !important; }
  .results.grid-view .cell-img { height: 150px; }

  /* ----- Pagination ----- */
  .pagination { padding: 16px 0; gap: 3px; flex-wrap: wrap; }
  .pagination a, .pagination span { padding: 6px 10px; font-size: 12px; min-width: 34px; text-align: center; border-radius: 8px; }

  /* ----- Product detail: B2B procurement flow ----- */
  .detail-wrap { padding: 0; gap: 0; grid-template-columns: 1fr; }
  .detail-left, .detail-right { padding: 14px; border-radius: 0; border: 0; border-bottom: 1px solid var(--rule); margin-bottom: 0; background: #fff; }
  .detail-left-top { flex-direction: column; gap: 12px; }
  .detail-left-img { flex: 0 0 auto; width: 100%; }
  .detail-left-img .detail-gallery { gap: 6px; }
  .detail-left-img .detail-main-img { width: 100%; height: 200px; border-radius: 10px; border: 1px solid #e8ecf0; }
  .detail-left-img .detail-thumbs img { width: 44px; height: 36px; border-radius: 6px; }
  .detail-left-info h1 { font-size: 16px; margin-bottom: 6px; line-height: 1.3; }
  .detail-left-info .key-params { font-size: 13px; font-weight: 500; }
  .detail-left-info .brand-line { font-size: 12px; }
  .detail-info .specs-grid { grid-template-columns: 1fr 1fr; gap: 4px 10px; font-size: 12px; }
  .detail-info .actions { flex-direction: column; gap: 6px; }
  .detail-info .actions a, .detail-info .actions .btn {
    width: 100%; text-align: center; justify-content: center;
    border-radius: 10px; font-weight: 600; padding: 12px;
  }
  .detail-price-box .price-big { font-size: 22px; }
  .detail-price-box .buy-actions { gap: 6px; }
  .detail-price-box .buy-actions .btn { padding: 10px; font-size: 13px; border-radius: 10px; }
  .detail-attr-table { font-size: 11px; }
  .detail-attr-table thead th, .detail-attr-table tbody td { padding: 5px 6px; }
  .detail-attr-search input { font-size: 12px; padding: 7px 10px 7px 30px; border-radius: 8px; }
  .detail-tabs button { padding: 8px 12px; font-size: 12px; border-radius: 8px; }
  .detail-module-title h2 { font-size: 15px; font-weight: 700; }

  /* ----- Auth / forms ----- */
  .auth-wrap { padding: 20px 12px; }
  .auth-card { padding: 20px 16px; border-radius: 14px; border: 1px solid var(--rule); }
  .auth-card h1 { font-size: 20px; }
  .form-row input, .form-row textarea, .form-row select { padding: 10px 12px; font-size: 14px; border-radius: 10px; border: 1px solid #d1d5db; }
  .form-actions { flex-direction: column; }
  .form-actions .btn-primary, .form-actions .btn-ghost { width: 100%; justify-content: center; border-radius: 10px; }

  /* ----- Content pages ----- */
  .page-hero { padding: 24px 16px; background: linear-gradient(165deg, #f8fafc, var(--accent-soft), #fff); }
  .page-hero h1 { font-size: 22px; }
  .page-wrap { padding: 20px 14px; }
  .grid-3, .grid-4, .grid-2 { grid-template-columns: 1fr; gap: 12px; }
  .section-title { font-size: 18px; }
  .card-panel { padding: 16px; border-radius: 14px; border: 1px solid var(--rule); }
  .about-stats { grid-template-columns: 1fr 1fr; gap: 10px; }
  .about-stats .stat .n { font-size: 24px; }
  .contact-grid { grid-template-columns: 1fr; gap: 16px; }
  .brand-wall { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .brand-card { padding: 12px; border-radius: 12px; }
  .brand-card h4 { font-size: 14px; }
  .prod-cat-grid { grid-template-columns: 1fr; gap: 10px; }
  .prod-cat { padding: 14px; flex-direction: column; align-items: center; text-align: center; border-radius: 14px; }
  .prod-cat .img { width: 80px; height: 80px; border-radius: 12px; }

  /* ----- Bottom Tab Bar: premium navigation ----- */
  .bottom-tab-bar {
    display: flex !important;
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 999;
    justify-content: space-around; align-items: center;
    height: 62px;
    background: rgba(255,255,255,0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid #e8ecf0;
    box-shadow: 0 -4px 24px rgba(0,0,0,0.06);
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-tab-bar .tab-item {
    flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
    gap: 2px; height: 100%; color: #94a3b8; font-size: 9px; font-weight: 500;
    text-decoration: none; transition: all 0.2s; position: relative;
  }
  .bottom-tab-bar .tab-item.on { color: var(--accent); }
  .bottom-tab-bar .tab-item.on .tab-icon { transform: scale(1.1); }
  .bottom-tab-bar .tab-item.on::after {
    content: '';
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 24px; height: 3px;
    background: linear-gradient(90deg, var(--accent), var(--accent2));
    border-radius: 0 0 3px 3px;
  }
  .bottom-tab-bar .tab-icon { font-size: 22px; line-height: 1; transition: transform 0.2s; }

  /* ----- FAB ----- */
  .fab-container { bottom: 78px; right: 16px; }
  .fab-container .fab-toggle { width: 44px; height: 44px; font-size: 22px; border-radius: 14px; }

  /* ----- Toast ----- */
  .toast { bottom: 78px; right: 12px; left: 12px; max-width: none; font-size: 12px; padding: 10px 16px; border-radius: 12px; text-align: center; }

  /* ----- Modal ----- */
  .modal-mask { padding: 12px; align-items: flex-end; }
  .modal { border-radius: 20px 20px 0 0; max-height: 85vh; padding: 20px 16px; }
  .modal .grid2 { grid-template-columns: 1fr; }

  /* ----- Cookie banner ----- */
  .cookie-banner-inner { flex-direction: column; align-items: stretch; padding: 12px 14px; gap: 10px; border-radius: 14px; }
  .cookie-banner-actions { flex-direction: column; }
  .cookie-btn { width: 100%; text-align: center; padding: 10px; font-size: 12px; border-radius: 10px; }

  /* ----- Mobile filter drawer ----- */
  .mobile-filter-drawer-sheet { border-radius: 20px 20px 0 0; }
  .mobile-filter-drawer-header { padding: 16px; }
  .mobile-filter-drawer-body { padding: 8px 14px 80px; }
  .mobile-filter-tag { padding: 6px 14px; font-size: 12px; border-radius: 20px; }

  /* ----- Mobile sort sheet ----- */
  .mobile-sort-sheet-content { border-radius: 20px 20px 0 0; }
  .mobile-sort-option { padding: 14px; font-size: 14px; border-radius: 10px; }

  /* ----- Detail substitute ----- */
  .detail-alt-head { display: none; }
  .detail-alt-line { grid-template-columns: 1fr; gap: 4px; padding: 10px 12px; min-width: 0; }

  /* ----- Lightbox ----- */
  .img-lightbox img { max-width: 98vw; max-height: 85vh; border-radius: 8px; }
}

/* ===== Skeleton Screen ===== */
.skeleton {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--bg2) 50%, var(--bg3) 75%);
  background-size: 200% 100%;
  animation: skeleton-shimmer 1.5s ease-in-out infinite;
  border-radius: 4px;
}
@keyframes skeleton-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-row {
  display: grid;
  grid-template-columns: 48px 1fr 1.5fr 1fr 0.8fr 0.6fr 0.8fr;
  gap: 12px;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid var(--rule);
}
.skeleton-row .sk-img { width: 40px; height: 40px; border-radius: 6px; }
.skeleton-row .sk-line { height: 14px; border-radius: 4px; }
.skeleton-row .sk-line.short { width: 60%; }

/* Skeleton card (mobile) */
.skeleton-card {
  display: none;
  background: var(--bg2);
  border: 1px solid var(--rule);
  border-radius: 10px;
  padding: 14px;
  margin: 8px 0;
}
.skeleton-card .sk-img { width: 48px; height: 48px; border-radius: 8px; margin-bottom: 10px; }
.skeleton-card .sk-line { height: 14px; border-radius: 4px; margin-bottom: 8px; }
.skeleton-card .sk-line.short { width: 50%; }

@media (max-width: 1100px) {
  .skeleton-row { display: none; }
  .skeleton-card { display: block; }
}

/* ===== Quote Cart ===== */
.quote-cart-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 200;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 22px; cursor: pointer;
  box-shadow: 0 6px 24px rgba(249,115,22,0.4);
  transition: transform 0.2s, box-shadow 0.2s;
  border: none;
}
.quote-cart-fab:hover { transform: scale(1.08); box-shadow: 0 8px 32px rgba(249,115,22,0.5); }
.quote-cart-fab .badge {
  position: absolute; top: -4px; right: -4px;
  background: #dc2626; color: #fff; font-size: 11px; font-weight: 700;
  min-width: 22px; height: 22px; border-radius: 11px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 5px; border: 2px solid var(--bg2);
}
.quote-cart-fab .badge:empty { display: none; }

/* Cart drawer */
.quote-cart-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.4);
  opacity: 0; pointer-events: none; transition: opacity 0.3s;
}
.quote-cart-overlay.open { opacity: 1; pointer-events: auto; }
.quote-cart-drawer {
  position: fixed; top: 0; right: 0; z-index: 301;
  width: 420px; max-width: 100vw; height: 100vh;
  background: var(--bg2); box-shadow: -4px 0 32px rgba(0,0,0,0.15);
  transform: translateX(100%); transition: transform 0.3s ease;
  display: flex; flex-direction: column;
}
.quote-cart-drawer.open { transform: translateX(0); }
.quote-cart-drawer .cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 20px; border-bottom: 1px solid var(--rule);
}
.quote-cart-drawer .cart-header h3 { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.quote-cart-drawer .cart-header .cart-close {
  background: none; border: none; font-size: 24px; color: var(--muted); cursor: pointer; padding: 4px 8px;
}
.quote-cart-drawer .cart-body {
  flex: 1; overflow-y: auto; padding: 12px 16px;
}
.quote-cart-drawer .cart-footer {
  padding: 16px 20px; border-top: 1px solid var(--rule);
  display: flex; flex-direction: column; gap: 8px;
}
.quote-cart-drawer .cart-footer .cart-total {
  font-size: 13px; color: var(--muted);
}
.quote-cart-drawer .cart-footer .cart-total strong { color: var(--ink); }
.quote-cart-drawer .cart-footer .btn {
  width: 100%; justify-content: center; padding: 12px;
  font-size: 15px; font-weight: 600;
}

/* Cart item */
.cart-item {
  display: flex; gap: 12px; padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  align-items: flex-start;
}
.cart-item:last-child { border-bottom: none; }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-mpn { font-weight: 600; font-size: 14px; color: var(--ink); margin-bottom: 2px; }
.cart-item .ci-meta { font-size: 12px; color: var(--muted); }
.cart-item .ci-meta span { margin-right: 8px; }
.cart-item .ci-qty { display: flex; align-items: center; gap: 4px; margin-top: 6px; }
.cart-item .ci-qty input {
  width: 56px; padding: 4px 8px; border: 1px solid var(--rule);
  border-radius: 4px; text-align: center; font-size: 13px;
  background: var(--bg); color: var(--ink);
}
.cart-item .ci-remove {
  background: none; border: none; color: var(--muted); cursor: pointer;
  font-size: 18px; padding: 4px; line-height: 1;
}
.cart-item .ci-remove:hover { color: var(--price); }

/* Add-to-cart button */
.btn-add-cart { display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 6px; font-size: 12px; font-weight: 500; background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent); cursor: pointer; transition: all 0.15s; }
.btn-add-cart:hover { background: var(--accent); color: #fff; }
.btn-add-cart.in-cart { background: var(--green); color: #fff; border-color: var(--green); }

.btn-notify { display: inline-flex; align-items: center; justify-content: center; gap: 5px; width: 100%; margin-top: 6px; padding: 6px 10px; border-radius: 6px; font-size: 12px; font-weight: 500; background: transparent; color: var(--accent); border: 1px solid var(--accent); cursor: pointer; transition: all 0.2s; text-align: center; }
.btn-notify .bell-icon { width: 14px; height: 14px; flex-shrink: 0; }
.btn-notify:hover { background: var(--accent); color: #fff; }
.btn-notify:hover .bell-icon { animation: bell-ring 0.5s ease; }

/* Notify Dialog */
.notify-dialog-overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 10000; display: flex; align-items: center; justify-content: center; animation: fadeIn 0.2s; }
.notify-dialog { background: #fff; border-radius: 12px; padding: 28px 24px 20px; max-width: 420px; width: 90%; box-shadow: 0 20px 60px rgba(0,0,0,0.3); }
.notify-dialog h3 { font-size: 1.15rem; font-weight: 700; margin: 0 0 8px; color: #1a1a2e; }
.notify-dialog p { font-size: 0.9rem; color: #6b7280; margin: 0 0 16px; line-height: 1.5; }
.notify-dialog p strong { color: #1a1a2e; }
.notify-email-input { width: 100%; padding: 10px 14px; border: 1px solid #d1d5db; border-radius: 8px; font-size: 0.95rem; outline: none; box-sizing: border-box; }
.notify-email-input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(217,119,6,0.15); }
.notify-error { color: #dc2626; font-size: 0.82rem; margin-top: 6px; }
.notify-dialog-btns { display: flex; gap: 10px; margin-top: 16px; justify-content: flex-end; }
.notify-dialog-btns .btn { padding: 8px 20px; border-radius: 8px; font-size: 0.9rem; font-weight: 600; cursor: pointer; border: none; }
.notify-dialog-btns .btn-ghost { background: #f3f4f6; color: #374151; }
.notify-dialog-btns .btn-ghost:hover { background: #e5e7eb; }
.notify-dialog-btns .btn-primary { background: var(--accent); color: #fff; }
.notify-dialog-btns .btn-primary:hover { background: #b45309; }
.notify-dialog-btns .btn:disabled { opacity: 0.6; cursor: not-allowed; }

/* Dark mode notify dialog */
[data-theme="dark"] .notify-dialog { background: #1f2937; }
[data-theme="dark"] .notify-dialog h3 { color: #f9fafb; }
[data-theme="dark"] .notify-dialog p { color: #9ca3af; }
[data-theme="dark"] .notify-dialog p strong { color: #f3f4f6; }
[data-theme="dark"] .notify-email-input { background: #374151; border-color: #4b5563; color: #f3f4f6; }
[data-theme="dark"] .notify-dialog-btns .btn-ghost { background: #374151; color: #d1d5db; }
[data-theme="dark"] .notify-dialog-btns .btn-ghost:hover { background: #4b5563; }

.quote-cart-empty {
  text-align: center; padding: 48px 20px; color: var(--muted);
}
.quote-cart-empty .empty-icon { font-size: 48px; margin-bottom: 12px; }

@media (max-width: 1100px) {
  .quote-cart-fab { bottom: 80px; right: 16px; width: 48px; height: 48px; font-size: 20px; }
  .quote-cart-drawer { width: 100vw; }
}

/* ==========================================================================
   DARK MODE — Comprehensive overrides for text visibility
   ========================================================================== */
[data-theme="dark"] {
  /* ---- Hardcoded light backgrounds → dark ---- */
  .hero-hot a { background: var(--bg3); border-color: var(--rule); color: var(--ink-soft); }
  .hero-search { background: var(--bg2); border-color: var(--rule); }
  .hero-search input { color: var(--ink); }
  .hero-search input::placeholder { color: var(--muted2); }
  .filter-card { background: var(--bg2); }
  .sort-bar { background: var(--bg2); }
  .result-row { background: var(--bg2); }
  .result-row:hover { background: var(--bg3); }
  .miniactions { background: var(--bg3); }
  .alt-container { background: #1e1105; }
  .result-row.is-alt { background: transparent; }
  .result-row.is-alt:hover { background: #2d1a0a; }
  .result-card { background: var(--bg2); }
  .result-card .card-body { background: var(--bg2); }
  .result-card .card-thumb { background: var(--bg3); border-color: var(--rule); }
  .result-card .card-bottom-row { background: var(--bg3); }
  .result-card .card-alt-bar { background: var(--bg3); }
  .result-card .btn-alts { background: #1e2a3a; color: var(--ink-soft); border-color: #334155; }
  .result-card .card-meta .pill { background: #1e2a3a; color: var(--ink-soft); border-color: #334155; }
  .result-card.is-alt .card-meta .pill { background: #2a1f10; border-color: #4a3520; }
  .result-row.is-alt .spec-item { background: #2a1f10; color: var(--ink-soft); }
  .result-card .card-meta .cond-pill.original { background: #1a2d22; border-color: #166534; }
  .result-card.is-alt { background: #1a1205; }
  .result-head { background: var(--bg3); }
  .pagination a { background: var(--bg3); color: var(--ink-soft); }
  .pagination a.on { background: var(--accent); color: #fff; }
  .pagination span { color: var(--muted); }
  .stock-card { background: var(--bg3); }
  .stock-card.empty { background: #1a1010; }
  .stock-card.low { background: #1a1205; }
  .stock-card.incoming { background: #1a1a2a; }
  .page-hero { background: linear-gradient(135deg, #1e1105 0%, #2d1a0a 60%, var(--bg2) 100%); }
  .sol-card .sol-head { background: linear-gradient(135deg, var(--accent-soft) 0%, var(--bg2) 100%); }
  .cookie-banner { background: var(--bg3); border-color: var(--rule); }
  .cookie-banner-text strong { color: var(--ink); }
  .cookie-banner-text span { color: var(--ink-soft); }
  .cookie-banner-text a { color: var(--accent); }
  .cookie-btn { background: var(--bg2); color: var(--ink-soft); border-color: var(--rule); }
  .cookie-btn:hover { background: var(--bg3); }
  .header-inner { background: var(--bg2); }
  .header-nav { background: var(--bg2); }
  .mobile-nav.open .header-nav { background: var(--bg2); }
  .hamburger { background: var(--bg3); }
  .bottom-tab-bar { background: var(--bg2); border-color: var(--rule); }
  .search-sticky { background: var(--bg2); border-color: var(--rule); }
  .search-sticky input { background: var(--bg3); border-color: var(--rule); color: var(--ink); }
  .skeleton-card { background: var(--bg2); border-color: var(--rule); }
  .skeleton-img, .skeleton-lines div {
    background: linear-gradient(90deg, var(--bg3) 25%, var(--rule) 50%, var(--bg3) 75%);
    background-size: 200% 100%;
  }
  .data-table { background: var(--bg2); }
  .data-table tbody tr:hover { background: var(--bg3); }
  .capsule { background: var(--bg3); color: var(--ink-soft); border-color: var(--rule); }
  .capsule:hover { background: var(--rule); color: var(--ink); }
  #capsuleSearchForm { background: var(--bg2); border-color: var(--rule); }
  #capsuleSearchForm input { color: var(--ink); }
  #capsuleSearchForm input::placeholder { color: var(--muted2); }
  .brand-capsule-row::-webkit-scrollbar-thumb { background: var(--muted2); }

  /* ---- Stock status pills - dark bg variants ---- */
  .stock-status-pill.in-stock { background: #1a3d22; color: #86efac; border-color: #166534; }
  .stock-status-pill.low-stock { background: #2d1a0a; color: #fdba74; border-color: #9a3412; }
  .stock-status-pill.in-transit { background: #1a2a3d; color: #93c5fd; border-color: var(--accent2); }
  .stock-status-pill.made-to-order { background: #2a1a3d; color: #c4b5fd; border-color: #5b21b6; }
  .stock-status-pill.out-of-stock { background: #2d1a1a; color: #fca5a5; border-color: #991b1b; }
  .lead-time { background: var(--bg3); color: var(--muted); border-color: var(--rule); }

  /* ---- Detail page ---- */
  .detail-left, .detail-right { background: var(--bg2); }
  .detail-left-img .detail-main-img { border-color: var(--rule); }
  .detail-main-img { background: var(--bg3); }
  .detail-thumb { border-color: var(--rule); }
  .detail-thumb.on { border-color: var(--accent); }
  .detail-attr-table tbody tr:nth-child(even) { background: var(--bg3); }
  .detail-info .specs-grid .spec-item { background: var(--bg3); }

  /* ---- Account ---- */
  .account-side { background: var(--bg2); }
  .account-main { background: var(--bg2); }
  .auth-card { background: var(--bg2); }

  /* ---- Forms ---- */
  input, select, textarea { background: var(--bg3); color: var(--ink); border-color: var(--rule); }
  input:focus, select:focus, textarea:focus { border-color: var(--accent); }

  /* ---- Cards / panels ---- */
  .card-panel { background: var(--bg2); }
  .contact-list { background: var(--bg2); }
  .contact-form { background: var(--bg2); }
  .brand-card { background: var(--bg2); }
  .prod-cat { background: var(--bg2); }
  .about-stats .stat { background: var(--bg2); }
  .about-flow .step { background: var(--bg2); }
  .param-card { background: var(--bg2); }

  /* ---- Misc ---- */
  .cell-img { background: var(--bg3); }
  .cell-thumb { background: var(--bg3); }
  .img-zoom { background: var(--bg2); }
  .zoom-thumbs { background: var(--bg3); }
  .detail-section { background: var(--bg2); }
  .detail-section-header { background: var(--bg3); }
  .detail-tabs .tab { color: var(--muted); }
  .detail-tabs .tab.active { color: var(--accent); border-color: var(--accent); }
  .detail-attr-table { background: var(--bg2); }
  .detail-attr-table th { background: var(--bg3); color: var(--muted); }
  .detail-attr-table td { border-color: var(--rule); }
  .detail-attr-table tr:nth-child(even) td { background: var(--bg3); }
  .filter-card .opts .on { background: var(--accent-soft); }
  .sort-tabs .on { background: var(--accent-soft); }
  .result-card .card-info .mpn a { color: var(--ink); }
  .result-card .card-info .mpn a:active { color: var(--accent); }
  .result-card .card-spec-line { color: var(--ink-soft); }
  .result-card .card-brand-line { color: var(--muted); }
  .subst-param-match { background: #422006; color: var(--accent); padding: 1px 4px; border-radius: 3px; }
  .logo-text .cn { color: #fff !important; }
  .logo-text .en { color: #94a3b8 !important; }
  .subst-table th.sortable .sort-icon { opacity: 0.7; color: var(--ink); }
  .subst-table th.sortable.active-sort .sort-icon { opacity: 1; color: var(--accent); }
  .subst-table th.sortable:hover { background: var(--bg3); }
  .subst-tab { background: var(--bg3); color: var(--ink-soft); }
  .subst-tab.active { background: var(--accent); color: #fff; }
  .btn-whatsapp-card { background: #25d366; color: #fff; }
  .no-stock .cell-img { opacity: 0.6; }
  .mobile-filter-drawer { background: var(--bg2); }
  .mobile-filter-drawer .drawer-header { background: var(--bg3); }
  .mobile-filter-drawer .drawer-body { background: var(--bg2); }
  .filter-card .opts a { color: var(--ink-soft); }
  .filter-card .opts a.on { color: var(--accent); }
  .sort-tabs a { color: var(--ink-soft); }
  .sort-tabs a.on { color: var(--accent); }
  .sort-check { color: var(--ink-soft); }
  .crumbs { color: var(--muted); }
  .crumbs a { color: var(--muted); }
  .crumbs a:hover { color: var(--accent); }
  .hero-hot a:active { background: var(--accent-soft); color: var(--accent); border-color: var(--accent); }
  .facet-group summary { color: var(--ink-soft); }
  .facet-group summary:hover { color: var(--accent); }

  /* ---- q-match text in dark mode ---- */
  .q-match { background: #422006; color: var(--accent); padding: 1px 4px; border-radius: 3px; }
  .q-match-title { background: #422006; color: var(--accent); padding: 1px 4px; border-radius: 3px; }
  .q-match-pill { background: #422006; color: var(--accent); padding: 1px 4px; border-radius: 3px; }

  /* ---- Brand link ---- */
  .brand-link { color: var(--accent); }
  .brand-link:hover { color: var(--accent); text-decoration: underline; }

  /* ---- Datasheet link ---- */
  a.pdf { color: var(--accent); }
  a.pdf:hover { color: var(--accent); }

  /* ---- Spec group divider ---- */
  .spec-group-divider { background: var(--rule); }

  /* ---- Mini actions ---- */
  .mini-actions a { color: var(--ink-soft); }
  .mini-actions a:hover { color: var(--accent); }

  /* ---- Price ---- */
  .price-col .price-main { color: var(--price); }

  /* ---- Stock tags ---- */
  .stock-tag.blue { background: #1a2a3d; color: #93c5fd; }
  .stock-tag.muted { background: var(--bg3); color: var(--muted); }

  /* ---- Notify button ---- */
  .btn-notify { color: var(--accent); border-color: var(--accent); }
  .btn-notify:hover { background: var(--accent); color: #fff; }

  /* ---- Subscribe panel & brand partners ---- */
  .subscribe-panel { background: var(--bg2); }
  .brand-partners { background: var(--bg2); }
  .subscribe-copy h3 { color: var(--ink); }
  .subscribe-copy p { color: var(--ink-soft); }
  .subscribe-form input { background: var(--bg3); color: var(--ink); border-color: var(--rule); }
  .subscribe-form input::placeholder { color: var(--muted); }

  /* ---- Detail files (series/env files) ---- */
  .detail-files-box { background: var(--bg2); border-color: var(--rule); }
  .detail-files-panel { border-color: var(--rule); }
  .detail-files-header:hover { background: var(--bg3); }
  .detail-files-header h4 { color: var(--ink); }
  .detail-files-list a { color: var(--ink-soft); }
  .detail-files-list a:hover { color: var(--accent); }

  /* ---- Datasheet preview ---- */
  .datasheet-preview { background: var(--bg3); }
  .datasheet-preview iframe { background: var(--bg2); }

  /* ---- Category cards homepage ---- */
  .home-cat-card { background: var(--bg2); }
  .home-cat-card h4 { color: var(--ink); }
  .home-cat-card p { color: var(--ink-soft); }
  .home-cat-card .cat-img-box { background: var(--bg3); }

  /* ---- Mobile bottom tab bar ---- */
  @media (max-width: 1100px) {
    body { background: var(--bg); }
    .bottom-tab-bar { background: rgba(15,23,42,0.95); }
    .bottom-tab-bar .tab-item { color: var(--muted); }
    .bottom-tab-bar .tab-item.on { color: var(--accent); }
    .hero-search { background: var(--bg2); }
    .hero-search input { color: var(--ink); }
  }

  }
