/* Anakade prototype styles. Colours are placeholders until branding/ has the real ones. */

:root {
  --bg: #f5f6f7;
  --surface: #ffffff;
  --ink: #16212b;
  --muted: #5d6b78;
  --line: #dde2e7;
  --brand: #0f4c5c;
  --brand-ink: #ffffff;
  --brand-soft: #e3eef0;
  --accent: #e8a317;
  --ok: #1d7a46;
  --low: #a35d00;
  --out: #b3261e;
  --select: #fff6e0;
  --radius: 6px;
  --font: 'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #11171c; --surface: #1a2229; --ink: #e6ebef; --muted: #9aa8b4; --line: #2c3740;
    --brand: #5fb3c4; --brand-ink: #0b1a1f; --brand-soft: #1d3138; --accent: #f0b43a;
    --ok: #5cc28a; --low: #e0a14a; --out: #ef7a72; --select: #2c2a1e; color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #11171c; --surface: #1a2229; --ink: #e6ebef; --muted: #9aa8b4; --line: #2c3740;
  --brand: #5fb3c4; --brand-ink: #0b1a1f; --brand-soft: #1d3138; --accent: #f0b43a;
  --ok: #5cc28a; --low: #e0a14a; --out: #ef7a72; --select: #2c2a1e; color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 15px/1.5 var(--font); min-height: 100vh; display: flex; flex-direction: column; }
main { flex: 1; }
a { color: var(--brand); }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 1.7rem; }
h2 { font-size: 1.25rem; }
h3 { font-size: 1.05rem; }
small, .small { font-size: .85em; }
.muted { color: var(--muted); }
.sku { font-family: var(--mono); font-size: .9em; }
.wrap { max-width: 1240px; margin: 0 auto; padding: 0 16px; }
.section { padding: 32px 16px; }

/* Header */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 10; }
.demo-bar { background: var(--accent); color: #1d1500; text-align: center; font-size: .8rem; padding: 3px 16px; font-weight: 500; }
.head-row { display: flex; align-items: center; gap: 20px; padding-top: 12px; padding-bottom: 10px; }
.logo { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 1.3rem; color: var(--ink); text-decoration: none; letter-spacing: .02em; }
.logo-mark { display: grid; place-items: center; width: 34px; height: 34px; background: var(--brand); color: var(--brand-ink); border-radius: var(--radius); }
.logo-svg { width: 24px; height: 24px; }
.search { flex: 1; display: flex; max-width: 620px; }
.search input { flex: 1; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-right: 0; border-radius: var(--radius) 0 0 var(--radius); font: inherit; background: var(--bg); color: var(--ink); }
.search button { padding: 0 16px; border: 0; background: var(--brand); color: var(--brand-ink); font: inherit; font-weight: 600; border-radius: 0 var(--radius) var(--radius) 0; cursor: pointer; }
.search.big input { padding: 14px 16px; font-size: 1.05rem; background: var(--surface); }
.cart-link { margin-left: auto; font-weight: 600; text-decoration: none; color: var(--ink); white-space: nowrap; }
.badge { display: inline-block; min-width: 20px; padding: 0 6px; border-radius: 10px; background: var(--accent); color: #1d1500; font-size: .8rem; text-align: center; }
.nav { display: flex; gap: 4px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.nav a { padding: 6px 10px; border-radius: var(--radius); text-decoration: none; color: var(--muted); white-space: nowrap; font-size: .92rem; }
.nav a:hover, .nav a[aria-current] { background: var(--brand-soft); color: var(--ink); }
.nav .nav-service { margin-left: auto; color: var(--brand); font-weight: 600; }

/* Buttons */
.btn { display: inline-block; padding: 10px 18px; background: var(--brand); color: var(--brand-ink); border: 0; border-radius: var(--radius); font: inherit; font-weight: 600; text-decoration: none; cursor: pointer; text-align: center; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--brand); border: 1px solid var(--brand); }
.btn.wide { width: 100%; }
.btn:disabled, button:disabled { opacity: .45; cursor: not-allowed; }
.link { background: none; border: 0; color: var(--brand); font: inherit; cursor: pointer; padding: 0; text-decoration: underline; }

/* Home */
.hero { background: linear-gradient(135deg, var(--brand-soft), var(--bg) 70%); border-bottom: 1px solid var(--line); }
.hero-grid { display: grid; grid-template-columns: 1.4fr 1fr; gap: 40px; align-items: center; padding-top: 48px; padding-bottom: 48px; }
.hero h1 { font-size: 2.3rem; max-width: 18ch; }
.lead { font-size: 1.1rem; color: var(--muted); max-width: 52ch; }
.quick { font-size: .9rem; color: var(--muted); }
.hero-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; box-shadow: 0 8px 24px rgba(0,0,0,.06); }
.hc-title { font-weight: 600; margin-bottom: 10px; }
.group-title { font-size: .8rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 24px 0 10px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: 14px; }
.cat-card { display: flex; gap: 14px; padding: 16px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--ink); text-decoration: none; transition: border-color .15s; }
.cat-card:hover { border-color: var(--brand); }
.cat-card p { margin: 0 0 6px; color: var(--muted); font-size: .9rem; }
.cat-card h3 { margin: 0 0 4px; }
.count { font-size: .8rem; color: var(--brand); font-weight: 600; }
.pic { width: 56px; height: 56px; flex: none; color: var(--brand); }
.band { background: var(--surface); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.points { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; padding-top: 28px; padding-bottom: 28px; }
.points h3 { color: var(--brand); }
.points p { margin: 0; color: var(--muted); font-size: .92rem; }
.service-teaser { display: grid; grid-template-columns: 1.3fr 1fr; gap: 32px; align-items: center; }
.service-teaser p { color: var(--muted); max-width: 56ch; }
.teaser-art { display: flex; justify-content: center; gap: 12px; }
.teaser-art .pic { width: 90px; height: 90px; }

/* Tables */
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.grid { width: 100%; border-collapse: collapse; font-size: .9rem; }
.grid th, .grid td { white-space: nowrap; padding: 8px 10px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: middle; }
.grid th { background: var(--bg); font-weight: 600; font-size: .8rem; color: var(--muted); white-space: nowrap; position: sticky; top: 0; }
.grid tbody tr:hover { background: var(--brand-soft); }
.grid .wrap-cell { white-space: normal; min-width: 180px; }
.grid td.breaks { white-space: normal; min-width: 150px; }
.grid .num { text-align: right; white-space: nowrap; }
.grid td a { text-decoration: none; }
.grid td a:hover { text-decoration: underline; }
.sort { background: none; border: 0; font: inherit; color: inherit; cursor: pointer; padding: 0; }
.empty { text-align: center; color: var(--muted); padding: 32px !important; }
.mini { width: 100%; border-collapse: collapse; font-size: .88rem; margin-bottom: 12px; }
.mini td { padding: 6px 0; border-bottom: 1px dashed var(--line); }
.mini td:last-child { text-align: right; white-space: nowrap; padding-left: 10px; font-weight: 600; }
.buy { display: flex; gap: 4px; }
.qty { width: 72px; padding: 5px 6px; border: 1px solid var(--line); border-radius: 4px; font: inherit; background: var(--surface); color: var(--ink); }
.btn-add { padding: 5px 10px; border: 0; background: var(--brand); color: var(--brand-ink); border-radius: 4px; font: inherit; font-weight: 600; cursor: pointer; }
.stock { font-size: .85em; white-space: nowrap; }
.stock.ok { color: var(--ok); }
.stock.low { color: var(--low); }
.stock.out { color: var(--out); }
.pb { display: inline-block; margin-right: 10px; white-space: nowrap; }
.pb small { color: var(--muted); }
.saving { color: var(--ok); }
.note { font-size: .8rem; color: var(--low); margin-top: 3px; }

/* Category */
.crumbs { padding-top: 16px; padding-bottom: 8px; font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.cat-layout { display: grid; grid-template-columns: 230px minmax(0, 1fr); gap: 24px; padding-bottom: 40px; align-items: start; }
.cat-layout:not(:has(.filters)) { grid-template-columns: minmax(0, 1fr); }
.filters { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; position: sticky; top: 130px; }
.filters summary { font-weight: 600; cursor: pointer; margin-bottom: 6px; }
.filters fieldset { border: 0; padding: 0; margin: 10px 0; }
.filters legend { font-size: .8rem; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; margin-bottom: 4px; }
.filters label { display: block; font-size: .9rem; padding: 2px 0; cursor: pointer; }
.results-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.results-head span { color: var(--muted); }

/* Product */
.product-top { display: grid; grid-template-columns: 260px 1fr; gap: 28px; padding-top: 8px; padding-bottom: 24px; }
.product-pic { aspect-ratio: 1; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; display: grid; place-items: center; align-content: center; gap: 8px; color: var(--muted); }
.product-pic .pic { width: 55%; height: auto; }
.brand { margin: 0; color: var(--muted); font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; }
.specs { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 8px; margin: 14px 0; }
.specs div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 6px 10px; }
.specs dt { font-size: .75rem; color: var(--muted); }
.specs dd { margin: 0; font-weight: 600; }
.product-body { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 24px; padding-bottom: 48px; align-items: start; }
.section-head { display: flex; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.vfilters { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.vfilters label { font-size: .85rem; color: var(--muted); display: flex; flex-direction: column; gap: 2px; }
.vfilters select, .rel select { padding: 5px 6px; border: 1px solid var(--line); border-radius: 4px; font: inherit; background: var(--surface); color: var(--ink); max-width: 100%; }
.variants tbody tr { cursor: pointer; }
.variants tr.selected, .variants tr.selected:hover { background: var(--select); box-shadow: inset 3px 0 0 var(--accent); }
.mates { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; position: sticky; top: 130px; }
.mates h2 { margin-bottom: 2px; }
.rel-list { list-style: none; margin: 12px 0; padding: 0; }
.rel { display: grid; gap: 4px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.rel-tick { display: flex; align-items: center; gap: 6px; cursor: pointer; }
.rel-type { font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; padding: 2px 6px; border-radius: 4px; background: var(--brand-soft); color: var(--brand); }
.t-requires { background: #fde9c8; color: #7a4a00; }
.t-tool, .t-used_with { background: var(--bg); color: var(--muted); }
.rel-body { padding-left: 22px; font-size: .9rem; display: grid; gap: 4px; }
.rel-body > a { font-weight: 600; text-decoration: none; }
.rel-qty { font-size: .82rem; color: var(--muted); }
.rel-qty strong { color: var(--ink); }
.set-box { background: var(--bg); border-radius: var(--radius); padding: 14px; margin-top: 8px; }
.sets { display: flex; align-items: center; justify-content: space-between; font-weight: 600; margin-bottom: 10px; }
.sets input { width: 90px; padding: 6px; border: 1px solid var(--line); border-radius: 4px; font: inherit; background: var(--surface); color: var(--ink); }
.set-total { display: flex; justify-content: space-between; margin: 10px 0; font-size: 1.05rem; }

/* Cart */
.cart tbody.set { border-left: 3px solid var(--accent); }
.group-head td { background: var(--select); font-weight: 600; font-size: .85rem; }
.cart-foot { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; margin-top: 18px; align-items: start; }
.totals { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; display: grid; gap: 10px; }
.totals > div { display: flex; justify-content: space-between; }
.grand { font-size: 1.15rem; }
.empty-cart { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 28px; }

/* Harness */
.harness-hero { padding-top: 36px; padding-bottom: 12px; }
.harness-hero p { max-width: 64ch; color: var(--muted); font-size: 1.05rem; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; counter-reset: step; margin: 20px 0 32px; padding: 0; list-style: none; }
.steps li { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 16px; counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); font-weight: 700; margin-bottom: 8px; }
.steps p { margin: 0; color: var(--muted); font-size: .9rem; }
.harness-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: 28px; padding-bottom: 48px; align-items: start; }
.offer { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 18px; }
.offer ul { padding-left: 18px; margin: 0; }
.offer li { margin-bottom: 6px; }
.form { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 20px; display: grid; gap: 14px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form label { display: grid; gap: 4px; font-size: .9rem; font-weight: 500; }
.form input, .form textarea, .form select { padding: 8px 10px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: var(--bg); color: var(--ink); width: 100%; }
.form fieldset { border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 12px; }
.form legend { font-size: .9rem; font-weight: 500; padding: 0 4px; }
.parts-list { max-height: 200px; overflow-y: auto; display: grid; gap: 2px; }
.parts-list label { display: flex; gap: 6px; align-items: baseline; font-weight: 400; grid-template-columns: none; }
.parts-list input { width: auto; }
.done { background: var(--brand-soft); border-radius: var(--radius); padding: 12px 14px; }

/* Fastener types guide */
.nav .nav-guide { margin-left: auto; }
.nav .nav-guide + .nav-service { margin-left: 0; }
.types-head { padding-top: 8px; padding-bottom: 8px; }
.types-head .lead { margin-top: 0; }
.type-search { width: 100%; max-width: 480px; padding: 10px 12px; border: 1px solid var(--line); border-radius: var(--radius); font: inherit; background: var(--surface); color: var(--ink); margin: 6px 0 14px; }
.type-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.type-chips a { padding: 5px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); text-decoration: none; font-size: .9rem; }
.type-chips a:hover { border-color: var(--brand); }
.type-chips span { color: var(--muted); font-size: .8rem; margin-left: 2px; }
.types-body { padding-bottom: 48px; }
.type-group { padding-top: 28px; scroll-margin-top: 140px; }
.type-group > p { margin-top: 0; }
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.type-card { background: var(--surface); border: 1px solid var(--line); border-radius: 10px; overflow: hidden; display: flex; flex-direction: column; }
.type-card[hidden], .type-group[hidden] { display: none; }
.type-pic { height: 120px; display: grid; place-items: center; background: #f4f6f8; border-bottom: 1px solid var(--line); padding: 12px; }
.type-pic img { max-width: 100%; max-height: 96px; object-fit: contain; }
.no-pic { font-size: .8rem; color: #6b7a87; border: 1px dashed #b9c3cc; border-radius: var(--radius); padding: 18px 14px; }
.type-info { padding: 12px 14px 14px; }
.type-info h3 { margin-bottom: 4px; }
.type-info p { margin: 0; font-size: .9rem; color: var(--muted); }
.abbr { font-family: var(--mono); font-size: .72rem; font-weight: 500; color: var(--brand); background: var(--brand-soft); padding: 1px 6px; border-radius: 4px; vertical-align: middle; }
.variant-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 10px; }
.variant-chips button { font: inherit; font-size: .75rem; padding: 2px 8px; border: 1px solid var(--line); border-radius: 999px; background: var(--bg); color: var(--ink); cursor: pointer; }
.variant-chips button[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: var(--brand-ink); }
.img-credit { margin-top: 32px; }
.product-pic:has(img) { background: #f4f6f8; }
.product-pic img { width: 60%; height: auto; }

/* Footer */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); margin-top: auto; }
.foot-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 24px; padding-top: 28px; padding-bottom: 20px; font-size: .9rem; }
.foot-grid a { display: block; color: var(--muted); text-decoration: none; padding: 2px 0; }
.foot-grid a:hover { color: var(--brand); }
.foot-grid p { color: var(--muted); max-width: 40ch; }
.foot-note { border-top: 1px solid var(--line); padding-top: 12px; padding-bottom: 20px; font-size: .8rem; color: var(--muted); }

/* Toast */
#toast { position: fixed; left: 50%; bottom: 20px; transform: translate(-50%, 120px); background: var(--ink); color: var(--bg); padding: 10px 16px; border-radius: var(--radius); font-size: .9rem; transition: transform .25s; z-index: 50; max-width: calc(100vw - 32px); }
#toast.show { transform: translate(-50%, 0); }
#toast a { color: var(--accent); margin-left: 8px; font-weight: 600; }

/* Responsive */
@media (max-width: 960px) {
  .hero-grid, .service-teaser, .product-body, .harness-grid, .cart-foot { grid-template-columns: 1fr; }
  .points, .steps { grid-template-columns: 1fr 1fr; }
  .mates, .filters { position: static; }
  .cat-layout { grid-template-columns: minmax(0, 1fr); }
}
@media (max-width: 640px) {
  .head-row { flex-wrap: wrap; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .hero h1 { font-size: 1.7rem; }
  .points, .steps, .form-row, .foot-grid { grid-template-columns: 1fr; }
  .product-top { grid-template-columns: 1fr; }
  .product-pic { max-width: 200px; }
  .site-header { position: static; }
  .teaser-art { display: none; }
  .filters details:not([open]) { margin-bottom: 0; }
}
