/* ==========================================================================
   The Aviation Point — the catalogue (build/catalog.py)
   Same brand as the rest (assets/styles.css tokens: ink, periwinkle, Schibsted
   + JetBrains Mono), its own layout: a shop, not the tools frame. Everything is
   scoped to the catalogue's bar and <main class="catalog">.
   ========================================================================== */

/* The catalogue bar: search, region, departments */
.cat-bar { background: var(--ink); color: #fff; }
.cat-bar .container { display: flex; align-items: center; gap: 20px; min-height: 64px; }
.cat-mark { color: #fff; text-decoration: none; font-weight: 800; font-size: 18px; letter-spacing: -0.02em; flex: none; }
.cat-mark::after { content: ""; display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); margin-left: 3px; }
.cat-search { position: relative; flex: 1; max-width: 640px; }
.cat-search svg { position: absolute; left: 14px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); fill: none; stroke: var(--muted); stroke-width: 2; stroke-linecap: round; pointer-events: none; }
.cat-search input { width: 100%; height: 42px; border: 0; border-radius: var(--radius); padding: 0 14px 0 42px; font: 15px var(--font); color: var(--ink); background: #fff; }
.cat-search input:focus { outline: none; box-shadow: 0 0 0 3px var(--accent); }
.cat-q-results { position: absolute; top: 48px; left: 0; right: 0; z-index: 60; background: #fff; color: var(--text); border-radius: var(--radius-lg); box-shadow: 0 12px 32px rgba(18,20,19,.18); padding: 6px; max-height: 60vh; overflow: auto; }
.cat-q-results a, .cat-q-results p { display: flex; justify-content: space-between; gap: 12px; padding: 9px 12px; margin: 0; border-radius: 6px; text-decoration: none; color: var(--ink); font-size: 14px; }
.cat-q-results a[aria-selected="true"], .cat-q-results a:hover { background: var(--accent-soft); }
.cat-q-results small { color: var(--muted); font-family: var(--mono); font-size: 12px; text-align: right; }
.cat-q-results p { color: var(--muted); }
.cat-region { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--on-dark); margin-left: auto; flex: none; }
.cat-region select { font: 600 14px var(--font); color: #fff; background: transparent; border: 1px solid var(--ink-3); border-radius: var(--radius); padding: 8px 10px; }
.cat-region select option { color: var(--ink); }
.cat-depts { border-bottom: 1px solid var(--line); background: #fff; }
.cat-depts .container { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; }
.cat-depts a { flex: none; padding: 13px 12px; font-size: 14px; color: var(--text-2); text-decoration: none; border-bottom: 2px solid transparent; }
.cat-depts a span { font: 12px var(--mono); color: var(--muted); }
.cat-depts a.on { color: var(--ink); font-weight: 600; border-color: var(--accent); }

.catalog [hidden] { display: none !important; }
.catalog h1, .catalog h2, .catalog h3 { color: var(--ink); letter-spacing: -0.02em; }
.catalog .kick { font: 500 11.5px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0; }
.catalog .lede { font-size: 18px; color: var(--text-2); max-width: 64ch; margin: 0; }
.catalog .crumbs { padding-top: 18px; }
.catalog .btn { display: inline-flex; align-items: center; gap: 6px; background: var(--accent); color: var(--on-accent); border: 0; border-radius: var(--radius); padding: 11px 18px; font-weight: 700; font-size: 15px; text-decoration: none; cursor: pointer; }
.catalog .btn:hover { filter: brightness(1.06); }
.catalog .btn-ghost { background: #fff; border: 1px solid var(--line-2); border-radius: var(--radius); padding: 8px 12px; cursor: pointer; font: inherit; }
.catalog .link { background: none; border: 0; color: var(--accent-ink); cursor: pointer; padding: 0; font: inherit; font-size: 13.5px; }
.catalog input[type="checkbox"] { accent-color: var(--ink); width: 16px; height: 16px; }

/* Home */
.cat-hero { background: var(--bg-2); border-bottom: 1px solid var(--line); padding: 44px 0 36px; }
.cat-hero h1 { font-size: clamp(32px, 4.6vw, 52px); font-weight: 800; line-height: 1.05; max-width: 17ch; margin: 10px 0 14px; }
.pn-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; }
.pn-chips button { font: 500 13px var(--mono); border: 1px solid var(--line-2); background: #fff; color: var(--ink); border-radius: 6px; padding: 7px 10px; cursor: pointer; }
.pn-chips button:hover { border-color: var(--ink); }
.cat-tab { padding-top: 36px; scroll-margin-top: 80px; }
.catalog .cat-tab > h2 { font-size: 26px; margin: 0 0 16px; }
.depts { display: grid; grid-template-columns: repeat(auto-fill, minmax(360px, 1fr)); gap: 16px; }
.cat-head-solo { grid-template-columns: 1fr; margin-bottom: 20px; }
.cat-dir .app-panel-top { display: none; }
.cat-types { margin: 0; padding-left: 20px; color: var(--text-2); columns: 2; column-gap: 32px; }
.cat-stds { font-family: var(--mono); font-size: 14px; }
.catalog .vendor-grid { grid-template-columns: 1fr; }
.dept { display: grid; grid-template-columns: 112px 1fr; gap: 18px; border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 18px; scroll-margin-top: 90px; }
.dept:target { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent); }
.dept-pic { background: var(--bg-2); border-radius: var(--radius); aspect-ratio: 1; overflow: hidden; display: grid; place-items: center; }
.dept-pic img { width: 150%; max-width: none; height: auto; mix-blend-mode: multiply; }
.dept h3 { font-size: 20px; margin: 0; display: flex; gap: 10px; align-items: baseline; }
.dept .count { font: 500 13px var(--mono); color: var(--muted); }
.dept p { margin: 6px 0 12px; color: var(--text-2); font-size: 14.5px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips a { font-size: 13.5px; font-weight: 600; border-radius: 6px; padding: 5px 9px; background: var(--accent-soft); text-decoration: none; color: var(--ink); }
.chips a:hover { background: var(--accent); }
.chips a span { font: 12px var(--mono); color: var(--muted); }
.cat-how, .cat-faq { padding-top: 28px; padding-bottom: 28px; }
.catalog .cat-how h2, .catalog .cat-faq h2, .catalog .similar h2, .catalog .pdp-side h2 { font-size: 22px; margin: 0 0 14px; }
.cat-how ol { margin: 0; padding-left: 20px; display: grid; gap: 8px; max-width: 74ch; color: var(--text-2); }
.cat-how b { color: var(--ink); }
.cat-feed { font-size: 14px; color: var(--muted); }
.cat-faq details { border-top: 1px solid var(--line); padding: 14px 0; max-width: 80ch; }
.cat-faq details:last-child { border-bottom: 1px solid var(--line); }
.cat-faq summary { font-weight: 600; color: var(--ink); cursor: pointer; }
.cat-faq p { margin: 8px 0 0; color: var(--text-2); }

/* Category */
.cat-head { display: grid; grid-template-columns: 1fr 320px; gap: 32px; align-items: end; padding: 10px 0 24px; border-bottom: 1px solid var(--line); }
.cat-head h1 { font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; line-height: 1.08; margin: 0 0 10px; }
.cat-head .lede { font-size: 16.5px; }
.guide-card { display: grid; gap: 4px; border: 1px solid var(--line); border-left: 3px solid var(--accent); border-radius: var(--radius); padding: 14px 16px; text-decoration: none; color: var(--text-2); font-size: 14px; }
.guide-card b { color: var(--ink); font-size: 16px; }
.guide-card:hover { background: var(--accent-soft); }
.listing { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 32px; padding: 24px 0; }
.rail { position: sticky; top: 88px; align-self: start; max-height: calc(100vh - 110px); overflow: auto; }
.rail-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.rail-close, .rail-open { display: none; }
.rail fieldset { border: 0; border-top: 1px solid var(--line); margin: 0; padding: 14px 0; }
.rail legend { font: 500 11.5px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); padding: 0; margin-bottom: 8px; }
.rail label { display: flex; align-items: center; gap: 8px; font-size: 14.5px; padding: 4px 0; cursor: pointer; }
.rail label span { margin-left: auto; font: 12px var(--mono); color: var(--muted); }
.toolbar { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.toolbar .count { margin: 0; font-size: 14px; color: var(--muted); }
.toolbar .count b { color: var(--ink); font-family: var(--mono); }
.view-switch { margin-left: auto; display: inline-flex; background: var(--bg-3); border-radius: var(--radius); padding: 3px; }
.view-switch button { border: 0; background: none; padding: 6px 12px; border-radius: 6px; font: inherit; font-size: 13.5px; cursor: pointer; color: var(--text-2); }
.view-switch button[aria-pressed="true"] { background: var(--ink); color: #fff; }
.catalog .grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.catalog .card { position: relative; border: 1px solid var(--line); border-radius: var(--radius-lg); background: #fff; transition: border-color .15s, box-shadow .15s; }
.catalog .card:hover { border-color: var(--line-2); box-shadow: 0 6px 18px rgba(18,20,19,.07); }
.card-link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: inherit; }
.card-pic { aspect-ratio: 4 / 3; background: var(--bg-2); border-radius: var(--radius-lg) var(--radius-lg) 0 0; overflow: hidden; display: grid; place-items: center; }
.card-pic img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.card-pic img[src$=".svg"] { object-fit: cover; object-position: 50% 12%; transform: scale(1.5); transform-origin: 50% 22%; }
.noimg { font: 11.5px var(--mono); color: var(--muted); letter-spacing: .06em; text-transform: uppercase; }
.card-body { padding: 12px 14px 14px; display: flex; flex-direction: column; flex: 1; }
.card-kick { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); margin: 0 0 4px; }
.catalog .card h3 { font-size: 16px; line-height: 1.25; letter-spacing: -0.01em; margin: 0 0 10px; }
.card-specs { list-style: none; margin: 0 0 12px; padding: 0; display: grid; gap: 3px; font-size: 13px; }
.card-specs li { display: flex; justify-content: space-between; gap: 8px; border-bottom: 1px dotted var(--line); padding-bottom: 3px; }
.card-specs span { color: var(--muted); }
.card-specs b { font: 500 12.5px var(--mono); color: var(--ink); text-align: right; }
.card-foot { margin-top: auto; display: flex; gap: 4px; padding-right: 84px; min-height: 22px; }
.rtag { font: 500 11px var(--mono); padding: 2px 6px; border-radius: 4px; background: var(--bg-3); color: var(--text-2); }
.rtag.mine { background: var(--accent); color: var(--on-accent); }
.rtag.none { background: none; padding: 2px 0; color: var(--muted); }
.cmp { position: absolute; right: 12px; bottom: 12px; font-size: 12.5px; color: var(--muted); display: flex; gap: 5px; align-items: center; cursor: pointer; }
.catalog .table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-lg); }
.catalog table { border-collapse: collapse; width: 100%; font-size: 14px; margin: 0; }
.catalog caption { text-align: left; font-size: 13px; color: var(--muted); padding: 10px 14px; caption-side: top; }
.catalog th, .catalog td { text-align: left; padding: 9px 14px; border-top: 1px solid var(--line); vertical-align: top; }
.catalog thead th { font: 500 11.5px var(--mono); letter-spacing: .06em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); white-space: nowrap; }
.cmp-table td { font-family: var(--mono); font-size: 13px; }
.cmp-table th[scope="row"] { font-weight: 600; min-width: 200px; }
.catalog td.na { color: var(--muted); font-family: var(--font); font-style: italic; }
.catalog tr.hl { background: var(--accent-soft); }
.cmp-tray { position: fixed; left: 0; right: 0; bottom: 0; background: var(--ink); color: #fff; z-index: 90; }
.cmp-tray .container { display: flex; align-items: center; gap: 16px; height: 60px; font-size: 14px; }
.cmp-tray #cat-tray-names { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cmp-tray .link { color: var(--on-dark); }
.cat-disclaimer { margin: 0 0 32px; }

/* Product */
.pdp { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: 44px; padding: 14px 0 36px; border-bottom: 1px solid var(--line); }
.pdp-media figure { margin: 0; position: sticky; top: 88px; }
.pdp-media img, .pdp-media .noimg { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; background: var(--bg-2); border-radius: var(--radius-lg); display: grid; place-items: center; mix-blend-mode: multiply; }
.pdp-media figcaption { font-size: 12.5px; color: var(--muted); margin-top: 8px; }
.pdp-main h1 { font-size: clamp(30px, 3.4vw, 42px); font-weight: 800; line-height: 1.08; margin: 8px 0 14px; }
.answer { font-size: 17px; color: var(--text-2); margin: 0 0 18px; max-width: 58ch; }
.key-specs { list-style: none; margin: 0 0 24px; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 8px; }
.key-specs li { background: var(--bg-2); border-radius: var(--radius); padding: 10px 12px; display: grid; gap: 2px; }
.key-specs span { font-size: 12px; color: var(--muted); }
.key-specs b { font: 500 15px var(--mono); color: var(--ink); }
.catalog .buy-h { font-size: 18px; margin: 0 0 10px; }
.offers { display: flex; flex-direction: column; gap: 8px; }
.offer { border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 14px 16px; display: grid; gap: 4px; }
.offer.mine { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); order: -1; }
.offer p { margin: 0; }
.offer-zone { font: 500 11px var(--mono); letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.offer.mine .offer-zone::after { content: " · your region"; color: var(--accent-ink); }
.offer-vendor b { color: var(--ink); font-size: 16px; }
.offer-vendor span { color: var(--muted); font-size: 13.5px; margin-left: 6px; }
.offer-listing { font-size: 13.5px; color: var(--text-2); }
.offer .btn { margin: 8px 0 4px; justify-self: start; }
.offer-note { font-size: 12.5px; color: var(--muted); }
.buy-foot { margin: 10px 0 0; }
.offer-none, .offer-soon { background: var(--bg-2); border-style: dashed; }
.offer-soon .offer-vendor b, .offer-none .offer-vendor b { color: var(--text-2); font-size: 15px; }
.pdp-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding: 32px 0; }
.pdp-text > p { max-width: 68ch; color: var(--text-2); }
.catalog .standfirst { font-size: 18px; color: var(--ink); }
.spec { margin: 28px 0; }
.catalog .spec h2 { font-size: 20px; margin: 0 0 10px; }
.spec-table { border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: hidden; border-collapse: separate !important; border-spacing: 0; }
.spec-table tr:first-child > * { border-top: 0; }
.spec-table th { width: 38%; color: var(--muted); font-weight: 500; background: var(--bg-2); }
.spec-table td { font-family: var(--mono); font-size: 13.5px; color: var(--ink); }
.source { font-size: 12.5px; color: var(--muted); margin: 6px 0 0; }
.variants { margin: 18px 0; }
.variants summary { cursor: pointer; font-weight: 700; color: var(--ink); font-size: 17px; margin-bottom: 10px; }
.variants summary span { font: 12px var(--mono); color: var(--muted); font-weight: 400; margin-left: 6px; }
.var-table td { font-family: var(--mono); font-size: 13px; white-space: nowrap; }
.pdp-side { align-self: start; position: sticky; top: 88px; }
.refs { list-style: none; margin: 0 0 20px; padding: 0; display: grid; gap: 8px; }
.refs a { display: grid; gap: 2px; border: 1px solid var(--line); border-radius: var(--radius); padding: 11px 13px; text-decoration: none; color: var(--text-2); font-size: 13.5px; }
.refs a:hover { border-color: var(--accent); background: var(--accent-soft); }
.refs b { color: var(--ink); font-size: 15px; }
.similar { padding: 8px 0 48px; }
.grid-row { grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)) !important; }
.grid-row .card-foot { padding-right: 0; }
.buy-bar { display: none; }

@media (max-width: 900px) {
  .cat-bar .container { flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .cat-search { order: 3; flex-basis: 100%; max-width: none; }
  .cat-region > span { display: none; }
  .depts { grid-template-columns: 1fr; }
  .dept { grid-template-columns: 72px 1fr; padding: 14px; gap: 14px; }
  .cat-head { grid-template-columns: 1fr; gap: 16px; }
  .listing { grid-template-columns: 1fr; }
  .rail { position: fixed; inset: 0 0 0 auto; top: 0; width: min(340px, 88vw); max-height: none; background: #fff; z-index: 200; padding: 16px; box-shadow: -12px 0 32px rgba(18,20,19,.2); transform: translateX(105%); transition: transform .2s; }
  .rail.open { transform: none; }
  .rail-close { display: block; background: none; border: 0; font-size: 26px; line-height: 1; cursor: pointer; }
  .rail-open { display: inline-block; }
  .catalog .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .catalog .card h3 { font-size: 14.5px; }
  .card-specs li:nth-child(n+3) { display: none; }
  .card-foot { padding-right: 0; }
  .cmp { display: none; }
  .pdp { grid-template-columns: 1fr; gap: 18px; }
  .pdp-media figure { position: static; }
  .pdp-media img { aspect-ratio: 4 / 3; }
  .pdp-cols { grid-template-columns: 1fr; gap: 8px; }
  .pdp-side { position: static; }
  .buy-bar { display: block; position: fixed; left: 0; right: 0; bottom: 0; z-index: 90; background: #fff; border-top: 1px solid var(--line); transform: translateY(100%); transition: transform .2s; }
  .buy-bar.show { transform: none; }
  .buy-bar .container { display: flex; align-items: center; justify-content: space-between; gap: 12px; height: 64px; }
  .buy-bar b { font-size: 14px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
}
@media (prefers-reduced-motion: reduce) { .rail, .buy-bar, .catalog .card { transition: none; } }
