/* FastAutoParts.ca storefront. Tokens follow web-ui/DESIGN-SYSTEM.md:
   navy = trust surfaces, blue = navigation + standard actions, orange = conversion only. */
:root {
  --navy: #071428;
  --blue: #0a49d7;
  --blue-2: #08359d;
  --orange: #ff5a00;
  --orange-2: #ff7a1a;
  --bg: #ffffff;
  --panel: #f4f7fb;
  --ink: #101827;
  --muted: #667085;
  --line: #e6eaf0;
  --link: #0a49d7;
  --row: #fafbfd;
  --hover: #eef3ff;
  --ok: #11845b;
  --field: #fbfcfe;
  --field-line: #d7deea;
  --shadow: 0 20px 50px rgba(7, 20, 40, .12);
  --accent: var(--orange);
  --accent-ink: #fff;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1424; --panel: #111d31; --ink: #e8edf5; --muted: #98a4b8; --line: #22304a;
    --link: #7fa6ff; --row: #0e192b; --hover: #16264a; --ok: #3fc48f; --field: #0e192b; --field-line: #2a3a57;
    --shadow: 0 20px 50px rgba(0, 0, 0, .4);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 14.5px/1.5 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: var(--bg); color: var(--ink);
  min-height: 100vh; display: flex; flex-direction: column;
}
a { color: var(--link); }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
.muted { color: var(--muted); }
.pad { padding: 16px; }
.wrap { width: min(1180px, calc(100% - 32px)); margin-inline: auto; }

/* top bar */
.topbar { background: var(--navy); color: #dce7fb; font-size: 12px; }
.topbar-row { min-height: 34px; display: flex; align-items: center; justify-content: space-between; gap: 6px 20px; flex-wrap: wrap; }
.topbar strong { color: #fff; }
.topbar a { color: #dce7fb; text-decoration: none; }
.topbar a:hover { color: #fff; }
.topbar-links { display: flex; gap: 20px; }

/* header */
.head { background: color-mix(in srgb, var(--bg) 96%, transparent); color: var(--ink); position: sticky; top: 0; z-index: 10;
  border-bottom: 1px solid var(--line); backdrop-filter: blur(14px); }
.head-row { min-height: 78px; display: grid; grid-template-columns: 260px minmax(220px, 1fr) auto; align-items: center; gap: 24px; }
.brand { display: block; line-height: 0; }
.brand img { width: 250px; height: auto; max-height: 74px; object-fit: contain; object-position: left center; }
@media (prefers-color-scheme: dark) { .brand img { background: #fff; border-radius: 12px; padding: 4px 10px; } }
.search { position: relative; display: flex; height: 48px; }
.search input { width: 100%; min-width: 0; border: 2px solid var(--field-line); border-radius: 14px; padding: 0 110px 0 16px; outline: none;
  background: var(--field); color: var(--ink); transition: border-color .2s, box-shadow .2s; }
.search input:focus { border-color: var(--blue); box-shadow: 0 0 0 4px rgba(10, 73, 215, .12); }
.search button { position: absolute; right: 5px; top: 5px; bottom: 5px; border: 0; border-radius: 10px; padding: 0 18px; color: #fff; background: var(--blue); font-weight: 800; }
.search button:hover { background: var(--blue-2); }
.head-actions { display: flex; align-items: center; gap: 10px; }
.icon-btn { position: relative; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 13px;
  background: var(--bg); color: var(--ink); text-decoration: none; }
.icon-btn:hover { border-color: #b8c9f3; color: var(--blue); }
.badge { position: absolute; right: -6px; top: -8px; display: grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px;
  border-radius: 99px; background: var(--orange); color: #fff; border: 2px solid var(--bg); font-size: 10px; font-weight: 900; }

/* section tabs */
.tabs { border-top: 1px solid var(--line); }
.tabs-row { display: flex; gap: 4px; overflow-x: auto; min-height: 44px; align-items: stretch; }
.tabs a { display: flex; align-items: center; color: var(--ink); text-decoration: none; padding: 0 12px; white-space: nowrap; font-size: 13px; font-weight: 800;
  border-bottom: 3px solid transparent; }
.tabs a:hover { color: var(--blue); }
.tabs a.on { color: var(--blue); border-bottom-color: var(--blue); }
.tabs-right { margin-left: auto; display: flex; gap: 4px; }
.tabs-right a { font-weight: 600; color: var(--muted); }

/* live search suggestions */
.suggest {
  display: none; position: absolute; top: 100%; left: 0; right: 0; margin-top: 4px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--shadow); max-height: 60vh; overflow-y: auto; z-index: 30; padding: 4px;
}
.suggest.show { display: block; }
.sug { display: flex; gap: 8px; padding: 7px 10px; cursor: pointer; border-radius: 8px; }
.sug small { color: var(--muted); }
.sug:hover, .sug.on { background: var(--hover); }
.sug-part { align-items: center; }
.sug-part img { width: 44px; height: 33px; object-fit: cover; border-radius: 6px; flex: none; }
.sug-price { margin-left: auto; white-space: nowrap; padding-left: 8px; }

main { flex: 1; padding: 16px 0 48px; min-width: 0; }
h1 { font-size: 22px; letter-spacing: -.02em; margin: 6px 0 12px; }
h2 { font-size: 17px; letter-spacing: -.01em; }
.crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }

/* catalog hero + trust strip (catalog home) */
.hero { position: relative; overflow: hidden; border-radius: 22px; color: #fff; padding: 30px 32px; margin-bottom: 14px;
  background: radial-gradient(circle at 85% 20%, #1557d3 0, #0a2d70 38%, #071428 80%); }
.hero::before { content: ""; position: absolute; inset: 0; opacity: .1; pointer-events: none;
  background-image: linear-gradient(rgba(255,255,255,.4) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.4) 1px, transparent 1px);
  background-size: 34px 34px; mask-image: linear-gradient(to right, transparent 25%, #000 80%); }
.hero > * { position: relative; }
.hero-kicker { display: inline-flex; align-items: center; gap: 9px; color: #bed1ff; font-size: 12px; font-weight: 900; letter-spacing: .14em; text-transform: uppercase; }
.hero-kicker::before { content: ""; width: 24px; height: 3px; border-radius: 5px; background: var(--orange); }
.hero h1 { margin: 8px 0 8px; font-size: clamp(30px, 4.4vw, 48px); line-height: 1; letter-spacing: -.045em; }
.hero h1 span { color: var(--orange); }
.hero p { margin: 0; max-width: 640px; color: #d5e0f5; font-size: 15.5px; }
.trust { display: grid; grid-template-columns: repeat(4, 1fr); border: 1px solid var(--line); border-radius: 16px; margin-bottom: 14px; overflow: hidden; }
.trust-item { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-right: 1px solid var(--line); }
.trust-item:last-child { border-right: 0; }
.trust-icon { width: 36px; height: 36px; flex: none; display: grid; place-items: center; border-radius: 11px; color: var(--blue); background: color-mix(in srgb, var(--blue) 10%, transparent); font-weight: 900; }
.trust-item:nth-child(2n) .trust-icon { color: var(--orange); background: color-mix(in srgb, var(--orange) 10%, transparent); }
.trust-item strong { display: block; font-size: 13px; }
.trust-item span { color: var(--muted); font-size: 11.5px; }

/* tree */
.tree, .tree ul { list-style: none; margin: 0; padding: 0; }
.tree ul { padding-left: 22px; }
.tn > .lbl {
  display: flex; align-items: center; gap: 8px; padding: 4px 8px; cursor: pointer; border-radius: 8px;
  color: var(--link); text-decoration: none; user-select: none;
}
.tn > .lbl:hover { background: var(--hover); }
.tn > .lbl .box {
  width: 16px; height: 16px; border: 1.5px solid var(--field-line); border-radius: 5px; font: 800 12px/12px ui-monospace, monospace;
  display: grid; place-items: center; color: var(--blue); flex: none;
}
.tn.open > .lbl { font-weight: 800; color: var(--ink); }
.tn.open > .lbl .box { background: var(--blue); border-color: var(--blue); color: #fff; }
.tn > .lbl .n { color: var(--muted); font-size: 11.5px; font-weight: 400; }
.tn.d0 > .lbl { font-size: 14px; font-weight: 800; text-transform: uppercase; letter-spacing: .03em; }
.tn.here > .lbl { background: var(--hover); box-shadow: inset 3px 0 0 var(--orange); }

/* listings */
.listing { border: 1px solid var(--line); border-radius: 14px; margin: 6px 0 12px; overflow: hidden; background: var(--bg); }
.listing table { width: 100%; border-collapse: collapse; }
.listing th { background: var(--panel); text-align: left; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted);
  padding: 8px 10px; border-bottom: 1px solid var(--line); }
.listing td { padding: 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
.listing tr:nth-child(even) td { background: var(--row); }
.listing tr:last-child td { border-bottom: 0; }
.listing td a { font-weight: 700; text-decoration: none; }
.listing td a:hover { text-decoration: underline; }
.thumb { width: 84px; height: 63px; object-fit: cover; border-radius: 10px; border: 1px solid var(--line); background: var(--panel); display: block; }
.pn { font-family: Consolas, ui-monospace, monospace; font-weight: 700; }
.cond { font-size: 11px; color: var(--muted); }
.fits { font-size: 12px; color: var(--muted); }
.more { font-size: 12px; }
.price { font-weight: 900; white-space: nowrap; font-size: 15px; }
.por { font-size: 12px; color: var(--muted); white-space: nowrap; }
.qty { width: 54px; padding: 5px 6px; border: 1px solid var(--field-line); border-radius: 8px; background: var(--field); color: var(--ink); }
.add {
  border: 0; background: var(--blue); color: #fff; border-radius: 11px; padding: 8px 14px; font-size: 12.5px; font-weight: 900; white-space: nowrap;
}
.add:hover { background: var(--blue-2); }
.add.in { background: var(--ok); }
.c-thumb, .c-qty, .c-price, .c-act { width: 1%; }

/* detail */
.detail { display: grid; grid-template-columns: minmax(0, 440px) 1fr; gap: 28px; }
.detail img { width: 100%; border-radius: 18px; border: 1px solid var(--line); }
.detail dl { display: grid; grid-template-columns: max-content 1fr; gap: 6px 14px; }
.detail dt { color: var(--muted); }
.detail dd { margin: 0; }
.detail .add { padding: 12px 22px; font-size: 14px; }
.desc { white-space: pre-line; }

/* forms / panels */
.panel { background: var(--panel); border: 1px solid var(--line); border-radius: 16px; padding: 14px 16px; margin-bottom: 14px; }
.row-form { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.row-form input, .row-form select { padding: 8px 10px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--ink); }
.row-form input:not([type=checkbox]) { min-width: 240px; flex: 1; max-width: 420px; }
.row-form label { display: inline-flex; align-items: center; gap: 6px; }
.btn { border: 0; background: var(--blue); color: #fff; border-radius: 11px; padding: 9px 16px; font-weight: 800; text-decoration: none; display: inline-block; }
.btn:hover { background: var(--blue-2); }
.btn.accent { background: var(--orange); }
.btn.accent:hover { background: var(--orange-2); }
.btn.ghost { background: transparent; color: var(--link); padding: 0; font-weight: 600; text-decoration: underline; }
.totals { text-align: right; padding: 10px 8px; font-size: 15px; }
.checkout { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 10px; }
.checkout label { display: flex; flex-direction: column; gap: 3px; font-size: 12px; font-weight: 700; color: var(--muted); }
.checkout input, .checkout textarea, .checkout select { padding: 9px 10px; border: 1px solid var(--field-line); border-radius: 10px; background: var(--field); color: var(--ink); font-weight: 400; }
.checkout input:focus, .checkout textarea:focus, .checkout select:focus, .row-form input:focus { outline: none; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(10, 73, 215, .12); }
.checkout .full { grid-column: 1 / -1; }
.ship-est { padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px dashed var(--field-line); font-size: 13.5px; }
.order-out { white-space: pre-wrap; font-family: Consolas, monospace; font-size: 12.5px; background: var(--bg); border: 1px solid var(--line); padding: 10px; border-radius: 10px; }

.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translate(-50%, 30px); opacity: 0; pointer-events: none;
  background: #0d1b30; color: #fff; padding: 11px 18px; border-radius: 12px; box-shadow: var(--shadow); transition: transform .25s, opacity .25s; z-index: 40; font-size: 13px;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.foot { background: #040d1b; color: #8b97ab; font-size: 12px; }
.foot-row { padding: 22px 0; display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; align-items: center; }
.foot-row span { display: inline-flex; align-items: center; gap: 10px; }
.foot a { color: #dce7fb; }
.foot-links { gap: 16px !important; }
.checkout .agree { align-items: flex-start; font-size: 12.5px; line-height: 1.45; }
.checkout .agree input { margin-top: 3px; flex: none; }

/* legal pages */
.legal { max-width: 860px; font-size: 15px; line-height: 1.65; }
.legal h1 { font-size: 30px; margin-bottom: 4px; }
.legal h2 { font-size: 19px; margin: 28px 0 6px; }
.legal h3 { font-size: 16px; margin: 18px 0 4px; }
.legal .meta { color: var(--muted); font-size: 13px; margin-bottom: 18px; }
.legal .note { background: var(--panel); border: 1px solid var(--line); border-radius: 14px; padding: 12px 16px; }
.legal table { border-collapse: collapse; width: 100%; font-size: 14px; }
.legal th, .legal td { border: 1px solid var(--line); padding: 7px 9px; text-align: left; vertical-align: top; }
.legal th { background: var(--panel); }
.legal-nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin: 4px 0 16px; font-size: 13.5px; }

/* my vehicle (garage) bar */
.garage { background: linear-gradient(110deg, var(--blue), #082f85); color: #fff; font-size: 13px; }
.garage-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 12px; padding: 9px 0; }
.g-lbl { font-weight: 900; display: inline-flex; align-items: center; gap: 8px; }
.g-lbl::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(255, 90, 0, .25); }
.g-picker { display: flex; flex-wrap: wrap; gap: 6px; }
.g-picker select { height: 36px; padding: 0 10px; min-width: 110px; max-width: 200px; background: #fff; color: #1a2a46; border: 0; border-radius: 9px; }
.g-picker select:disabled { opacity: .6; }
.g-saved { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.g-chip { display: inline-flex; align-items: center; gap: 4px; border: 1px solid rgba(255,255,255,.3); background: rgba(255,255,255,.1); border-radius: 999px; padding: 2px 4px 2px 10px; }
.g-chip.on { background: #fff; border-color: #fff; color: #0d1b30; font-weight: 800; }
.g-chip button { border: 0; background: none; color: inherit; padding: 2px 4px; font-weight: inherit; }
.g-chip.on .g-shop { background: var(--orange); color: #fff; border-radius: 99px; padding: 2px 10px; font-weight: 800; }
.g-chip .g-x { opacity: .7; }
.fitb { display: inline-block; font-size: 11px; font-weight: 800; border-radius: 99px; padding: 1px 8px; margin-top: 4px; }
.fitb.yes { background: color-mix(in srgb, var(--ok) 14%, transparent); color: var(--ok); }
.fitb.no { background: color-mix(in srgb, var(--orange) 14%, transparent); color: var(--orange); }
.fitb.unk { color: var(--muted); font-weight: 400; padding: 0; }
.hp { position: absolute !important; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* side cart */
.dr-shade { position: fixed; inset: 0; background: rgba(3, 11, 25, .55); z-index: 30; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100vw); background: var(--bg); color: var(--ink);
  z-index: 31; display: flex; flex-direction: column; transform: translateX(105%); transition: transform .3s; box-shadow: -20px 0 60px rgba(0, 0, 0, .2); }
.drawer.open { transform: none; }
.dr-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 20px; border-bottom: 1px solid var(--line); font-size: 18px; }
.dr-x { border: 0; width: 38px; height: 38px; border-radius: 10px; background: var(--panel); color: var(--ink); font-size: 15px; }
.dr-lines { list-style: none; margin: 0; padding: 0; overflow-y: auto; flex: 1; }
.dr-lines li { display: grid; grid-template-columns: 64px 1fr auto; gap: 10px; align-items: center; padding: 12px 20px; border-bottom: 1px solid var(--line); font-size: 13px; }
.dr-lines li.new { background: color-mix(in srgb, var(--ok) 9%, transparent); }
.dr-lines img { width: 64px; height: 48px; object-fit: cover; border-radius: 8px; }
.dr-lines a { font-weight: 700; text-decoration: none; }
.dr-lines small { display: block; }
.dr-q { white-space: nowrap; }
.dr-foot { padding: 16px 20px; border-top: 1px solid var(--line); display: flex; flex-wrap: wrap; gap: 10px 14px; align-items: center; }
.dr-foot > div { flex-basis: 100%; }
.dr-foot .btn.accent { flex: 1; text-align: center; padding: 13px; }

/* saved carts + checkout extras */
.saved-carts { margin-top: 14px; }
.saved-carts h2 { margin: 8px 0 4px; font-size: 15px; }
.saved-carts ul { margin: 0; padding-left: 18px; }
.saved-carts li { padding: 3px 0; }
.saved-carts label { display: inline-flex; gap: 6px; align-items: center; }
.checkout .chk { flex-direction: row; align-items: center; gap: 6px; color: var(--ink); font-weight: 400; }

.drawer[hidden], .dr-shade[hidden] { display: none; }

@media (max-width: 980px) {
  .head-row { grid-template-columns: 210px 1fr auto; gap: 14px; }
  .brand img { width: 200px; }
  .trust { grid-template-columns: repeat(2, 1fr); }
  .trust-item:nth-child(2) { border-right: 0; }
  .trust-item:nth-child(-n+2) { border-bottom: 1px solid var(--line); }
}
@media (max-width: 720px) {
  .wrap { width: calc(100% - 26px); }
  .head { position: static; } /* a sticky header + garage would fill half a phone screen */
  .topbar-links { display: none; }
  .head-row { grid-template-columns: 1fr auto; min-height: 64px; gap: 10px; padding: 6px 0; }
  .brand img { width: 180px; }
  .search { grid-column: 1 / -1; grid-row: 2; height: 44px; }
  .hero { padding: 22px 20px; border-radius: 18px; }
  .listing .c-fit-col { display: none; }
  .detail { grid-template-columns: 1fr; }
  .listing td, .listing th { padding: 7px 6px; }
  .thumb { width: 60px; height: 45px; }
  .g-picker select { max-width: none; flex: 1 1 40%; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation: none !important; transition: none !important; } }

/* Continue with Google panel (account page): same stacked agreement boxes as the sign-up form */
#googleForm label { display: flex; gap: 6px; align-items: flex-start; margin: 6px 0; font-size: 12.5px; line-height: 1.45; }
#googleForm label input { margin-top: 3px; flex: none; }
#gBtn { margin-top: 10px; max-width: 360px; }

/* Demo catalog notice + part-type subheadings in listings (2026-10-27) */
.demo-note { background: #fff4e5; color: #7a4a00; border-bottom: 1px solid #f3d6a6; font-size: 13px; padding: 7px 0; }
.demo-note a { color: inherit; font-weight: 700; }
.listing tr.ptype th { text-align: left; background: var(--panel, #f3f5f8); font-size: 13px; letter-spacing: .02em; padding: 8px 10px; border-top: 1px solid var(--line, #e3e7ec); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .demo-note { background: #3a2a10; color: #f6d9a8; border-color: #5a4318; } }
:root[data-theme="dark"] .demo-note { background: #3a2a10; color: #f6d9a8; border-color: #5a4318; }
