@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 400 700;
    font-stretch: 75% 100%;
    font-display: swap;
    src: url(../fonts/archivo-latin-ext.woff2) format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
    font-family: 'Archivo';
    font-style: normal;
    font-weight: 400 700;
    font-stretch: 75% 100%;
    font-display: swap;
    src: url(../fonts/archivo-latin.woff2) format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
    --color-bg: #f3f2f2;
    --color-surface: #eae9e9;
    --color-text: #201e1d;
    --color-accent: #a04a3a;
    --color-accent-2: #b5685a;
    --color-stock-ok: #2f7d46;
    --color-stock-low: #d9a400;
    --color-stock-out: #c0392b;
    --color-stock-out-text: #a3291d;
    --color-divider: color-mix(in srgb, #201e1d 40%, transparent);

    --color-neutral-100: #f8f4f4;
    --color-neutral-200: #eae7e7;
    --color-neutral-300: #d7d3d3;
    --color-neutral-400: #bab6b6;
    --color-neutral-500: #9b9797;
    --color-neutral-600: #7d7979;
    --color-neutral-700: #605d5d;
    --color-neutral-800: #444141;
    --color-neutral-900: #2d2b2b;

    --color-accent-100: #f6eeec;
    --color-accent-200: #ecdad6;
    --color-accent-300: #dbbab3;
    --color-accent-400: #c69287;
    --color-accent-500: #b26a5d;
    --color-accent-600: #873d30;
    --color-accent-700: #6e3227;
    --color-accent-800: #53261e;
    --color-accent-900: #3a1b15;

    --font-heading: "Archivo", system-ui, sans-serif;
    --font-heading-weight: 800;
    --font-body: "Archivo", system-ui, sans-serif;

    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-6: 24px;
    --space-8: 32px;

    --radius-sm: 0px;
    --radius-md: 0px;
    --radius-lg: 0px;

    --shadow-sm: 0 1px 2px color-mix(in srgb, #2d2b2b 14%, transparent);
    --shadow-md: 0 3px 10px color-mix(in srgb, #2d2b2b 16%, transparent);
    --shadow-lg: 0 12px 32px color-mix(in srgb, #2d2b2b 22%, transparent);

    --gutter: clamp(16px, 4vw, 40px);
    --tabbar: 60px;
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font: 400 15px/1.55 var(--font-body); }
h1, h2, h3, h4, h5, h6 { margin: 0 0 var(--space-2); font-family: var(--font-heading); font-weight: var(--font-heading-weight); line-height: 1.12; letter-spacing: -0.015em; }
h1 { font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.03em; }
h2 { font-size: 22px; }
h3 { font-size: 20px; }
p { margin: 0; }
a { color: var(--color-accent); text-underline-offset: 3px; }
a:hover { color: var(--color-accent-600); }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
::selection { background: color-mix(in srgb, var(--color-accent) 30%, transparent); }
input::-webkit-outer-spin-button, input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
svg.icon { width: 20px; height: 20px; flex: none; }

/* Buttons */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    cursor: pointer; text-decoration: none;
    font-family: var(--font-heading); font-weight: var(--font-heading-weight);
    font-size: 14px; line-height: 1.2; color: var(--color-text);
    background: transparent; border: 1px solid transparent;
    padding: var(--space-2) calc(var(--space-3) * 1.2);
    border-radius: var(--radius-md);
}
.btn svg { display: block; }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary { background: var(--color-accent); color: var(--color-bg); }
.btn-primary:hover { background: var(--color-accent-600); color: var(--color-bg); }
.btn-primary:active { background: var(--color-accent-700); }
.btn-secondary { border-color: var(--color-divider); }
.btn-secondary:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
.btn-secondary:active { background: color-mix(in srgb, var(--color-text) 14%, transparent); }
.btn-ghost { color: var(--color-accent); padding-inline: var(--space-1); }
.btn-ghost:hover { background: color-mix(in srgb, var(--color-accent) 10%, transparent); }
.btn-ghost:active { background: color-mix(in srgb, var(--color-accent) 18%, transparent); }
.btn-icon { width: 36px; height: 36px; padding: 0; }
.btn-lg { min-height: 52px; font-size: 16px; padding: 0 20px; }
.btn-block { width: 100%; }

/* Forms */
.field > label { display: block; font-size: 12px; margin-bottom: 5px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.input, input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], textarea {
    width: 100%; min-height: 36px; padding: 6px 10px; font: inherit;
    font-size: 14px; color: var(--color-text); caret-color: var(--color-accent);
    background: var(--color-surface);
    border: 1px solid var(--color-divider); border-radius: var(--radius-md);
}
.input:hover, input:hover, textarea:hover { border-color: color-mix(in srgb, var(--color-text) 45%, transparent); }
.input:focus-visible, input:focus-visible, textarea:focus-visible { border-color: var(--color-accent); outline-offset: 0; }
textarea, textarea.input { min-height: 90px; resize: vertical; }
.input-lg { min-height: 52px; font-size: 16px; }
.seg-opt input { position: absolute; opacity: 0; width: 0; height: 0; pointer-events: none; }
.seg { display: inline-flex; overflow: hidden; border: 1px solid var(--color-divider); border-radius: var(--radius-md); }
.seg-opt { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.seg-opt + .seg-opt { border-left: 1px solid var(--color-divider); }
.seg-opt:has(input:checked) { background: var(--color-accent); color: var(--color-bg); }
.seg-opt:not(:has(input:checked)):hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); }
.seg-opt:has(input:focus-visible) { outline: 2px solid var(--color-accent); outline-offset: -2px; }

/* Tags */
.tag { display: inline-flex; align-items: center; font-size: 11px; letter-spacing: 0.02em; padding: 3px 10px; border-radius: calc(var(--radius-md) * 0.75); }
.tag-accent { background: var(--color-accent-100); color: var(--color-accent-800); }
.tag-neutral { background: var(--color-neutral-100); color: var(--color-neutral-800); }
.tag-outline { border: 1px solid var(--color-accent); color: var(--color-accent); }
.tag-status, .pill { display: inline-flex; align-items: center; font-size: 12px; font-weight: 600; padding: 3px 10px; white-space: nowrap; border: 1px solid transparent; }
.tag-status.is-ok { background: var(--color-neutral-200); color: var(--color-neutral-800); border-color: var(--color-neutral-200); }
.tag-status.is-low, .pill.pending { background: var(--color-bg); color: var(--color-accent-700); border-color: var(--color-accent); }
.tag-status.is-out, .pill.refused { background: var(--color-accent-700); color: var(--color-bg); border-color: var(--color-accent-700); }
.pill.accepted { background: var(--color-text); color: var(--color-bg); border-color: var(--color-text); }

/* Tables */
.table { width: 100%; border-collapse: collapse; font-size: 14px; }
.table th { text-align: left; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: color-mix(in srgb, var(--color-text) 60%, transparent); padding: var(--space-2); border-bottom: 2px solid var(--color-divider); }
.table td { padding: var(--space-2); border-bottom: 1px solid var(--color-divider); }
.table tbody tr:hover { background: color-mix(in srgb, var(--color-text) 4%, transparent); }

/* Page building blocks */
.page-title { margin: 0 0 20px; font-size: clamp(32px, 5vw, 52px); letter-spacing: -0.03em; }
.crumbs { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; font-size: 13px; color: var(--color-neutral-700); }
.crumbs a { color: var(--color-neutral-700); }
.crumbs a:hover { color: var(--color-accent); }
.kicker { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-700); }
.rule { border-top: 2px solid var(--color-text); }
.stat { display: flex; flex-direction: column; }
.stat > :first-child { font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-neutral-700); }
.stat > :nth-child(2) { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stat small { color: var(--color-neutral-700); font-size: 12px; }
.stock-bar { display: block; height: 4px; margin-top: 6px; background: var(--color-neutral-300); }
.stock-bar > i { display: block; height: 100%; background: var(--color-text); }
.stock-bar.is-low > i { background: var(--color-accent); }
.stock-bar.is-out > i { background: var(--color-accent-700); }
.thumb { flex: none; display: grid; place-items: center; width: 72px; height: 72px; overflow: hidden; background: var(--color-neutral-200); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.empty { max-width: 46ch; padding: 32px 0; border-top: 2px solid var(--color-text); color: var(--color-neutral-700); }
.empty p { margin-top: 8px; }
.empty h2, .empty h3, .empty strong { color: var(--color-text); }

/* Shell */
.top { position: sticky; top: 0; z-index: 20; background: var(--color-bg); border-bottom: 2px solid var(--color-text); }
.top-inner { display: flex; align-items: stretch; gap: 16px; max-width: 1280px; min-height: 60px; margin: 0 auto; padding: 0 var(--gutter); }
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; color: var(--color-text); text-decoration: none; }
.brand:hover { color: var(--color-text); }
.brand img { width: auto; max-width: 160px; max-height: 36px; object-fit: contain; }
.brand-mark { flex: none; width: 22px; height: 22px; background: var(--color-accent); }
.brand-text { display: flex; flex-direction: column; min-width: 0; line-height: 1.15; }
.brand-name { overflow: hidden; font-size: 16px; font-weight: 800; text-overflow: ellipsis; white-space: nowrap; }
.tabs { display: flex; align-items: stretch; margin-left: auto; }
.tabs a { display: flex; align-items: center; gap: 8px; padding: 0 14px; color: var(--color-text); font-size: 14px; font-weight: 600; text-decoration: none; }
.tabs a:hover { background: var(--color-neutral-200); color: var(--color-text); }
.tabs a[aria-current=page] { color: var(--color-accent); box-shadow: inset 0 -4px 0 var(--color-accent); }
.badge { display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 5px; background: var(--color-accent); color: var(--color-bg); font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums; }
.badge.outline { background: transparent; border: 1px solid var(--color-accent); color: var(--color-accent-700); }
.user { display: flex; align-items: center; gap: 12px; padding-left: 16px; border-left: 2px solid var(--color-divider); }
.user-name { font-size: 13px; color: var(--color-neutral-700); }
.logout { margin: 0; }
.logout button { display: flex; align-items: center; gap: 6px; padding: 8px 4px; border: 0; background: transparent; color: var(--color-text); font: inherit; font-size: 14px; font-weight: 600; cursor: pointer; }
.logout button:hover { color: var(--color-accent); }
main { max-width: 1280px; margin: 0 auto; padding: var(--gutter) var(--gutter) 64px; }

@media (max-width: 720px) {
    .top-inner { justify-content: space-between; }
    .brand-text .kicker, .user-name, .logout-label { display: none; }
    .user { margin-left: auto; }
    .tabs { position: fixed; right: 0; bottom: 0; left: 0; z-index: 20; display: grid; grid-template-columns: repeat(4, 1fr); margin: 0; min-height: var(--tabbar); padding-bottom: env(safe-area-inset-bottom); background: var(--color-bg); border-top: 2px solid var(--color-text); }
    .tabs a { flex-direction: column; justify-content: center; gap: 2px; min-height: var(--tabbar); padding: 0 4px; font-size: 12px; }
    .tabs a[aria-current=page] { box-shadow: inset 0 4px 0 var(--color-accent); }
    /* Pin the counter to the icon's corner instead of stacking it under the label. */
    .tabs a { position: relative; }
    .tabs .badge { position: absolute; top: 4px; left: calc(50% + 4px); min-width: 18px; height: 18px; padding: 0 4px; font-size: 11px; }
    .tabs .badge.outline { background: var(--color-bg); }
    main { padding-bottom: 76px; }
}

/* Flash and toast */
.flash { margin-bottom: 16px; padding: 12px 16px; border-left: 4px solid var(--color-text); background: var(--color-surface); }
.flash.error { border-left-color: var(--color-accent-700); background: var(--color-accent-100); color: var(--color-accent-800); }
.toast-wrap { position: fixed; right: 16px; bottom: 16px; left: 16px; z-index: 40; display: flex; pointer-events: none; }
.toast { display: flex; align-items: center; gap: 10px; max-width: 480px; padding: 12px 16px; background: var(--color-text); color: var(--color-bg); font-size: 14px; box-shadow: var(--shadow-lg); pointer-events: auto; }
.toast svg { flex: none; color: var(--color-accent-400); }
.toast a { padding-left: 8px; color: var(--color-accent-400); font-weight: 800; white-space: nowrap; }
@media (max-width: 720px) { .toast-wrap { bottom: calc(var(--tabbar) + 16px + env(safe-area-inset-bottom)); } }

/* Login */
.login { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 420px), 1fr)); min-height: 100vh; }
.login-panel { display: flex; flex-direction: column; justify-content: space-between; gap: 48px; min-height: 260px; padding: clamp(24px, 5vw, 64px); background: var(--color-accent); color: var(--color-bg); }
.login-panel .brand { color: var(--color-bg); font-size: 16px; font-weight: 800; }
.login-panel .brand-mark { background: var(--color-bg); }
.login-headline { max-width: 9ch; margin: 0; font-size: clamp(44px, 7vw, 88px); line-height: 0.96; letter-spacing: -0.035em; }
.login-lead { max-width: 34ch; margin: 24px 0 0; font-size: 18px; line-height: 1.45; }
.login-side { display: flex; align-items: center; padding: clamp(24px, 5vw, 64px); }
.login-form { display: flex; flex-direction: column; gap: 20px; width: 100%; max-width: 400px; }
.login-form h1 { margin: 0; font-size: 40px; }
.login-form .flash { margin: 0; }
.login-form .btn { justify-content: space-between; }
.login-form .input { min-height: 48px; font-size: 16px; }

/* Long product names and codes; word-break is the fallback for Safari < 15.4 */
.tile-name, .tile-code, .product-info h1, .product-code, .line-name, .line-code { overflow-wrap: anywhere; word-break: break-word; }

.actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
/* Search */
.search { display: flex; gap: 8px; max-width: 760px; }
.search-field { position: relative; flex: 1; min-width: 0; }
.search-field svg.icon { position: absolute; top: 50%; left: 13px; width: 20px; height: 20px; color: var(--color-neutral-700); transform: translateY(-50%); pointer-events: none; }
.search-field input { padding-left: 42px; }
.search .btn { flex: none; padding: 0 16px; }
.search-lg { max-width: 820px; }
.search-lg input[type=search] { min-height: 52px; font-size: 16px; padding-left: 44px; }
.search-lg .btn { min-height: 52px; padding: 0 22px; font-size: 15px; }
.search-lg .icon-btn { width: 52px; height: 52px; }

/* Catalog home */
.home-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin-top: 16px; font-size: 14px; }
.home-link { display: flex; align-items: center; gap: 8px; padding: 4px 0; color: var(--color-text); text-decoration: none; }
.home-link:hover { color: var(--color-accent); }
.home-link i { width: 8px; height: 8px; background: var(--color-accent); }
.home-link.is-pending i { background: transparent; border: 1.5px solid var(--color-accent); }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 24px; margin-top: 40px; }
.cat-card { display: flex; flex-direction: column; gap: 20px; padding: 16px 0 8px; border-top: 2px solid var(--color-text); color: var(--color-text); text-decoration: none; }
.cat-card:hover { color: var(--color-accent); }
.cat-card-top { display: flex; justify-content: space-between; align-items: baseline; }
.cat-card-top .kicker { letter-spacing: 0.08em; }
.cat-card-name { font-size: clamp(30px, 3.6vw, 44px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; overflow-wrap: anywhere; }
.cat-thumbs { display: flex; gap: 2px; }
.cat-thumbs > span { flex: 1; min-width: 0; aspect-ratio: 1; background: var(--color-neutral-200); }
.cat-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.cat-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; color: var(--color-text); }

/* The tiled wall: tiles touch, each draws half of a 2px grout joint */
.tile { display: flex; flex-direction: column; min-width: 0; background: var(--color-bg); box-shadow: 0 0 0 1px var(--color-divider); text-decoration: none; }
.tile-img { aspect-ratio: 1; overflow: hidden; background: var(--color-bg); }
.tile-img img { width: 100%; height: 100%; object-fit: cover; }
.tile-body { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px 14px; }
.tile-name { display: -webkit-box; overflow: hidden; font-weight: 600; font-stretch: 85%; line-height: 1.2; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.tile-code { color: var(--color-neutral-700); font-size: 13px; font-variant-numeric: tabular-nums; }
.tile:hover .tile-name { color: var(--color-accent); }

/* Product list: toolbar, rows, grid tiles */
.list-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; padding-bottom: 16px; border-top: 0; border-bottom: 2px solid var(--color-text); }
.list-head .page-title { margin: 0; }
.list-count { font-size: 14px; color: var(--color-neutral-700); font-variant-numeric: tabular-nums; }
.list-tools { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; padding: 16px 0; }
.list-search { flex: 1 1 220px; max-width: 380px; min-height: 42px; }
.list-sort { width: auto; min-height: 42px; cursor: pointer; }
.seg a.seg-opt { min-height: 42px; color: var(--color-text); text-decoration: none; }
.seg a.seg-opt:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
.seg a.seg-opt[aria-current] { background: var(--color-accent); color: var(--color-bg); }
.seg-count { opacity: .7; font-variant-numeric: tabular-nums; }
.view-toggle { display: flex; margin-left: auto; border: 1px solid var(--color-divider); }
.view-toggle a { display: grid; place-items: center; width: 42px; height: 40px; color: var(--color-text); }
.view-toggle a + a { border-left: 1px solid var(--color-divider); }
.view-toggle a:hover { background: color-mix(in srgb, var(--color-text) 7%, transparent); color: var(--color-text); }
.view-toggle a[aria-current] { background: var(--color-accent); color: var(--color-bg); }

.row-head, .prow { display: grid; grid-template-columns: 56px minmax(0, 1fr) 84px 200px 140px 210px; gap: 16px; align-items: center; }
.row-head { align-items: end; padding-bottom: 8px; border-bottom: 2px solid var(--color-text); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--color-neutral-700); }
.prow { padding: 10px 0; border-bottom: 1px solid var(--color-divider); }
.prow:hover { background: var(--color-neutral-100); }
.prow-thumb { width: 56px; height: 56px; }
.prow-main { min-width: 0; }
.prow-name { font-size: 15px; font-weight: 800; color: var(--color-text); text-decoration: none; overflow-wrap: anywhere; line-height: 1.25; }
.prow-name:hover { color: var(--color-accent); }
.prow-code { font-size: 12px; color: var(--color-neutral-700); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.prow-box-inline, .prow-inc-label { display: none; }
.prow-box, .prow-inc { font-size: 14px; font-variant-numeric: tabular-nums; }
.prow-inc { font-size: 13px; color: var(--color-neutral-700); line-height: 1.3; }
.prow-stock-line { display: flex; justify-content: space-between; align-items: baseline; gap: 8px; }
.prow-qty { font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.prow-qty.is-out { color: var(--color-neutral-600); }
.prow-sub { font-size: 12px; color: var(--color-neutral-700); white-space: nowrap; }
.prow-sub.is-low, .prow-sub.is-out { color: var(--color-accent-700); }
.prow-add { display: flex; }
.prow-add .input { min-width: 0; min-height: 40px; border-right: 0; font-variant-numeric: tabular-nums; }
.prow-add .btn { flex: none; width: 44px; min-height: 40px; padding: 0; }
@media (max-width: 1179px) {
    .row-head { display: none; }
    .prow { grid-template-columns: 72px minmax(0, 1fr); gap: 8px 14px; align-items: start; padding: 14px 0; }
    .prow-thumb { width: 72px; height: 72px; grid-row: 1; }
    .prow-box { display: none; }
    .prow-box-inline, .prow-inc-label { display: inline; }
    .prow-main, .prow-stock, .prow-inc { grid-column: 2; }
    .prow-inc { font-size: 12px; }
    .prow-add { grid-column: 1 / -1; }
    .prow-add .input { min-height: 44px; font-size: 16px; }
    .prow-add .btn { width: 56px; min-height: 44px; }
}

.grid-view { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 32px 20px; padding-top: 8px; }
.tile-stock { background: transparent; box-shadow: none; }
.tile-stock .tile-img { position: relative; aspect-ratio: 4 / 3; background: var(--color-neutral-200); }
.tile-stock .tag-status { position: absolute; top: 0; left: 0; }
.tile-stock .tile-body { padding: 10px 0 0; border-top: 2px solid var(--color-text); }
.tile-qty { margin-top: 6px; font-size: 15px; font-weight: 800; font-variant-numeric: tabular-nums; }
.tile-qty.is-out { color: var(--color-neutral-600); }

/* Pagination: covers the simple-default and the bootstrap-4 Laravel views */
.pagination { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; margin: 24px 0 0; padding: 0; list-style: none; }
.pagination a, .pagination span { display: inline-flex; align-items: center; justify-content: center; min-width: 44px; min-height: 44px; padding: 0 14px; border: 1px solid var(--color-divider); border-radius: 0; background: var(--color-bg); text-decoration: none; font-variant-numeric: tabular-nums; }
.pagination a:hover { border-color: var(--color-accent); color: var(--color-accent); }
.pagination .active span { border-color: var(--color-accent); background: var(--color-accent); color: var(--color-bg); }
.pagination .disabled span { color: var(--color-neutral-700); opacity: .6; }

/* Product */
.product { display: grid; gap: 20px; }
.gallery { display: flex; margin: 0 calc(-1 * var(--gutter)); overflow-x: auto; background: var(--color-neutral-200); border-bottom: 1px solid var(--color-divider); scroll-snap-type: x mandatory; scrollbar-width: thin; scrollbar-color: var(--color-divider) transparent; }
.gallery img { flex: 0 0 100%; width: 100%; aspect-ratio: 1; object-fit: contain; scroll-snap-align: start; }
.gallery-empty { aspect-ratio: 1; margin: 0 calc(-1 * var(--gutter)); background: var(--color-neutral-200); border-bottom: 1px solid var(--color-divider); }
.gallery-hint { margin-top: 8px; color: var(--color-neutral-700); font-size: 13px; }
.product-info { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.product-code { margin-top: 6px; color: var(--color-neutral-700); font-variant-numeric: tabular-nums; }
.product-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.product-info h1 { font-size: clamp(30px, 4.4vw, 52px); letter-spacing: -0.03em; }
.stock-block, .buy { display: flex; flex-direction: column; gap: 12px; padding-top: 12px; border-top: 2px solid var(--color-text); }
.stock-head, .buy-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
.buy-head label { margin: 0; }
.stock-num { font-size: clamp(40px, 5.5vw, 64px); font-weight: 800; letter-spacing: -0.03em; line-height: 1; font-variant-numeric: tabular-nums; }
.stock-num span { font-size: 0.45em; letter-spacing: 0; }
.stock-num.is-low { color: var(--color-accent-700); }
.stock-num.is-out { color: var(--color-neutral-600); }
.stock-block .stock-bar { height: 6px; margin-top: 4px; }
.stock-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.stock-stats .stat > :nth-child(2) { font-size: 18px; }
.stock-stats .stat > :first-child { text-transform: none; letter-spacing: 0; font-size: 12px; font-weight: 400; }
.stock-stats small { color: var(--color-neutral-700); font-size: 12px; }
.stock-lines { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.stock-lines li { display: flex; flex-direction: column; gap: 2px; padding: 10px 12px; border-left: 4px solid var(--color-text); background: var(--color-surface); }
.stock-lines li.is-green { border-left-color: var(--color-stock-ok); }
.stock-lines li.is-yellow { border-left-color: var(--color-stock-low); }
.stock-lines li.is-red { border-left-color: var(--color-stock-out); }
.stock-lines li.is-blue { border-left-color: var(--color-neutral-500); }
.stock-lines span { color: var(--color-neutral-700); font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }
.stock-lines b { font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.stock-lines li.is-red b { color: var(--color-stock-out-text); }
.pack { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; margin: 0; padding-top: 12px; border-top: 1px solid var(--color-divider); }
.pack dt, .pack-sub { color: var(--color-neutral-700); font-size: 12px; }
.pack dd { margin: 0; font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
.pack dd.pack-sub { font-size: 12px; font-weight: 400; }

.buy { padding-top: 16px; }
.buy-row { display: flex; flex-wrap: wrap; gap: 8px; }
.stepper { display: flex; flex: 1 1 240px; min-width: 0; }
.stepper .btn { flex: none; width: 52px; min-height: 52px; padding: 0; }
.stepper .input { min-width: 0; min-height: 52px; border-width: 1px 0; border-radius: 0; font-size: 20px; font-weight: 800; text-align: center; font-variant-numeric: tabular-nums; }
.buy-row > .btn-primary { flex: 1 1 200px; justify-content: space-between; }
.calc { margin: 0; font-size: 14px; font-variant-numeric: tabular-nums; }
.warn { margin: 0; padding: 8px 12px; border-left: 4px solid var(--color-accent); background: var(--color-accent-100); color: var(--color-accent-700); font-size: 14px; }
.warn[hidden] { display: none; }
.in-cart { margin: 0; color: var(--color-neutral-700); font-size: 13px; }
.hint { color: var(--color-neutral-700); font-size: 13px; }


.description { border: 1px solid var(--color-divider); border-radius: 0; background: var(--color-bg); }
.description summary { display: flex; align-items: center; min-height: 48px; padding: 0 16px; font-weight: 600; list-style: none; cursor: pointer; }
.description summary::-webkit-details-marker { display: none; }
.description summary::after { content: '+'; margin-left: auto; color: var(--color-neutral-700); font-size: 20px; }
.description[open] summary::after { content: '\2013'; }
.description-body { max-width: 65ch; padding: 0 16px 16px; overflow-x: auto; }
.description-body img { height: auto; }
.product-details { display: grid; gap: 20px; margin-top: 20px; }
.specs { margin: 0; padding: 0 16px 16px; }
.specs div { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 8px; padding: 8px 0; border-top: 1px solid var(--color-divider); }
.specs dt { align-self: center; color: var(--color-neutral-700); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; overflow-wrap: anywhere; }
.specs dd { margin: 0; font-weight: 600; font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }

@media (min-width: 900px) {
    .product { grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); gap: 40px; align-items: start; }
    .gallery-wrap { position: sticky; top: 96px; }
    .gallery, .gallery-empty { margin: 0; border: 1px solid var(--color-divider); border-radius: 0; }
    .product-details { grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); gap: 40px; align-items: start; margin-top: 40px; }
}

/* Cart */
.cart-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 8px 16px; margin-bottom: 24px; }
.cart-head .page-title { margin: 0; }
.cart-summary { color: var(--color-neutral-700); font-size: 14px; }
.cart { display: grid; gap: 32px; }
.cart-line { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--color-divider); }
.cart-line .thumb { width: 64px; height: 64px; }
.cart-line-body { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px 24px; min-width: 0; }
.cart-line-info { flex: 1 1 220px; min-width: 0; }
.line-name { display: block; font-size: 15px; font-weight: 800; color: var(--color-text); text-decoration: none; }
.line-name:hover { color: var(--color-accent); }
.line-code { margin: 0; color: var(--color-neutral-700); font-size: 12px; }
.line-stock { display: flex; align-items: center; gap: 6px; margin: 4px 0 0; font-size: 13px; }
.line-stock .dot { flex: none; width: 8px; height: 8px; background: var(--color-neutral-700); }
.line-stock.ok .dot { background: var(--color-text); }
.line-stock.low .dot { background: var(--color-accent); }
.line-stock.out .dot, .line-stock.over .dot { background: var(--color-accent); }
.line-stock.over, .line-stock.out { color: var(--color-accent-700); }
.cart-line-qty { display: flex; align-items: center; gap: 16px; }
.cart-line-qty .stepper { flex: none; display: flex; }
.cart-line-qty .stepper .btn { width: 40px; min-height: 40px; }
.cart-line-qty .stepper .input { width: 56px; min-height: 40px; padding: 0; border-width: 1px 0; font-size: 16px; }
.qty-label { margin-left: -8px; color: var(--color-neutral-700); font-size: 13px; }
.line-total { min-width: 88px; text-align: right; font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; }
.icon-remove { display: grid; place-items: center; width: 40px; height: 40px; border: 0; background: transparent; color: var(--color-neutral-700); cursor: pointer; }
.icon-remove:hover { background: var(--color-accent-100); color: var(--color-accent); }
.unavailable-note { margin-top: 4px; color: var(--color-accent-700); font-size: 14px; }
.is-unavailable .thumb, .is-unavailable .line-name, .is-unavailable .line-code { opacity: .5; }
.cart-main { padding-top: 0; }
.cart-main > .btn-ghost { margin-top: 12px; }
.cart-save { display: flex; justify-content: flex-end; margin-top: 12px; }
.send { display: flex; flex-direction: column; gap: 16px; padding-top: 16px; }
.send h2 { margin: 0; font-size: 22px; }
.send-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; padding-bottom: 16px; border-bottom: 1px solid var(--color-divider); }
.send .btn-primary { justify-content: space-between; }
.send-note { margin: 0; color: var(--color-neutral-700); font-size: 13px; }
.sent { display: grid; grid-template-columns: minmax(0, 1fr); gap: 40px; max-width: 1040px; padding-top: 24px; }
.sent-mark { display: grid; place-items: center; width: 40px; height: 40px; background: var(--color-accent); color: var(--color-bg); }
.sent .page-title { margin: 16px 0 8px; font-size: clamp(24px, 3vw, 32px); overflow-wrap: anywhere; }
.sent-text { max-width: 44ch; margin: 0 0 20px; font-size: 15px; color: var(--color-neutral-800); }
.sent-note { margin: 0 0 24px; padding: 8px 12px; border-left: 4px solid var(--color-accent); background: var(--color-accent-100); font-size: 14px; overflow-wrap: anywhere; }
.sent .actions { margin-top: 0; }
/* The request slip: a tear-off line separates the header from the lines */
.slip { padding: 20px 24px 24px; background: var(--color-neutral-100); border-top: 2px solid var(--color-text); }
.slip-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; margin-bottom: 6px; }
.slip-meta { font-size: 14px; color: var(--color-neutral-700); font-variant-numeric: tabular-nums; overflow-wrap: anywhere; }
.slip-lines { margin-top: 16px; padding-top: 6px; border-top: 2px dashed var(--color-neutral-400); }
.slip-lines .request-line:first-child { border-top: 0; }
.slip .request-notes { padding-bottom: 10px; }
.slip-total { padding-top: 12px; border-top: 2px solid var(--color-text); font-size: 18px; font-weight: 800; font-variant-numeric: tabular-nums; }
@media (min-width: 900px) {
    .sent { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
    .cart { grid-template-columns: minmax(0, 1fr) 360px; gap: 48px; align-items: start; }
    .send { position: sticky; top: 96px; }
}

/* Requests */
.requests { max-width: 960px; }
.seg-scroll { overflow-x: auto; margin-bottom: 24px; }
.request { border-top: 2px solid var(--color-text); }
.request > summary { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 12px; align-items: center; padding: 16px 0; cursor: pointer; list-style: none; }
.request > summary::-webkit-details-marker { display: none; }
.request > summary:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 2px; }
.request-title { display: flex; flex-wrap: wrap; align-items: baseline; gap: 2px 16px; }
.request-id { font-size: 22px; font-weight: 800; letter-spacing: -0.01em; }
.request-date { font-size: 14px; color: var(--color-neutral-700); font-variant-numeric: tabular-nums; }
.request-state { display: flex; align-items: center; gap: 12px; }
.request[open] .chevron { transform: rotate(180deg); }
.request-summary { grid-column: 1 / -1; font-size: 14px; color: var(--color-neutral-800); overflow-wrap: anywhere; }
.request-body { padding-bottom: 20px; }
.reason { margin: 0 0 12px; padding: 10px 12px; border-left: 4px solid var(--color-accent); background: var(--color-accent-100); color: var(--color-accent-800); font-size: 14px; overflow-wrap: anywhere; }
.request-line { display: grid; grid-template-columns: 40px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 10px 0; border-top: 1px solid var(--color-divider); }
.request-line .thumb { width: 40px; height: 40px; }
.request-line .line-name { font-size: 15px; font-weight: 600; }
.request-line .line-code { font-size: 12px; color: var(--color-neutral-700); }
.request-line-qty { font-size: 16px; font-weight: 800; font-variant-numeric: tabular-nums; white-space: nowrap; }
.request-notes { margin: 0; padding-top: 10px; border-top: 1px solid var(--color-divider); font-size: 14px; color: var(--color-neutral-700); overflow-wrap: anywhere; }
.request-body form { margin-top: 12px; }
.request-body .btn { min-height: 40px; }

/* Scan page */
.scan { max-width: 640px; margin-bottom: 32px; }
.scan-frame { position: relative; aspect-ratio: 4 / 3; background: var(--color-neutral-900); display: grid; place-items: center; overflow: hidden; }
.scan-corner { position: absolute; z-index: 2; width: 32px; height: 32px; border: 0 solid var(--color-bg); pointer-events: none; }
.scan-corner.tl { left: 12%; top: 16%; border-left-width: 3px; border-top-width: 3px; }
.scan-corner.tr { right: 12%; top: 16%; border-right-width: 3px; border-top-width: 3px; }
.scan-corner.bl { left: 12%; bottom: 16%; border-left-width: 3px; border-bottom-width: 3px; }
.scan-corner.br { right: 12%; bottom: 16%; border-right-width: 3px; border-bottom-width: 3px; }
#reader { position: absolute; inset: 0; z-index: 1; overflow: hidden; background: var(--color-neutral-900); }
#reader video { width: 100% !important; height: 100% !important; object-fit: cover; }
.scan-line, .scan-hint { display: none; position: absolute; z-index: 2; }
.scan-line { left: 12%; right: 12%; top: 50%; height: 2px; background: var(--color-accent); box-shadow: 0 0 12px var(--color-accent); }
.scan-hint { bottom: 6%; color: var(--color-neutral-300); font-size: 14px; text-align: center; }
.scan-frame.is-scanning .scan-line, .scan-frame.is-scanning .scan-hint { display: block; }
.scan-toggle { position: relative; z-index: 3; min-height: 52px; padding: 0 22px; font-size: 16px; }
.scan-frame.is-scanning .scan-toggle { position: absolute; top: 12px; right: 12px; min-height: 40px; padding: 0 14px; font-size: 14px; }
.scan-form { margin-top: 28px; }
.scan-form-row { display: flex; gap: 8px; }
.scan-form .input { min-height: 48px; font-size: 16px; flex: 1; min-width: 0; }
.scan-form .btn { min-height: 48px; padding: 0 20px; }
.scan-error { margin-top: 8px; font-size: 14px; color: var(--color-accent-700); }
.scan-matches { margin-top: 32px; }


.btn-quiet { display: inline-flex; align-items: center; min-height: 44px; padding: 0 8px; border: 0; background: none; color: var(--color-neutral-700); font: 500 15px/1 var(--font-body); text-decoration: underline; cursor: pointer; }
.icon-btn { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 48px; height: 48px; border: 1px solid var(--color-divider); background: var(--color-surface); color: var(--color-text); }
.login-kicker { margin-bottom: 8px; }

/* Delivery choice in the send form */
.delivery { margin: 0; padding: 0; border: 0; display: flex; flex-direction: column; gap: 8px; }
.delivery legend { padding: 0; margin-bottom: 5px; font-size: 12px; color: color-mix(in srgb, var(--color-text) 70%, transparent); }
.delivery-opt { display: flex; align-items: center; gap: 8px; font-size: 14px; cursor: pointer; }
.delivery-opt input { margin: 0; accent-color: var(--color-accent); }
.delivery-note, .delivery-county { margin: 4px 0 0; font-size: 13px; color: var(--color-neutral-700); }
.delivery-pallex { display: flex; flex-direction: column; gap: 16px; }
.delivery-pallex[hidden], .pallex-req[hidden] { display: none; }
.delivery-quote { margin: 6px 0 0; font-size: 14px; font-weight: 600; }
.delivery-quote small { display: block; margin-top: 2px; font-size: 12px; font-weight: 400; color: var(--color-neutral-700); }
.delivery-quote[hidden] { display: none; }
