/*
 * The two-row website header (components/site-header.php). Colours: Admin → Settings → Branding through /theme.css
 * (--theme-*; Helpers\Theme), falling back to the variables.css tokens when the settings are unavailable. No colour is
 * written here: only those tokens, the neutral surface/text/border tokens, and transparency mixes of them.
 * Layout follows the approved reference (design-references/hiklass-two-row-header.png). Loaded after site-responsive.css.
 */
.site-header, .search-dialog {
  --hdr-primary: var(--tk-header-bg, var(--theme-primary, var(--brand-primary)));
  --hdr-on-primary: var(--tk-header-text, var(--theme-on-primary, var(--text-inverse)));
  --hdr-secondary: var(--theme-secondary, var(--brand-accent));
  --hdr-on-secondary: var(--theme-on-secondary, var(--text-inverse));
  --hdr-secondary-text: var(--theme-secondary-text, var(--brand-accent));
  --hdr-accent: var(--tk-header-cta, var(--theme-accent, var(--brand-secondary)));
  /* White on the accent (Get a Quote, the search grid button, the basket count), as the owner asked (2026-11-08/09). With #FF4A17
     text is 3.4:1, below WCAG AA 4.5:1 for this size: a documented exception (two-row-header.md §12b3, §12d). */
  --hdr-on-accent: var(--tk-header-cta-text, var(--text-inverse));
  --hdr-surface: var(--bg-surface);
  --hdr-divider-dark: color-mix(in srgb, var(--hdr-on-primary) 28%, transparent);
  /* Row two: the Branding primary colour at 67 % alpha (owner, 2026-11-08: back from 90 %). A colour with alpha,
     never `opacity`, so the logo, text and buttons stay fully opaque. */
  --hdr-main-bg: var(--tk-nav-bg, color-mix(in srgb, var(--hdr-primary) 67%, transparent));
  --utility-h: 0px;
  --main-h: 4rem;
}
.site-header {
  /* Row one scrolls away; row two stays at the top of the window. */
  position: sticky; top: calc(-1 * var(--utility-h)); z-index: 30;
  background: transparent;
  box-shadow: 0 10px 24px -14px color-mix(in srgb, var(--text-primary) 45%, transparent);
}
.site-header.has-news { --utility-h: 2.75rem; }
:where(body.site) [id] { scroll-margin-top: 5.5rem; }
.site-header :focus-visible { outline: 2px solid var(--hdr-secondary-text); outline-offset: 2px; }
.header-utility :focus-visible { outline-color: var(--hdr-on-primary); }

/* ---------- row one: utility ---------- */
.header-utility { display: none; overflow-x: clip; overflow-y: visible; background: var(--hdr-primary); color: var(--hdr-on-primary); }
.site-header.has-news .header-utility { display: block; }
.header-utility-bar { display: flex; align-items: center; gap: 0.75rem; height: var(--utility-h); }
.header-search, .header-quote, .header-basket { display: none; }

/* What's New: label + a compact ticker. The announcements scroll right to left without stopping (site.js moves the
   track; presentation-only copies after the real list make the loop seamless). Without JavaScript, or with reduced
   motion, the list stands still and scrolls sideways by hand. */
.whats-new { display: flex; align-items: center; flex: 1 1 auto; min-width: 0; height: 100%; --ticker-speed: 60; }
.whats-new-label {
  position: relative; display: inline-flex; align-items: center; flex-shrink: 0; gap: 0.5rem; height: 100%;
  padding: 0 1.25rem 0 0; margin-right: 1rem; background: var(--hdr-secondary); color: var(--hdr-on-secondary);
  font-family: var(--font-heading); font-size: var(--text-small); font-weight: 600; white-space: nowrap;
}
/* The label's band reaches the window edge and ends in the reference's slanted cut. */
.whats-new-label::before { content: ""; position: absolute; top: 0; bottom: 0; right: 100%; width: 100vw; background: inherit; }
.whats-new-label::after { content: ""; position: absolute; top: 0; bottom: 0; left: 100%; width: 1rem; background: inherit; clip-path: polygon(0 0, 100% 0, 0 100%); }
.whats-new-label .icon { width: 1.25rem; height: 1.25rem; }
.whats-new-label-text { display: none; }
.whats-new-viewport { position: relative; flex: 1 1 auto; min-width: 0; height: 100%; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.whats-new-viewport::-webkit-scrollbar { display: none; }
.whats-new.is-ticking .whats-new-viewport { overflow: hidden; }
.whats-new-track { display: flex; align-items: center; width: max-content; height: 100%; margin: 0; padding: 0; list-style: none; white-space: nowrap; }
.whats-new.is-ticking .whats-new-track { will-change: transform; }
.whats-new-item { display: flex; align-items: center; flex-shrink: 0; height: 100%; font-size: var(--text-small); font-weight: 600; }
/* A small dot after every message (also after the last, so each copy of the list has the same width). */
.whats-new-item::after { content: ""; flex-shrink: 0; width: 0.3125rem; height: 0.3125rem; margin: 0 1.25rem; border-radius: 50%; background: currentColor; opacity: 0.55; }
.whats-new-link, .whats-new-text { color: inherit; text-decoration: none; }
.whats-new-link { display: inline-flex; align-items: center; gap: 0.375rem; min-height: 2rem; border-radius: var(--radius-sm); }
.whats-new-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.whats-new-link:focus-visible { outline: 2px solid var(--hdr-on-primary); outline-offset: 2px; }
.whats-new-icon { display: inline-flex; flex-shrink: 0; opacity: 0.85; }
.whats-new-icon .icon { width: 0.875rem; height: 0.875rem; }
.whats-new-more { font-weight: 500; text-decoration: underline; text-underline-offset: 3px; }

/* Search (smart search, 2026-11-08): grid scope button · field · voice · image · Search, all in one pill. The accent
   and white come from the theme tokens above; the field is the neutral surface. The autocomplete panel drops below. */
.header-search { position: relative; flex: 1 1 24rem; min-width: 18rem; max-width: 44rem; height: 2.5rem; }
.smart-search-field { position: relative; display: flex; align-items: center; width: 100%; height: 100%; border-radius: 999px; background: var(--hdr-surface); box-shadow: 0 0 0 3px color-mix(in srgb, var(--hdr-on-primary) 14%, transparent); }
.smart-search-scope { position: relative; align-self: stretch; display: flex; }
.smart-search-scope-button {
  display: inline-flex; align-items: center; justify-content: center; width: 3.5rem; padding: 0 0.875rem 0 0.375rem; border: 0; border-radius: 999px 0 0 999px;
  background: var(--hdr-accent); color: var(--hdr-on-accent); cursor: pointer;
}
.smart-search-scope-button .icon { width: 1.25rem; height: 1.25rem; }
.smart-search-scope-button:hover { background: color-mix(in srgb, var(--hdr-accent) 85%, var(--text-primary)); }
.smart-search.is-scoped .smart-search-scope-button { box-shadow: inset 0 -3px 0 var(--hdr-on-accent); }
.smart-search-field input {
  position: relative; flex: 1; min-width: 0; height: 100%; margin-left: -0.75rem; padding: 0 0.75rem 0 1rem; border: 0; border-radius: 999px 0 0 999px;
  background: var(--hdr-surface); color: var(--text-primary); font-size: var(--text-small);
}
.smart-search-field input::placeholder { color: var(--text-muted); }
.smart-search-field input:focus-visible { outline: none; }
.smart-search-field:focus-within { box-shadow: 0 0 0 3px var(--hdr-on-primary); }
.smart-search-field input::-webkit-search-cancel-button { cursor: pointer; }
.smart-search-tools { display: flex; align-items: center; flex-shrink: 0; gap: 0.125rem; padding: 0 0.375rem; border-left: 1px solid var(--border-default); }
.smart-search-tool {
  display: inline-flex; align-items: center; justify-content: center; width: 2rem; height: 2rem; border: 0; border-radius: 999px;
  background: transparent; color: var(--hdr-primary); cursor: pointer;
}
.smart-search-tool[hidden] { display: none; }
.smart-search-tool .icon { width: 1.25rem; height: 1.25rem; }
.smart-search-tool:hover { background: var(--bg-muted); }
.smart-search-tool:focus-visible, .smart-search-scope-button:focus-visible { outline: 2px solid var(--hdr-secondary-text); outline-offset: -2px; }
.smart-search-tool[aria-disabled="true"] { opacity: 0.45; cursor: not-allowed; }
.smart-search.is-listening [data-voice] { background: color-mix(in srgb, var(--hdr-accent) 16%, transparent); color: var(--hdr-accent); animation: search-listen 1.2s ease-in-out infinite; }
@keyframes search-listen { 50% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--hdr-accent) 25%, transparent); } }
.header-search-button {
  display: inline-flex; align-items: center; gap: 0.5rem; flex-shrink: 0; height: calc(100% - 6px); margin-right: 3px; padding: 0 1.125rem; border: 0; border-radius: 999px;
  background: var(--hdr-secondary); color: var(--hdr-on-secondary); font-size: var(--text-small); font-weight: 600; cursor: pointer;   /* owner 2026-11-09: blue (Branding secondary), was accent */
}
.header-search-button:hover { background: color-mix(in srgb, var(--hdr-secondary) 88%, var(--hdr-on-secondary)); }
.header-search-button:focus-visible { outline: 2px solid var(--hdr-secondary-text); outline-offset: 2px; }
.header-search-button .icon { width: 1.125rem; height: 1.125rem; }
[data-header-search][aria-busy="true"] button[type="submit"] .icon { animation: header-spin 0.9s linear infinite; }
@keyframes header-spin { to { transform: rotate(360deg); } }
.header-search-hint {
  position: absolute; top: calc(100% + 0.5rem); left: 1rem; z-index: 46; margin: 0; padding: 0.375rem 0.625rem; border-radius: var(--radius-sm);
  background: var(--hdr-surface); color: var(--text-primary); font-size: var(--text-caption); font-weight: 500; box-shadow: var(--shadow-lg); max-width: calc(100% - 2rem);
}
.header-search-hint:empty { display: none; }
.smart-search:has([aria-invalid="true"]) .header-search-hint { color: var(--state-error-text); }

/* Scope menu (grid button) */
.smart-search-scopes {
  position: absolute; top: calc(100% + 0.5rem); left: 0; z-index: 47; min-width: 12rem; margin: 0; padding: 0.375rem; list-style: none;
  border-radius: var(--radius-lg); background: var(--hdr-surface); box-shadow: var(--shadow-lg);
}
.smart-search-scopes[hidden] { display: none; }
.smart-search-scopes button {
  display: flex; align-items: center; gap: 0.5rem; width: 100%; min-height: 2.5rem; padding: 0 0.75rem; border: 0; border-radius: var(--radius-sm);
  background: transparent; color: var(--text-primary); font-size: var(--text-small); text-align: left; cursor: pointer;
}
.smart-search-scopes button:hover, .smart-search-scopes button:focus-visible { background: var(--bg-muted); outline: none; }
.smart-search-scopes button:focus-visible { box-shadow: inset 0 0 0 2px var(--hdr-secondary-text); }
.smart-search-scopes .icon { width: 1rem; height: 1rem; color: var(--hdr-secondary-text); visibility: hidden; }
.smart-search-scopes [aria-checked="true"] { font-weight: 600; }
.smart-search-scopes [aria-checked="true"] .icon { visibility: visible; }

/* Autocomplete panel */
.smart-search-panel {
  position: absolute; top: calc(100% + 0.5rem); left: 0; z-index: 45; width: max(100%, 30rem); max-width: calc(100vw - 2rem); max-height: min(70vh, 36rem);
  overflow-y: auto; overscroll-behavior: contain; border-radius: var(--radius-lg); background: var(--hdr-surface); color: var(--text-primary); box-shadow: var(--shadow-lg);
}
.smart-search-panel[hidden] { display: none; }
.smart-search-results:empty { display: none; }
.smart-search-results { padding: 0.375rem; }
.smart-search-group + .smart-search-group { margin-top: 0.25rem; padding-top: 0.25rem; border-top: 1px solid var(--border-default); }
.smart-search-group-label { display: flex; align-items: center; gap: 0.5rem; margin: 0; padding: 0.5rem 0.75rem 0.25rem; color: var(--text-muted); font-size: var(--text-caption); font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; }
.smart-search-group-label span { padding: 0 0.375rem; border-radius: 999px; background: var(--bg-muted); letter-spacing: 0; }
.smart-search-option { display: flex; align-items: center; gap: 0.75rem; min-height: 2.75rem; padding: 0.5rem 0.75rem; border-radius: var(--radius); cursor: pointer; }
.smart-search-option.is-active { background: var(--bg-muted); box-shadow: inset 3px 0 0 var(--hdr-secondary); }
.smart-search-thumb { flex-shrink: 0; width: 3rem; height: 3rem; border-radius: var(--radius); object-fit: cover; background: var(--bg-muted); }
.smart-search-thumb-icon { display: inline-flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--hdr-secondary) 10%, transparent); color: var(--hdr-secondary-text); }
.smart-search-thumb-icon .icon { width: 1.25rem; height: 1.25rem; }
.smart-search-text { display: flex; flex-direction: column; min-width: 0; gap: 0.0625rem; }
.smart-search-title { overflow: hidden; color: var(--text-primary); font-size: var(--text-small); font-weight: 600; text-overflow: ellipsis; white-space: nowrap; }
.smart-search-category { color: var(--hdr-secondary-text); font-size: var(--text-caption); font-weight: 500; }
.smart-search-similarity { color: var(--text-secondary); font-weight: 600; }
.smart-search-description { display: -webkit-box; overflow: hidden; color: var(--text-muted); font-size: var(--text-caption); -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; }
.smart-search-option mark { padding: 0; border-radius: 2px; background: color-mix(in srgb, var(--hdr-accent) 18%, transparent); color: var(--text-primary); }
.smart-search-more, .smart-search-all { gap: 0.5rem; min-height: 2.5rem; color: var(--hdr-secondary-text); font-size: var(--text-small); font-weight: 600; }
.smart-search-more .icon, .smart-search-all .icon { width: 1rem; height: 1rem; }
.smart-search-all { margin-top: 0.25rem; border-top: 1px solid var(--border-default); border-radius: 0 0 var(--radius) var(--radius); }
.smart-search-empty { padding: 1rem 1.125rem 1.125rem; }
.smart-search-empty[hidden], .smart-search-error[hidden] { display: none; }
.smart-search-empty-title { display: flex; align-items: flex-start; gap: 0.5rem; margin: 0 0 0.75rem; color: var(--text-primary); font-weight: 600; }
.smart-search-empty-title .icon { flex-shrink: 0; width: 1.125rem; height: 1.125rem; margin-top: 0.125rem; color: var(--text-muted); }
.smart-search-empty-actions { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.smart-search-browse-label { margin: 1rem 0 0.25rem; color: var(--text-muted); font-size: var(--text-caption); font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; }
.smart-search-browse { display: flex; flex-wrap: wrap; gap: 0.25rem 1rem; margin: 0; padding: 0; list-style: none; }
.smart-search-browse a { display: inline-flex; align-items: center; min-height: 2.25rem; color: var(--hdr-secondary-text); font-size: var(--text-small); font-weight: 500; }
.smart-search-error { margin: 0; padding: 1rem 1.125rem; color: var(--text-secondary); font-size: var(--text-small); }

/* Image panel (only where image search can be tried) */
.smart-search-image {
  position: absolute; top: calc(100% + 0.5rem); right: 0; z-index: 45; display: flex; flex-direction: column; align-items: flex-start; gap: 0.625rem;
  width: min(22rem, calc(100vw - 2rem)); padding: 1rem; border-radius: var(--radius-lg); background: var(--hdr-surface); color: var(--text-primary); box-shadow: var(--shadow-lg);
}
.smart-search-image[hidden] { display: none; }
.smart-search-image p { margin: 0; }
.smart-search-image-title { font-weight: 600; }
.smart-search-image-note, .smart-search-image-why { color: var(--text-muted); font-size: var(--text-caption); }
.smart-search-file { position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none; }
.smart-search-file:focus-visible + label { outline: 2px solid var(--hdr-secondary-text); outline-offset: 2px; }
.smart-search-image-error { color: var(--state-error-text); font-size: var(--text-caption); font-weight: 500; }
.smart-search-image-error:empty { display: none; }
.smart-search-image-preview { margin: 0; }
.smart-search-image-preview[hidden] { display: none; }
.smart-search-image-preview img { display: block; min-width: 5rem; min-height: 5rem; max-width: 100%; max-height: 10rem; border-radius: var(--radius); object-fit: contain; background: var(--bg-muted); }
.smart-search-image-preview figcaption { margin-top: 0.25rem; color: var(--text-muted); font-size: var(--text-caption); overflow-wrap: anywhere; }
.smart-search-image-actions { display: flex; gap: 0.5rem; }

/* Get a Quote: filled pill in the Branding accent colour with white text (owner, 2026-11-08) */
.header-quote {
  align-items: center; flex-shrink: 0; gap: 0.5rem; height: 2.375rem; padding: 0 1.125rem; border: 2px solid var(--hdr-accent); border-radius: 999px;
  background: var(--hdr-accent); color: var(--hdr-on-accent); font-size: var(--text-small); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.header-quote:hover { background: var(--tk-header-cta-hover, color-mix(in srgb, var(--hdr-accent) 85%, var(--text-primary))); border-color: var(--tk-header-cta-hover, var(--hdr-accent)); color: var(--hdr-on-accent); text-decoration: none; }
.header-quote .icon { width: 1.125rem; height: 1.125rem; }

/* Client Login (2026-11-16): after the basket, for agency clients (→ /clogin). An outlined pill in the header's own
   colours, so it reads as a secondary action next to the filled Get a Quote; it fills softly on hover. */
.header-client-login {
  display: none; position: relative; align-items: center; flex-shrink: 0; gap: 0.5rem; height: 2.375rem; padding: 0 1rem;
  border: 2px solid color-mix(in srgb, var(--hdr-on-primary) 55%, transparent); border-radius: 999px; background: transparent;
  color: var(--hdr-on-primary); font-size: var(--text-small); font-weight: 600; text-decoration: none; white-space: nowrap;
  transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}
.header-client-login:hover { background: color-mix(in srgb, var(--hdr-on-primary) 14%, transparent); border-color: var(--hdr-on-primary); color: var(--hdr-on-primary); text-decoration: none; }
.header-client-login:focus-visible { outline: 3px solid var(--hdr-on-primary); outline-offset: 2px; }
.header-client-login[aria-current="page"] { border-color: var(--hdr-on-primary); background: color-mix(in srgb, var(--hdr-on-primary) 14%, transparent); }
.header-client-login .icon { width: 1.125rem; height: 1.125rem; }

/* Basket with its count badge */
/* Basket (2026-11-09): [subtotal] [icon + count] as one link. The subtotal and count come from the API (HK.basket in
   site.js); the count is a circle in the Branding accent with white digits (owner, 2026-11-09: the same documented
   3.4:1 contrast exception as Get a Quote). */
.header-basket { position: relative; align-items: center; gap: 0.25rem; flex-shrink: 0; height: 2.75rem; padding: 0 0.125rem 0 0.25rem; border-radius: var(--radius); color: var(--hdr-on-primary); text-decoration: none; }
.header-basket:hover, .header-basket-compact:hover { text-decoration: none; }
.header-basket:hover .basket-total, .header-basket-compact:hover .basket-total { text-decoration: underline; text-underline-offset: 3px; }
.basket-total { color: var(--hdr-on-primary); font-size: var(--text-small); font-weight: 600; line-height: 1; white-space: nowrap; font-variant-numeric: tabular-nums; }
.header-basket[aria-busy="true"] .basket-total, .header-basket-compact[aria-busy="true"] .basket-total { opacity: 0.7; }
.basket-icon { position: relative; display: inline-flex; align-items: center; justify-content: center; flex-shrink: 0; width: 2.75rem; height: 2.75rem; }
.header-basket .basket-icon .icon { width: 1.75rem; height: 1.75rem; transition: transform 0.2s ease; }
.header-basket:hover .basket-icon .icon { transform: scale(1.06); }
.basket-count {
  position: absolute; top: 0.0625rem; right: -0.0625rem; display: inline-flex; align-items: center; justify-content: center;
  width: 1.25rem; height: 1.25rem; padding: 0; border-radius: 50%;
  background: var(--hdr-accent); color: var(--hdr-on-accent); font-size: var(--text-overline); font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.basket-count.is-wide { font-size: 0.5625rem; letter-spacing: -0.02em; }   /* "99+" stays inside the circle */
/* The wishlist badge keeps the earlier header badge look (Branding secondary, hidden at zero). */
.wishlist-count {
  position: absolute; top: 0; right: -0.125rem; display: inline-flex; align-items: center; justify-content: center;
  min-width: 1.25rem; height: 1.25rem; padding: 0 0.3125rem; border-radius: 999px;
  background: var(--hdr-secondary); color: var(--hdr-on-secondary); font-size: var(--text-overline); font-weight: 700; line-height: 1;
  box-shadow: 0 0 0 2px var(--hdr-primary);
}
.wishlist-count[hidden] { display: none; }

/* Wishlist, just before the basket: the basket's size, colours and badge; a filled heart once something is saved. */
.header-wishlist {
  display: none; position: relative; align-items: center; justify-content: center; flex-shrink: 0; width: 2.75rem; height: 2.75rem;
  border-radius: var(--radius); color: var(--hdr-on-primary); text-decoration: none;
}
.header-wishlist .icon { width: 1.75rem; height: 1.75rem; transition: transform 0.2s ease; }
.header-wishlist:hover .icon, .header-wishlist:focus-visible .icon { transform: scale(1.12); }
.header-wishlist.has-items .icon, .header-wishlist-compact.has-items .icon { fill: currentColor; }
.header-wishlist-compact .wishlist-count { top: 0.125rem; right: 0.125rem; }
/* "My Wishlist" tooltip: on hover and keyboard focus; Escape hides it (WCAG 1.4.13). The link's name is its aria-label. */
.header-tip {
  position: absolute; top: calc(100% + 0.375rem); left: 50%; z-index: 60; padding: 0.25rem 0.5rem; border-radius: var(--radius-sm);
  background: var(--hdr-on-primary); color: var(--hdr-primary); font-size: var(--text-caption); font-weight: 600; line-height: 1.4; white-space: nowrap;
  transform: translateX(-50%); opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.15s ease;
}
.header-wishlist:hover .header-tip, .header-wishlist:focus-visible .header-tip { opacity: 1; visibility: visible; }
.header-wishlist.is-tip-dismissed .header-tip { opacity: 0; visibility: hidden; }

.header-divider { display: none; }

/* ---------- row two: logo, navigation, account ---------- */
.header-main { background: var(--hdr-main-bg); color: var(--hdr-on-primary); }
.header-main :focus-visible { outline-color: var(--hdr-on-primary); }
.header-main-bar { position: relative; display: flex; align-items: center; gap: 1rem; height: var(--main-h); }
.site-logo { display: inline-flex; align-items: center; flex-shrink: 0; }
.site-logo img { display: block; height: 2.25rem; width: auto; }

.desktop-nav { display: none; }
.desktop-nav > ul { display: flex; align-items: center; gap: 0.25rem; list-style: none; margin: 0; padding: 0; }
.desktop-nav-link {
  position: relative; display: inline-flex; align-items: center; gap: 0.25rem; height: var(--main-h); padding: 0 0.5rem;
  border: 0; background: transparent; color: var(--tk-nav-link, var(--hdr-on-primary));
  font-family: var(--font-heading); font-size: 0.9375rem; font-weight: 600; text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: color 0.15s ease;
}
.desktop-nav-link::after {
  content: ""; position: absolute; left: 0.5rem; right: 0.5rem; bottom: 0.75rem; height: 3px; border-radius: 999px;
  background: var(--hdr-secondary); transform: scaleX(0); transition: transform 0.2s ease;
}
.desktop-nav-link:hover, .desktop-nav-link[aria-expanded="true"] { color: var(--tk-nav-active, var(--tk-nav-link, var(--hdr-on-primary))); text-decoration: none; }
.desktop-nav-link:hover::after, .desktop-nav-link[aria-expanded="true"]::after { transform: scaleX(0.5); }
.desktop-nav-link.is-active { color: var(--tk-nav-active, var(--tk-nav-link, var(--hdr-on-primary))); }
.desktop-nav-link.is-active::after { transform: none; }
.desktop-nav-link:focus-visible { outline-offset: -0.75rem; }
.desktop-nav-link .chevron { width: 1rem; height: 1rem; color: inherit; transition: transform 0.3s ease; }
.desktop-nav-link[aria-expanded="true"] .chevron { transform: rotate(180deg); }

.header-account {
  display: none; align-items: center; flex-shrink: 0; gap: 0.625rem; height: 2.75rem; padding: 0 1.375rem; border-radius: 999px;
  background: var(--hdr-secondary); color: var(--hdr-on-secondary); font-family: var(--font-heading); font-size: 0.9375rem; font-weight: 600;
  text-decoration: none; white-space: nowrap;
}
.header-account:hover { background: color-mix(in srgb, var(--hdr-secondary) 88%, var(--hdr-on-secondary)); text-decoration: none; }
.header-account .icon { width: 1.375rem; height: 1.375rem; }

/* Compact actions below 1024 px: search, basket, quote, menu */
.header-compact-actions { display: flex; align-items: center; gap: 0.25rem; margin-left: auto; }
.header-icon-button {
  position: relative; display: inline-flex; align-items: center; justify-content: center; width: 2.75rem; height: 2.75rem;
  border: 0; border-radius: var(--radius); background: transparent; color: var(--hdr-on-primary); cursor: pointer;
}
.header-icon-button:hover { background: color-mix(in srgb, var(--hdr-on-primary) 12%, transparent); }
.header-icon-button .icon { width: 1.375rem; height: 1.375rem; }
.header-basket-compact { display: inline-flex; align-items: center; gap: 0.25rem; color: var(--hdr-on-primary); text-decoration: none; border-radius: var(--radius); }
.header-basket-compact .basket-total { display: none; }   /* shown from 560 px, where the compact row has room */
.header-basket-compact .basket-count { top: 0.125rem; right: 0.125rem; }
.header-quote-compact {
  display: none; align-items: center; gap: 0.375rem; height: 2.5rem; padding: 0 1rem; margin: 0 0.25rem; border-radius: 999px;
  background: var(--hdr-accent); color: var(--hdr-on-accent); font-size: var(--text-small); font-weight: 600; text-decoration: none; white-space: nowrap;
}
.header-quote-compact:hover { background: color-mix(in srgb, var(--hdr-accent) 85%, var(--text-primary)); color: var(--hdr-on-accent); text-decoration: none; }

/* ---------- mega menus (Services and Products share the markup) ---------- */
.mega { position: static; }
.mega-panel {
  position: absolute; top: 100%; left: 50%; transform: translateX(-50%); z-index: 40;
  width: min(94vw, 1100px); max-height: 70vh; overflow-y: auto; padding: 1.5rem;
  background: var(--hdr-surface); color: var(--text-primary);
  border: 1px solid var(--border-default); border-top: 3px solid var(--hdr-secondary); border-radius: 0 0 var(--radius) var(--radius); box-shadow: var(--shadow-lg);
}
.mega-head { display: flex; flex-direction: column; gap: 0.25rem; margin-bottom: 1.25rem; padding-bottom: 1rem; border-bottom: 1px solid var(--border-default); }
.mega-head h2 { font-family: var(--font-sans); font-size: var(--text-label); font-weight: 600; color: var(--text-primary); }
.mega-head p, .mega-empty { margin: 0; font-size: var(--text-caption); color: var(--text-muted); }
.mega-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem 1.5rem; }
.mega-category { display: flex; flex-direction: column; gap: 0.5rem; min-width: 0; }
.mega-category-link { display: flex; align-items: center; gap: 0.5rem; color: var(--text-primary); font-size: var(--text-label); font-weight: 600; text-decoration: none; }
.mega-category-link:hover { color: var(--hdr-secondary-text); text-decoration: none; }
.mega-icon { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 2rem; height: 2rem; border-radius: var(--radius); background: color-mix(in srgb, var(--hdr-secondary) 10%, transparent); color: var(--hdr-secondary-text); }
.mega-description { margin: 0; font-size: var(--text-caption); color: var(--text-muted); display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.mega-category ul { list-style: none; margin: 0.25rem 0 0; padding: 0; display: flex; flex-direction: column; gap: 0.25rem; }
.mega-category ul a { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 0.25rem 0.375rem; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: var(--text-small); text-decoration: none; }
.mega-category ul a:hover { background: var(--bg-muted); color: var(--hdr-secondary-text); }
.mega-panel :focus-visible { outline: 2px solid var(--hdr-secondary-text); outline-offset: 1px; }
.mega-foot { display: flex; justify-content: flex-end; margin-top: 1.5rem; padding-top: 1rem; border-top: 1px solid var(--border-default); }
.mega-foot a { display: inline-flex; align-items: center; gap: 0.375rem; font-size: var(--text-small); font-weight: 600; color: var(--hdr-secondary-text); text-decoration: none; }
.mega-foot a:hover { text-decoration: underline; }

/* ---------- mobile drawer and search dialog: theme colours on the shared drawer ---------- */
.mobile-nav-head { background: linear-gradient(to bottom right, var(--theme-primary, var(--brand-deep)), color-mix(in srgb, var(--theme-primary, var(--brand-primary)) 80%, var(--theme-secondary, var(--brand-accent)))); }
/* Smart search in the mobile search dialog: the same pill, full width; panels flow inside the dialog. */
.search-dialog { overflow: visible; }
.smart-search-dialog { position: relative; padding: 0.75rem; border-bottom: 1px solid var(--border-default); }
.smart-search-dialog .smart-search-field { height: 3rem; box-shadow: 0 0 0 1px var(--border-default); }
.smart-search-dialog .smart-search-field:focus-within { box-shadow: 0 0 0 2px var(--hdr-secondary-text); }
.smart-search-dialog .header-search-button span { display: none; }
.smart-search-dialog .header-search-button { padding: 0 0.875rem; }
.smart-search-row { display: flex; align-items: center; gap: 0.375rem; }
.smart-search-row .smart-search-field { flex: 1; min-width: 0; }
.smart-search-dialog .smart-search-close { flex-shrink: 0; }
.smart-search-dialog .smart-search-scope-button { width: 3rem; }
.smart-search-dialog .header-search-hint { position: static; margin: 0.5rem 0.25rem 0; padding: 0; box-shadow: none; max-width: none; }
.smart-search-dialog .smart-search-panel, .smart-search-dialog .smart-search-image { position: static; width: auto; max-width: none; max-height: 55vh; margin-top: 0.75rem; box-shadow: 0 0 0 1px var(--border-default); }
.smart-search-dialog .smart-search-scopes { top: calc(100% + 0.25rem); }
.search-suggestions a { display: flex; align-items: center; gap: 0.5rem; min-height: 2.75rem; padding: 0 0.5rem; border-radius: var(--radius-sm); color: var(--text-primary); font-size: var(--text-small); text-decoration: none; }
.search-suggestions a:hover, .search-suggestions a:focus-visible { background: var(--bg-muted); text-decoration: none; }
.search-suggestions a:focus-visible { outline: 2px solid var(--theme-secondary-text, var(--brand-accent)); outline-offset: -2px; }

/* ---------- breakpoints ---------- */
/* Narrow phones (< 360 px): logo + search, wishlist, basket and menu buttons (44 px each) fit without sideways
   scrolling: tighter gaps and side padding, and the same official logo drawn a little smaller. */
@media (max-width: 359.98px) {
  .header-main-bar { gap: 0.5rem; }
  .header-main .container { padding-left: 0.75rem; padding-right: 0.75rem; }
  .header-compact-actions { gap: 0; }
  .site-logo img { height: 2rem; }
}
@media (min-width: 560px) {
  .header-basket-compact .basket-total { display: inline; }
}
@media (min-width: 640px) {
  .whats-new-label-text { display: inline; }
  .header-quote-compact { display: inline-flex; }
}

@media (min-width: 1024px) {
  .site-header, .site-header.has-news { --utility-h: 3.25rem; --main-h: 4.5rem; }
  :where(body.site) [id] { scroll-margin-top: 6rem; }
  .header-utility { display: block; }
  .header-utility-bar { gap: 1rem; }
  /* Row one proportions: a compact ticker (about a fifth of the row), the search takes the free space. */
  .whats-new { flex: 0 1 24%; min-width: 11rem; max-width: 22rem; }
  .header-search { display: flex; flex: 1 1 auto; min-width: 20rem; max-width: none; }
  .header-quote { display: inline-flex; }
  .header-wishlist, .header-basket, .header-client-login { display: inline-flex; }
  .header-basket + .header-client-login { margin-left: 0.25rem; }
  /* Thin separators between the reference's groups */
  .header-search::before, .header-quote::before, .header-wishlist::before {
    content: ""; position: absolute; top: 50%; left: -0.5rem; width: 1px; height: 1.75rem; transform: translateY(-50%); background: var(--hdr-divider-dark);
  }
  .header-quote, .header-basket { position: relative; }
  .header-wishlist::before { left: -0.5rem; }
  .header-wishlist + .header-basket { margin-left: -0.5rem; }   /* wishlist and basket: one group after the divider */
  /* ≥ 24 px between the ticker window and the search (WCAG 2.2 target spacing for a link sliding out of view). */
  .whats-new + .header-search { margin-left: 0.75rem; }
  .header-search::before { left: -0.75rem; }
  .site-header:not(.has-news) .header-search::before { display: none; }
  .site-header:not(.has-news) .header-search { max-width: none; }

  .site-logo img { height: 2.5rem; }
  .desktop-nav { display: flex; flex: 1; justify-content: center; min-width: 0; }
  .desktop-nav > ul { gap: 0; }
  .site-logo, .desktop-nav { position: relative; }
  .desktop-nav::before, .desktop-nav::after { content: ""; position: absolute; top: 50%; width: 1px; height: 2.5rem; transform: translateY(-50%); background: var(--hdr-divider-dark); }
  .desktop-nav::before { left: 0; }
  .desktop-nav::after { right: 0; }
  .desktop-nav > ul { padding: 0 0.5rem; }
  .header-account { display: inline-flex; padding: 0 1rem; font-size: var(--text-small); }
  .header-compact-actions { display: none; }
  .mega-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* 1024–1279 px: the label shows its icon only, leaving the ticker room to read; the ticker takes a little less of the
   row so the search stays at least twice its width with the wishlist heart beside the basket. */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  .whats-new-label-text { display: none; }
  .whats-new { flex-basis: 19%; min-width: 10rem; }
  /* Client Login: a round icon button here (its name stays for screen readers), so the search keeps its width. */
  .header-client-login { width: 2.375rem; padding: 0; justify-content: center; }
  .header-client-login-text { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
}

@media (min-width: 1280px) {
  /* With the basket subtotal in row one, the ticker takes a fifth so the search stays at least twice its width. */
  .whats-new { flex-basis: 20%; }
  .site-header, .site-header.has-news { --main-h: 5rem; }
  .site-logo img { height: 3rem; }
  .desktop-nav > ul { gap: 0.5rem; padding: 0 1rem; }
  .desktop-nav-link { padding: 0 0.625rem; font-size: 1rem; }
  .desktop-nav-link::after { left: 0.625rem; right: 0.625rem; bottom: 1rem; }
  .header-main-bar { gap: 1.5rem; }
  .header-account { padding: 0 1.5rem; font-size: 0.9375rem; }
  .mega-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

@media (min-width: 1536px) {
  .mega-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); }
}

/* 1024–1279 px: the Search button keeps its icon only, so the field keeps room to type. */
@media (min-width: 1024px) and (max-width: 1279.98px) {
  /* Hidden visually only: the button keeps "Search" as its name (display: none left it unnamed — axe button-name). */
  .smart-search-bar .header-search-button span { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
  .smart-search-bar .header-search-button { padding: 0 0.875rem; }
}
@media (prefers-reduced-motion: reduce) {
  .desktop-nav-link::after, .desktop-nav-link .chevron { transition: none; }
  [data-header-search][aria-busy="true"] button[type="submit"] .icon { animation: none; }
  .smart-search.is-listening [data-voice] { animation: none; }
  .header-wishlist .icon, .header-tip, .header-basket .basket-icon .icon, .header-client-login { transition: none; }
}

/* Website Manager (2026-11-09): a plain dropdown under a navigation item (same open/close behaviour as the mega
   menus in site.js; links and icons from the published layout). */
.nav-dropdown { position: relative; }
.nav-dropdown-panel { left: 0; transform: none; width: max-content; min-width: 14rem; max-width: min(90vw, 22rem); padding: 0.5rem; }
.nav-dropdown-panel ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.125rem; }
.nav-dropdown-panel a { display: flex; align-items: center; gap: 0.5rem; padding: 0.5rem 0.625rem; border-radius: var(--radius-sm); color: var(--text-secondary); font-size: var(--text-small); text-decoration: none; }
.nav-dropdown-panel a:hover, .nav-dropdown-panel a[aria-current="page"] { background: var(--bg-muted); color: var(--hdr-secondary-text); }
.nav-dropdown-panel .icon { color: var(--hdr-secondary-text); flex-shrink: 0; }

/* Staff preview of the unpublished header and footer (?layout-preview=draft). */
.layout-preview-bar { position: sticky; top: 0; z-index: 60; display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem 0.75rem; padding: 0.5rem 1rem; background: var(--theme-secondary, var(--brand-accent)); color: var(--theme-on-secondary, var(--text-inverse)); font-size: var(--text-small); text-align: center; }
.layout-preview-bar a { color: inherit; font-weight: 600; text-decoration: underline; }
