/* Layout: sticky steel header; catalog = sidebar categories + parts grid; part page = spec sheet + description column */
:root {
  --bg: #f3f4f6;
  --surface: #ffffff;
  --ink: #15181d;
  --muted: #5b6370;
  --line: #d8dce2;
  --steel: #1c232d;
  --steel-ink: #eef1f5;
  --flame: #e0531f;
  --flame-soft: #fde9df;
  --ok: #1f7a4a;
  --display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --body: "Barlow", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, Menlo, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0f1216; --surface: #171b21; --ink: #e7eaee; --muted: #98a1ad; --line: #2a3039;
    --steel: #0b0e12; --steel-ink: #e7eaee; --flame: #f2703f; --flame-soft: #3a1d12; --ok: #4cc485;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0f1216; --surface: #171b21; --ink: #e7eaee; --muted: #98a1ad; --line: #2a3039;
  --steel: #0b0e12; --steel-ink: #e7eaee; --flame: #f2703f; --flame-soft: #3a1d12; --ok: #4cc485;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { background: var(--bg); color: var(--ink); font-family: var(--body); font-size: 16px; line-height: 1.55; }
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 10; background: var(--steel); }
.wrap { max-width: 1200px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; text-wrap: balance; letter-spacing: 0.005em; }
p { margin: 0; }
a { color: inherit; }
.mono { font-family: var(--mono); }
.label { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); }
button, input, select, textarea { font: inherit; }
:focus-visible { outline: 3px solid var(--flame); outline-offset: 2px; }

.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--steel); color: var(--steel-ink); }
.top .wrap { display: flex; align-items: center; gap: 18px; padding-block: 12px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--display); font-weight: 700; font-size: 1.45rem; letter-spacing: 0.02em; text-transform: uppercase; }
.brand small { display: block; font-family: var(--mono); font-size: 0.62rem; font-weight: 400; letter-spacing: 0.1em; opacity: 0.7; }
.search { flex: 1 1 280px; display: flex; min-width: 0; }
.search input { width: 100%; min-width: 0; padding: 10px 14px; border-radius: 6px; border: 1px solid #3a4452; background: #262f3b; color: #eef1f5; }
.search input::placeholder { color: #a3adba; }
.toplinks { display: flex; gap: 16px; font-size: 0.92rem; align-items: center; }
.toplinks a { text-decoration: none; opacity: 0.85; }
.toplinks .ph { font-family: var(--mono); }
@media (max-width: 640px) { .toplinks .hide-sm { display: none; } }

.hero { background: var(--steel); color: var(--steel-ink); border-top: 1px solid #2c3541; }
.hero .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 40px; padding-block: 44px 52px; align-items: end; }
.hero h1 { font-size: clamp(2.4rem, 5.5vw, 4rem); text-transform: uppercase; }
.hero h1 span { color: var(--flame); }
.hero p { margin-top: 14px; opacity: 0.85; max-width: 36em; font-size: 1.08rem; }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; background: #33404f; border: 1px solid #33404f; border-radius: 8px; overflow: hidden; }
.stats div { background: #1f2833; padding: 16px; }
.stats b { display: block; font-family: var(--display); font-size: 2rem; color: #fff; font-variant-numeric: tabular-nums; }
.stats span { font-size: 0.82rem; opacity: 0.75; }
@media (max-width: 820px) { .hero .wrap { grid-template-columns: 1fr; } }

.crumbs { font-size: 0.88rem; color: var(--muted); padding-block: 18px 0; display: flex; gap: 8px; flex-wrap: wrap; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { color: var(--flame); }

.layout { display: grid; grid-template-columns: 240px 1fr; gap: 32px; padding-block: 28px 64px; }
@media (max-width: 860px) { .layout { grid-template-columns: 1fr; } }
.side { min-width: 0; }
.side nav { display: grid; gap: 2px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); }
.side a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 12px; border-radius: 6px; text-decoration: none; font-weight: 500; }
.side a:hover { background: var(--surface); }
.side a.on { background: var(--flame-soft); color: var(--flame); }
.side a span { font-family: var(--mono); font-size: 0.8rem; color: var(--muted); }
@media (max-width: 860px) {
  .side nav { position: static; display: flex; overflow-x: auto; gap: 6px; padding-bottom: 4px; }
  .side a { flex: none; border: 1px solid var(--line); background: var(--surface); }
}

.main { min-width: 0; }
.listhead { display: flex; justify-content: space-between; align-items: end; gap: 12px; flex-wrap: wrap; margin-bottom: 18px; }
.listhead h2 { font-size: 2rem; text-transform: uppercase; }
.listhead p { color: var(--muted); max-width: 46em; margin-top: 6px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.item { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 16px; display: grid; gap: 8px; grid-template-rows: auto auto 1fr auto; text-decoration: none; min-width: 0; transition: border-color .15s; }
.item:hover { border-color: var(--flame); }
.item h3 { font-family: var(--body); font-size: 1rem; font-weight: 600; line-height: 1.3; }
.item .sum { font-size: 0.88rem; color: var(--muted); }
.item .foot { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding-top: 8px; border-top: 1px dashed var(--line); }
.price { font-family: var(--mono); font-weight: 500; font-variant-numeric: tabular-nums; }
.stock { font-size: 0.78rem; font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
.stock.in { color: var(--ok); }
.stock.low { color: var(--flame); }
.empty { padding: 40px; text-align: center; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: 8px; }

/* Part page */
.part { display: grid; grid-template-columns: 1fr 360px; gap: 32px; padding-block: 24px 64px; align-items: start; }
@media (max-width: 900px) { .part { grid-template-columns: 1fr; } }
.part h1 { font-size: clamp(2rem, 4.5vw, 3rem); }
.part .sub { display: flex; gap: 10px 22px; flex-wrap: wrap; margin-top: 12px; font-size: 0.92rem; color: var(--muted); }
.part .sub b { color: var(--ink); font-family: var(--mono); font-weight: 500; }
.desc { display: grid; gap: 14px; margin-top: 26px; max-width: 68ch; }
.desc h2 { font-size: 1.35rem; text-transform: uppercase; margin-top: 12px; }
.desc ul { margin: 0; padding-left: 20px; display: grid; gap: 6px; }
.specs { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.specs th, .specs td { text-align: left; padding: 9px 0; border-bottom: 1px solid var(--line); vertical-align: top; font-size: 0.92rem; }
.specs th { color: var(--muted); font-weight: 500; width: 46%; padding-right: 12px; }
.specs td { font-family: var(--mono); font-size: 0.85rem; }
.tablebox { overflow-x: auto; }
.flow { border-collapse: collapse; min-width: 380px; font-variant-numeric: tabular-nums; }
.flow th, .flow td { padding: 8px 14px; border: 1px solid var(--line); font-family: var(--mono); font-size: 0.85rem; text-align: right; }
.flow th { background: var(--bg); font-weight: 500; color: var(--muted); }
.buy { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 22px; display: grid; gap: 14px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 84px); min-width: 0; }
@media (max-width: 900px) { .buy { position: static; } }
.buy .big { font-family: var(--display); font-size: 2.4rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.buy .big small { font-family: var(--body); font-size: 0.85rem; font-weight: 400; color: var(--muted); }
.qty { display: flex; gap: 10px; }
.qty input { width: 80px; padding: 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); }
.btn { padding: 12px 18px; border-radius: 6px; border: 0; background: var(--flame); color: #fff; font-weight: 600; cursor: pointer; flex: 1; }
.btn.ghost { background: transparent; color: var(--ink); border: 1px solid var(--line); }
.ship { font-size: 0.86rem; color: var(--muted); display: grid; gap: 4px; }
.toast { font-size: 0.88rem; padding: 10px 12px; border-radius: 6px; background: var(--flame-soft); }
.related { margin-top: 40px; }
.related h2 { font-size: 1.35rem; text-transform: uppercase; margin-bottom: 14px; }
.notice { font-size: 0.85rem; color: var(--muted); border-left: 3px solid var(--flame); padding: 8px 12px; background: var(--surface); }

.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; margin-bottom: 40px; }
.cat { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 18px; text-decoration: none; display: grid; gap: 6px; }
.cat:hover { border-color: var(--flame); }
.cat h3 { font-size: 1.35rem; text-transform: uppercase; }
.cat p { font-size: 0.88rem; color: var(--muted); }
.cat .n { font-family: var(--mono); font-size: 0.8rem; color: var(--flame); }

footer { background: var(--steel); color: var(--steel-ink); font-size: 0.86rem; }
footer .wrap { padding-block: 32px; display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 28px; }
footer p { opacity: 0.75; margin-top: 6px; }
@media (max-width: 760px) { footer .wrap { grid-template-columns: 1fr; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .item, .cat { transition: none; } }

.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.listhead .h2 { font-size: 2rem; text-transform: uppercase; }
main { display: block; }

/* ELCO catalog additions */
.plist { width: 100%; border-collapse: collapse; background: var(--surface); font-variant-numeric: tabular-nums; min-width: 520px; }
.plist th, .plist td { text-align: left; padding: 9px 14px; border-bottom: 1px solid var(--line); font-size: 0.92rem; vertical-align: top; }
.plist th { font-family: var(--mono); font-size: 0.72rem; letter-spacing: 0.08em; text-transform: uppercase; color: var(--muted); font-weight: 500; background: var(--bg); position: sticky; top: 0; }
.plist td a { text-decoration: none; }
.plist td a:hover { color: var(--flame); text-decoration: underline; }
.plist tr:hover td { background: var(--bg); }
.tablebox { overflow-x: auto; border: 1px solid var(--line); border-radius: 8px; }
.desc .tablebox { border: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 16px; }
.chip { font-size: 0.82rem; padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); }
.chip b { font-family: var(--mono); font-weight: 500; color: var(--flame); margin-left: 4px; }
.finder { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 24px; margin-bottom: 40px; }
.finder h2 { font-size: 1.6rem; text-transform: uppercase; margin-bottom: 8px; }
.finder p { color: var(--muted); }
.finder-form { display: flex; gap: 10px; min-width: 0; }
.finder-form input, .quote input[type=email] { flex: 1; min-width: 0; padding: 12px 14px; border: 1px solid var(--line); border-radius: 6px; background: var(--bg); color: var(--ink); font-family: var(--mono); }
.quote { display: grid; gap: 10px; }
.quote input[type=email] { font-family: var(--body); }
.buy .big { font-size: 1.9rem; }
.part h1 { font-size: clamp(1.7rem, 3.6vw, 2.5rem); }
@media (max-width: 760px) { .finder { grid-template-columns: 1fr; } }
.toplinks .hrs { font-family: var(--mono); font-size: 0.72rem; padding: 2px 7px; border: 1px solid var(--flame); color: var(--flame); border-radius: 999px; }
