/* Auto Rim Clearance — dark, cool, responsive. One stylesheet for PC + mobile. */
:root {
  --bg: #0d0f12;
  --bg2: #15181d;
  --bg3: #1d2127;
  --line: #2a2f37;
  --text: #f2f4f7;
  --muted: #9aa3af;
  --red: #e63329;
  --red-dark: #b81f18;
  --green: #22c55e;
  --amber: #f59e0b;
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.5;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select, textarea { font-family: inherit; font-size: 16px; }

/* ---------- top bar / header ---------- */
.topbar {
  background: var(--red);
  color: #fff;
  text-align: center;
  font-weight: 800;
  letter-spacing: .06em;
  font-size: 13px;
  padding: 8px 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.site-header { background: #101216; border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 50; }
.header-inner {
  max-width: 1240px; margin: 0 auto; padding: 12px 16px;
  display: flex; align-items: center; gap: 16px;
}
.hamburger { display: none; background: none; border: 0; color: var(--text); font-size: 24px; padding: 4px 8px; }
.logo { font-size: 24px; font-weight: 900; letter-spacing: .02em; white-space: nowrap; }
.logo span { color: var(--red); }
.logo-cn { color: var(--muted); font-size: 13px; white-space: nowrap; border: 1px solid var(--line); padding: 3px 8px; border-radius: 999px; }
.lang-toggle {
  background: var(--bg3); color: var(--text); border: 1px solid var(--line);
  padding: 9px 12px; border-radius: 8px; font-weight: 700; white-space: nowrap;
}
.lang-toggle:hover { border-color: var(--red); }
.header-search { flex: 1; display: flex; max-width: 560px; margin-left: auto; }
.header-search input {
  flex: 1; min-width: 0; background: var(--bg3); border: 1px solid var(--line);
  color: var(--text); padding: 10px 14px; border-radius: 8px 0 0 8px; outline: none;
}
.header-search input:focus { border-color: var(--red); }
.header-search button {
  background: var(--red); color: #fff; border: 0; padding: 0 18px;
  border-radius: 0 8px 8px 0; font-size: 20px;
}
.header-actions { display: flex; align-items: center; gap: 14px; }
.header-phone { color: var(--muted); font-size: 14px; white-space: nowrap; }
.cart-btn {
  background: var(--bg3); color: var(--text); border: 1px solid var(--line);
  padding: 9px 14px; border-radius: 8px; font-weight: 700; white-space: nowrap;
}
.cart-btn:hover { border-color: var(--red); }
.cart-count {
  background: var(--red); color: #fff; border-radius: 999px;
  padding: 1px 7px; font-size: 12px; margin-left: 4px;
}
.main-nav { display: flex; justify-content: center; gap: 8px; border-top: 1px solid var(--line); }
.main-nav a {
  padding: 11px 22px; font-weight: 800; letter-spacing: .08em; font-size: 14px;
  color: var(--muted); border-bottom: 3px solid transparent;
}
.main-nav a:hover, .main-nav a.active { color: #fff; border-bottom-color: var(--red); }

/* ---------- layout ---------- */
#app { max-width: 1240px; margin: 0 auto; padding: 0 16px 48px; min-height: 60vh; }
.section { margin-top: 28px; }
.section h2 { font-size: 22px; font-weight: 900; letter-spacing: .02em; margin-bottom: 14px; }
.section h2 .hot { color: var(--red); }

/* ---------- hero ---------- */
.hero {
  margin-top: 20px; border-radius: 14px; overflow: hidden; position: relative;
  background: radial-gradient(1200px 500px at 70% -10%, #3a0d0b 0%, #14161a 55%, #0d0f12 100%);
  border: 1px solid var(--line);
  padding: 44px 36px 36px;
}
.hero h1 { font-size: clamp(34px, 6vw, 64px); font-weight: 900; line-height: 1.02; letter-spacing: -.01em; }
.hero h1 .red { color: var(--red); }
.hero p { color: var(--muted); font-size: 17px; margin-top: 12px; max-width: 560px; }
.hero .cta-row { display: flex; gap: 12px; margin-top: 22px; flex-wrap: wrap; }
.btn {
  display: inline-block; background: var(--red); color: #fff; border: 0;
  padding: 13px 26px; border-radius: 8px; font-weight: 800; font-size: 15px; letter-spacing: .03em;
}
.btn:hover { background: var(--red-dark); }
.btn.ghost { background: transparent; border: 1px solid var(--line); color: var(--text); }
.btn.ghost:hover { border-color: var(--red); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ---------- fitment selector ---------- */
.fitment {
  margin-top: 20px; background: linear-gradient(180deg, #1a2f4a, #14273d);
  border: 1px solid #274a6b; border-radius: 14px; padding: 22px;
}
.fitment h2 { text-align: center; font-size: 24px; font-weight: 900; letter-spacing: .06em; margin-bottom: 16px; }
.fitment-row { display: flex; gap: 12px; }
.fitment-row select, .fitment-row button {
  flex: 1; min-width: 0; padding: 13px 12px; border-radius: 8px; font-size: 15px;
}
.fitment-row select {
  background: #fff; color: #111; border: 0; appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%23e63329' stroke-width='2' fill='none'/></svg>");
  background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px;
}
.fitment-row select:disabled { background-color: #cbd5e1; color: #64748b; }
.fitment-row .btn { flex: 0 0 150px; }
.fitment-note { text-align: center; color: #9fb6cc; font-size: 13px; margin-top: 10px; }

/* ---------- trust bar ---------- */
.trustbar {
  margin-top: 20px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px;
}
.trustbar div {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px; text-align: center; font-weight: 800; font-size: 14px; letter-spacing: .03em;
}
.trustbar div small { display: block; color: var(--muted); font-weight: 400; margin-top: 2px; }

/* ---------- category tiles ---------- */
.tiles { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.tile {
  position: relative; border-radius: 14px; overflow: hidden; min-height: 190px;
  display: flex; flex-direction: column; justify-content: flex-end; padding: 22px;
  border: 1px solid var(--line); background: #171a1f;
}
.tile h3 { font-size: 28px; font-weight: 900; }
.tile p { color: var(--muted); }
.tile .go { color: var(--red); font-weight: 800; margin-top: 8px; }
.tile .count {
  position: absolute; top: 14px; right: 14px; background: rgba(0,0,0,.55);
  padding: 4px 10px; border-radius: 999px; font-size: 12px; font-weight: 700;
}
.tile.wheels { background: linear-gradient(135deg, #232a35, #12151a 60%), url("https://cdn.shopify.com/s/files/1/0752/7664/8768/files/w96965b.jpg?v=1693127737") right -40px center / 260px no-repeat; }
.tile.custom { background: linear-gradient(135deg, #3a0d0b, #12151a 65%), url("https://cdn.shopify.com/s/files/1/0752/7664/8768/files/aly85334u45_25_2d6a0ed4-0f0e-44cb-a8b6-3e5f51ee14ad.jpg?v=1693080254") right -30px center / 240px no-repeat; }

/* ---------- product grid ---------- */
.toolbar {
  display: flex; gap: 10px; flex-wrap: wrap; align-items: center;
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 12px; margin: 18px 0;
}
.toolbar select, .toolbar input[type="search"] {
  background: var(--bg3); border: 1px solid var(--line); color: var(--text);
  padding: 9px 10px; border-radius: 8px; min-width: 0;
}
.toolbar .spacer { flex: 1; }
.toolbar label { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.result-meta { color: var(--muted); font-size: 14px; margin-bottom: 12px; }
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card {
  background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; display: flex; flex-direction: column; transition: border-color .15s, transform .15s;
}
.card:hover { border-color: var(--red); transform: translateY(-2px); }
.card .imgwrap { aspect-ratio: 1; background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.card .imgwrap img { width: 100%; height: 100%; object-fit: contain; }
.card .body { padding: 12px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card h3 { font-size: 14px; font-weight: 600; line-height: 1.35; }
.card h3 a:hover { color: var(--red); }
.price-row { display: flex; align-items: baseline; gap: 8px; margin-top: auto; }
.price-now { color: var(--red); font-size: 20px; font-weight: 900; }
.price-was { color: var(--muted); text-decoration: line-through; font-size: 14px; }
.off-badge { background: var(--red); color: #fff; font-size: 11px; font-weight: 800; padding: 2px 7px; border-radius: 999px; }
.stock { font-size: 12px; font-weight: 700; }
.stock.in { color: var(--green); }
.stock.out { color: var(--amber); }
.card .btn, .card .btn-ghost { width: 100%; text-align: center; padding: 10px; font-size: 14px; }
.btn-ghost {
  background: transparent; border: 1px solid var(--line); color: var(--text);
  border-radius: 8px; font-weight: 700;
}
.btn-ghost:hover { border-color: var(--amber); color: var(--amber); }

/* ---------- pagination ---------- */
.pagination { display: flex; gap: 6px; justify-content: center; margin-top: 24px; flex-wrap: wrap; }
.pagination button {
  background: var(--bg2); border: 1px solid var(--line); color: var(--text);
  min-width: 40px; padding: 9px 12px; border-radius: 8px; font-weight: 700;
}
.pagination button.active, .pagination button:hover { background: var(--red); border-color: var(--red); color: #fff; }
.pagination button:disabled { opacity: .4; cursor: not-allowed; }

/* ---------- product detail ---------- */
.detail { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin-top: 20px; }
.detail .gallery { background: #fff; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); }
.detail .gallery .main-img { aspect-ratio: 1; display: flex; align-items: center; justify-content: center; }
.detail .gallery .main-img img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: 8px; padding: 10px; flex-wrap: wrap; background: var(--bg2); }
.thumbs img { width: 64px; height: 64px; object-fit: contain; background: #fff; border-radius: 8px; border: 2px solid transparent; cursor: pointer; }
.thumbs img.active { border-color: var(--red); }
.detail h1 { font-size: 24px; line-height: 1.3; }
.detail .price-row { margin: 14px 0; }
.detail .price-now { font-size: 34px; }
.detail .price-was { font-size: 18px; }
.detail .meta { color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.qty-row { display: flex; gap: 10px; align-items: center; margin: 18px 0; flex-wrap: wrap; }
.qty-row input { width: 76px; background: var(--bg3); border: 1px solid var(--line); color: var(--text); padding: 11px; border-radius: 8px; text-align: center; }
.specs { margin-top: 24px; background: var(--bg2); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.specs h3 { margin-bottom: 10px; }
.specs p { color: #cbd5e1; margin-bottom: 10px; font-size: 14px; }
.notify-form { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.notify-form input { flex: 1; min-width: 200px; background: var(--bg3); border: 1px solid var(--line); color: var(--text); padding: 11px 12px; border-radius: 8px; }

/* ---------- cart drawer / checkout ---------- */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.6); z-index: 90;
  opacity: 0; pointer-events: none; transition: opacity .2s;
}
.drawer-overlay.open { opacity: 1; pointer-events: auto; }
.cart-drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 94vw); z-index: 100;
  background: var(--bg2); border-left: 1px solid var(--line);
  transform: translateX(100%); transition: transform .25s; display: flex; flex-direction: column;
}
.cart-drawer.open { transform: translateX(0); }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 16px; border-bottom: 1px solid var(--line); }
.drawer-head button { background: none; border: 0; color: var(--text); font-size: 20px; }
.drawer-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.drawer-foot { padding: 16px; border-top: 1px solid var(--line); }
.drawer-foot .total-row { display: flex; justify-content: space-between; font-size: 18px; font-weight: 900; margin-bottom: 12px; }
.drawer-foot .btn { width: 100%; }
.cart-item { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 72px; height: 72px; object-fit: contain; background: #fff; border-radius: 8px; flex: none; }
.cart-item .ci-info { flex: 1; min-width: 0; }
.cart-item .ci-title { font-size: 13px; font-weight: 600; line-height: 1.3; }
.cart-item .ci-price { color: var(--red); font-weight: 800; margin-top: 4px; }
.qty-ctrl { display: flex; align-items: center; gap: 8px; margin-top: 6px; }
.qty-ctrl button { background: var(--bg3); border: 1px solid var(--line); color: var(--text); width: 28px; height: 28px; border-radius: 6px; font-weight: 800; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.form { max-width: 560px; margin: 20px auto 0; background: var(--bg2); border: 1px solid var(--line); border-radius: 14px; padding: 24px; }
.form label { display: block; font-size: 13px; font-weight: 700; color: var(--muted); margin: 14px 0 6px; }
.form input, .form textarea {
  width: 100%; background: var(--bg3); border: 1px solid var(--line); color: var(--text);
  padding: 12px; border-radius: 8px; outline: none;
}
.form input:focus, .form textarea:focus { border-color: var(--red); }
.form .btn { width: 100%; margin-top: 20px; }
.order-success { text-align: center; padding: 48px 16px; }
.order-success .big { font-size: 56px; }
.order-success h2 { margin: 12px 0; }
.order-no { font-size: 22px; font-weight: 900; color: var(--red); letter-spacing: .04em; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); background: #101216; margin-top: 20px; }
.footer-inner { max-width: 1240px; margin: 0 auto; padding: 32px 16px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.footer-col h4 { margin-bottom: 10px; font-size: 14px; letter-spacing: .06em; }
.footer-col a, .footer-col p { display: block; color: var(--muted); font-size: 14px; margin-bottom: 6px; }
.footer-bottom { text-align: center; color: var(--muted); font-size: 12px; padding: 14px; border-top: 1px solid var(--line); }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 80px);
  background: #1f2937; color: #fff; border: 1px solid var(--line); border-radius: 8px;
  padding: 12px 18px; z-index: 200; opacity: 0; transition: all .25s; pointer-events: none;
  max-width: 92vw; text-align: center;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }
.loading { text-align: center; color: var(--muted); padding: 48px 0; }

/* ---------- mobile ---------- */
@media (max-width: 900px) {
  .grid { grid-template-columns: repeat(3, 1fr); }
  .detail { grid-template-columns: 1fr; }
  .header-phone { display: none; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 640px) {
  .hamburger { display: block; }
  .header-inner { flex-wrap: wrap; gap: 10px; }
  .logo { font-size: 19px; order: 1; }
  .hamburger { order: 0; }
  .header-actions { order: 2; margin-left: auto; }
  .header-search { order: 3; flex-basis: 100%; max-width: none; }
  .main-nav {
    display: none; flex-direction: column; align-items: stretch; text-align: center;
  }
  .main-nav.open { display: flex; }
  .main-nav a { border-bottom: 1px solid var(--line); padding: 13px; }
  .hero { padding: 28px 20px; }
  .fitment-row { flex-direction: column; }
  .fitment-row .btn { flex: none; width: 100%; }
  .trustbar { grid-template-columns: 1fr; }
  .tiles { grid-template-columns: 1fr; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card h3 { font-size: 12px; }
  .price-now { font-size: 17px; }
  .toolbar select, .toolbar input[type="search"] { flex: 1 1 46%; }
  .footer-inner { grid-template-columns: 1fr; }
  .detail h1 { font-size: 19px; }
}
