:root {
  --bg: #ffffff;
  --bg-soft: #f5f5f7;
  --bg-card: #ffffff;
  --text: #111318;
  --text-muted: #5b616e;
  --border: #e5e7eb;
  --accent: #0066cc;
  --accent-hover: #0052a3;
  --accent-soft: rgba(0, 102, 204, 0.08);
  --success: #15803d;
  --danger: #dc2626;
  --shadow-sm: 0 2px 8px rgba(17, 19, 24, 0.05);
  --shadow-md: 0 12px 30px rgba(17, 19, 24, 0.08);
  --radius: 14px;
  --radius-sm: 10px;
  --max-w: 1240px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

html[data-theme="dark"] {
  --bg: #0b0d12;
  --bg-soft: #141720;
  --bg-card: #161a24;
  --text: #f3f5f8;
  --text-muted: #a0a8b8;
  --border: #262c3b;
  --accent: #3b82f6;
  --accent-hover: #60a5fa;
  --accent-soft: rgba(59, 130, 246, 0.14);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 12px 30px rgba(0, 0, 0, 0.45);
}

*, *::before, *::after { box-sizing: border-box; }
body {
  margin: 0;
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { max-width: var(--max-w); margin: 0 auto; padding: 0 20px; }

/* Top Trust Bar */
.trust-strip {
  background: #111318;
  color: #f3f5f8;
  font-size: 12.5px;
  padding: 8px 16px;
  text-align: center;
}
html[data-theme="dark"] .trust-strip { background: #05070a; border-bottom: 1px solid var(--border); }
.trust-strip span { opacity: 0.9; margin: 0 8px; }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--border);
}
html[data-theme="dark"] .site-header { background: rgba(11, 13, 18, 0.9); }
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
  gap: 16px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  flex-shrink: 0;
}
.brand-logo {
  height: 32px;
  width: auto;
  border-radius: 6px;
  background: #fff;
  padding: 2px 6px;
}
.brand-badge {
  font-size: 10px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
}
.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-muted);
}
.nav-links a:hover, .nav-links a.active { color: var(--text); font-weight: 600; }
.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }

.icon-btn {
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: 999px;
  padding: 7px 13px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}
.icon-btn:hover { background: var(--bg-soft); }
.cart-link {
  background: var(--text);
  color: var(--bg);
  border-color: var(--text);
}
.cart-link:hover { opacity: 0.9; background: var(--text); }
.cart-badge {
  background: var(--accent);
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid transparent;
  transition: all 0.15s ease;
}
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); }
.btn-secondary { background: var(--bg-card); color: var(--text); border-color: var(--border); }
.btn-secondary:hover { background: var(--bg-soft); }
.btn-sm { padding: 8px 14px; font-size: 13px; }
.btn-block { width: 100%; }

/* Breadcrumb */
.breadcrumb {
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.breadcrumb a:hover { color: var(--accent); text-decoration: underline; }

/* Hero */
.hero {
  padding: 48px 0 56px;
  background: linear-gradient(180deg, var(--bg-soft) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}
.hero-grid {
  display: grid;
  grid-template-columns: 1fr 1.15fr;
  gap: 40px;
  align-items: center;
}
.eyebrow {
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 12px;
}
.hero h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.03em;
}
.hero-sub {
  margin: 0 0 24px;
  font-size: 16.5px;
  color: var(--text-muted);
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.hero-media {
  border-radius: 18px;
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow-md);
  background: var(--bg-card);
}
.hero-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* Sections */
.section { padding: 56px 0; }
.section-soft { background: var(--bg-soft); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
  flex-wrap: wrap;
}
.section-head h2 { margin: 0 0 6px; font-size: clamp(24px, 3vw, 32px); letter-spacing: -0.02em; }
.section-head p { margin: 0; color: var(--text-muted); }

/* Category Tiles */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 22px;
}
.cat-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s, box-shadow 0.16s;
}
.cat-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.cat-card img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-bottom: 1px solid var(--border); }
.cat-card-body { padding: 18px 20px; }
.cat-card-body h3 { margin: 0 0 6px; font-size: 18px; }
.cat-card-body p { margin: 0 0 10px; font-size: 13.5px; color: var(--text-muted); }
.cat-link { font-size: 13.5px; font-weight: 700; color: var(--accent); }

/* Product Grid */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}
.product-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.16s, box-shadow 0.16s;
}
.product-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.product-thumb {
  position: relative;
  aspect-ratio: 4 / 3;
  background: var(--bg-soft);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}
.product-thumb img { width: 100%; height: 100%; object-fit: cover; }
.stock-tag {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--success);
  box-shadow: var(--shadow-sm);
}
.stock-tag.oem { color: var(--accent); }
.product-body { padding: 20px; display: flex; flex-direction: column; flex: 1; }
.product-cat { font-size: 11.5px; font-weight: 700; text-transform: uppercase; letter-spacing: 0.05em; color: var(--accent); margin-bottom: 4px; }
.product-title { margin: 0 0 8px; font-size: 18.5px; font-weight: 700; }
.product-short { margin: 0 0 14px; font-size: 13.5px; color: var(--text-muted); flex: 1; }
.product-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-top: 12px;
  margin-bottom: 14px;
  border-top: 1px solid var(--border);
}
.price-main { font-size: 20px; font-weight: 800; }
.price-sub { font-size: 12px; color: var(--text-muted); }

/* Product Detail Page (PDP) */
.pdp-grid {
  display: grid;
  grid-template-columns: 1.1fr 0.95fr;
  gap: 36px;
  align-items: start;
  padding-bottom: 48px;
}
.pdp-gallery { display: grid; gap: 12px; }
.pdp-main-img {
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--bg-soft);
  aspect-ratio: 4 / 3;
}
.pdp-main-img img { width: 100%; height: 100%; object-fit: cover; }
.pdp-thumbs { display: flex; gap: 10px; flex-wrap: wrap; }
.pdp-thumb-btn {
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 0;
  overflow: hidden;
  width: 96px;
  height: 72px;
  background: var(--bg-soft);
}
.pdp-thumb-btn.active { border-color: var(--accent); }
.pdp-thumb-btn img { width: 100%; height: 100%; object-fit: cover; }

.pdp-info h1 { margin: 6px 0 8px; font-size: clamp(26px, 3vw, 34px); letter-spacing: -0.025em; }
.pdp-price-box {
  background: var(--bg-soft);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px;
  margin: 16px 0 22px;
}
.pdp-price-box .price-main { font-size: 28px; }
.opt-group { margin-bottom: 18px; }
.opt-label { display: block; font-size: 13.5px; font-weight: 700; margin-bottom: 8px; }
.opt-list { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px; }
.opt-btn {
  border: 1.5px solid var(--border);
  background: var(--bg-card);
  color: var(--text);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  text-align: left;
}
.opt-btn.selected { border-color: var(--accent); background: var(--accent-soft); }
.opt-btn strong { display: block; font-size: 13.5px; }
.opt-btn span { display: block; font-size: 12px; color: var(--text-muted); margin-top: 2px; }

.pdp-cta { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 20px; }

.spec-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-card);
}
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 13px 16px; text-align: left; border-bottom: 1px solid var(--border); }
th { width: 32%; background: var(--bg-soft); font-weight: 700; }
tr:last-child th, tr:last-child td { border-bottom: none; }

/* Cart & Checkout Pages */
.two-col-page {
  display: grid;
  grid-template-columns: 1.35fr 0.85fr;
  gap: 28px;
  align-items: start;
  padding-bottom: 64px;
}
.panel {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
}
.cart-row {
  display: grid;
  grid-template-columns: 96px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}
.cart-row:last-child { border-bottom: none; }
.cart-row img { width: 96px; height: 72px; object-fit: cover; border-radius: 8px; border: 1px solid var(--border); }
.qty-ctrl { display: inline-flex; align-items: center; gap: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-field { display: grid; gap: 6px; margin-bottom: 12px; }
.form-field label { font-size: 13px; font-weight: 600; }
.input {
  width: 100%;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}
.pay-method {
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 12px 14px;
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  margin-bottom: 10px;
}
.pay-method.selected { border-color: var(--accent); background: var(--accent-soft); }

/* Trust Grid */
.trust-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.trust-card { background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--radius); padding: 20px; }
.trust-card h3 { margin: 0 0 6px; font-size: 16px; }
.trust-card p { margin: 0; font-size: 13.5px; color: var(--text-muted); }

/* Footer */
footer {
  border-top: 1px solid var(--border);
  background: var(--bg-soft);
  padding: 32px 0;
  font-size: 13.5px;
  color: var(--text-muted);
}
.footer-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 14px; }

@media (max-width: 960px) {
  .hero-grid, .pdp-grid, .two-col-page, .cat-grid, .product-grid { grid-template-columns: 1fr; }
  .trust-grid { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}
@media (max-width: 600px) {
  .trust-grid, .opt-list, .pdp-cta, .form-grid { grid-template-columns: 1fr; }
  .cart-row { grid-template-columns: 72px 1fr; }
}
@media print {
  .trust-strip, .site-header, .breadcrumb, footer, .no-print { display: none !important; }
}
