/* Africar Spares Warehouse: catalogue pages.
 *
 * Listing pages (category, search, brand) with the product table, its phone
 * rows, the pager and the empty states; the brand filter; the product card;
 * the product page and its photo lightbox; the brands index and brand head.
 * Loaded on every page from base.html, after site.css, whose tokens, buttons,
 * fields, page head, crumbs and chips it uses.
 *
 * There is no mockup for these pages. They follow the approved homepage
 * (design/mockups/current-brand/index.html): flat grounds and hairlines
 * instead of shadows, 2px corners, part numbers in ink 800 with tabular
 * figures, brand names as small red capitals (a brand in the range, never
 * Africar's own), catalogue descriptions in 500 capitals, the outlined red
 * "Add to quote", fields outlined in --field-line, and 2px or 3px ink rules
 * under headings.
 *
 * Breakpoints: 1180 and 1024 (the listing drops its sidebar; the filter's JS
 * in _filter_sidebar.html matches at 1025, change both together), 800 (the
 * table becomes rows: signed out it needs about 700px), 760 (phones: the
 * product page stacks, 44px targets), 560 (Add to quote under the row), 480
 * (one card per row) and 360.
 */

/* ── Shared marks ─────────────────────────────────────────────────────── */
/* New / End of range: small square tags. End of range is white on the red (5.8:1). */
.badge{display:inline-flex;align-items:center;height:22px;padding:0 7px;border-radius:var(--r);background:var(--ink);color:var(--white);font-size:11.5px;font-weight:800;letter-spacing:.06em;line-height:1;text-transform:uppercase;white-space:nowrap;vertical-align:middle}
.badge.sale{background:var(--cta-bg);color:var(--cta-fg)}

/* the trade-price lock (also used, as a span, on the quote page) */
.price-lock{display:inline-flex;align-items:center;gap:7px;font-size:var(--fs-sm);font-weight:600;color:var(--muted);text-decoration:none}
.price-lock svg{width:14px;height:14px;flex:none;color:var(--accent-ink)}
a.price-lock:hover{color:var(--ink);text-decoration:underline;text-underline-offset:3px}
.price{font-weight:800;font-size:var(--fs-md)}
/* a shown price (demo customers only) is excl. VAT, the client's rule ("All prices shown are
   excluding VAT."): a small muted line under the figure on cards and the quote (5.6:1 on
   white); in the listing table the Price column's head says it, and each row says it on phones */
.price-ex{display:inline-flex;flex-direction:column;line-height:1.2}
.ex-vat{display:block;margin-top:2px;font-size:12px;font-weight:600;letter-spacing:.01em;line-height:1.3;color:var(--muted);white-space:nowrap}
.ptable .c-price .ex-vat{display:none}

/* Add to quote: the mockup's outlined red button (.btn-add) */
.add{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 14px;border:2px solid var(--petrol);border-radius:var(--r);background:var(--white);color:var(--petrol);font:inherit;font-size:var(--fs-sm);font-weight:700;line-height:1.2;white-space:nowrap;cursor:pointer;transition:background-color .15s,color .15s}
.add:hover{background:var(--petrol);color:var(--white)}
.add:active{background:var(--cta-hover);border-color:var(--cta-hover);color:var(--white)}

/* ── Product card (product page "You looked at", CMS product blocks) ─── */
/* A hairline grid: each card draws its own 1px edge over a 1px gap, so a short row (one to
   three recently viewed parts) leaves no grey cells, and a card in a CMS grid keeps an edge. */
.cards{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:1px;padding:1px}
.card{display:flex;flex-direction:column;min-width:0;background:var(--white);box-shadow:0 0 0 1px var(--line)}
.card .c-img{position:relative;display:grid;place-items:center;aspect-ratio:6 / 5;background:var(--white);border-bottom:1px solid var(--line);text-decoration:none}
.card .c-img img{width:80%;height:88%;object-fit:contain;mix-blend-mode:multiply}
.card .c-img .noimg{color:var(--muted);font-size:var(--fs-sm);font-weight:600}
.card .badges{position:absolute;left:12px;top:12px;display:flex;flex-wrap:wrap;gap:6px}
.card .c-body{display:flex;flex-direction:column;flex:1;padding:16px 20px 18px}
.card .sku{display:flex;justify-content:space-between;align-items:baseline;gap:4px 12px;flex-wrap:wrap}
.card .sku b{font-size:var(--fs-h3);font-weight:800;letter-spacing:-.01em;line-height:1.1}
.card .sku > span{margin-left:auto;font-size:12px;font-weight:700;letter-spacing:.07em;line-height:1.3;color:var(--accent-ink);text-align:right;text-transform:uppercase}
.card h3{flex:1;margin-top:10px;font-size:13.5px;font-weight:500;letter-spacing:.02em;line-height:1.55;text-transform:uppercase;overflow-wrap:break-word}
.card h3 a{text-decoration:none}
.card h3 a:hover{text-decoration:underline;text-decoration-color:var(--accent-ink);text-decoration-thickness:2px;text-underline-offset:4px}
.card .c-foot{display:flex;justify-content:space-between;align-items:center;gap:10px;margin-top:16px;padding-top:14px;border-top:1px solid var(--line)}
.card .price-lock{min-height:40px}

/* ── Listing: sidebar and results ─────────────────────────────────────── */
.listing{display:grid;grid-template-columns:232px minmax(0,1fr);gap:48px;align-items:start}
.listing.no-facets{grid-template-columns:minmax(0,1fr)}
#results:focus{outline:none}
.htmx-request #results,#results.htmx-request{opacity:.55;transition:opacity .2s}

/* the brand filter: a ruled list under a 2px ink rule, as the department menu */
.facets{position:sticky;top:calc(var(--head-h) + 24px)}
.facets details > summary{display:none}
/* where the sidebar shows, its list shows even before (or without) the script that opens it */
@media (min-width:1025px){.facets details::details-content{content-visibility:visible}}
.facets h2{padding-bottom:10px;border-bottom:2px solid var(--ink);font-size:var(--fs-ui);font-weight:800;letter-spacing:0;line-height:1.3}
.facets ul{list-style:none;margin:0;padding:0;max-height:min(70vh,640px);overflow-y:auto;overscroll-behavior:contain}
.facets li{border-bottom:1px solid var(--line)}
.facets a{display:flex;justify-content:space-between;align-items:center;gap:10px;min-height:42px;padding:8px 10px;font-size:var(--fs-ui);font-weight:600;letter-spacing:.02em;line-height:1.3;text-decoration:none}
.facets a span{flex:none;color:var(--muted);font-size:var(--fs-sm);font-weight:600;letter-spacing:0}
.facets a:hover{background:var(--white)}
.facets a.on{background:var(--ink);color:var(--white)}
.facets a.on span{color:var(--on-petrol-muted)}
.facets a:focus-visible{outline-offset:-3px}
/* the red ring is 2.84:1 on ink, so the selected row takes a white one (the list scrolls, so it stays inset) */
.facets a.on:focus-visible{outline-color:var(--accent-on-ink)}
/* the search page's two groups, Department over Brand: the sidebar scrolls as one, so a sticky
   column taller than the window never hides the bottom of the brand list */
.facets ul + h2{margin-top:28px}
@media (min-width:1025px){
  .facets.two{max-height:calc(100vh - var(--head-h) - 48px);overflow-y:auto;overscroll-behavior:contain;scrollbar-width:thin}
  .facets.two ul{max-height:none;overflow:visible}
}

/* count and sort */
.toolbar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:12px 20px;min-height:44px;margin-bottom:16px}
.toolbar .total{font-size:var(--fs-md);font-weight:800}
.toolbar .total span{color:var(--muted);font-weight:500}
.toolbar form{display:flex;align-items:center;gap:10px;font-size:var(--fs-ui)}
.toolbar label{color:var(--muted);font-weight:600}
/* a model and number no description found writes together (golf 6): said above the rows */
.site .loose-note{margin:0 0 16px;padding:12px 16px;border:1px solid var(--line);border-left:3px solid var(--ink);border-radius:var(--r);background:var(--white);font-size:var(--fs-ui);line-height:1.5;max-width:80ch;overflow-wrap:anywhere}
.toolbar .select{font-weight:600}
/* a search that is only a brand's name (fuhler): its brand page, above the rows */
.brand-jump{margin:-8px 0 12px;font-size:var(--fs-ui)}
.brand-jump a{display:inline-flex;align-items:center;gap:8px;min-height:44px}
.brand-jump svg{width:16px;height:16px;flex:none;transition:transform .2s var(--ease)}
.brand-jump a:hover svg{transform:translateX(3px)}

/* ── Product table ────────────────────────────────────────────────────── */
.ptable{width:100%;border-collapse:collapse;background:var(--white);border:1px solid var(--line)}
.ptable th{padding:12px 14px 10px;border-bottom:2px solid var(--ink);background:var(--white);text-align:left;font-size:var(--fs-sm);font-weight:700;color:var(--muted);white-space:nowrap}
.ptable td{padding:12px 14px;border-bottom:1px solid var(--line);vertical-align:middle}
.ptable tbody tr:last-child td{border-bottom:0}
.ptable tbody tr:hover td{background:var(--porcelain)}
.ptable .c-img{width:1%;padding-right:2px}
.ptable .p-thumb{display:grid;place-items:center;width:64px;height:64px;background:var(--white);border:1px solid var(--line);overflow:hidden;text-decoration:none}
.ptable .p-thumb img{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply}
/* a part with no photo says so in its box (muted on white, 5.6:1) */
.ptable .p-noimg{padding:0 4px;color:var(--muted);font-size:11.5px;font-weight:700;letter-spacing:.02em;line-height:1.2;text-align:center}
.ptable .c-sku{width:1%;white-space:nowrap}
.ptable .p-sku{font-size:var(--fs-md);font-weight:800;letter-spacing:-.005em;color:var(--ink);text-decoration:none}
.ptable .p-sku:hover{text-decoration:underline;text-decoration-color:var(--accent-ink);text-decoration-thickness:2px;text-underline-offset:5px}
.ptable .p-badges{display:flex;flex-wrap:wrap;gap:4px;margin-top:6px}
.ptable .p-desc{display:block;font-size:var(--fs-sm);font-weight:500;letter-spacing:.02em;line-height:1.55;text-transform:uppercase;text-decoration:none;overflow-wrap:break-word}
.ptable .p-desc:hover{text-decoration:underline;text-underline-offset:3px}
.ptable .p-brand{display:block;margin-top:4px;font-size:12px;font-weight:700;letter-spacing:.07em;line-height:1.3;color:var(--accent-ink);text-transform:uppercase}
.ptable .c-price{text-align:right;white-space:nowrap}
.ptable .price-lock{min-height:40px}
.ptable .c-add{width:1%;white-space:nowrap}
.ptable .c-add form{display:grid;grid-template-columns:auto auto;justify-content:end;align-items:center;column-gap:8px}
.ptable .q{width:64px;height:40px;margin:0;padding:0 8px;border:1px solid var(--field-line);border-radius:var(--r);background:var(--white);font:inherit;font-weight:600;color:var(--ink);text-align:right}
.ptable .q:focus{outline:none;border-color:var(--ink);box-shadow:inset 0 0 0 1px var(--ink)}
.ptable .q:focus-visible{outline:3px solid var(--petrol);outline-offset:2px}
/* what an add did ("Added 2 x 601014. View quote"), under the field and button; it takes no
   height while empty and never widens the column (width 0, then both grid columns) */
.ptable .added{grid-column:1 / -1;width:0;min-width:100%;font-size:var(--fs-sm);font-weight:600;line-height:1.45;white-space:normal;text-align:right;overflow-wrap:break-word}
.ptable .added:not(:empty){margin-top:8px}
.ptable .added .tlink{text-underline-offset:4px}

/* pager: outlined buttons either side of the page count */
.pager{display:flex;align-items:center;justify-content:space-between;gap:12px 16px;margin-top:24px;padding-top:20px;border-top:1px solid var(--line-strong)}
.pager .pg-at{color:var(--muted);font-size:var(--fs-ui);font-weight:600}
.pager .pg-gap{min-width:1px}
.pager .pg-prev svg{transform:scaleX(-1)}
.pager .pg-prev:hover svg{transform:scaleX(-1) translateX(3px)}

/* ── Empty states ─────────────────────────────────────────────────────── */
/* a search with no results: three ways to find the part, search again, or ask */
.nores{text-align:left;padding:40px clamp(20px,4vw,48px) 44px;border:1px solid var(--line)}
.nores > strong{font-size:clamp(22px,2.2vw,28px);font-weight:800;letter-spacing:-.018em;line-height:1.15;overflow-wrap:anywhere}
.nores > p{margin:10px 0 0!important;max-width:60ch}
.nores .ways{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));margin:24px 0 0;padding:0;list-style:none;counter-reset:way;border-top:2px solid var(--ink)}
.nores .ways li{counter-increment:way;display:grid;grid-template-columns:32px minmax(0,1fr);align-content:start;gap:4px 10px;padding:18px 20px 20px 0}
.nores .ways li + li{padding-left:20px;border-left:1px solid var(--line)}
.nores .ways li::before{content:counter(way);grid-row:span 2;font-size:26px;font-weight:800;line-height:1;color:var(--accent-ink)}
.nores .ways b{font-weight:800;font-size:var(--fs-md);line-height:1.3}
.nores .ways span{color:var(--muted)}
.nores .ways .tlink{color:var(--ink);text-underline-offset:4px}
.nores .again{display:flex;gap:8px;max-width:560px;margin-top:8px}
.nores .again .input{flex:1;min-width:0}
.nores .again .btn{margin:0}
.nores .acts{display:flex;flex-wrap:wrap;gap:10px;margin-top:20px;padding-top:20px;border-top:1px solid var(--line)}
.nores .acts .btn{margin:0}
.nores .acts form{display:flex;margin:0}
.nores .ways .tlink.nw{white-space:nowrap}
/* what to try first: a VIN, a part number it may have meant, or close numbers (a red rule) */
.nores .nr-first{display:flex;flex-wrap:wrap;align-items:center;gap:10px 20px;margin-top:20px;padding:16px 20px;background:var(--porcelain);border-left:3px solid var(--accent-ink)}
.nores .nr-first p{margin:0!important;max-width:60ch}
.nores .nr-first .btn{margin:0}
.nores .nr-big{font-size:var(--fs-md);font-weight:700;color:var(--ink)}
.nores .nr-big .tlink{color:var(--ink);font-weight:800;text-underline-offset:5px}
/* other searches that find parts: ruled rows, the search as the link and its count after it */
.nores .nr-try{margin:20px 0 4px;padding:0;list-style:none;border-top:2px solid var(--ink)}
.nores .nr-try li{padding:12px 0;border-bottom:1px solid var(--line);line-height:1.5}
.nores .nr-try .tlink{color:var(--ink);text-underline-offset:5px;overflow-wrap:anywhere}
.nores .nr-try span{color:var(--muted)}

/* the search page with nothing typed yet */
.s-start{max-width:760px;padding:32px clamp(20px,4vw,40px) 34px;background:var(--white);border:1px solid var(--line);border-top:var(--rule-heavy)}
.s-start label{display:block;margin-bottom:10px;font-weight:700}
.s-start .s-row{display:flex;gap:8px}
.s-start .input{flex:1;min-width:0;height:52px;font-size:var(--fs-md)}
.s-start .btn{min-height:52px}
.s-start .s-try{margin-top:16px;color:var(--muted);line-height:1.9}
.s-start .s-try .tlink{color:var(--ink);text-underline-offset:4px}

/* ── Product page ─────────────────────────────────────────────────────── */
/* the breadcrumbs sit in a slim page-head band, as on the listing pages */
.pdp-head .wrap{padding-block:14px}
.pdp-head .crumbs{margin:0}
.pdp{display:grid;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);gap:56px;align-items:start}

/* gallery: catalogue photography stays on white */
/* beside the buy column the photo stays in view while that column scrolls (not on phones) */
.gallery{position:sticky;top:calc(var(--head-h) + 24px)}
.gallery .g-main{position:relative;aspect-ratio:1 / 1;background:var(--white);border:1px solid var(--line)}
.gallery .g-main button{position:absolute;inset:0;width:100%;height:100%;padding:0;border:0;background:none;cursor:zoom-in}
.gallery .g-main button:focus-visible{outline-offset:-3px}
.gallery .g-main img{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply;padding:6%}
.gallery .g-zoom{position:absolute;right:12px;bottom:12px;display:grid;place-items:center;width:40px;height:40px;background:var(--white);border:1px solid var(--line-strong);border-radius:var(--r);color:var(--ink);transition:border-color .15s}
.gallery .g-zoom svg{width:18px;height:18px}
.gallery .g-main button:hover .g-zoom{border-color:var(--ink)}
.gallery .noimg{position:absolute;inset:0;display:grid;place-items:center;padding:20px;text-align:center;color:var(--muted);font-weight:600}
.gallery .g-thumbs{display:flex;flex-wrap:wrap;gap:8px;margin-top:8px}
.gallery .g-thumbs button{width:76px;height:76px;padding:0;border:1px solid var(--line);border-radius:var(--r);background:var(--white);overflow:hidden;cursor:pointer}
.gallery .g-thumbs button:hover{border-color:var(--field-line)}
.gallery .g-thumbs button.on{border-color:var(--petrol);box-shadow:inset 0 0 0 1px var(--petrol)}
.gallery .g-thumbs img{width:100%;height:100%;object-fit:contain;mix-blend-mode:multiply}

/* the photo overlay: footer black, a white close button, white focus rings */
.lightbox{position:fixed;inset:0;z-index:80;display:flex;align-items:center;justify-content:center;padding:4vmin;background:rgba(21,19,19,.92)}
.lightbox img{max-width:100%;max-height:100%;object-fit:contain;background:var(--white);border-radius:var(--r)}
.lightbox .icon-btn{position:absolute;top:16px;right:16px;background:var(--white);color:var(--ink)}
.lightbox .icon-btn:hover{background:var(--sage-soft)}
.lightbox :focus-visible{outline-color:var(--white)}

/* buy column: brand and badges, the part number with its description as the h1, a 3px rule */
.buy .b-meta{display:flex;flex-wrap:wrap;align-items:center;gap:8px 12px;min-height:24px}
.buy .b-brand{font-size:12px;font-weight:700;letter-spacing:.07em;line-height:1.3;color:var(--accent-ink);text-transform:uppercase;text-decoration:none}
.buy a.b-brand{text-decoration:underline;text-decoration-color:transparent;text-decoration-thickness:2px;text-underline-offset:5px;transition:text-decoration-color .15s}
.buy a.b-brand:hover{text-decoration-color:currentColor}
.buy h1{margin-top:10px;padding-bottom:20px;border-bottom:var(--rule-heavy);font-weight:800;line-height:1;text-wrap:initial}
.buy .b-sku{display:block;font-size:clamp(40px,4.2vw,58px);letter-spacing:-.02em;line-height:1;overflow-wrap:anywhere}
.buy .b-desc{display:block;margin-top:14px;font-size:clamp(17px,1.5vw,20px);font-weight:500;letter-spacing:.02em;line-height:1.5;text-transform:uppercase;overflow-wrap:break-word;text-wrap:pretty}
.buy .b-price{padding:18px 0;border-bottom:1px solid var(--line)}
.buy .b-price .price{font-size:32px}
.buy .b-price .vat{display:block;margin-top:2px;color:var(--muted);font-size:var(--fs-sm)}
.buy .b-price .price-lock{min-height:44px;color:var(--ink);font-size:var(--fs-body);font-weight:700}
.buy .b-price .price-lock svg{width:16px;height:16px}
.buy .b-price .price-lock span{text-decoration:underline;text-decoration-color:var(--accent-ink);text-decoration-thickness:2px;text-underline-offset:5px}
.buy .b-price .price-lock:hover span{text-decoration-color:currentColor}
.buy .b-add{display:flex;gap:10px;margin-top:22px}
.buy .b-add .input{flex:none;width:96px;height:52px;text-align:center;font-weight:700;font-size:var(--fs-md)}
.buy .b-add .btn{flex:1;min-height:52px}

/* save to a list: a disclosure under the button */
.buy .save{margin-top:12px}
.buy .save summary{display:inline-flex;align-items:center;gap:8px;min-height:44px;font-weight:700;cursor:pointer;list-style:none;text-decoration:underline;text-decoration-color:var(--accent-ink);text-decoration-thickness:2px;text-underline-offset:6px}
.buy .save summary::-webkit-details-marker{display:none}
.buy .save summary:hover{text-decoration-color:currentColor}
.buy .save summary svg{width:12px;height:12px;transition:transform .2s}
.buy .save[open] summary svg{transform:rotate(180deg)}
.buy .save form{display:flex;flex-wrap:wrap;align-items:center;gap:8px;margin-top:8px;padding:16px;background:var(--white);border:1px solid var(--line)}
.buy .save .select,.buy .save .input{flex:1 1 180px;width:auto;min-width:0;height:44px}
.buy .save .save-qty{display:flex;align-items:center;gap:8px}
.buy .save .save-qty label{font-weight:600;color:var(--muted)}
.buy .save .save-qty .input{flex:none;width:76px;text-align:center}

/* specification and documents: ruled lists under a 2px ink rule */
.spec{margin-top:36px}
.spec h2{padding-bottom:10px;border-bottom:2px solid var(--ink);font-size:20px;letter-spacing:-.01em;line-height:1.2}
.spec dl{margin:0}
.spec dl div{display:flex;justify-content:space-between;gap:16px;padding:11px 0;border-bottom:1px solid var(--line)}
.spec dt{color:var(--muted)}
.spec dd{margin:0;font-weight:600;text-align:right}
.spec ul{list-style:none;margin:0;padding:0}
.spec li a{display:flex;align-items:center;gap:10px;min-height:46px;padding:10px 0;border-bottom:1px solid var(--line);font-weight:600;text-decoration:none}
.spec li a:hover{text-decoration:underline;text-decoration-color:var(--accent-ink);text-decoration-thickness:2px;text-underline-offset:4px}
.spec li svg{width:18px;height:18px;flex:none;color:var(--accent-ink)}

/* before you order: the homepage's red square ticks, as a list in this column */
.before{margin-top:36px;padding:22px 24px 24px;background:var(--white);border:1px solid var(--line);border-top:var(--rule-heavy)}
.before h2{font-size:20px;letter-spacing:-.01em;line-height:1.2}
.before .checks{margin-top:14px}
.before .checks li{grid-template-columns:38px minmax(0,1fr);padding:14px 0}
.before .checks .tick{width:26px;height:26px;background:var(--petrol)}
.before .checks .tick svg{width:13px;height:13px;color:var(--white)}
.before .checks strong{font-weight:800}
.before .b-ask{margin-top:18px}

/* recently viewed: a section head with the 3px rule */
.related{margin-top:80px}
.related h2{margin-bottom:24px;padding-bottom:16px;border-bottom:var(--rule-heavy);font-size:clamp(26px,2.4vw,34px)}

/* ── Brands index and brand head ──────────────────────────────────────── */
/* brand logos sit on a white plate, since most are drawn for white */
.b-logo{display:flex;align-items:center;justify-content:center;width:150px;height:64px;padding:8px 12px;background:var(--white);border-radius:var(--r)}
.b-logo img{max-width:100%;max-height:100%;object-fit:contain}
.b-logo img + .b-logo-name{display:none}
.b-logo-name{font-size:20px;font-weight:800;letter-spacing:-.01em;line-height:1.1;text-align:center;overflow-wrap:anywhere}

/* the index: the homepage band's pale wash in a hairline grid of linked cells */
.brand-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:1px;margin:0;padding:1px;list-style:none}
.brand-grid li{display:flex;min-width:0}
.brand-grid a{flex:1;display:grid;grid-template-columns:min(180px,46%) minmax(0,1fr) auto;align-items:center;gap:20px;padding:18px;background:var(--band-cell);box-shadow:0 0 0 1px var(--tile-rule);text-decoration:none;transition:box-shadow .15s}
.brand-grid a:hover{box-shadow:0 0 0 1px var(--tile-rule),inset 0 -3px 0 var(--petrol)}
.brand-grid a:focus-visible{position:relative;z-index:1;outline-offset:-4px}
.brand-grid .b-logo{width:100%;height:84px;padding:10px 16px}
.brand-grid .b-logo img{max-height:54px}
.brand-grid .b-txt{display:flex;flex-direction:column;gap:4px;min-width:0}
.brand-grid .b-name{font-size:12px;font-weight:700;letter-spacing:.07em;line-height:1.3;color:var(--accent-ink);text-transform:uppercase;overflow-wrap:anywhere}
.brand-grid .b-count{font-size:var(--fs-lead);font-weight:800;line-height:1.2;color:var(--ink)}
.brand-grid .b-go{width:18px;height:18px;color:var(--ink);transition:transform .2s var(--ease)}
.brand-grid a:hover .b-go{transform:translateX(3px)}

/* a brand page's head: the plate, the kicker and the name, with the 3px rule under all three */
.brand-head{display:flex;align-items:center;gap:16px 24px;flex-wrap:wrap;padding-bottom:18px;border-bottom:var(--rule-heavy)}
.brand-head .b-logo{width:190px;height:84px;padding:10px 16px;border:1px solid var(--line)}
.brand-head .b-logo img{max-height:60px}
.brand-head .kick{font-size:12px;font-weight:700;letter-spacing:.07em;line-height:1.3;color:var(--accent-ink);text-transform:uppercase}
.site .brand-head h1{margin-top:8px;padding-bottom:0;border-bottom:0}
.site .brand-head.has-logo h1{position:absolute;width:1px;height:1px;margin:0;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}

/* ════════════════════════════════════════════════════════════════════════
   Responsive
   ════════════════════════════════════════════════════════════════════════ */
@media (max-width:1180px){
  .listing{grid-template-columns:200px minmax(0,1fr);gap:28px}
  .ptable td,.ptable th{padding-left:10px;padding-right:10px}
  .ptable .q{width:56px}
  .pdp{gap:40px}
  .cards{grid-template-columns:repeat(2,minmax(0,1fr))}
  .brand-grid{grid-template-columns:repeat(2,minmax(0,1fr))}
}
/* the listing drops its sidebar at 1024: the filter becomes a field-like button over the results */
@media (max-width:1024px){
  .listing{grid-template-columns:minmax(0,1fr);gap:16px}
  .facets{position:static}
  .facets details > summary{display:flex;align-items:center;gap:10px;min-height:48px;padding:0 14px;background:var(--white);border:1px solid var(--field-line);border-radius:var(--r);font-weight:700;cursor:pointer;list-style:none}
  .facets details > summary::-webkit-details-marker{display:none}
  .facets details > summary:hover{border-color:var(--ink)}
  .facets details > summary .f-cur{min-width:0;padding:2px 8px;background:var(--ink);color:var(--white);border-radius:var(--r);font-size:var(--fs-sm);letter-spacing:.02em;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
  .facets details > summary svg{flex:none;margin-left:auto;transition:transform .2s}
  .facets details[open] > summary svg{transform:rotate(180deg)}
  .facets details[open] > summary{margin-bottom:8px}
  .facets h2{display:none}
  .facets ul{background:var(--white);border:1px solid var(--line);border-bottom:0;max-height:min(60vh,520px)}
  .facets a:not(.on):hover{background:var(--sage-light)}
  /* two groups in the open filter: each keeps its heading */
  .facets.two h2{display:block;margin:0;padding:10px 14px 8px;background:var(--white);border:1px solid var(--line);border-bottom:2px solid var(--ink);font-size:var(--fs-sm)}
  .facets.two ul{max-height:min(40vh,360px)}
  .facets.two ul + h2{margin-top:10px}
  /* the label and the filters in force wrap onto a second line rather than squeezing to an ellipsis */
  .facets details > summary{flex-wrap:wrap;row-gap:6px;padding-block:8px}
  .facets details > summary .f-label{flex:none}
}
@media (max-width:900px){
  .pdp{gap:32px}
  .related{margin-top:64px}
}
/* the table becomes rows: photo, then the part number, description, brand and price beside it,
   then quantity and Add to quote across the row */
@media (max-width:800px){
  .ptable thead{display:none}
  .ptable,.ptable tbody,.ptable tr,.ptable td{display:block}
  .ptable tr{display:grid;grid-template-columns:64px minmax(0,1fr) auto;grid-template-rows:auto auto 1fr;grid-template-areas:"img sku add" "img desc add" "img price add";column-gap:14px;padding:14px;border-bottom:1px solid var(--line)}
  .ptable tbody tr:last-child{border-bottom:0}
  .ptable td{padding:0;border:0}
  .ptable td.c-img{grid-area:img;width:auto;padding:0}
  .ptable .c-sku{grid-area:sku;width:auto;display:flex;flex-wrap:wrap;align-items:center;gap:6px 10px;white-space:normal}
  .ptable .p-badges{margin:0}
  .ptable .c-desc{grid-area:desc;margin-top:4px}
  .ptable .c-price{grid-area:price;margin-top:2px;text-align:left}
  .ptable .c-price .ex-vat{display:inline;margin:0}
  .ptable .c-add{grid-area:add;width:auto;align-self:center}
  .ptable tbody tr:hover td{background:none}
  /* the whole row opens the part (the part number link stretched over it), so the tap target is
     the row, not a 26px number; the price lock and the quote form sit above it */
  .ptable tr{position:relative}
  .ptable .p-sku::after{content:"";position:absolute;inset:0}
  .ptable .p-desc,.ptable .price-lock,.ptable .c-add form{position:relative;z-index:1}
  .nores .ways{grid-template-columns:minmax(0,1fr)}
  .nores .ways li,.nores .ways li + li{padding:16px 0;border-left:0}
  .nores .ways li + li{border-top:1px solid var(--line)}
}
/* phones: 44px targets */
@media (max-width:760px){
  .ptable .q{width:72px;height:44px}
  .add{min-height:44px}
  .ptable .price-lock,.card .price-lock{min-height:44px}
  .facets a{min-height:44px}
  .card .c-body{padding:14px 16px 16px}
  .card .sku{flex-direction:column;align-items:flex-start;gap:4px}
  .card .sku > span{margin-left:0;text-align:left}
  .card .c-foot{flex-direction:column;align-items:stretch;gap:8px}
  .card .c-foot .add{width:100%}
  .pager{flex-wrap:wrap}
  .pager .btn{flex:1 1 0;min-width:0}
  .pager .pg-at{order:-1;flex-basis:100%;text-align:center}
  .pager .pg-gap{display:none}
  .nores .again{flex-wrap:wrap}
  .nores .again .btn{flex:1}
  .nores .acts .btn,.nores .acts form{flex:1 1 220px}
  .nores .acts form .btn{width:100%}
  .nores .nr-first{padding:14px 16px}
  .nores .nr-first .btn{flex:1 1 220px}
  .nores .nr-try .tlink,.nores .nr-first .tlink,.nores .ways .tlink.nw{display:inline-flex;align-items:center;min-height:44px}
  .ptable .added .tlink{display:inline-flex;align-items:center;min-height:44px}
  .s-start .s-row{flex-direction:column}
  .s-start .input{flex:none;width:100%}
  .s-start .btn{width:100%}
  .s-start .s-try .tlink,.nores .ways .tlink{display:inline-flex;align-items:center;min-height:44px}
  .pdp{grid-template-columns:minmax(0,1fr)}
  .gallery{position:static}
  .buy a.b-brand{display:inline-flex;align-items:center;min-height:44px}
  .buy .b-sku{font-size:clamp(36px,11vw,46px)}
  .buy .b-desc{font-size:var(--fs-body)}
  .buy .b-add .input{width:80px}
  .before{padding:18px 16px 20px}
  .before .b-ask{width:100%}
  .brand-grid{grid-template-columns:minmax(0,1fr)}
  .brand-head .b-logo{width:150px;height:68px}
  .related{margin-top:56px}
}
/* narrow phones: quantity and Add to quote move under the row, full width */
@media (max-width:560px){
  .ptable tr{grid-template-columns:64px minmax(0,1fr);grid-template-rows:none;grid-template-areas:"img sku" "img desc" "img price" "add add"}
  .ptable .c-add{margin-top:10px}
  .ptable .c-add form{grid-template-columns:auto minmax(0,1fr);justify-content:stretch}
  .ptable .c-add .add{width:100%}
  .ptable .added{text-align:left}
}
/* one card per row, the photo beside the text (as the mockup's shelf at 480) */
@media (max-width:480px){
  .pager .pg-w{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
  .cards{grid-template-columns:minmax(0,1fr)}
  .cards .card{display:grid;grid-template-columns:104px minmax(0,1fr);grid-template-rows:auto 1fr auto;grid-template-areas:"img sku" "img desc" "foot foot"}
  .cards .card .c-img{grid-area:img;align-self:stretch;aspect-ratio:auto;place-items:start center;padding-top:8px;border-bottom:0;border-right:1px solid var(--line)}
  .cards .card .c-img img{width:88px;height:88px}
  .cards .card .c-img .noimg{padding:24px 6px;font-size:var(--fs-xs);text-align:center}
  .cards .card .badges{left:6px;top:auto;bottom:8px;right:6px}
  .cards .card .c-body{display:contents}
  .cards .card .sku{grid-area:sku;padding:12px 14px 0}
  .cards .card h3{grid-area:desc;margin-top:8px;padding:0 14px 12px}
  .cards .card .c-foot{grid-area:foot;flex-direction:row;align-items:center;gap:16px;margin:0;padding:8px 14px 12px}
  .cards .card .c-foot form{flex:1}
  .gallery .g-thumbs button{width:64px;height:64px}
  .brand-grid a{grid-template-columns:min(150px,44%) minmax(0,1fr) auto;gap:14px;padding:14px}
  .brand-grid .b-logo{height:72px;padding:8px 12px}
}
@media (max-width:360px){
  .ptable tr{grid-template-columns:56px minmax(0,1fr);column-gap:12px;padding:12px}
  .ptable .p-thumb{width:56px;height:56px}
  .buy .b-add .input{width:72px}
}
