:root {
  --bg: #ffffff;
  --bg-2: #f8fafc;
  --surface: #ffffff;
  --line: #e5e7eb;
  --text: #0f172a;
  --text-2: #475569;
  --muted: #64748b;
  --accent: #dc2626;
  --accent-h: #7f1d1d;
  --primary: #0f172a;
  --radius: 6px;
  --maxw: 1240px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0a0c0f; --bg-2: #0f172a; --surface: #111827; --line: #1f2937;
    --text: #f1f5f9; --text-2: #cbd5e1; --muted: #94a3b8;
    --accent: #ef4444; --accent-h: #f87171; --primary: #f1f5f9;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: 'Inter', system-ui, -apple-system, sans-serif; line-height: 1.55; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
h1, h2, h3, h4 { color: var(--primary); font-weight: 700; line-height: 1.2; margin: 0 0 12px; }
h1 { font-size: 32px; } h2 { font-size: 24px; } h3 { font-size: 18px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }
.section { padding: 40px 0; }

/* Header */
.site { position: sticky; top: 0; z-index: 100; background: var(--bg); border-bottom: 1px solid var(--line); backdrop-filter: blur(8px); }
.head { display: flex; align-items: center; justify-content: space-between; padding: 14px 24px; gap: 24px; }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 18px; }
.brand-mark { display: inline-flex; align-items: center; justify-content: center; width: 38px; height: 38px; background: var(--primary); color: var(--bg); font-weight: 900; font-size: 14px; border-radius: var(--radius); letter-spacing: 1px; }
.nav { display: flex; gap: 22px; font-size: 14px; font-weight: 500; }
.nav a { color: var(--text-2); }
.nav a:hover { color: var(--accent); }
.cart { padding: 8px 14px; background: var(--accent); color: #fff; border-radius: var(--radius); font-size: 13px; font-weight: 600; }
.cart:hover { color: #fff; background: var(--accent-h); }
.mobile-toggle { display: none; background: none; border: 0; font-size: 22px; cursor: pointer; color: var(--text); }

/* Hero */
.hero { padding: 80px 0; background: linear-gradient(135deg, var(--primary) 0%, #1e293b 100%); color: #fff; }
.hero h1 { color: #fff; font-size: 48px; margin-bottom: 12px; letter-spacing: -0.02em; }
.hero .sub { color: rgba(255,255,255,.75); font-size: 18px; margin-bottom: 28px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 12px 24px; border-radius: var(--radius); font-size: 14px; font-weight: 600; cursor: pointer; border: 1px solid transparent; transition: all .15s; }
.btn.primary { background: var(--accent); color: #fff; border-color: var(--accent); }
.btn.primary:hover { background: var(--accent-h); border-color: var(--accent-h); color: #fff; }
.btn.ghost { background: transparent; color: #fff; border-color: rgba(255,255,255,.3); }
.btn.ghost:hover { background: rgba(255,255,255,.1); color: #fff; }
.btn.big { padding: 14px 32px; font-size: 15px; }

/* Category grid on home */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 16px; margin-top: 24px; }
.cat-tile { padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); transition: all .2s; }
.cat-tile:hover { border-color: var(--accent); transform: translateY(-2px); color: var(--text); }
.cat-name { font-weight: 700; font-size: 16px; margin-bottom: 6px; }
.cat-count { color: var(--muted); font-size: 13px; }

/* Product grid */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; margin-top: 24px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: all .2s; }
.card:hover { border-color: var(--accent); transform: translateY(-2px); box-shadow: 0 8px 20px rgba(0,0,0,.08); color: var(--text); }
.card .thumb { aspect-ratio: 1; background: var(--bg-2); overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.card .body { padding: 14px; }
.card .title { font-size: 14px; font-weight: 600; line-height: 1.4; min-height: 40px; margin-bottom: 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .price { font-size: 17px; font-weight: 800; color: var(--accent); }

/* Breadcrumb */
.crumb { font-size: 13px; color: var(--muted); margin-bottom: 16px; }
.crumb a:hover { color: var(--accent); }

/* Category page */
.lede { color: var(--text-2); font-size: 15px; margin-top: 8px; }

/* Pagination */
.pager { display: flex; align-items: center; justify-content: center; gap: 24px; margin: 40px 0 0; font-size: 14px; }
.pager a { color: var(--accent); font-weight: 600; }
.pager span { color: var(--muted); }

/* Product detail page */
.pdp-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 40px; margin-top: 20px; }
.pdp-media .hero-img { width: 100%; aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); border-radius: var(--radius); background: var(--bg-2); }
.pdp-media .thumbs { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 10px; }
.pdp-media .thumbs img { aspect-ratio: 1; object-fit: cover; border: 1px solid var(--line); border-radius: 4px; cursor: pointer; }
.pdp-info h1 { font-size: 26px; margin-bottom: 12px; }
.pdp-info .price.big { font-size: 32px; color: var(--accent); font-weight: 800; margin: 12px 0 20px; }
.pdp-info .sku, .pdp-info .brand-tag { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.pdp-info .short-desc { color: var(--text-2); margin: 20px 0 24px; line-height: 1.7; }
.pdp-info .btn { margin-right: 8px; margin-bottom: 8px; }
.pdp-desc { margin-top: 40px; padding-top: 30px; border-top: 1px solid var(--line); color: var(--text-2); line-height: 1.7; }
.pdp-desc img { border-radius: var(--radius); margin: 12px 0; }

/* Content pages (about/contact/etc.) */
.content-block { line-height: 1.75; color: var(--text-2); max-width: 800px; }
.content-block h2 { margin-top: 32px; color: var(--primary); }
.content-block p { margin: 12px 0; }
.content-block ul, .content-block ol { margin: 12px 0 12px 20px; }
.content-block a { color: var(--accent); }
.content-block a:hover { text-decoration: underline; }

/* Footer */
.site-foot { background: var(--bg-2); border-top: 1px solid var(--line); padding: 40px 0 0; margin-top: 60px; }
.site-foot .grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; margin: 0; }
.site-foot h4 { color: var(--primary); font-size: 15px; margin-bottom: 12px; }
.site-foot ul { list-style: none; padding: 0; margin: 0; }
.site-foot li { margin: 8px 0; }
.site-foot a { color: var(--text-2); font-size: 14px; }
.site-foot a:hover { color: var(--accent); }
.brand-foot { font-weight: 800; font-size: 18px; margin-bottom: 8px; }
.tag { color: var(--muted); font-size: 14px; }
.foot-bar { margin-top: 30px; padding: 20px 24px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: 13px; }

/* Cart page (client-side rendered) */
#cart-root, #checkout-root { min-height: 200px; padding: 20px 0; }
.cart-item { display: grid; grid-template-columns: 80px 1fr auto auto; gap: 20px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 80px; height: 80px; object-fit: cover; border-radius: var(--radius); }
.cart-total { text-align: right; margin-top: 20px; font-size: 20px; font-weight: 800; }

/* Mobile */
@media (max-width: 780px) {
  .nav { display: none; }
  body.nav-open .nav { display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; padding: 20px 24px; background: var(--surface); border-bottom: 1px solid var(--line); }
  .mobile-toggle { display: block; }
  .hero { padding: 50px 0; } .hero h1 { font-size: 32px; }
  .pdp-grid { grid-template-columns: 1fr; gap: 24px; }
  .site-foot .grid { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); }
}
