/* ════════════════════════════════════════════════════════════════
   TOKENS.CSS — single source of truth (migration work order item 4)
   Imported FIRST via additional.css. No token may be re-declared
   in any other stylesheet. Legacy token names are aliased below
   and will be removed once component files are refactored.
   ════════════════════════════════════════════════════════════════ */
:root {
  /* ── Layout ── */
  --rf-container: 1600px;
  --rf-px: 24px;
  --rf-utility-h: 0px;           /* JS sets via offsetHeight when a utility bar exists */

  /* ── Radii ── */
  --card-r: 14px;
  --btn-r: 9px;
  --pill: 999px;

  /* ── Brand colour — ONE blue ── */
  --brand-blue:   #0066cc; /* AA 4.5:1 with white text (was the old blue at ~4.0:1) */
  --brand-blue-d: #005bb5;
  --brand-navy:   #1a2232;
  --brand-navy-2: #0d1320;
  --brand-sale:   #b8224b;
  --brand-green:  #1f7a3a;

  /* ── Text — AA-passing muted (#86868b body text is banned) ── */
  --ink: #1d1d1f;
  --t2:  #515154;
  --t3:  #6e6e73;                /* 4.6:1 on white — WCAG AA pass */

  /* ── One font stack ── */
  --font: 'InterVariable', 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, system-ui, sans-serif;

  /* ── Legacy aliases (do not use in new code) ── */
  --blue:     var(--brand-blue);
  --blue-d:   var(--brand-blue-d);
  --rf-blue:  var(--brand-blue);
  --rf-blue-d:var(--brand-blue-d);
  --mfx-blue: var(--brand-blue);
  --pgx-blue: var(--brand-blue);
  --mfx-ink:  var(--ink);
  --pgx-ink:  var(--ink);
  --mfx-card-r: var(--card-r);   /* was 18px — unified to 14px */
  --c-card-radius: var(--card-r);
  --rf-text-3: var(--t3);
  --rf-muted:  var(--t3);
  --c-text-4:  var(--t3);
}

/* ── Item 4: kill the 18px/14px card radius split ── */
.rfd-card, .card, .pdrawer { border-radius: var(--card-r) !important; }

/* ── Item 4: muted body text never #86868b ── */
.rfd-sub, .rfd-cdesc, .card-desc, .rf-cat-dhead-hint,
.pdrawer__highlight-sub, .pdrawer__delivery-sub,
.rfd-dcount, .pg-bc, .rpf-sub {
  color: var(--t3) !important;
}

/* ════════════════════════════════════════════════════════════════
   ITEM 5 — SKIP LINK (.rf-skip injected first-in-body by rf-shared.js)
   ════════════════════════════════════════════════════════════════ */
.rf-skip {
  position: absolute;
  top: -100%;
  left: 50%;
  transform: translateX(-50%);
  background: var(--brand-blue);
  color: #fff;
  padding: 10px 22px;
  border-radius: 0 0 10px 10px;
  font: 600 13.5px var(--font);
  z-index: 100001;
  text-decoration: none;
  transition: top 160ms ease;
}
.rf-skip:focus { top: 0; outline: none; }

.rf-visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}

/* ════════════════════════════════════════════════════════════════
   UNIFIED FILTER COMPONENT — .rf-filter-bar / .rf-filter-pill
   Single definition; all page-specific filter variants must alias
   these tokens or use these classes directly (no page forks).
   ════════════════════════════════════════════════════════════════ */
:root {
  --filter-h:      36px;
  --filter-pill-h: 32px;
  --filter-r:      999px;           /* full pill */
  --filter-bg:     #ececee;
  --filter-active: var(--brand-blue);
  --filter-font:   13px;
}

/* canonical bar wrapper */
.rf-filter-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  background: var(--filter-bg);
  border-radius: var(--filter-r);
  padding: 3px;
  overflow-x: auto;
  scrollbar-width: none;
  flex-wrap: nowrap;
}
.rf-filter-bar::-webkit-scrollbar { display: none; }

/* canonical pill button */
.rf-filter-pill {
  flex: 0 0 auto;
  height: var(--filter-pill-h);
  padding: 0 15px;
  border-radius: var(--filter-r);
  border: none;
  background: transparent;
  font: inherit;
  font-size: var(--filter-font);
  font-weight: 500;
  color: var(--t2);
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms, color 150ms, box-shadow 150ms;
}
.rf-filter-pill:hover { color: var(--ink); }
.rf-filter-pill[aria-selected="true"],
.rf-filter-pill.active {
  background: #fff;
  color: var(--filter-active);
  font-weight: 700;
  box-shadow: 0 1px 4px rgba(0,0,0,0.10), 0 0 0 1px rgba(0,0,0,0.04);
}
.rf-filter-pill:focus-visible {
  outline: 2.5px solid var(--brand-blue);
  outline-offset: 2px;
}

/* ── alias existing tab/chip/pill classes → canonical vars ── */
/* Parts Finder rpf-tabs already uses matching CSS — alias radii + colours */
.rpf-tabs  { background: var(--filter-bg); }
.rpf-tab   { height: var(--filter-pill-h); font-size: var(--filter-font); }
.rpf-tab.active { color: var(--filter-active); }

/* Shop filter chips */
.rpf-chip  { height: 28px; border-radius: var(--filter-r); }
.rpf-chip.active { background: var(--ink); border-color: var(--ink); }

/* Shop page dd-btn pills */
.rfd-tab   { border-radius: var(--filter-r) !important; }

/* ════════════════════════════════════════════════════════════════
   ITEM 19 — header blur: 12px on mobile + compositing hint
   ════════════════════════════════════════════════════════════════ */
.sh { will-change: transform; }
@media (max-width: 768px) {
  .sh-inner {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
  }
}

/* ════════════════════════════════════════════════════════════════
   ITEM 2 — MOBILE HAMBURGER + SLIDE-IN NAV DRAWER (≤768px)
   Markup injected by rf-shared.js. Desktop nav hidden at ≤768px.
   ════════════════════════════════════════════════════════════════ */
.sh-hamburger {
  display: none;
  width: 44px; height: 44px;
  border: none; background: none;
  cursor: pointer;
  align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--ink);
  border-radius: 10px;
  margin-left: 4px;
}
.sh-hamburger:focus-visible { outline: 2.5px solid var(--brand-blue); outline-offset: 2px; }
.sh-hamburger svg { width: 22px; height: 22px; stroke: currentColor; stroke-width: 2; }

@media (max-width: 768px) {
  .sh-nav, .sh-search { display: none !important; }
  .sh-hamburger { display: inline-flex; }
  .sh-acts .sh-icon[title="Track Order"],
  .sh-acts a[href="contact.html"].sh-icon { display: none; }
}

.sh-mdrawer-overlay {
  position: fixed; inset: 0;
  background: rgba(13,19,32,0.45);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 100000;
  opacity: 0;
  transition: opacity 240ms ease;
  pointer-events: none;
}
.sh-mdrawer-overlay.on { opacity: 1; pointer-events: auto; }

.sh-mdrawer {
  position: fixed; top: 0; right: 0; bottom: 0;
  width: min(360px, 92vw);
  background: #fff;
  z-index: 100001;
  transform: translateX(102%);
  transition: transform 300ms cubic-bezier(0.2, 0.9, 0.2, 1);
  display: flex; flex-direction: column;
  box-shadow: -18px 0 60px rgba(0,0,0,0.18);
  font-family: var(--font);
}
.sh-mdrawer.on { transform: translateX(0); }

.sh-mdrawer__hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px 18px 14px;
  border-bottom: 1px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
}
.sh-mdrawer__logo { font: 700 18px var(--font); letter-spacing: -0.04em; color: var(--ink); text-decoration: none; }
.sh-mdrawer__logo span { color: var(--brand-blue); }
.sh-mdrawer__close {
  width: 44px; height: 44px;
  border: none; background: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--ink); border-radius: 10px;
}
.sh-mdrawer__close:focus-visible { outline: 2.5px solid var(--brand-blue); outline-offset: 2px; }
.sh-mdrawer__close svg { width: 18px; height: 18px; stroke-width: 2.4; }

.sh-mdrawer__search {
  margin: 14px 18px 4px;
  height: 44px;
  border: 1px solid rgba(0,0,0,0.14);
  border-radius: 10px;
  display: flex; align-items: center; gap: 8px;
  padding: 0 12px;
  flex-shrink: 0;
}
.sh-mdrawer__search:focus-within { border-color: var(--brand-blue); box-shadow: 0 0 0 3px rgba(0,102,204,0.14); }
.sh-mdrawer__search svg { width: 16px; height: 16px; stroke: var(--t3); flex-shrink: 0; }
.sh-mdrawer__search input { border: none; background: none; outline: none; flex: 1; font: 14px var(--font); color: var(--ink); min-width: 0; }

.sh-mdrawer__body { flex: 1; overflow-y: auto; padding: 8px 0 16px; }

.sh-mdrawer__acc-btn {
  width: 100%;
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px;
  padding: 0 18px;
  border: none; background: none; cursor: pointer;
  font: 600 15px var(--font);
  letter-spacing: -0.015em;
  color: var(--ink);
  text-align: left;
}
.sh-mdrawer__acc-btn:focus-visible { outline: 2.5px solid var(--brand-blue); outline-offset: -3px; border-radius: 8px; }
.sh-mdrawer__acc-btn svg { width: 14px; height: 14px; stroke-width: 2.6; transition: transform 220ms ease; opacity: 0.5; }
.sh-mdrawer__acc-btn[aria-expanded="true"] svg { transform: rotate(180deg); opacity: 1; }
.sh-mdrawer__acc-body {
  display: none;
  flex-direction: column;
  padding: 2px 0 8px;
  background: #f8f8fa;
}
.sh-mdrawer__acc-body.on { display: flex; }
.sh-mdrawer__sub {
  display: flex; align-items: center;
  min-height: 44px;
  padding: 0 18px 0 30px;
  font: 500 14px var(--font);
  color: var(--t2);
  text-decoration: none;
}
.sh-mdrawer__sub:hover, .sh-mdrawer__sub:focus-visible { color: var(--brand-blue); }

.sh-mdrawer__link {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 48px;
  padding: 0 18px;
  font: 600 15px var(--font);
  letter-spacing: -0.015em;
  color: var(--ink);
  text-decoration: none;
}
.sh-mdrawer__link:focus-visible { outline: 2.5px solid var(--brand-blue); outline-offset: -3px; border-radius: 8px; }
.sh-mdrawer__link small { font: 500 11px var(--font); color: var(--t3); }
.sh-mdrawer__sep { height: 1px; background: rgba(0,0,0,0.07); margin: 8px 18px; }

.sh-mdrawer__cta {
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
  margin: 10px 18px 0;
  min-height: 48px;
  border-radius: 12px;
  background: var(--brand-blue);
  color: #fff;
  font: 600 14.5px var(--font);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 160ms;
}
.sh-mdrawer__cta:hover { background: var(--brand-blue-d); }
.sh-mdrawer__foot {
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(0,0,0,0.08);
  flex-shrink: 0;
}

/* ════════════════════════════════════════════════════════════════
   ITEM 3 — COOKIE CONSENT BANNER (POPIA / GDPR, Consent Mode v2)
   Markup injected by rf-shared.js. Nothing fires pre-consent.
   ════════════════════════════════════════════════════════════════ */
.rf-consent {
  position: fixed;
  left: 16px; right: 16px;
  bottom: 16px;
  z-index: 100002;
  max-width: 720px;
  margin: 0 auto;
  background: #fff;
  border: 1px solid rgba(0,0,0,0.1);
  border-radius: 16px;
  box-shadow: 0 18px 60px -12px rgba(13,19,32,0.3), 0 4px 14px rgba(0,0,0,0.08);
  padding: 18px 20px;
  font-family: var(--font);
  display: flex;
  gap: 18px;
  align-items: center;
  flex-wrap: wrap;
  transform: translateY(calc(100% + 32px));
  transition: transform 380ms cubic-bezier(0.2, 0.9, 0.2, 1);
}
.rf-consent.on { transform: translateY(0); }
.rf-consent__txt { flex: 1 1 320px; min-width: 0; }
.rf-consent__h { font-size: 14px; font-weight: 700; letter-spacing: -0.01em; color: var(--ink); margin: 0 0 3px; }
.rf-consent__p { font-size: 12.5px; line-height: 1.5; color: var(--t2); margin: 0; }
.rf-consent__p a { color: var(--brand-blue); text-decoration: none; }
.rf-consent__p a:hover { text-decoration: underline; }
.rf-consent__acts { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; }
.rf-consent__btn {
  min-height: 40px;
  padding: 0 18px;
  border-radius: 10px;
  font: 600 13px var(--font);
  cursor: pointer;
  transition: background 150ms, color 150ms, border-color 150ms;
}
.rf-consent__btn--accept { background: var(--brand-blue); color: #fff; border: 1px solid var(--brand-blue); }
.rf-consent__btn--accept:hover { background: var(--brand-blue-d); }
.rf-consent__btn--essential { background: #fff; color: var(--ink); border: 1px solid rgba(0,0,0,0.2); }
.rf-consent__btn--essential:hover { border-color: var(--ink); }
.rf-consent__btn:focus-visible { outline: 2.5px solid var(--brand-blue); outline-offset: 2px; }

/* ════════════════════════════════════════════════════════════════
   ITEM 6 — focus visibility on nav triggers
   ════════════════════════════════════════════════════════════════ */
.sh-nav-btn:focus-visible,
.sh-icon:focus-visible {
  outline: 2.5px solid var(--brand-blue);
  outline-offset: 3px;
  border-radius: 8px;
}

/* ════════════════════════════════════════════════════════════════
   ITEM 12 — shop page additions (trust strip · promo insert · CTA band)
   ════════════════════════════════════════════════════════════════ */
.shop-trust {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  margin: 18px 0 6px;
  padding: 14px 18px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--card-r);
  background: #f8f8fa;
}
.shop-trust__item {
  display: inline-flex; align-items: center; gap: 9px;
  font: 600 12.5px var(--font);
  color: var(--ink);
  flex: 1 1 auto;
  justify-content: center;
  min-width: 0;
}
.shop-trust__item svg { width: 17px; height: 17px; stroke: var(--brand-blue); stroke-width: 2; flex-shrink: 0; }
.shop-trust__item small { font-weight: 500; color: var(--t3); }
@media (max-width: 768px) {
  .shop-trust { gap: 12px; }
  .shop-trust__item { flex: 1 1 40%; justify-content: flex-start; }
}

.shop-promo-insert {
  display: flex; align-items: center; justify-content: space-between;
  gap: 22px; flex-wrap: wrap;
  margin: 26px 0 8px;
  padding: 26px 28px;
  border-radius: var(--card-r);
  background: linear-gradient(135deg, var(--brand-navy) 0%, var(--brand-navy-2) 70%);
  color: #fff;
  position: relative;
  overflow: hidden;
}
.shop-promo-insert::after {
  content: '';
  position: absolute; inset: auto -10% -70% 40%;
  height: 130%;
  background: radial-gradient(ellipse, rgba(0,102,204,0.32), transparent 68%);
  pointer-events: none;
}
.shop-promo-insert > * { position: relative; z-index: 2; }
.shop-promo-insert__ey { font: 700 10.5px var(--font); letter-spacing: 0.14em; text-transform: uppercase; color: #4da3ff; margin: 0 0 8px; }
.shop-promo-insert__h { font: 700 clamp(19px, 2.4vw, 26px)/1.15 var(--font); letter-spacing: -0.03em; margin: 0 0 6px; }
.shop-promo-insert__p { font: 400 13.5px/1.5 var(--font); color: rgba(255,255,255,0.65); margin: 0; max-width: 520px; }
.shop-promo-insert__cta {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 24px;
  border-radius: var(--pill);
  background: #fff; color: var(--ink);
  font: 600 13.5px var(--font);
  text-decoration: none;
  flex-shrink: 0;
  transition: background 160ms, color 160ms;
}
.shop-promo-insert__cta:hover { background: var(--brand-blue); color: #fff; }

.shop-cta-band {
  display: flex; align-items: center; justify-content: space-between;
  gap: 20px; flex-wrap: wrap;
  margin: 34px 0 8px;
  padding: 28px 30px;
  border: 1px solid rgba(0,0,0,0.08);
  border-radius: var(--card-r);
  background: #f8f8fa;
}
.shop-cta-band__h { font: 700 clamp(18px, 2.2vw, 24px)/1.2 var(--font); letter-spacing: -0.03em; color: var(--ink); margin: 0 0 4px; }
.shop-cta-band__p { font: 400 13.5px/1.5 var(--font); color: var(--t2); margin: 0; }
.shop-cta-band__acts { display: flex; gap: 10px; flex-shrink: 0; flex-wrap: wrap; }
.shop-cta-band__btn {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 22px;
  border-radius: var(--pill);
  font: 600 13.5px var(--font);
  text-decoration: none;
  transition: background 160ms, color 160ms, border-color 160ms;
}
.shop-cta-band__btn--primary { background: var(--brand-blue); color: #fff; border: 1px solid var(--brand-blue); }
.shop-cta-band__btn--primary:hover { background: var(--brand-blue-d); }
.shop-cta-band__btn--ghost { background: #fff; color: var(--ink); border: 1px solid rgba(0,0,0,0.2); }
.shop-cta-band__btn--ghost:hover { border-color: var(--brand-blue); color: var(--brand-blue); }

/* ════════════════════════════════════════════════════════════════
   ITEM 14 — Machine Finder breadcrumb + back-to-shop CTA
   ════════════════════════════════════════════════════════════════ */
.mf-bc {
  max-width: 1100px; margin: 0 auto;
  padding: 18px 24px 0;
  font: 500 12.5px var(--font);
  color: var(--t3);
  display: flex; align-items: center; gap: 8px;
}
.mf-bc a { color: var(--t3); text-decoration: none; transition: color 140ms; }
.mf-bc a:hover { color: var(--brand-blue); }
.mf-bc-sep { color: rgba(0,0,0,0.25); }
.mf-back-shop {
  display: inline-flex; align-items: center; gap: 7px;
  min-height: 44px; padding: 0 22px;
  border-radius: var(--pill);
  border: 1px solid rgba(0,0,0,0.2);
  background: #fff; color: var(--ink);
  font: 600 13.5px var(--font);
  text-decoration: none;
  transition: border-color 150ms, color 150ms;
}
.mf-back-shop:hover { border-color: var(--brand-blue); color: var(--brand-blue); }

