/* ══════════════════════════════════════════════════════════════════════════
   NEL'S DISTRIBUTORS — CATALOGUE PAGES
   Loaded AFTER css/nel-design.css by the 8 brand pages and products.html.

   SCOPE: only the components the catalogue pages need that the design system
   does not already ship — breadcrumb, page-head band, brand badge, filter
   rows and pagination. Everything else (cards, chips, buttons, grid, empty
   state, logo tiles) is reused from nel-design.css rather than reinvented, so
   a change to the design system still reaches these pages.

   THEMES: no colour is hard-coded. Every surface, border and text colour is a
   token (--surface, --line, --ink, --muted, --red…) so both the day and night
   token sets drive this file. The only literal colours are white-on-red
   overlays, which sit on --red in BOTH themes and are therefore theme-safe.

   TAP TARGETS: the handoff draws 40px filter chips and 40px pagination
   squares. The build rule for this site is >=44px, so chips inside a filter
   row and every pagination control are lifted to 44px here. Visually the
   difference is 2px of padding; functionally it is the difference between a
   thumb hitting the control and missing it on a 390px phone.
   ══════════════════════════════════════════════════════════════════════════ */

/* ── Breadcrumb ────────────────────────────────────────────────────────── */
.nel-crumb{display:flex;flex-wrap:wrap;align-items:center;gap:7px;
  font-size:13px;color:var(--muted);}
.nel-crumb a{color:var(--muted);transition:color .15s;}
.nel-crumb a:hover{color:var(--red-text);}
.nel-crumb-sep{opacity:1;}
.nel-crumb-now{color:var(--ink);font-weight:600;}

/* ── Page-head band (brand hero + products header) ─────────────────────────
   The 3px accent bar sits at bottom:-1px so it covers the band's own border
   rather than stacking under it — otherwise the brand colour reads as 4px on
   one page and 3px on another depending on the border colour of the theme. */
.nel-cat-head{position:relative;background:var(--surface);border-bottom:1px solid var(--line);}
.nel-cat-head .nel-wrap{padding-top:30px;padding-bottom:30px;}
.nel-cat-bar{position:absolute;left:0;right:0;bottom:-1px;height:3px;background:var(--red);opacity:.9;}

.nel-bh-row{display:flex;flex-direction:column;gap:20px;}
@media(min-width:900px){
  .nel-bh-row{flex-direction:row;align-items:center;justify-content:space-between;gap:32px;}
}
/* 2026-09-16: this row had no min-width:0, so the logo tile (a fixed 152px on
   a phone) plus the brand name and blurb established a min-content floor wider
   than the viewport — Lekkewaan pushed a 320px screen to 379px and a 414px one
   to 417px, because "veldtoerusting" is an unbreakable 14-character Afrikaans
   compound. Flex children default to min-width:auto, which is what lets a long
   word refuse to shrink. Measured on lekkewaan.html, the worst case of the ten
   brand pages; the same floor existed on the others with shorter words. */
.nel-bh-id{display:flex;align-items:center;gap:16px;margin-top:16px;min-width:0;}
.nel-bh-id>div{min-width:0;}
.nel-bh-id .nel-h1,.nel-bh-id .nel-muted{overflow-wrap:anywhere;hyphens:auto;}
@media(max-width:420px){
  .nel-bh-id{gap:12px;}
}
/* 2026-09-12. This was the worst logo on the site and it survived the 09-11
   pass because the fault was on the IMG, not the tile: a 110x58 tile whose
   image was capped at 88x34. Kubota's lockup is 5.16:1, so the width cap
   always bound first and it drew 88x17 inside a 110x58 box — a third of the
   tile, with white space all round it, on the page that is meant to be that
   brand's front door. Caps deleted; .nel-logo-tile img already contains the
   artwork inside the tile's padding box, which is what should size it. */
.nel-bh-tile{width:190px;height:80px;border-radius:12px;padding:7px 9px;}
@media(max-width:400px){
  .nel-bh-tile{width:152px;height:64px;padding:6px 8px;}
}
.nel-bh-aside{display:flex;flex-direction:column;align-items:flex-start;gap:10px;flex-shrink:0;}

.nel-badge{display:inline-flex;align-items:center;background:var(--red-soft);color:var(--red-text);
  font-family:'Montserrat',system-ui,sans-serif;font-weight:700;font-size:12px;letter-spacing:.06em;
  text-transform:uppercase;padding:7px 13px;border-radius:999px;}

/* ── Filter rows ───────────────────────────────────────────────────────── */
.nel-filters{display:flex;flex-direction:column;gap:12px;}
.nel-filter-row{display:flex;flex-wrap:wrap;align-items:center;gap:8px;}
.nel-filter-lbl{font-size:12px;font-weight:700;letter-spacing:.08em;text-transform:uppercase;
  color:var(--muted);flex-shrink:0;}
@media(min-width:640px){.nel-filter-lbl{min-width:94px;}}
.nel-chips{display:flex;flex-wrap:wrap;gap:8px;}
/* >=44px hit target, see header note. */
.nel-filter-row .nel-chip{min-height:44px;}
.nel-chip-n{display:inline-flex;align-items:center;justify-content:center;min-width:21px;height:21px;
  padding:0 6px;border-radius:999px;background:var(--surface2);color:var(--muted);
  font-size:11.5px;font-weight:700;line-height:1;}
/* Active chip is a --red fill in both themes, so a white-on-red count pill is
   theme-safe and keeps its contrast. */
.nel-chip[aria-pressed="true"] .nel-chip-n{background:rgba(0,0,0,.34);color:#fff;}  /* 9.60:1 (was 3.48:1) */
.nel-count{font-size:13px;color:var(--muted);}

/* ── Pagination ────────────────────────────────────────────────────────── */
.nel-pages{display:flex;flex-wrap:wrap;justify-content:center;align-items:center;gap:6px;margin-top:36px;}
.nel-page{min-width:44px;height:44px;display:inline-flex;align-items:center;justify-content:center;
  padding:0 10px;border-radius:10px;border:1.5px solid var(--line-strong);background:var(--surface);
  color:var(--ink);font-weight:700;font-size:14px;cursor:pointer;
  transition:background .15s,color .15s,border-color .15s;}
.nel-page:hover:not(:disabled):not(.is-active){background:var(--surface2);}
.nel-page.is-active{background:var(--red);border-color:var(--red);color:#fff;cursor:default;}
.nel-page:disabled{color:var(--muted);opacity:.7;cursor:default;background:transparent;
  border-color:transparent;}
.nel-page-gap{min-width:22px;height:44px;display:inline-flex;align-items:center;justify-content:center;
  color:var(--muted);font-weight:700;}

/* ── Help / CTA band ───────────────────────────────────────────────────── */
.nel-help{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:20px;
  padding:clamp(22px,3.5vw,36px);}
.nel-help-copy{max-width:58ch;}
.nel-help-ctas{display:flex;flex-wrap:wrap;gap:10px;}

/* ── Overflow guard ────────────────────────────────────────────────────────
   Long Afrikaans model names ("Falcon F60-450 Flexwing Slasher") in a 3-up
   grid at 390px are the one place this layout can push the page sideways.
   Grid columns are already minmax(0,1fr) in the design system; this makes the
   text inside them wrap rather than establish a wider min-content floor. */
.nel-prod-name,.nel-crumb,.nel-help-copy h2{overflow-wrap:anywhere;}

/* ══ CATEGORY HEADINGS IN THE PRODUCT GRID ═══════════════════════════════
   Rendered by js/nel-products.js when no category chip is selected. The
   heading is a grid item like the cards, so it has to span every column, and
   the first one must not push a rule against the row of chips above it. */
.nel-grid-head{grid-column:1/-1;display:flex;align-items:baseline;gap:10px;
  margin:26px 0 2px;padding-bottom:9px;border-bottom:1px solid var(--line);
  font-family:'Montserrat',system-ui,-apple-system,'Segoe UI',Roboto,sans-serif;
  font-weight:800;font-size:17px;letter-spacing:.01em;color:var(--ink);}
.nel-grid-head:first-child{margin-top:0;}
.nel-grid-head-n{font-size:12.5px;font-weight:700;color:var(--muted);
  font-variant-numeric:tabular-nums;letter-spacing:.04em;}

/* ══ BRAND HEADER AS A PHOTO BAND ════════════════════════════════════════
   The brand pages opened on a thin white strip — logo, name, one line — while
   four of the brands already had a full-width photograph of their own machine
   sitting unused in images/hero/. Added as an opt-in: the band only becomes a
   photo when NEL.brands[x].hero is set, so the six brands with no verified
   photo of their own keep the clean header rather than borrowing someone
   else's tractor. Same scrim discipline as the home hero — the dark band holds
   across the whole text column and only falls away past it. */
.nel-cat-head{position:relative;}
/* The machine sits centre-left in all four of these photographs, which is
   exactly where the scrim is darkest — anchoring right moves it into the
   readable-but-visible zone instead of burying it. */
.nel-bh-photo{position:absolute;inset:0;width:100%;height:100%;object-fit:cover;
  object-position:64% center;display:block;z-index:0;}
.nel-bh-photo[hidden],.nel-bh-scrim[hidden]{display:none;}
/* The brand-header text column is narrower than the home hero's — crumb,
   logo, name and one line, ending around 58% of the width — so the ramp can
   start letting the photograph through sooner. */
.nel-bh-scrim{position:absolute;inset:0;z-index:1;pointer-events:none;
  background:linear-gradient(96deg, rgba(10,10,10,.93) 0%, rgba(10,10,10,.86) 40%,
    rgba(10,10,10,.62) 60%, rgba(10,10,10,.30) 78%, rgba(10,10,10,.14) 100%);}
.nel-cat-head.has-photo{background:#0A0A0A;min-height:310px;display:flex;align-items:center;}
.nel-cat-head.has-photo > .nel-wrap{position:relative;z-index:2;padding-top:30px;padding-bottom:30px;}
/* Text on the photo: the band is dark in BOTH themes, so these are literal. */
.nel-cat-head.has-photo .nel-h1{color:#FFFFFF;}
.nel-cat-head.has-photo .nel-muted{color:#D6D1C9;}
.nel-cat-head.has-photo .nel-crumb,
.nel-cat-head.has-photo .nel-crumb a{color:#CFC9C0;}
.nel-cat-head.has-photo .nel-crumb a:hover{color:#FFFFFF;}
.nel-cat-head.has-photo .nel-crumb-now{color:#FFFFFF;}
.nel-cat-head.has-photo .nel-crumb-sep{color:#8B857C;}
.nel-cat-head.has-photo .nel-badge{background:rgba(255,255,255,.14);color:#FFFFFF;
  border-color:rgba(255,255,255,.28);}
.nel-cat-head.has-photo .nel-bh-tile{border-color:rgba(255,255,255,.3);}
@media(max-width:899.98px){
  .nel-cat-head.has-photo{min-height:0;}
  /* On a phone the copy fills the width, so the sideways ramp cannot carry it —
     a straight top-to-bottom scrim does. */
  /* 2026-09-12: was a flat .88/.92 veil, which was so nearly opaque that the
     machine the band exists to show had disappeared. Measured the rendered
     pixels behind every text run at 414px: at .84/.74/.80 the weakest text
     (the 13px breadcrumb) still sits at 7.6:1 — past AAA — and the tractor
     and horizon come back. */
  .nel-cat-head.has-photo .nel-bh-scrim{
    background:linear-gradient(to bottom, rgba(10,10,10,.84) 0%,
      rgba(10,10,10,.74) 55%, rgba(10,10,10,.80) 100%);}
}
