/* ===== ui.css: one calm design layer for the whole portal (customer site and staff admin) =====
   Loaded LAST on index.html and admin.html. It takes the language of the Quick order screen and applies it everywhere:
   flat surfaces, 1px lines, 8px corners, one dark primary button, plain white secondary buttons, a quiet underlined
   text link, 40px touch targets, the − | n | + quantity picker, and gold only as an accent and a focus ring.
   No gradients, no pill shapes, no glossy shadows on controls. Specials (specials.css) and Quick order (quick.css)
   keep their own look; this file only lines the rest up with them. */

@font-face {
    font-family: 'Nunito Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 200 1000;
    src: url(/fonts/nunito-sans-latin-wght-normal.woff2) format('woff2-variations'), url(/fonts/nunito-sans-latin-wght-normal.woff2) format('woff2');
}
@font-face {
    font-family: 'Plus Jakarta Sans';
    font-style: normal;
    font-display: swap;
    font-weight: 200 800;
    src: url(/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2-variations'), url(/fonts/plus-jakarta-sans-latin-wght-normal.woff2) format('woff2');
}

/* ---- tokens ------------------------------------------------------------------------------ */
:root {
    --font: 'Nunito Sans', system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --font-display: 'Plus Jakarta Sans', 'Nunito Sans', system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    --ui-ink: #1D1A12;          /* text and the one primary button */
    --ui-ink-2: #3A3426;        /* primary hover */
    --ui-mute: #6B6555;
    --ui-faint: #9A937F;
    --ui-line: #E6E0D2;         /* every 1px line */
    --ui-line-2: #CFC7B3;       /* a line under the pointer */
    --ui-soft: #F7F4EC;         /* hover rows, sunken areas */
    --ui-gold: #CEA95C;
    --ui-gold-deep: #7A5C14;
    --ui-ring: 0 0 0 4px rgba(206, 169, 92, .28);
    --ui-r: 8px;
    --ui-r-lg: 12px;
    --ui-h: 40px;
    --ui-h-sm: 36px;
    --ui-h-lg: 48px;
    --ui-pop: 0 16px 40px rgba(29, 26, 18, .18);
    /* the older look's tokens, made flat */
    --border: var(--ui-line);
    --radius: var(--ui-r-lg);
    --shadow-sm: none;
    --shadow-md: none;
    --shadow-lg: 0 24px 60px rgba(23, 21, 15, .28);
}
body { font-family: var(--font); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
h1, h2, h3, .pagehd, .main h1 { font-family: var(--font-display); letter-spacing: -.015em; }
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible { outline: 2px solid var(--ui-gold); outline-offset: 2px; }
input[type="checkbox"], input[type="radio"] { accent-color: var(--ui-ink); width: 16px; height: 16px; margin: 0; flex: none; cursor: pointer; }

/* ---- buttons ----------------------------------------------------------------------------- */
/* .qo-btn (Quick order) is left alone: it already is this design */
:is(button, a, label).primary:not(.qo-btn), :is(button, a, label).quiet:not(.qo-btn), :is(button, a).danger, .ui-btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ui-h); padding: 8px 16px;
    border: 1px solid var(--ui-line); border-radius: var(--ui-r); background: #fff; color: var(--ui-ink);
    font: inherit; font-size: 14px; font-weight: 700; line-height: 1.2; text-align: center; text-decoration: none; cursor: pointer;
    box-shadow: none; filter: none; transform: none; transition: background .12s, border-color .12s, color .12s;
}
:is(button, a, label).quiet:not(.qo-btn):hover, .ui-btn:hover { border-color: var(--ui-ink); background: #fff; box-shadow: none; }
:is(button, a, label).primary:not(.qo-btn) { background: var(--ui-ink); border-color: var(--ui-ink); color: #fff; }
:is(button, a, label).primary:not(.qo-btn):hover { background: var(--ui-ink-2); border-color: var(--ui-ink-2); filter: none; box-shadow: none; }
:is(button, a, label).primary:not(.qo-btn):active { transform: none; background: #000; }
:is(button, a).danger { color: var(--bad); border-color: #E9C9C4; }
:is(button, a).danger:hover { background: #FDF4F2; border-color: var(--bad); }
:is(button, a, label):is(.primary, .quiet, .danger):disabled, .ui-btn:disabled { opacity: .45; cursor: default; }
:is(button, a).big { min-height: var(--ui-h-lg); padding: 10px 22px; font-size: 15.5px; }
:is(button, a, label).primary:not(.qo-btn):focus-visible, :is(button, a, label).quiet:not(.qo-btn):focus-visible, :is(button, a).danger:focus-visible { outline: 0; box-shadow: var(--ui-ring); }
a.quiet.linkbtn2 { padding: 8px 16px; }
/* the quiet underlined text link */
.linkbtn { background: none; border: 0; padding: 2px 0; color: var(--ui-gold-deep); font: inherit; font-size: inherit; font-weight: 700; cursor: pointer; text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.linkbtn:hover { color: var(--ui-ink); }
/* a small square close / remove button */
.xbtn { width: 32px; height: 32px; padding: 0; border-radius: 6px; border: 0; background: transparent; color: var(--ui-mute); font-size: 22px; line-height: 1; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; }
.xbtn:hover { background: var(--ui-soft); color: var(--ui-ink); }
.wabtn { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: var(--ui-h); padding: 8px 16px; border: 1px solid var(--ui-line); border-radius: var(--ui-r); background: #fff; color: #128C4A; font-weight: 700; font-size: 14px; text-decoration: none; }
.wabtn:hover { border-color: #128C4A; }

/* ---- the quantity picker: − | n | + (same as Quick order) ------------------------------- */
.qty { display: inline-flex; align-items: stretch; flex: none; height: var(--ui-h-sm); border: 1px solid var(--ui-line); border-radius: var(--ui-r); overflow: hidden; background: #fff; vertical-align: middle; }
.qty button { width: 32px; padding: 0; border: 0; background: #fff; color: var(--ui-ink); font-size: 17px; line-height: 1; cursor: pointer; }
.qty button:hover { background: var(--ui-soft); }
.qty input { width: 52px; height: auto; padding: 0; border: 0; border-left: 1px solid var(--ui-line); border-right: 1px solid var(--ui-line); border-radius: 0; background: #fff; color: var(--ui-ink); text-align: center; font: inherit; font-weight: 800; -moz-appearance: textfield; appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty input:focus { outline: 2px solid var(--ui-gold); outline-offset: -2px; box-shadow: none; }
.tile .qty, .again .qty { border-radius: var(--ui-r); }

/* ---- form fields ------------------------------------------------------------------------ */
:is(.field, .filters, .toolbar2, .filtbar, .mvrow, .form, .inline, .login) :is(input, textarea):where(:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="range"]):not([type="color"])),
.note, .bigtext, .srch input, input.cq {
    min-height: var(--ui-h); padding: 8px 12px; border: 1px solid var(--ui-line); border-radius: var(--ui-r); background: #fff; color: var(--ui-ink);
    font: inherit; font-size: 15px; box-shadow: none; transition: border-color .12s, box-shadow .12s;
}
:is(.field, .form, .login) textarea, .bigtext { min-height: 0; line-height: 1.45; }
:is(.field, .filters, .toolbar2, .filtbar, .mvrow, .form, .inline, .login) :is(input, textarea):focus, .note:focus, .bigtext:focus, .srch input:focus, input.cq:focus { outline: 0; border-color: var(--ui-ink); box-shadow: var(--ui-ring); }
.field label, .filters label { display: block; margin-bottom: 6px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-mute); }
.field .chk, .field label.chk { text-transform: none; letter-spacing: 0; font-size: 14px; font-weight: 600; color: var(--ui-ink); }
.field.big input { min-height: var(--ui-h-lg); border: 1.5px solid var(--ui-ink); font-size: 17px; font-weight: 700; padding: 0 14px; }
.field.bad input, .field.bad textarea { border-color: var(--bad); }
.note { min-height: var(--ui-h-sm); font-size: 14px; padding: 6px 10px; }
.hint { color: var(--ui-mute); }
.chk { display: flex; gap: 10px; align-items: center; cursor: pointer; }
input[type="file"] { font: inherit; font-size: 13px; color: var(--ui-mute); max-width: 100%; }
input[type="file"]::file-selector-button { min-height: var(--ui-h-sm); margin-right: 10px; padding: 0 14px; border: 1px solid var(--ui-line); border-radius: var(--ui-r); background: #fff; color: var(--ui-ink); font: inherit; font-size: 13.5px; font-weight: 700; cursor: pointer; }
input[type="file"]::file-selector-button:hover { border-color: var(--ui-ink); }
.srch input { border-color: var(--ui-ink); }
.srchres { margin-top: 4px; border: 1px solid var(--ui-line); border-radius: var(--ui-r); overflow: hidden; background: #fff; }
.srchres:empty { display: none; }
.srchres button { display: block; width: 100%; text-align: left; background: #fff; border: 0; border-bottom: 1px solid var(--ui-line); padding: 9px 12px; cursor: pointer; font-size: 13.5px; }
.srchres button:last-child { border-bottom: 0; }
.srchres button:hover { background: var(--ui-soft); box-shadow: inset 3px 0 0 var(--ui-gold); }
.srchres .none { padding: 9px 12px; font-size: 13px; color: var(--ui-mute); }

/* ---- the custom select (js/ui/select.js) ------------------------------------------------- */
.ui-select { position: relative; display: inline-flex; vertical-align: middle; min-width: 0; max-width: 100%; }
select.ui-select-native { position: absolute !important; left: 0; bottom: 0; width: 1px !important; height: 1px !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important; border: 0 !important; opacity: 0 !important; pointer-events: none !important; clip-path: inset(50%); }
.ui-select-btn { display: flex; align-items: center; gap: 8px; width: 100%; min-width: 0; min-height: var(--ui-h); margin: 0; padding: 0 10px 0 12px; border: 1px solid var(--ui-line); border-radius: var(--ui-r); background: #fff; color: var(--ui-ink); font: inherit; font-size: 14px; font-weight: 650; line-height: 1.2; text-align: left; text-transform: none; letter-spacing: 0; cursor: pointer; transition: border-color .12s, box-shadow .12s; }
.ui-select-btn:hover { border-color: var(--ui-line-2); }
.ui-select-btn:focus-visible, .ui-select.is-open .ui-select-btn { outline: 0; border-color: var(--ui-ink); box-shadow: var(--ui-ring); }
.ui-select-val { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ui-select-btn.is-placeholder .ui-select-val { color: var(--ui-faint); font-weight: 500; }
.ui-select-chev { flex: none; color: var(--ui-mute); transition: transform .15s; }
.ui-select.is-open .ui-select-chev { transform: rotate(180deg); }
.ui-select-btn:disabled { opacity: .5; cursor: default; background: var(--ui-soft); }
/* where a select used to fill its box, the new one does too */
:is(.field, .filters .field, .rsec, .form, .sumbox, .pm-controls) .ui-select, .ui-select.ui-select-block { display: flex; width: 100%; }
.ui-select-block { margin-top: 6px; }
.ui-select { min-width: 180px; }
.panel > .ui-select { display: flex; width: min(100%, 440px); }
.mvrow .ui-select { flex: 1 1 200px; }
.filtbar .ui-select { flex: 0 1 auto; min-width: 170px; }
.sortsel { gap: 8px; }
.sortsel .ui-select { min-width: 170px; }
table .ui-select-btn { min-height: var(--ui-h-sm); font-size: 13px; }
td > .ui-select { min-width: 72px; }
/* the open list */
.ui-select-pop { position: fixed; z-index: 1000; display: flex; flex-direction: column; overflow: hidden; background: #fff; color: var(--ui-ink); border: 1px solid var(--ui-ink); border-radius: 10px; box-shadow: var(--ui-pop); font-family: var(--font); font-size: 14px; }
.ui-select-find { flex: none; padding: 8px; border-bottom: 1px solid var(--ui-line); }
.ui-select-find input { width: 100%; height: var(--ui-h-sm); padding: 0 10px; border: 1px solid var(--ui-line); border-radius: 6px; font: inherit; font-size: 15px; color: var(--ui-ink); background: #fff; }
.ui-select-find input:focus { outline: 0; border-color: var(--ui-ink); box-shadow: var(--ui-ring); }
.ui-select-list { flex: 1; min-height: 0; list-style: none; margin: 0; padding: 4px 0; overflow: auto; outline: 0; overscroll-behavior: contain; }
.ui-select-opt { position: relative; padding: 9px 14px 9px 32px; line-height: 1.3; cursor: pointer; overflow-wrap: anywhere; }
.ui-select-opt.is-active { background: var(--ui-soft); box-shadow: inset 3px 0 0 var(--ui-gold); }
.ui-select-opt.is-on { font-weight: 800; }
.ui-select-opt.is-on::before { content: ''; position: absolute; left: 13px; top: 50%; width: 9px; height: 5px; border-left: 2px solid var(--ui-ink); border-bottom: 2px solid var(--ui-ink); transform: translateY(-70%) rotate(-45deg); }
.ui-select-opt.is-placeholder { color: var(--ui-mute); }
.ui-select-opt[aria-disabled="true"] { color: var(--ui-faint); cursor: default; }
.ui-select-group { padding: 10px 14px 4px; font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--ui-mute); }
.ui-select-group:not(:first-child) { border-top: 1px solid var(--ui-line); margin-top: 4px; }
.ui-select-none { padding: 12px 14px; font-size: 13px; color: var(--ui-mute); }
@media (pointer: coarse) { .ui-select-opt { padding-top: 12px; padding-bottom: 12px; } }

/* ---- segmented choice (checkout delivery / collection, orders filter) ----------------------- */
.seg { display: inline-flex; padding: 0; border: 1px solid var(--ui-line); border-radius: var(--ui-r); overflow: hidden; background: #fff; }
.seg button { min-height: var(--ui-h); padding: 0 16px; border: 0; border-right: 1px solid var(--ui-line); background: #fff; color: var(--ui-ink); font: inherit; font-size: 14px; font-weight: 700; cursor: pointer; transition: background .12s, color .12s; }
.seg button:last-child { border-right: 0; }
.seg button:hover { background: var(--ui-soft); }
.seg button.on, .seg button.on:hover { background: var(--ui-ink); color: #fff; font-weight: 800; }
.checkout .seg { display: flex; width: 100%; }
.checkout .seg button { flex: 1; min-height: var(--ui-h-lg); font-size: 15px; }

/* ---- chips, pills, badges: square-ish, never capsules ---------------------------------------- */
.chips { gap: 8px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 32px; padding: 0 10px; border: 1px solid var(--ui-line); border-radius: 6px; background: #fff; color: var(--ui-ink); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.chip:hover { background: #fff; border-color: var(--ui-ink); }
.pill { border-radius: 6px; padding: 3px 8px; font-size: 12px; font-weight: 800; letter-spacing: .01em; line-height: 1.35; }
.badge { border-radius: 6px; padding: 2px 8px; font-weight: 700; font-size: 11.5px; }
.n { border-radius: 5px; font-weight: 800; }
.sptag { border-radius: 4px; }

/* ---- surfaces ------------------------------------------------------------------------------ */
.panel { border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); box-shadow: none; }
.panel h3 { font-size: 16px; font-weight: 800; }
.kpi { border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); box-shadow: none; transition: border-color .12s; }
.kpi:hover { transform: none; box-shadow: none; border-color: var(--ui-line-2); }
.lk-kpis .kpi i { border-radius: var(--ui-r); background: var(--ui-soft); }
.message { border-radius: var(--ui-r); }
.howbox { background: var(--ui-soft); border: 1px solid var(--ui-line); border-radius: var(--ui-r); }
.dialog { border-radius: 14px; box-shadow: var(--shadow-lg); }
.dialog .hd { border-bottom: 1px solid var(--ui-line); }
.totbox { border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); }
.totbox .tl { border-top: 1px solid var(--ui-ink); }
.totbox > .tl:first-child { border-top: 0; margin-top: 0; padding-top: 3px; }
.addrbox { background: var(--ui-soft); border: 1px solid var(--ui-line); border-radius: var(--ui-r); }
.toast { background: var(--ui-ink); border-radius: var(--ui-r); box-shadow: 0 8px 24px rgba(0, 0, 0, .22); font-weight: 600; }
.toast.error { background: var(--bad); }
.empty { color: var(--ui-mute); }

/* ---- tables ------------------------------------------------------------------------------ */
table.lines th, table.t th { background: var(--ui-soft); color: var(--ui-mute); font-size: 11px; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; border-bottom: 1px solid var(--ui-line); }
table.t th { background: transparent; }
table.lines td, table.t td { border-bottom: 1px solid var(--ui-line); }
.clickrow:hover td, table.t tr.click:hover td { background: var(--ui-soft); }
table.lines tr.flag td, tr.rv.check td { background: #FFFAEE; }
tr.rv.none td { background: #FDF4F2; }

/* ===== header (dark, gold accents, no gloss) ============================================== */
.top { background: #17150F; box-shadow: none; border-bottom: 1px solid rgba(206, 169, 92, .22); }
.searchbar input { height: 44px; padding: 0 56px 0 14px; border: 1px solid transparent; border-radius: var(--ui-r); background: #fff; box-shadow: none; font-size: 16px; }
.searchbar input:focus { border-color: var(--ui-gold); box-shadow: var(--ui-ring); }
.searchbar .sbtn { top: 4px; right: 4px; width: 44px; height: 36px; border-radius: 6px; background: var(--ui-ink); color: #fff; filter: none; }
.searchbar .sbtn:hover { background: var(--ui-ink-2); filter: none; }
.basketlink, .top button.link, .walink { min-height: var(--ui-h); padding: 0 12px; border: 1px solid rgba(255, 255, 255, .16); border-radius: var(--ui-r); background: transparent; color: #fff; font-weight: 700; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; }
.basketlink:hover, .top button.link:hover { background: rgba(255, 255, 255, .04); border-color: var(--ui-gold); color: #fff; }
.walink { padding: 0 12px 0 6px; }
.walink svg { width: 26px; height: 26px; }
.walink:hover { background: rgba(255, 255, 255, .04); border-color: #25D366; }
@media (max-width: 1100px) { .walink { padding: 0 6px; } }
.menu { border: 1px solid var(--ui-line); border-radius: 10px; box-shadow: var(--ui-pop); padding: 4px 0; }
.menu .who { padding: 10px 14px 12px; margin-bottom: 4px; }
.menu a, .menu button { padding: 10px 14px; font-weight: 650; }
.menu a:hover, .menu button:hover { background: var(--ui-soft); box-shadow: inset 3px 0 0 var(--ui-gold); }
/* search suggestions: a list, like Quick order's results */
.suggest { border: 1px solid var(--ui-ink); border-radius: 10px; box-shadow: var(--ui-pop); }
.suggest button { border-bottom: 1px solid var(--ui-soft); padding: 10px 14px; }
.suggest button:hover, .suggest button:focus { background: var(--ui-soft); box-shadow: inset 3px 0 0 var(--ui-gold); }
.suggest .all { color: var(--ui-gold-deep); font-weight: 800; background: var(--ui-soft); }
.tabs { background: #1C1912; border-bottom: 1px solid rgba(206, 169, 92, .16); }
.tabs a { border-bottom-width: 2px; }

/* ===== home ================================================================================ */
.lk-sechd h2 { padding-left: 13px; }
.lk-sechd h2::before { width: 3px; border-radius: 0; background: var(--ui-gold); }
.lk-sechd a { color: var(--ui-gold-deep); text-decoration: underline; text-underline-offset: 2px; text-decoration-thickness: 1px; }
.lk-hero { border-radius: var(--ui-r-lg); background: #17150F; box-shadow: none; border: 1px solid rgba(206, 169, 92, .25); }
.lk-hero::after { display: none; }
.lk-hero-art { opacity: .08; animation: none; }
.lk-hero-cta { border-radius: var(--ui-r); background: var(--ui-gold); color: var(--ui-ink); box-shadow: none; padding: 10px 18px; }
.lk-hero:hover .lk-hero-cta { transform: none; background: #D8B66E; }
.lk-hero-badges img { box-shadow: none; border-width: 2px; }
.catcirc { background: color-mix(in srgb, var(--tint) 9%, #FFFFFF); box-shadow: none; transition: none; }
.cattile, .range, .catrow { border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); box-shadow: none; transition: border-color .12s; }
.cattile::before { height: 3px; }
.cattile:hover, .cattile:focus-visible, .range:hover, .catrow:hover, .catrow.open { transform: none; box-shadow: none; border-color: var(--ui-line-2); }
.cattile:hover .catcirc, .cathd:hover .catcirc, .range:hover img { transform: none; }
.range img { box-shadow: none; transition: none; }
.chev { border-radius: 6px; background: var(--ui-soft); }
.catrow.open .chev { background: var(--ui-soft); }
.catsubs a { border-radius: 6px; }
.catsubs a:hover { background: var(--ui-soft); }
.catsubs em { border-radius: 5px; }
.again { border-radius: 0; }
.again:hover { background: transparent; }
.again .againbuy { display: grid; grid-template-columns: auto auto; grid-template-areas: "qty add" "inb inb"; gap: 4px 8px; align-items: center; justify-items: end; }
.againbuy .qty { grid-area: qty; }
.againbuy button.add { grid-area: add; min-height: var(--ui-h-sm); padding: 0 14px; }
.againbuy .inb { grid-area: inb; }
/* the page-entrance animations were part of the old gloss: content simply appears */
.lk-welcome, #specials, .lk-kpis, .lk-sec, .cols, .lk-pagehd, .catrow, .cattile, .catrow.open .catsubs { animation: none !important; }

/* ===== shop: rail, toolbar, tiles ========================================================== */
.rail { border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); padding: 14px; box-shadow: none; }
.railhd b { font-family: var(--font-display); font-size: 16px; }
.rsec summary { font-size: 11px; font-weight: 800; letter-spacing: .06em; color: var(--ui-mute); padding: 6px 0; }
.cats button { min-height: 34px; padding: 6px 10px; border-radius: 6px; font-size: 14px; align-items: center; }
.cats button:hover { background: var(--ui-soft); }
.cats button.on, .cats button.on:hover { background: var(--ui-soft); color: var(--ui-ink); font-weight: 800; box-shadow: inset 3px 0 0 var(--ui-gold); }
.cats button.on span { color: var(--ui-mute); }
.cats ul { border-left: 1px solid var(--ui-line); }
.brands label, .chk { padding: 5px 2px; gap: 10px; }
.toolbar { gap: 10px; }
.viewtoggle { height: var(--ui-h); border: 1px solid var(--ui-line); border-radius: var(--ui-r); overflow: hidden; background: #fff; }
.viewtoggle button { width: 40px; padding: 0; border: 0; background: #fff; color: var(--ui-mute); font-size: 16px; cursor: pointer; }
.viewtoggle button + button { border-left: 1px solid var(--ui-line); }
.viewtoggle button:hover { background: var(--ui-soft); color: var(--ui-ink); }
.viewtoggle button.on { background: var(--ui-ink); color: #fff; }
.pager { gap: 12px; }
/* the button rules above set display; keep the classes that hide things winning */
@media (min-width: 900px) { .filterbtn { display: none !important; } }
@media (max-width: 899px) { .rail { border-radius: 0; border-width: 0 1px 0 0; } }
@media (max-width: 720px) { .hide-sm { display: none !important; } }

.grid.grid { gap: 14px; }
.tile { border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); box-shadow: none; transition: border-color .12s; }
.tile:hover, .tile:focus-within { transform: none; box-shadow: none; border-color: var(--ui-line-2); }
.tile .pic { background: var(--ui-soft); border-bottom: 1px solid var(--ui-line); }
.tile:hover .pic > img:not(.brandlogo) { transform: none; }
.tile .pic .brandlogo { border: 1px solid var(--ui-line); border-radius: 6px; background: #fff; box-shadow: none; }
.tile .body { padding: 12px 12px 12px; }
.tile .code:hover { color: var(--ui-gold-deep); text-decoration: underline; text-underline-offset: 2px; }
.tile .row .stock::before { width: 7px; height: 7px; box-shadow: none; }
.fav { width: 34px; height: 34px; border-radius: var(--ui-r); border: 1px solid var(--ui-line); background: #fff; box-shadow: none; font-size: 17px; line-height: 1; color: var(--ui-mute); display: inline-flex; align-items: center; justify-content: center; }
.fav:hover { transform: none; border-color: var(--ui-ink); color: #C2185B; }
.fav.on { color: #C2185B; }

/* the buy box on a tile: picker + "n in basket" on top, a full-width Add to basket below */
.tile .buy { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "qty inb" "add add"; gap: 8px; align-items: center; margin-top: 10px; }
.tile .buy .qty { grid-area: qty; }
.tile .buy .qty input { width: 44px; }
.tile .buy button.add { grid-area: add; width: 100%; min-height: var(--ui-h); padding: 0 12px; border-radius: var(--ui-r); font-weight: 800; flex: none; }
.inb { font-size: 12px; font-weight: 800; color: var(--good); line-height: 1.2; }
.tile .buy .inb { grid-area: inb; justify-self: end; text-align: right; margin: 0; }
/* once the part is in the basket the button goes quiet: it is now "Add more" */
[data-buy] button.add.more { background: #fff; border-color: var(--ui-line); color: var(--ui-ink); }
[data-buy] button.add.more:hover { background: #fff; border-color: var(--ui-ink); }
[data-buy] button.add.busy { opacity: .6; }
[data-buy].flash .inb { animation: ui-flash 1.4s ease-out; }
@keyframes ui-flash { from { background: #FFF3D1; box-shadow: 0 0 0 4px #FFF3D1; } to { background: transparent; box-shadow: 0 0 0 4px transparent; } }

/* list view: one row per part */
.grid.list .tile .body { gap: 6px 18px; }
.grid.list .tile .buy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 0 0 0 auto; }
.grid.list .tile .buy button.add { width: auto; min-width: 140px; }
.grid.list .tile .buy .inb { order: 3; }
.grid.list .tile .fav { left: 8px; }

/* ===== the flip card and the product window ================================================= */
.pcard-scene { height: 516px; }
.pcard-body { min-height: 0; }
.pcard-face { border: 1px solid var(--ui-line); border-radius: 14px; box-shadow: 0 20px 50px rgba(0, 0, 0, .35); }
.pcard-accent { height: 3px; }
.pcard-tile { border: 1px solid var(--ui-line); border-radius: 10px; background: var(--ui-soft); }
.pcard-strip, .pcard-fits { border-top: 1px solid var(--ui-line); }
.pcard-buy { display: grid; grid-template-columns: auto minmax(0, 1fr); grid-template-areas: "qty add" "inb inb"; gap: 6px 8px; align-items: center; padding: 10px 14px; border-top: 1px solid var(--ui-line); }
.pcard-buy .qty { grid-area: qty; }
.pcard-buy .qty input { width: 48px; padding: 0; }
.pcard-buy .qty button { width: 32px; }
.pcard-buy button.add { grid-area: add; width: 100%; min-height: var(--ui-h-sm); padding: 0 12px; }
.pcard-buy .inb { grid-area: inb; }
.pcard-ft { background: var(--ui-soft); border-top: 1px solid var(--ui-line); padding: 8px 14px; gap: 8px; }
.pcard-open, .pcard-open.gold { min-height: 32px; padding: 0 12px; border: 1px solid var(--ui-line); border-radius: var(--ui-r); background: #fff; color: var(--ui-ink); font: inherit; font-size: 12.5px; font-weight: 700; cursor: pointer; }
.pcard-open:hover { border-color: var(--ui-ink); }
.pcard-fav { min-height: 32px; padding: 0 4px; border: 0; background: none; color: var(--ui-mute); font: inherit; font-size: 13px; font-weight: 700; cursor: pointer; }
.pcard-fav:hover { color: var(--ui-ink); }
.pcard-fav.on { color: #C2185B; }
.pcard-row { border-bottom: 1px solid var(--ui-line); }
.buyrow { gap: 8px; align-items: center; }
.detbuy { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.detbuy .qty { height: var(--ui-h); }
.detbuy button.add { min-width: 150px; }
.detail .photo { background: var(--ui-soft); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); }
.thumbs img { border-radius: 6px; border-color: var(--ui-line); }

/* ===== basket, checkout, orders, saved, addresses, upload ================================== */
.basketfoot { margin-top: 12px; }
.actions { gap: 8px; }
.sumbox .tot { font-family: var(--font-display); }
.sumlines div { border-bottom: 1px solid var(--ui-soft); }
.toolbar2 { align-items: center; }
.toolbar2 input { min-width: 220px; }
.track { border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); }
.track li { border-right: 1px solid var(--ui-line); }
.track li span { background: var(--ui-soft); color: var(--ui-mute); }
.track li.past span { background: #E4F2E4; color: var(--good); }
.track li.now { background: var(--ui-soft); box-shadow: inset 0 -2px 0 var(--ui-gold); }
.track li.now span { background: var(--ui-ink); color: #fff; }
.timeline li { border-left: 2px solid var(--ui-line); }
.btnstack { gap: 8px; }
.btnstack :is(button, a) { width: 100%; }
.addnew { border: 1.5px dashed var(--ui-line-2); border-radius: var(--ui-r-lg); background: transparent; box-shadow: none; color: var(--ui-mute); font-weight: 700; font-size: 15px; transition: border-color .12s, color .12s; }
.addnew:hover { border-color: var(--ui-ink); color: var(--ui-ink); }
.rowbtns { gap: 8px; }
td.rowbtns { display: flex; flex-wrap: wrap; }
.drop { border: 1.5px dashed var(--ui-line-2); border-radius: var(--ui-r-lg); background: var(--ui-soft); }
.drop.over { border-style: solid; border-color: var(--ui-ink); background: #FFF8E8; }
.drop .big { font-size: 30px; color: var(--ui-mute); }
.dropbtns { gap: 8px; }
.rvsum { gap: 8px; }
.rvtable td.st { font-size: 16px; }
.okbtn { min-height: var(--ui-h-sm) !important; padding: 0 12px !important; }
.spin { border-color: var(--ui-line); border-top-color: var(--ui-ink); border-width: 3px; }
.emptybasket p { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.done .slip { font-family: var(--font-display); }
.done p:last-child { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }

/* ===== login (the dark art stays; the controls follow the new design) ======================= */
.lg-card { border-radius: 14px; background: rgba(255, 255, 255, .06); border: 1px solid rgba(255, 255, 255, .13); box-shadow: 0 24px 60px rgba(0, 0, 0, .45); }
#loginbox .lg-card .field input { min-height: 46px; padding: 0 14px; border: 1px solid rgba(255, 255, 255, .2); border-radius: var(--ui-r); background: rgba(255, 255, 255, .06); color: #fff; font-size: 16px; box-shadow: none; }
#loginbox .lg-card .field input:focus { border-color: var(--ui-gold); background: rgba(255, 255, 255, .09); box-shadow: var(--ui-ring); }
#loginbox .lg-card .field label { color: #D9D0B6; }
/* on the dark page the primary button is the gold one: flat, square-cornered */
#loginbox .lg-card button.primary { width: 100%; min-height: var(--ui-h-lg); margin-top: 6px; border-radius: var(--ui-r); background: var(--ui-gold); border-color: var(--ui-gold); color: var(--ui-ink); font-size: 16px; font-weight: 800; box-shadow: none; }
#loginbox .lg-card button.primary:hover { background: #D8B66E; border-color: #D8B66E; }
#loginbox .lg-card button.primary:focus-visible { box-shadow: 0 0 0 4px rgba(206, 169, 92, .4); }
.lg-ic { border-radius: 10px; box-shadow: none; }
.lg-forgot a { text-underline-offset: 2px; }
/* the admin's plain login card */
.login:not(:has(.lg-card)) { border: 1px solid var(--ui-line); border-radius: 14px; box-shadow: none; }
.login .logo { border-radius: 10px; }
.login button.primary { width: 100%; min-height: var(--ui-h-lg); }

/* ===== phone: bottom bar and the account sheet ============================================= */
.sheet { border-radius: 16px 16px 0 0; }
.sheet > a, .sheet > button { border-radius: var(--ui-r); min-height: 48px; font-weight: 700; }
.sheet > a:hover, .sheet > button:hover { background: var(--ui-soft); }
.sheet > a > span, .sheet > button > span { border-radius: var(--ui-r); background: var(--ui-soft); color: var(--ui-ink); width: 36px; height: 36px; }
@media (max-width: 720px) {
    body.has-bnav .bnav:not([hidden]) { background: #17150F; -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; border-top: 1px solid rgba(206, 169, 92, .22); }
    .bnav .on::before { height: 2px; border-radius: 0; top: -6px; left: 30%; right: 30%; }
    .bnav .bn-ic .n { border-radius: 5px; }
    .searchbar input { height: 44px; }
    .searchbar .sbtn { height: 36px; width: 44px; }
    .basketlink, .top button.link { padding: 0 10px; }
    .walink { padding: 0 6px; }

    .tile .body { padding: 10px; }
    .tile .buy { gap: 6px; }
    .tile .buy .qty input { width: 38px; }
    .tile .buy .qty button { width: 30px; }
    .tile .buy .inb { font-size: 11px; }
    .tile .buy button.add { font-size: 13.5px; }
    .fav { width: 32px; height: 32px; }
    .grid.list .tile .buy { margin: 6px 0 0; width: 100%; }
    .grid.list .tile .fav { left: auto; right: 8px; }
    .grid.list .tile .buy button.add { flex: 1; min-width: 0; }

    .again { grid-template-columns: 54px minmax(0, 1fr); }
    .again .againbuy { grid-column: 1 / -1; justify-content: start; justify-items: start; grid-template-columns: auto minmax(0, 1fr) ; grid-template-areas: "qty add" "inb inb"; }
    .again .againbuy button.add { justify-self: stretch; }

    .toolbar { gap: 8px; }
    .toolbar .count { flex-basis: 100%; order: 3; }
    .sortsel { flex: 1 1 0; min-width: 0; }
    .sortsel .ui-select { flex: 1 1 auto; min-width: 0; }
    .toolbar2 input { min-width: 0; width: 100%; flex-basis: 100%; }
    .actions .primary.big { width: 100%; }
    .seg button { padding: 0 12px; }
    .pcard-scene { width: min(300px, calc(100vw - 32px)); }
    td.rowbtns :is(button) { min-height: var(--ui-h-sm); padding: 0 10px; font-size: 13px; }

    /* basket lines become small cards on a phone: picture, part and remove on top; quantity and price below */
    table.basketlines thead { display: none; }
    table.basketlines, table.basketlines tbody { display: block; width: 100%; }
    table.basketlines tr { display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; grid-template-areas: "th part x" "th qty price"; gap: 8px 10px; padding: 12px; border-bottom: 1px solid var(--ui-line); }
    table.basketlines tr:last-child { border-bottom: 0; }
    table.basketlines td { display: block; padding: 0; border: 0; background: transparent; }
    table.basketlines td.thumb { grid-area: th; width: 52px; }
    table.basketlines td:nth-child(2) { grid-area: part; min-width: 0; }
    table.basketlines td:nth-child(4) { grid-area: qty; }
    table.basketlines td:nth-child(5) { grid-area: price; align-self: center; }
    table.basketlines td:last-child { grid-area: x; }
    table.basketlines tr.flag { background: #FFFAEE; }

    /* the upload review: one card per line */
    table.rvtable thead { display: none; }
    table.rvtable, table.rvtable tbody { display: block; width: 100%; }
    table.rvtable tr.rv { display: grid; grid-template-columns: 26px minmax(0, 1fr) auto; grid-template-areas: "st wrote acts" ". matched matched" ". q q"; gap: 6px 10px; padding: 12px; border-bottom: 1px solid var(--ui-line); }
    table.rvtable tr.rv td { display: block; padding: 0; border: 0; background: transparent; }
    table.rvtable td.st { grid-area: st; width: auto; text-align: left; }
    table.rvtable td.wrote { grid-area: wrote; min-width: 0; }
    table.rvtable td.matched { grid-area: matched; min-width: 0; }
    table.rvtable td.q { grid-area: q; }
    table.rvtable td.q:empty { display: none; }
    table.rvtable td.acts { grid-area: acts; display: flex; gap: 4px; align-items: flex-start; }
    table.rvtable tr.rv.check { background: #FFFAEE; }
    table.rvtable tr.rv.none { background: #FDF4F2; }
}

/* ===== staff admin console (CSS only; its markup belongs to admin/*.js) ===================== */
.side { background: #fff; border-right: 1px solid var(--ui-line); }
.side a { padding: 8px 12px; border-radius: 6px; font-size: 14px; font-weight: 600; color: var(--ui-ink); }
.side a:hover { background: var(--ui-soft); }
.side a.on, .side a.on:hover { background: var(--ui-soft); color: var(--ui-ink); font-weight: 800; box-shadow: inset 3px 0 0 var(--ui-gold); }
.side .grp { font-weight: 800; color: var(--ui-mute); }
.main h1 { font-weight: 800; }
.main .kpi { border-radius: var(--ui-r-lg); }
.main .kpi b, .kpi b { font-family: var(--font-display); font-weight: 800; }
.board { gap: 10px; }
.bcol { background: var(--ui-soft); border: 1px solid var(--ui-line); border-radius: var(--ui-r-lg); }
.n2 { border-radius: 5px; border: 1px solid var(--ui-line); font-weight: 800; }
.ocard { border: 1px solid var(--ui-line); border-radius: var(--ui-r); box-shadow: none; }
.ocard:hover { border-color: var(--ui-ink); box-shadow: none; }
.latetag { border-radius: 5px; }
.qk { min-height: 32px !important; padding: 0 10px !important; font-size: 12.5px !important; }
.filtbar { gap: 8px; }
.filtbar input[type=search], .filtbar input[type=date] { min-height: var(--ui-h); }
.refbox { background: var(--ui-soft); border: 1px solid var(--ui-line); }
.dropzone { border: 1.5px dashed var(--ui-line-2); background: var(--ui-soft); border-radius: var(--ui-r-lg); }
.dropzone.over { border-style: solid; border-color: var(--ui-ink); background: #FFF8E8; }
.pic { border-color: var(--ui-line); border-radius: var(--ui-r); }
.pwbox { border-radius: var(--ui-r); }
.hbars .t { border-radius: 3px; } .hbars .t i { border-radius: 0; }
.top button.navtoggle { display: none; }   /* not wired to anything; admin2.css hides it too */
@media (max-width: 760px) {
    .side a.on { box-shadow: inset 0 -2px 0 var(--ui-gold); }
}

@media (prefers-reduced-motion: reduce) {
    [data-buy].flash .inb { animation: none; }
    .ui-select-chev { transition: none; }
}
