/* Central Supply - online ordering */
:root {
  --navy: #0c2340;
  --navy-2: #143a66;
  --blue: #1a5fd0;
  --blue-ink: #0f48a8;
  --blue-soft: #e8f0fd;
  --green: #11865a;
  --green-soft: #e3f5ec;
  --amber: #b45f06;
  --amber-soft: #fdf1e1;
  --red: #c4302b;
  --red-soft: #fdeaea;
  --ink: #0f1b2d;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --line-2: #cbd5e1;
  --bg: #f3f5f9;
  --surface: #ffffff;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow-sm: 0 1px 2px rgba(15, 27, 45, .06), 0 1px 3px rgba(15, 27, 45, .06);
  --shadow: 0 4px 14px rgba(15, 27, 45, .08), 0 1px 3px rgba(15, 27, 45, .06);
  --shadow-lg: 0 20px 50px rgba(15, 27, 45, .22);
  --font: "Segoe UI Variable Text", "Segoe UI", system-ui, -apple-system, Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: "Cascadia Mono", Consolas, "SFMono-Regular", Menlo, monospace;
  --header-h: 68px;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font: 15px/1.5 var(--font); color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { max-width: 100%; display: block; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input, select, textarea { font: inherit; color: inherit; }
h1, h2, h3 { line-height: 1.2; margin: 0; letter-spacing: -.01em; }
h1 { font-size: 26px; font-weight: 700; }
h2 { font-size: 19px; font-weight: 650; }
h3 { font-size: 15px; font-weight: 600; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: .92em; }
.nowrap { white-space: nowrap; }
.right { text-align: right; }
.hidden { display: none !important; }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---------- Buttons & inputs ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 40px; padding: 0 16px; border-radius: 10px; border: 1px solid var(--line-2); background: var(--surface); color: var(--ink); font-weight: 600; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s, box-shadow .15s, transform .05s; text-decoration: none !important; }
.btn:hover { background: #f8fafc; border-color: #94a3b8; }
.btn:active { transform: translateY(1px); }
.btn:focus-visible, .input:focus-visible, .qty input:focus-visible { outline: 3px solid rgba(26, 95, 208, .35); outline-offset: 1px; }
.btn.primary { background: var(--blue); border-color: var(--blue); color: #fff; }
.btn.primary:hover { background: var(--blue-ink); border-color: var(--blue-ink); }
.btn.success { background: var(--green); border-color: var(--green); color: #fff; }
.btn.success:hover { background: #0c6f4a; }
.btn.danger { color: var(--red); }
.btn.ghost { background: transparent; border-color: transparent; }
.btn.ghost:hover { background: rgba(15, 27, 45, .06); }
.btn.sm { height: 32px; padding: 0 11px; font-size: 13.5px; border-radius: 8px; }
.btn.lg { height: 50px; padding: 0 22px; font-size: 16px; border-radius: 12px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn svg { width: 18px; height: 18px; flex: none; }

.input, select.input, textarea.input { width: 100%; height: 42px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 10px 12px; resize: vertical; line-height: 1.45; }
.input:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 95, 208, .15); outline: none; }
label.field { display: block; margin-bottom: 14px; }
label.field > span { display: block; font-size: 13px; font-weight: 600; color: var(--ink-2); margin-bottom: 6px; }
.hint { font-size: 12.5px; color: var(--muted); margin-top: 5px; }

.badge { display: inline-flex; align-items: center; gap: 5px; padding: 2px 9px; border-radius: 99px; font-size: 12px; font-weight: 600; background: #eef2f7; color: var(--ink-2); white-space: nowrap; }
.badge.green { background: var(--green-soft); color: var(--green); }
.badge.amber { background: var(--amber-soft); color: var(--amber); }
.badge.red { background: var(--red-soft); color: var(--red); }
.badge.blue { background: var(--blue-soft); color: var(--blue-ink); }

/* ---------- Header ---------- */
.topbar { background: var(--navy); color: #c9d6ea; font-size: 12.5px; }
.topbar .wrap { display: flex; justify-content: space-between; gap: 16px; height: 32px; align-items: center; }
.topbar a { color: #fff; }
.wrap { max-width: 1440px; margin: 0 auto; padding: 0 24px; }
header.site { position: sticky; top: 0; z-index: 40; background: rgba(255, 255, 255, .96); backdrop-filter: saturate(1.4) blur(8px); border-bottom: 1px solid var(--line); }
header.site .wrap { display: flex; align-items: center; gap: 22px; height: var(--header-h); }
.logo { display: flex; align-items: center; flex: none; }
.logo img { height: 46px; width: auto; mix-blend-mode: multiply; }
.search { position: relative; flex: 1; max-width: 640px; }
.search input { width: 100%; height: 44px; padding: 0 44px 0 44px; border-radius: 12px; border: 1px solid var(--line-2); background: #f6f8fb; transition: background .15s, border-color .15s, box-shadow .15s; }
.search input:focus { background: #fff; border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 95, 208, .14); outline: none; }
.search > svg { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); width: 20px; height: 20px; color: var(--muted); pointer-events: none; }
.toolbar .search input { height: 38px; }
.nav-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.nav-link { display: inline-flex; align-items: center; gap: 7px; height: 40px; padding: 0 12px; border-radius: 10px; color: var(--ink-2); font-weight: 600; font-size: 14px; white-space: nowrap; }
.nav-link:hover { background: #f1f5f9; text-decoration: none; }
.nav-link.active { color: var(--blue-ink); background: var(--blue-soft); }
.nav-link svg { width: 19px; height: 19px; }
.cart-btn { display: inline-flex; align-items: center; gap: 10px; height: 44px; padding: 0 14px 0 12px; border-radius: 12px; background: var(--navy); color: #fff; font-weight: 600; text-decoration: none !important; transition: background .15s; }
.cart-btn:hover { background: var(--navy-2); }
.cart-btn svg { width: 21px; height: 21px; }
.cart-btn .count { min-width: 22px; height: 22px; padding: 0 6px; border-radius: 99px; background: #ffb547; color: var(--navy); font-size: 12.5px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center; }
.cart-btn .total { font-variant-numeric: tabular-nums; }
.cart-btn.bump { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.07); } }

.menu { position: relative; }
.menu-panel { position: absolute; right: 0; top: calc(100% + 8px); min-width: 230px; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: var(--shadow); padding: 6px; display: none; }
.menu.open .menu-panel { display: block; }
.menu-panel .who { padding: 10px 12px 8px; border-bottom: 1px solid var(--line); margin-bottom: 4px; }
.menu-panel .who b { display: block; }
.menu-panel a, .menu-panel button { display: flex; width: 100%; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 8px; color: var(--ink); background: none; border: 0; cursor: pointer; text-align: left; font-size: 14px; }
.menu-panel a:hover, .menu-panel button:hover { background: #f1f5f9; text-decoration: none; }

.deptbar { background: var(--surface); border-bottom: 1px solid var(--line); }
/* Desktop: departments wrap so every one is visible. Narrow screens: one swipeable row with faded edges. */
.deptbar .wrap { display: flex; flex-wrap: wrap; gap: 2px 2px; align-items: center; padding-top: 6px; padding-bottom: 6px; }
.deptbar .wrap::-webkit-scrollbar { display: none; }
.deptbar a { flex: none; padding: 7px 12px; border-radius: 8px; color: var(--ink-2); font-size: 14px; font-weight: 550; white-space: nowrap; }
.deptbar a:hover { background: #f1f5f9; text-decoration: none; }
.deptbar a.active { background: var(--navy); color: #fff; }

main { min-height: calc(100vh - 300px); }
.page { padding-top: 26px; padding-bottom: 60px; }

/* ---------- Home ---------- */
.hero { position: relative; overflow: hidden; border-radius: 20px; background: radial-gradient(1200px 400px at 85% -10%, #2a5ea8 0%, transparent 60%), linear-gradient(120deg, var(--navy) 0%, #12325a 60%, #184683 100%); color: #fff; padding: 38px 40px; display: grid; grid-template-columns: 1.3fr 1fr; gap: 30px; align-items: center; }
.hero h1 { font-size: 32px; font-weight: 750; letter-spacing: -.02em; }
.hero p { color: #c9d8ef; font-size: 16px; margin: 10px 0 22px; max-width: 560px; }
.hero .actions { display: flex; flex-wrap: wrap; gap: 10px; }
.hero .btn { border-color: rgba(255, 255, 255, .25); background: rgba(255, 255, 255, .08); color: #fff; }
.hero .btn:hover { background: rgba(255, 255, 255, .16); }
.hero .btn.primary { background: #ffb547; border-color: #ffb547; color: var(--navy); }
.hero .btn.primary:hover { background: #ffc46b; }
.hero-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.hero-stats div { background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .12); border-radius: 14px; padding: 16px; }
.hero-stats b { display: block; font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; }
.hero-stats span { font-size: 13px; color: #c9d8ef; }

.section { margin-top: 34px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 14px; }
.dept-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(176px, 1fr)); gap: 14px; }
.dept-tile { display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; color: var(--ink); transition: box-shadow .2s, transform .2s, border-color .2s; text-decoration: none !important; }
.dept-tile:hover { box-shadow: var(--shadow); transform: translateY(-2px); border-color: #c7d4e6; }
.dept-tile .pics { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; margin-bottom: 12px; }
.dept-tile .pics img { width: 100%; height: auto; aspect-ratio: 1; object-fit: contain; background: #fff; border-radius: 8px; }
.dept-tile b { font-size: 15px; }
.dept-tile span { font-size: 13px; color: var(--muted); }

.strip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(210px, 230px); gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x proximity; }
.strip > * { scroll-snap-align: start; }

/* ---------- Shop layout ---------- */
.shop { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; }
.sidebar { position: sticky; top: calc(var(--header-h) + 16px); max-height: calc(100vh - var(--header-h) - 32px); overflow: auto; padding-right: 4px; }
.sidebar h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); margin: 0 0 8px 10px; }
.cat-tree { list-style: none; padding: 0; margin: 0 0 18px; }
.cat-tree ul { list-style: none; padding: 0 0 4px 12px; margin: 0; border-left: 1px solid var(--line); margin-left: 14px; }
.cat-tree a { display: flex; justify-content: space-between; gap: 8px; padding: 6px 10px; border-radius: 8px; color: var(--ink-2); font-size: 14px; }
.cat-tree a:hover { background: #e9eef5; text-decoration: none; }
.cat-tree a.active { background: var(--navy); color: #fff; font-weight: 600; }
.cat-tree a.active .n { color: #c9d8ef; }
.cat-tree .n { color: var(--muted); font-size: 12.5px; font-variant-numeric: tabular-nums; }
.side-card { background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.toggle { display: flex; align-items: center; gap: 10px; cursor: pointer; font-size: 14px; font-weight: 550; padding: 4px 2px; }
.toggle input { width: 18px; height: 18px; accent-color: var(--blue); }

.crumbs { font-size: 13px; color: var(--muted); margin-bottom: 6px; }
.crumbs a { color: var(--muted); }
.listing-head { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.listing-head .count { color: var(--muted); font-size: 14px; margin-top: 4px; }
.toolbar { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.toolbar select.input { width: auto; height: 38px; }
.seg { display: inline-flex; background: #e8edf4; border-radius: 10px; padding: 3px; }
.seg button { border: 0; background: transparent; height: 32px; padding: 0 12px; border-radius: 8px; font-weight: 600; font-size: 13.5px; color: var(--ink-2); cursor: pointer; display: inline-flex; align-items: center; gap: 6px; }
.seg button.on { background: #fff; color: var(--ink); box-shadow: var(--shadow-sm); }
.seg svg { width: 16px; height: 16px; }
.mobile-cats { display: none; margin-bottom: 14px; }

/* ---------- Product cards ---------- */
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(208px, 1fr)); gap: 16px; }
.card { position: relative; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .2s, border-color .2s, transform .2s; }
.card:hover { box-shadow: var(--shadow); border-color: #c7d4e6; }
.card.in-cart { border-color: #8fb3ef; box-shadow: 0 0 0 1px #8fb3ef; }
.card .img { position: relative; aspect-ratio: 1; background: #fff; padding: 14px; cursor: pointer; border: 0; display: block; width: 100%; }
.card .img img { width: 100%; height: 100%; object-fit: contain; transition: transform .3s; }
.card:hover .img img { transform: scale(1.04); }
.card .flag { position: absolute; top: 10px; left: 10px; }
.card .body { display: flex; flex-direction: column; flex: 1; padding: 0 14px 14px; gap: 6px; }
.card .meta { display: flex; justify-content: space-between; gap: 6px; font-size: 12px; color: var(--muted); }
.card .meta .mono { color: var(--ink-2); font-weight: 600; }
.card .title { font-size: 14px; font-weight: 600; line-height: 1.35; color: var(--ink); cursor: pointer; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 3.95em; }
.card .title:hover { color: var(--blue-ink); }
.card .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding-top: 6px; }
.price { font-size: 18px; font-weight: 750; font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.price small { font-size: 12px; font-weight: 600; color: var(--muted); margin-left: 2px; }
.price-login { font-size: 13px; font-weight: 600; }
.unit-price { font-size: 12px; color: var(--muted); }
.noimg { width: 100%; height: 100%; display: grid; place-items: center; color: #b6c2d3; background: repeating-linear-gradient(45deg, #f8fafc, #f8fafc 10px, #f1f5f9 10px, #f1f5f9 20px); border-radius: 10px; font-size: 12px; font-weight: 600; }
.noimg svg { width: 40px; height: 40px; }

.qty { display: inline-flex; align-items: center; height: 38px; border: 1px solid var(--line-2); border-radius: 10px; background: #fff; overflow: hidden; }
.qty button { width: 34px; height: 100%; border: 0; background: #f6f8fb; cursor: pointer; font-size: 18px; font-weight: 600; color: var(--ink-2); display: grid; place-items: center; }
.qty button:hover { background: #e9eef5; }
.qty input { width: 46px; height: 100%; border: 0; text-align: center; font-weight: 700; font-variant-numeric: tabular-nums; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }
.in-cart .qty { border-color: var(--blue); }
.in-cart .qty input { color: var(--blue-ink); }
.add-btn { height: 38px; padding: 0 14px; border-radius: 10px; border: 0; background: var(--blue); color: #fff; font-weight: 650; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; transition: background .15s; }
.add-btn:hover { background: var(--blue-ink); }
.add-btn svg { width: 17px; height: 17px; }

/* list view / order sheet rows */
.rows { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: clip; }
.row { display: grid; grid-template-columns: 64px 104px 1fr 90px 100px 128px 96px; gap: 14px; align-items: center; padding: 8px 16px; border-bottom: 1px solid var(--line); min-height: 72px; }
.row:last-child { border-bottom: 0; }
.row:hover { background: #fafbfd; }
.row.in-cart { background: #f3f7fe; }
.row .thumb { width: 56px; height: 56px; border-radius: 8px; background: #fff; border: 1px solid var(--line); padding: 3px; cursor: pointer; }
.row .thumb img { width: 100%; height: 100%; object-fit: contain; }
.row .desc { font-weight: 600; font-size: 14px; line-height: 1.35; cursor: pointer; }
.row .desc:hover { color: var(--blue-ink); }
.row .sub { font-size: 12px; color: var(--muted); }
.row-head { background: #f6f8fb; min-height: 0; padding-top: 10px; padding-bottom: 10px; font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); position: sticky; top: var(--header-h); z-index: 5; }
.row .ext { text-align: right; font-weight: 700; font-variant-numeric: tabular-nums; }
.row .p { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }

.sheet-qty { width: 84px; height: 40px; border: 1px solid var(--line-2); border-radius: 9px; text-align: center; font-weight: 700; font-size: 15px; font-variant-numeric: tabular-nums; }
.sheet-qty:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 95, 208, .18); outline: none; }
.in-cart .sheet-qty { border-color: var(--blue); background: #fff; color: var(--blue-ink); }

.load-more { display: flex; justify-content: center; padding: 26px 0; color: var(--muted); }
.empty { text-align: center; padding: 70px 20px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line-2); border-radius: var(--radius); }
.empty svg { width: 46px; height: 46px; color: #b6c2d3; margin: 0 auto 10px; }
.empty h2 { color: var(--ink); margin-bottom: 6px; }

/* ---------- Sticky order bar ---------- */
.orderbar { position: sticky; bottom: 0; z-index: 30; margin-top: 18px; background: var(--navy); color: #fff; border-radius: 14px; padding: 12px 14px 12px 22px; display: flex; align-items: center; gap: 18px; box-shadow: var(--shadow-lg); }
.orderbar .stats { display: flex; gap: 26px; flex: 1; flex-wrap: wrap; }
.orderbar .stats div { font-size: 13px; color: #c9d8ef; }
.orderbar .stats b { display: block; color: #fff; font-size: 18px; font-variant-numeric: tabular-nums; }
.orderbar .btn.primary { background: #ffb547; border-color: #ffb547; color: var(--navy); }
.orderbar .btn.primary:hover { background: #ffc46b; }

/* ---------- Panels, tables, tabs ---------- */
.panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); }
.panel-pad { padding: 20px 22px; }
.panel-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 16px 22px; border-bottom: 1px solid var(--line); }
.tabs { display: flex; gap: 4px; box-shadow: inset 0 -1px var(--line); margin-bottom: 20px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs a, .tabs button { padding: 10px 14px; border: 0; background: none; font-weight: 600; color: var(--muted); border-bottom: 2px solid transparent; cursor: pointer; white-space: nowrap; font-size: 14.5px; display: inline-flex; align-items: center; gap: 8px; }
.tabs a:hover, .tabs button:hover { color: var(--ink); text-decoration: none; }
.tabs .on { color: var(--blue-ink); border-bottom-color: var(--blue); }
.tabs svg { width: 18px; height: 18px; }

table.t { width: 100%; border-collapse: collapse; font-size: 14px; }
table.t th { text-align: left; font-size: 12px; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); font-weight: 700; padding: 11px 14px; background: #f6f8fb; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 11px 14px; border-bottom: 1px solid var(--line); vertical-align: middle; }
table.t tr:last-child td { border-bottom: 0; }
table.t tr.click { cursor: pointer; }
table.t tr.click:hover td { background: #f8fafc; }
table.t .num { text-align: right; font-variant-numeric: tabular-nums; }
.table-wrap { overflow-x: auto; }

/* ---------- Cart / checkout ---------- */
.checkout { display: grid; grid-template-columns: 1fr 380px; gap: 26px; align-items: start; }
.summary { position: sticky; top: calc(var(--header-h) + 16px); }
.sum-line { display: flex; justify-content: space-between; padding: 6px 0; font-size: 14.5px; }
.sum-total { display: flex; justify-content: space-between; align-items: baseline; padding: 14px 0 4px; margin-top: 8px; border-top: 1px solid var(--line); font-size: 15px; font-weight: 700; }
.sum-total b { font-size: 26px; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.address { font-size: 14px; line-height: 1.5; padding: 12px 14px; background: #f6f8fb; border-radius: 10px; border: 1px solid var(--line); }
.cart-row { display: grid; grid-template-columns: 76px 1fr auto; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--line); align-items: center; }
.cart-row:last-child { border-bottom: 0; }
.cart-row .thumb { width: 76px; height: 76px; border-radius: 10px; border: 1px solid var(--line); padding: 4px; background: #fff; cursor: pointer; }
.cart-row .thumb img { width: 100%; height: 100%; object-fit: contain; }
.cart-row .controls { display: flex; align-items: center; gap: 16px; }
.cart-row .ext { min-width: 92px; text-align: right; font-weight: 750; font-size: 16px; font-variant-numeric: tabular-nums; }
.cart-row.bad { background: var(--red-soft); }

.alert { display: flex; gap: 12px; align-items: flex-start; padding: 13px 16px; border-radius: 12px; font-size: 14px; border: 1px solid; margin-bottom: 16px; }
.alert svg { width: 20px; height: 20px; flex: none; margin-top: 1px; }
.alert.green { background: var(--green-soft); border-color: #b5e2cb; color: #0b5e3f; }
.alert.amber { background: var(--amber-soft); border-color: #f4d3a8; color: #7c4103; }
.alert.red { background: var(--red-soft); border-color: #f3c0bd; color: #8f1f1b; }
.alert.blue { background: var(--blue-soft); border-color: #bcd3f7; color: #0c3c8c; }

.success-hero { text-align: center; padding: 34px 20px 26px; }
.success-hero .check { width: 64px; height: 64px; border-radius: 50%; background: var(--green-soft); color: var(--green); display: grid; place-items: center; margin: 0 auto 14px; }
.success-hero .check svg { width: 34px; height: 34px; }

/* ---------- Modal ---------- */
.modal-back { position: fixed; inset: 0; z-index: 100; background: rgba(9, 18, 33, .55); backdrop-filter: blur(3px); display: flex; align-items: flex-start; justify-content: center; padding: 6vh 16px 16px; overflow-y: auto; animation: fade .15s ease; }
.modal { position: relative; width: 100%; max-width: 560px; background: #fff; border-radius: 18px; box-shadow: var(--shadow-lg); animation: rise .2s ease; }
.modal.wide { max-width: 940px; }
.modal-head { display: flex; justify-content: space-between; align-items: center; gap: 10px; padding: 18px 22px; border-bottom: 1px solid var(--line); }
.modal-body { padding: 20px 22px; }
.modal-foot { display: flex; justify-content: flex-end; gap: 10px; padding: 14px 22px 18px; }
.modal .x { position: absolute; top: 12px; right: 12px; z-index: 2; }
@keyframes fade { from { opacity: 0; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px) scale(.985); } }

.pd { display: grid; grid-template-columns: 1.05fr 1fr; }
.pd-img { background: #fff; padding: 30px; border-right: 1px solid var(--line); display: grid; place-items: center; border-radius: 18px 0 0 18px; min-height: 380px; }
.pd-img img { max-height: 460px; object-fit: contain; }
.pd-info { padding: 32px 30px 26px; display: flex; flex-direction: column; gap: 14px; }
.pd-info h2 { font-size: 22px; line-height: 1.3; padding-right: 30px; }
.specs { display: grid; grid-template-columns: auto 1fr; gap: 6px 16px; font-size: 14px; margin: 0; }
.specs dt { color: var(--muted); }
.specs dd { margin: 0; font-weight: 550; }
.pd-buy { display: flex; align-items: center; gap: 12px; padding: 16px; border-radius: 14px; background: #f6f8fb; border: 1px solid var(--line); }
.pd-buy .price { font-size: 26px; }
.family { border-top: 1px solid var(--line); padding: 18px 22px 22px; }
.family .strip { grid-auto-columns: 120px; }
.mini { display: flex; flex-direction: column; gap: 6px; padding: 8px; border: 1px solid var(--line); border-radius: 12px; background: #fff; cursor: pointer; font-size: 12px; line-height: 1.3; color: var(--ink-2); }
.mini:hover { border-color: var(--blue); }
.mini.cur { border-color: var(--blue); box-shadow: 0 0 0 1px var(--blue); }
.mini .im { aspect-ratio: 1; }
.mini .im img { width: 100%; height: 100%; object-fit: contain; }
.mini span { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 200; display: flex; flex-direction: column; gap: 8px; align-items: center; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; background: #0f1b2d; color: #fff; padding: 12px 16px 12px 14px; border-radius: 12px; box-shadow: var(--shadow-lg); font-size: 14px; animation: rise .2s ease; max-width: min(560px, calc(100vw - 32px)); }
.toast svg { width: 20px; height: 20px; flex: none; color: #5fd3a0; }
.toast.err svg { color: #ff8a80; }
.toast a { color: #9cc3ff; font-weight: 600; }

/* ---------- Login ---------- */
.auth { min-height: 100vh; display: grid; grid-template-columns: 1.1fr 1fr; background: #fff; }
.auth-brand { background: radial-gradient(900px 500px at 10% 110%, #245ba3 0%, transparent 60%), linear-gradient(150deg, #0a1d36 0%, var(--navy) 50%, #163f73 100%); color: #fff; padding: 56px; display: flex; flex-direction: column; justify-content: space-between; }
.auth-brand .logo-card { background: #fff; border-radius: 16px; padding: 14px 18px; display: inline-flex; width: fit-content; }
.auth-brand .logo-card img { height: 64px; }
.auth-brand h1 { font-size: 40px; font-weight: 750; letter-spacing: -.025em; line-height: 1.12; max-width: 520px; }
.auth-brand p { color: #c9d8ef; font-size: 17px; max-width: 500px; margin: 16px 0 0; }
.auth-brand ul { list-style: none; padding: 0; margin: 30px 0 0; display: grid; gap: 12px; }
.auth-brand li { display: flex; gap: 12px; align-items: center; color: #e2ebf8; }
.auth-brand li svg { width: 22px; height: 22px; color: #ffb547; flex: none; }
.auth-brand .foot { color: #9fb3cf; font-size: 13px; }
.auth-form { display: flex; align-items: center; justify-content: center; padding: 40px 24px; }
.auth-form form { width: 100%; max-width: 380px; }
.auth-form h2 { font-size: 26px; margin-bottom: 6px; }

/* ---------- Footer ---------- */
footer.site { background: var(--navy); color: #9fb3cf; font-size: 13.5px; margin-top: 40px; }
footer.site .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-top: 28px; padding-bottom: 28px; }
footer.site b { color: #fff; }
footer.site a { color: #cfe0ff; }

/* ---------- Admin ---------- */
.kpis { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; margin-bottom: 22px; }
.kpi { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.kpi span { font-size: 13px; color: var(--muted); font-weight: 600; }
.kpi b { display: block; font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; margin-top: 2px; }
.kpi small { color: var(--muted); }
.cred { background: #0f1b2d; color: #e2ebf8; border-radius: 12px; padding: 16px 18px; font-family: var(--mono); font-size: 14px; line-height: 1.7; white-space: pre-wrap; word-break: break-all; }
.cred b { color: #ffb547; font-weight: 700; }
pre.file { background: #0f1b2d; color: #d3e2f7; border-radius: 12px; padding: 14px 16px; font-family: var(--mono); font-size: 12px; line-height: 1.55; overflow-x: auto; margin: 0; }
.dl { display: grid; grid-template-columns: 170px 1fr; gap: 8px 18px; font-size: 14px; }
.dl dt { color: var(--muted); }
.dl dd { margin: 0; word-break: break-word; }
.stack { display: grid; gap: 18px; }
.cols-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.cols-2 > *, .stack > * { min-width: 0; }

.spinner { width: 22px; height: 22px; border: 3px solid #d7e0ec; border-top-color: var(--blue); border-radius: 50%; animation: spin .8s linear infinite; margin: 0 auto; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading { padding: 80px 0; text-align: center; color: var(--muted); }

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .nav-link .lbl { display: none; }
  .row { grid-template-columns: 56px 90px 1fr 90px 120px 84px; }
  .row .pk { display: none; }
}
@media (max-width: 900px) {
  .wrap { padding: 0 16px; }
  .shop, .checkout { grid-template-columns: 1fr; }
  .sidebar { display: none; }
  .mobile-cats { display: block; }
  .deptbar .wrap { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; height: 46px; padding-top: 0; padding-bottom: 0; }
  .deptbar.more-right .wrap { -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, #000 calc(100% - 56px), transparent); }
  .deptbar.more-left .wrap { -webkit-mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to left, #000 calc(100% - 56px), transparent); }
  .deptbar.more-left.more-right .wrap { -webkit-mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); mask-image: linear-gradient(to right, transparent, #000 56px, #000 calc(100% - 56px), transparent); }
  .summary { position: static; }
  .hero { grid-template-columns: 1fr; padding: 28px 24px; }
  .pd { grid-template-columns: 1fr; }
  .pd-img { border-right: 0; border-bottom: 1px solid var(--line); border-radius: 18px 18px 0 0; min-height: 0; }
  .pd-img img { max-height: 300px; }
  .auth { grid-template-columns: 1fr; }
  .auth-brand { padding: 32px 24px; }
  .auth-brand h1 { font-size: 28px; }
  .auth-brand ul, .auth-brand .foot { display: none; }
  .cols-2 { grid-template-columns: 1fr; }
  .topbar .hide-sm { display: none; }
}
@media (max-width: 720px) {
  header.site .wrap { flex-wrap: wrap; height: auto; padding-top: 10px; padding-bottom: 10px; gap: 10px; }
  .search { order: 3; flex-basis: 100%; max-width: none; }
  .logo img { height: 38px; }
  .cart-btn .total { display: none; }
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .card .body { padding: 0 10px 10px; }
  .card .foot { flex-direction: column; align-items: stretch; }
  .card .foot .qty, .card .foot .add-btn { width: 100%; justify-content: center; }
  .card .foot .qty input { flex: 1; }
  .row { grid-template-columns: 52px 1fr auto; gap: 10px; padding: 10px 12px; }
  .row .code, .row .p, .row .ext { display: none; }
  .row-head { display: none; }
  .row .desc-cell .sub-sm { display: block; }
  .cart-row { grid-template-columns: 60px 1fr; }
  .cart-row .thumb { width: 60px; height: 60px; }
  .cart-row .controls { grid-column: 1 / -1; justify-content: space-between; }
  .orderbar { flex-direction: column; align-items: stretch; padding: 12px; gap: 10px; }
  .orderbar .stats { gap: 18px; }
  .orderbar .btn.lg { height: 44px; }
  .topbar .wrap > span:first-child, .kbd-tip { display: none; }
  .topbar .wrap { justify-content: center; }
  .hero-stats { grid-template-columns: repeat(3, 1fr); }
  .hero h1 { font-size: 25px; }
  .dl { grid-template-columns: 1fr; gap: 2px; }
  .dl dd { margin-bottom: 8px; }
  .page { padding-top: 18px; }
}
.sub-sm { display: none; }

@media print {
  .topbar, header.site, .deptbar, footer.site, .no-print, .toasts { display: none !important; }
  body { background: #fff; }
  .panel { border: 0; }
}
