/* DistriHUB dashboard. Colours, fonts and shapes follow distrihub.eu. */
:root {
  --bg: #fefefe;
  --cream: #f4f6e8;
  --text: #000;
  --text-2: rgba(0, 0, 0, .7);
  --text-3: rgba(0, 0, 0, .5);
  --text-4: rgba(0, 0, 0, .4);
  --line: rgba(0, 0, 0, .1);
  --line-soft: rgba(0, 0, 0, .06);
  --green: #9bb53a;
  --green-hover: #8aa32e;
  --green-dark: #6f861f;
  --green-tint: #eef3dc;
  --blue: #0092c8;
  --blue-tint: #e3f3fa;
  --red: #c4372c;
  --red-tint: #fbe9e7;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow: 0 1px 2px rgba(0, 0, 0, .04), 0 6px 24px rgba(0, 0, 0, .05);
  --font: Inter, "Inter Fallback", ui-sans-serif, system-ui, sans-serif;
  --font-head: Montserrat, "Montserrat Fallback", ui-sans-serif, system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 16px/1.5 var(--font);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1; }
a { color: var(--green-dark); text-underline-offset: 2px; }
a:hover { color: var(--text); }
h1, h2, h3 { font-family: var(--font-head); line-height: 1.2; margin: 0 0 .5em; }
h1 { font-size: 30px; font-weight: 900; letter-spacing: -.01em; }
h2 { font-size: 20px; font-weight: 800; }
h3 { font-size: 16px; font-weight: 800; }
p { margin: 0 0 1em; }
code { font-size: .9em; background: var(--cream); padding: 1px 5px; border-radius: 4px; }
[hidden] { display: none !important; }
.wrap { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 16px; }
.page { padding-top: 28px; padding-bottom: 56px; }
.muted { color: var(--text-3); }
.small { font-size: 13px; }
.nowrap { white-space: nowrap; }
.num { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.mono { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
td.mono { white-space: nowrap; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(254, 254, 254, .9);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 64px; }
.logo {
  font-family: var(--font-head); font-weight: 900; font-size: 24px; letter-spacing: -.02em;
  color: var(--text); text-decoration: none; white-space: nowrap;
}
.logo span { color: var(--green); }
.logo small { font-family: var(--font); font-weight: 400; font-size: 12px; color: var(--text-3); letter-spacing: 0; margin-left: 2px; }
.main-nav { display: flex; align-items: center; gap: 4px; flex: 1; }
.main-nav > a, .dropdown > summary {
  color: var(--text-2); text-decoration: none; font-weight: 500; font-size: 15px;
  padding: 8px 12px; border-radius: var(--radius-sm); cursor: pointer; list-style: none; white-space: nowrap;
}
.dropdown > summary::-webkit-details-marker { display: none; }
.dropdown > summary::after { content: "▾"; font-size: 11px; margin-left: 5px; color: var(--text-4); }
.main-nav > a:hover, .dropdown > summary:hover { background: var(--line-soft); color: var(--text); }
.main-nav > a.active, .dropdown.active > summary { color: var(--text); font-weight: 600; background: var(--green-tint); }
.nav-spacer { flex: 1; }
.cart-link { display: inline-flex; align-items: center; gap: 6px; }
.cart-badge {
  background: var(--green); color: #fff; font-size: 12px; font-weight: 700;
  min-width: 20px; height: 20px; border-radius: 10px; padding: 0 6px; display: inline-grid; place-items: center;
}
.cart-badge.bump { animation: bump .35s ease; }
@keyframes bump { 50% { transform: scale(1.3); } }
.dropdown { position: relative; }
.dropdown-menu {
  position: absolute; top: calc(100% + 6px); left: 0; min-width: 200px; z-index: 60;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 6px;
}
.dropdown-menu.right { left: auto; right: 0; }
.dropdown-menu a, .dropdown-menu button.link {
  display: block; width: 100%; text-align: left; padding: 8px 12px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: 15px;
}
.dropdown-menu a:hover, .dropdown-menu button.link:hover { background: var(--cream); }
.dropdown-menu a.active { font-weight: 600; color: var(--green-dark); }
.account > summary { max-width: 220px; overflow: hidden; text-overflow: ellipsis; }
.menu-toggle { display: none; margin-left: auto; background: none; border: 1px solid var(--line); border-radius: var(--radius-sm); font-size: 20px; padding: 4px 10px; cursor: pointer; }

.site-footer { border-top: 1px solid var(--line); color: var(--text-3); font-size: 13px; padding: 20px 0; }

/* Buttons and form controls */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  background: var(--green); color: #fff; border: 2px solid var(--green);
  font: 600 15px/1.2 var(--font); padding: 10px 18px; border-radius: var(--radius-sm);
  text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s;
}
.btn:hover { background: var(--green-hover); border-color: var(--green-hover); color: #fff; }
.btn:disabled { opacity: .55; cursor: not-allowed; }
.btn-outline { background: #fff; color: var(--text); border-color: var(--green); }
.btn-outline:hover { background: var(--green-tint); color: var(--text); border-color: var(--green); }
.btn-ghost { background: transparent; color: var(--text-2); border-color: var(--line); }
.btn-ghost:hover { background: var(--line-soft); color: var(--text); border-color: var(--line); }
.btn-danger { background: #fff; color: var(--red); border-color: rgba(196, 55, 44, .4); }
.btn-danger:hover { background: var(--red-tint); color: var(--red); border-color: var(--red); }
.btn-sm { padding: 6px 12px; font-size: 14px; }
.btn-lg { padding: 13px 24px; font-size: 16px; }
.btn-block { width: 100%; }
button.link { background: none; border: 0; padding: 0; font: inherit; color: var(--green-dark); cursor: pointer; text-decoration: underline; text-underline-offset: 2px; }
button.link.danger { color: var(--red); }

label { font-weight: 600; font-size: 14px; }
.field { display: grid; gap: 6px; }
.field .hint { font-weight: 400; color: var(--text-3); font-size: 13px; }
input[type=text], input[type=email], input[type=password], input[type=search], input[type=number], input[type=url], input[type=date], select, textarea {
  width: 100%; font: 400 15px/1.4 var(--font); color: var(--text);
  background: #fff; border: 1px solid rgba(0, 0, 0, .18); border-radius: var(--radius-sm); padding: 9px 12px;
}
input:focus, select:focus, textarea:focus, .btn:focus-visible, a:focus-visible, button:focus-visible, summary:focus-visible {
  outline: 3px solid rgba(155, 181, 58, .45); outline-offset: 1px; border-color: var(--green);
}
input[type=checkbox] { width: 16px; height: 16px; accent-color: var(--green); vertical-align: -3px; margin: 0 4px 0 0; }
.check { display: inline-flex; align-items: center; gap: 4px; font-weight: 500; cursor: pointer; }
.error-text { color: var(--red); font-size: 13px; font-weight: 500; }
.form-grid { display: grid; gap: 16px; }
.form-grid > *, .grid-2 > *, .cart-grid > *, .catalog > * { min-width: 0; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline { display: inline; }

/* Alerts, badges, toast */
.alert { padding: 12px 16px; border-radius: var(--radius); margin-bottom: 20px; border: 1px solid; font-weight: 500; }
.alert-success { background: var(--green-tint); border-color: rgba(155, 181, 58, .5); }
.alert-error { background: var(--red-tint); border-color: rgba(196, 55, 44, .35); color: #7a1f17; }
.alert-info { background: var(--blue-tint); border-color: rgba(0, 146, 200, .3); color: #004a66; }
.alert ul { margin: 6px 0 0; padding-left: 20px; font-weight: 400; }
.badge {
  display: inline-block; font-size: 12px; font-weight: 600; padding: 3px 10px; border-radius: 999px;
  background: var(--line-soft); color: var(--text-2); white-space: nowrap;
}
.badge-submitted, .badge-queued, .badge-running { background: var(--blue-tint); color: #00658a; }
.badge-confirmed, .badge-ready, .badge-success { background: var(--green-tint); color: var(--green-dark); }
.badge-shipped { background: #e7eefc; color: #2c4f9e; }
.badge-completed { background: #111; color: #fff; }
.badge-cancelled, .badge-failed { background: var(--red-tint); color: var(--red); }
.pill {
  display: inline-block; border: 1px solid rgba(155, 181, 58, .5); background: var(--cream);
  border-radius: 999px; padding: 4px 14px; font-size: 13px; font-weight: 500; color: var(--text-2);
}
.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 100;
  background: #111; color: #fff; padding: 12px 18px; border-radius: var(--radius); box-shadow: var(--shadow);
  font-size: 15px; max-width: calc(100vw - 32px);
}
.toast.error { background: var(--red); }

/* Cards, panels, tables */
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.card + .card { margin-top: 20px; }
/* In a grid the gap does the spacing; a margin would push the second card down. */
:is(.grid-2, .continue-grid, .dash-aside) > .card + .card { margin-top: 0; }
.card-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.card-head h2 { margin: 0; }
.page-head { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; justify-content: space-between; margin-bottom: 24px; }
.page-head h1 { margin: 0; }
.page-head p { margin: 6px 0 0; color: var(--text-2); }
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
table { width: 100%; border-collapse: collapse; font-size: 14px; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--line-soft); vertical-align: middle; }
th { font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; background: #fcfcf8; }
tbody tr:last-child td { border-bottom: 0; }
tbody tr:hover td { background: #fcfdf7; }
tfoot td { font-weight: 700; background: #fcfcf8; }
.empty-state { text-align: center; padding: 56px 16px; color: var(--text-2); }
.empty-state h1, .empty-state h2 { color: var(--text); }

/* Dashboard */
.dash-hero {
  background: linear-gradient(180deg, var(--cream) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line-soft); padding: 28px 0 24px;
}
.dash-greeting { margin: 0 0 14px; font-family: var(--font-head); font-weight: 800; font-size: 22px; }
.dash-greeting span { font-family: var(--font); font-weight: 400; font-size: 15px; color: var(--text-3); }
.dash-search {
  display: flex; align-items: center; gap: 8px; background: #fff;
  border: 1px solid rgba(0, 0, 0, .18); border-radius: 12px; padding: 6px 6px 6px 16px; box-shadow: 0 4px 18px rgba(0, 0, 0, .05);
}
.dash-search:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(155, 181, 58, .25); }
.dash-search-icon { color: var(--text-4); display: flex; }
.dash-search input[type=search] { flex: 1; min-width: 0; border: 0; padding: 10px 4px; font-size: 16px; background: none; }
.dash-search input[type=search]:focus { outline: 0; box-shadow: none; }
.dash-search-extra { display: flex; flex-wrap: wrap; gap: 6px 22px; margin: 12px 0 0; font-size: 14px; }
.dash-search-extra a { display: inline-flex; align-items: center; gap: 6px; color: var(--text-2); text-decoration: none; }
.dash-search-extra a:hover { color: var(--green-dark); }
.dash { display: grid; gap: 32px; }
.dash-section h2 { font-size: 19px; margin: 0 0 14px; }
.dash-section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.dash-section-head a, .continue-link { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; color: var(--green-dark); text-decoration: none; }
.dash-section-head a:hover, .continue-link:hover { color: var(--text); }
.continue-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }
.continue-card { display: flex; flex-direction: column; gap: 14px; padding: 20px; }
.continue-head { display: flex; gap: 12px; align-items: center; }
.continue-head h3 { margin: 0; font-size: 16px; }
.continue-head p { margin: 1px 0 0; }
.cart-preview { display: flex; gap: 8px; align-items: center; }
.cart-preview .mini { width: 52px; height: 52px; object-fit: contain; border: 1px solid var(--line-soft); border-radius: 8px; background: #fff; font-size: 18px; }
.cart-preview .more { font-size: 13px; font-weight: 600; color: var(--text-3); padding-left: 4px; }
.continue-foot { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
.continue-total { font-family: var(--font-head); font-weight: 800; font-size: 22px; line-height: 1.1; }
.continue-list { list-style: none; margin: 0; padding: 0; display: grid; }
.continue-list li + li { border-top: 1px solid var(--line-soft); }
.continue-list li > a, .continue-list .feed-line { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 0; color: var(--text); text-decoration: none; }
.continue-list li > a:hover strong { color: var(--green-dark); text-decoration: underline; }
.continue-list li span:first-child { display: grid; min-width: 0; }
.continue-list .muted { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.continue-link { margin-top: auto; }
.dash-main { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 28px; align-items: start; }
.dash-primary { display: grid; gap: 32px; min-width: 0; }
.dash-aside { display: grid; gap: 16px; position: sticky; top: 16px; }
.dash-aside .card { margin: 0; padding: 20px; }
.dash-aside h3 { font-size: 16px; margin: 0; }
.cat-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.cat-card { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 12px 10px; display: flex; flex-direction: column; transition: border-color .15s; }
.cat-card:hover { border-color: rgba(155, 181, 58, .6); }
.cat-card-title { display: flex; align-items: baseline; gap: 4px; padding: 2px 6px 8px; color: var(--text); text-decoration: none; font-weight: 700; font-size: 15px; }
.cat-card-title:hover span:first-child { color: var(--green-dark); text-decoration: underline; }
.cat-card ul { list-style: none; margin: 0; padding: 0; }
.cat-card li a { display: flex; align-items: baseline; padding: 5px 6px; border-radius: var(--radius-sm); color: var(--text-2); text-decoration: none; font-size: 14px; }
.cat-card li a:hover { background: var(--cream); color: var(--text); }
.cat-card li a span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-card-more { display: inline-flex; align-items: center; gap: 4px; margin-top: auto; padding: 8px 6px 2px; font-size: 13px; font-weight: 600; color: var(--green-dark); text-decoration: none; }
.cat-card-more:hover { color: var(--text); }
.again-list { display: grid; gap: 10px; }
.product-card.mini { grid-template-columns: 56px minmax(0, 1fr) auto; grid-template-areas: "media info buy"; gap: 16px; padding: 10px 14px; }
.product-card.mini .pc-media { grid-area: media; align-self: center; }
.product-card.mini .pc-info { grid-area: info; }
.product-card.mini .pc-buy { grid-area: buy; }
.product-card.mini .pc-media .thumb { width: 56px; height: 56px; }
.product-card.mini .pc-media .placeholder { font-size: 20px; }
.product-card.mini .pc-name { -webkit-line-clamp: 1; }
.product-card.mini .pc-buy { display: flex; align-items: center; gap: 12px; }
.product-card.mini .pc-price { font-size: 18px; min-width: 88px; }
.ok-text { color: var(--green-dark); }
.warn-text { color: #9a5c00; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.worth { display: grid; gap: 4px; }
.worth h3 { margin-bottom: 8px !important; }
.worth-row { display: flex; align-items: center; gap: 12px; padding: 8px; margin: 0 -8px; border-radius: 8px; color: var(--text); text-decoration: none; }
.worth-row > span:nth-child(2) { flex: 1; display: grid; }
.worth-row strong { font-size: 14px; }
.worth-row small { font-size: 13px; color: var(--text-3); }
.worth-row > .icon { color: var(--text-4); }
a.worth-row:hover { background: var(--cream); }
a.worth-row:hover > .icon { color: var(--green-dark); }
.worth-row.quiet { opacity: .6; }
.manager { display: grid; gap: 10px; }
.manager-head { display: flex; align-items: center; gap: 12px; }
.manager-head p { margin: 1px 0 0; }
.avatar { width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; flex: none; background: var(--green); color: #fff; font: 800 15px/1 var(--font-head); }
.manager-line { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text); text-decoration: none; overflow-wrap: anywhere; }
.manager-line .icon { color: var(--text-3); flex: none; }
.manager-line:hover { color: var(--green-dark); }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; margin: 28px 0; }
.stat { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 20px; text-decoration: none; color: inherit; }
a.stat:hover { border-color: var(--green); }
.stat b { display: block; font-family: var(--font-head); font-weight: 900; font-size: 28px; line-height: 1.1; }
.stat span { color: var(--text-3); font-size: 14px; }
.grid-2 { display: grid; grid-template-columns: repeat(auto-fit, minmax(380px, 1fr)); gap: 20px; }

/* Catalog */
.catalog { display: grid; grid-template-columns: 280px minmax(0, 1fr); gap: 28px; align-items: start; }
/* Smart sticky: a short sidebar stays under the header; a tall one scrolls with the page and
   sticks once its bottom is in view (app.js sets --sticky-top). No scrollbar inside the sidebar. */
.filter-panel { position: sticky; top: var(--sticky-top, 88px); }
.filter-panel > summary { display: none; list-style: none; }
.filter-panel > summary::-webkit-details-marker { display: none; }
.filters { display: grid; gap: 22px; font-size: 14px; }
.filters h3 { font-size: 13px; text-transform: uppercase; letter-spacing: .05em; color: var(--text-3); margin-bottom: 8px; font-family: var(--font); font-weight: 600; }
.cat-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 2px; }
.cat-list a { display: flex; justify-content: space-between; gap: 8px; padding: 5px 8px; border-radius: var(--radius-sm); color: var(--text); text-decoration: none; }
.cat-list a:hover { background: var(--cream); }
.cat-list a.active { background: var(--green-tint); font-weight: 600; }
.cat-list .muted { font-size: 12px; }
.crumbs { font-size: 14px; color: var(--text-3); margin-bottom: 8px; }
.crumbs a { color: var(--text-2); }
.price-range { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.brand-list { max-height: 260px; overflow-y: auto; display: grid; gap: 4px; padding-right: 4px; }
.brand-list .check { font-weight: 400; font-size: 14px; }
.filters .tree { max-height: 340px; padding: 8px; }
.filters .tree-row label { font-size: 14px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin: -4px 0 14px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px 4px 12px; border-radius: 999px;
  background: var(--green-tint); border: 1px solid rgba(155, 181, 58, .5); color: var(--text); text-decoration: none; font-size: 13px; font-weight: 500;
}
.chip span { color: var(--text-3); font-size: 15px; line-height: 1; }
.chip:hover { border-color: var(--green); color: var(--text); }
.chip:hover span { color: var(--red); }
.chip-clear { font-size: 13px; color: var(--text-3); }
.search-bar { display: flex; gap: 10px; margin-bottom: 16px; }
.search-bar input { flex: 1; font-size: 16px; padding: 12px 14px; }
.results-head { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin-bottom: 14px; }
.results-head select { width: auto; }
.product-list { display: grid; gap: 10px; }
.product-row {
  display: grid; grid-template-columns: 72px minmax(0, 1fr) 130px 210px; gap: 18px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 16px;
}
.product-row:hover { border-color: rgba(155, 181, 58, .7); }
.thumb { width: 72px; height: 72px; object-fit: contain; border-radius: var(--radius-sm); background: #fff; }
.placeholder {
  display: grid; place-items: center; background: var(--cream); color: var(--green-dark);
  font-family: var(--font-head); font-weight: 900; font-size: 26px;
}
.product-name { font-weight: 600; color: var(--text); text-decoration: none; display: block; margin-bottom: 3px; }
.product-name:hover { color: var(--green-dark); text-decoration: underline; }
.product-meta { font-size: 13px; color: var(--text-3); display: flex; flex-wrap: wrap; gap: 4px 14px; }
.price { font-family: var(--font-head); font-weight: 800; font-size: 18px; }
.price small { display: block; font-family: var(--font); font-weight: 400; font-size: 12px; color: var(--text-3); }
.stock { font-size: 13px; font-weight: 500; }
.stock.in { color: var(--green-dark); }
.stock.out { color: var(--red); }
.add-form { display: flex; gap: 8px; align-items: center; justify-content: flex-end; }
.add-form input[type=number] { width: 76px; text-align: center; padding: 8px 6px; }
.pagination { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 24px; }
.pagination a, .pagination span { padding: 7px 13px; border-radius: var(--radius-sm); border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: 14px; }
.pagination a:hover { border-color: var(--green); }
.pagination .current { background: var(--green); border-color: var(--green); color: #fff; font-weight: 700; }
.pagination span:not(.current) { border-color: transparent; }

/* Definition lists (orders, imports) */
.specs { display: grid; grid-template-columns: max-content 1fr; gap: 8px 20px; font-size: 14px; margin: 20px 0; }
.specs dt { color: var(--text-3); }
.specs dd { margin: 0; }

/* Product page: image | name and details | buy box. The image and the buy box stay in view while the details scroll. */
.pd-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; margin: 0 0 20px; font-size: 13px; color: var(--text-4); }
.pd-crumbs a { color: var(--text-3); text-decoration: none; }
.pd-crumbs a:hover { color: var(--green-dark); text-decoration: underline; }
.pd-crumbs a:last-child { color: var(--text-2); font-weight: 500; }
.pd {
  display: grid; grid-template-columns: minmax(0, 400px) minmax(0, 1fr) 340px; column-gap: 40px;
  grid-template-areas: "media head buy" "media details buy"; grid-template-rows: auto 1fr; align-items: start;
}
.pd-media { grid-area: media; position: sticky; top: 88px; }
.pd-image {
  aspect-ratio: 1; display: grid; place-items: center; padding: 28px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
}
.pd-image img { width: 100%; height: 100%; object-fit: contain; }
.pd-image-empty {
  width: 100%; height: 100%; display: grid; place-items: center; border-radius: 10px;
  background: var(--cream); color: var(--green-dark); font: 900 96px/1 var(--font-head);
}
.pd-head { grid-area: head; min-width: 0; }
.pd-kicker { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; min-height: 22px; }
.pd-brand { font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--green-dark); text-decoration: none; }
.pd-brand:hover { color: var(--text); }
.pd-badge { padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 700; letter-spacing: .02em; }
.pd-badge.new { background: var(--green-tint); color: var(--green-dark); }
.pd-badge.back { background: var(--blue-tint); color: #00658a; }
.pd-title { margin: 0 0 16px; font-size: 28px; font-weight: 800; line-height: 1.22; letter-spacing: -.01em; overflow-wrap: anywhere; }
.pd-ids { display: flex; flex-wrap: wrap; gap: 8px; }
.pd-id {
  display: inline-flex; align-items: baseline; gap: 6px; padding: 5px 10px; cursor: copy;
  background: #fff; border: 1px solid var(--line); border-radius: 8px;
  font: 500 13px/1.4 ui-monospace, "Cascadia Mono", Consolas, monospace; color: var(--text);
  transition: border-color .15s, background-color .15s;
}
.pd-id span { font: 600 10px/1 var(--font); letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); }
.pd-id:hover { border-color: var(--green); background: var(--green-tint); }

.pd-buy {
  grid-area: buy; position: sticky; top: 88px; display: grid; gap: 16px; padding: 24px;
  background: #fff; border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow);
}
.pd-price strong { display: block; font: 900 34px/1 var(--font-head); letter-spacing: -.01em; }
.pd-price span { display: block; margin-top: 6px; font-size: 13px; color: var(--text-3); }
.pd-note { margin: 0; font-size: 13px; line-height: 1.45; color: var(--text-2); }
.pd-note.good { padding: 8px 12px; border-radius: 8px; background: var(--green-tint); color: var(--green-dark); font-weight: 600; }
.pd-facts { list-style: none; margin: 0; padding: 14px 0; display: grid; gap: 10px; border-top: 1px solid var(--line-soft); border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.pd-facts li { display: flex; align-items: center; gap: 10px; }
.pd-facts .icon { color: var(--text-3); flex: none; }
.pd-facts .in { color: var(--green-dark); font-weight: 600; }
.pd-facts .low { color: #b26b00; font-weight: 600; }
.pd-facts .out { color: var(--red); font-weight: 600; }
.pd-dot { width: 8px; height: 8px; margin: 0 4px; border-radius: 50%; background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 18%, transparent); flex: none; }
/* Quantity and button side by side, both 48px tall; the line total appears under them from 2 units. */
.buy-form.pd-form { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.pd-form .stepper { border-radius: 10px; height: 48px; }
.pd-form .stepper button { width: 40px; font-size: 19px; }
.pd-form .stepper input[type=number] { width: 52px; padding: 0; font-size: 16px; }
.pd-form .buy-btn { gap: 10px; height: 48px; padding: 0 16px; font-size: 16px; border-radius: 10px; }
.pd-line-total { grid-column: 1 / -1; margin: -2px 0 0; font-size: 13px; color: var(--text-2); font-variant-numeric: tabular-nums; }
.pd-line-total:empty { display: none; }
.pd-room { margin: -4px 0 0; font-size: 13px; color: var(--text-3); }
.pd-in-cart { font-size: 13px; }
.pd-history { display: flex; gap: 8px; align-items: flex-start; margin: 0; padding-top: 14px; border-top: 1px solid var(--line-soft); font-size: 13px; line-height: 1.45; color: var(--text-2); }
.pd-history .icon { color: var(--text-3); flex: none; margin-top: 2px; }

.pd-details { grid-area: details; min-width: 0; margin-top: 32px; }
.pd-section + .pd-section { margin-top: 32px; }
.pd-section h2 { margin: 0 0 12px; font-size: 17px; }
.pd-specs { margin: 0; border-top: 1px solid var(--line); }
.pd-specs > div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 16px; padding: 11px 0; border-bottom: 1px solid var(--line-soft); font-size: 14px; }
.pd-specs dt { color: var(--text-3); }
.pd-specs dd { margin: 0; color: var(--text); }
.pd-specs a { color: var(--green-dark); text-decoration: none; font-weight: 500; }
.pd-specs a:hover { text-decoration: underline; }
.pd-desc-text { max-width: 72ch; font-size: 15px; line-height: 1.7; color: var(--text-2); overflow-wrap: anywhere; }
.pd-desc.is-clamped .pd-desc-text { max-height: 13.6em; overflow: hidden; -webkit-mask-image: linear-gradient(#000 55%, transparent); mask-image: linear-gradient(#000 55%, transparent); }
.pd-more { margin-top: 10px; padding: 0; background: none; border: 0; font: 600 14px var(--font); color: var(--green-dark); cursor: pointer; }
.pd-more:hover { color: var(--text); text-decoration: underline; }
.pd-updated { margin: 32px 0 0; font-size: 12px; color: var(--text-4); }

.pd-related { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--line); }
.pd-related-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.pd-related-head h2 { margin: 0; font-size: 20px; }
.pd-related-head a { display: inline-flex; align-items: center; gap: 5px; font-size: 14px; font-weight: 600; color: var(--green-dark); text-decoration: none; }
.pd-related-head a:hover { color: var(--text); }
.pd-related-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 14px; }
.pd-tile {
  display: grid; grid-template-rows: auto 1fr auto; gap: 10px; padding: 12px; color: var(--text); text-decoration: none;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; transition: border-color .15s, box-shadow .15s;
}
.pd-tile:hover { border-color: rgba(155, 181, 58, .6); box-shadow: 0 4px 18px rgba(0, 0, 0, .06); }
.pd-tile, .pd-tile > * { min-width: 0; }
.pd-tile-img { display: block; aspect-ratio: 1; overflow: hidden; }
.pd-tile-img .thumb { display: grid; place-items: center; width: 100%; height: 100%; object-fit: contain; }
.pd-tile-img .placeholder { font-size: 32px; border-radius: 8px; }
.pd-tile-name { font-size: 13px; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pd-tile:hover .pd-tile-name { color: var(--green-dark); }
.pd-tile-foot { display: grid; gap: 2px; }
.pd-tile-foot strong { font: 800 15px var(--font-head); }
.pd-tile-foot span { font-size: 12px; font-weight: 600; }
.pd-tile-foot .in { color: var(--green-dark); }
.pd-tile-foot .low { color: #b26b00; }
.pd-tile-foot .out { color: var(--red); }

/* Cart */
.cart-grid { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 24px; align-items: start; }
.cart-head .actions { gap: 6px; }
.cart-main { display: grid; gap: 16px; min-width: 0; }
.cart-table { padding: 4px 20px; }
.cart-row {
  display: grid; grid-template-columns: 64px minmax(0, 1fr) 110px 128px 104px 28px; gap: 16px; align-items: center;
  padding: 14px 0; border-top: 1px solid var(--line-soft);
}
[data-frag="lines"] > .cart-row:first-child { border-top: 0; }
.cart-row-head { padding: 10px 0 8px; font-size: 12px; font-weight: 600; color: var(--text-3); text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line); }
.cart-row-head span:nth-child(3), .cart-row-head span:nth-child(5) { text-align: right; }
.cr-media .thumb { width: 64px; height: 64px; font-size: 22px; }
.cr-info { display: grid; gap: 4px; min-width: 0; }
.cr-name { font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--text); text-decoration: none; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
a.cr-name:hover { color: var(--green-dark); text-decoration: underline; }
.cr-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; font-size: 13px; }
.cr-status { display: flex; flex-wrap: wrap; align-items: center; gap: 2px 14px; font-size: 13px; }
.cr-status .avail { font-size: 13px; }
.cr-ship { display: inline-flex; align-items: center; gap: 5px; color: var(--text-2); }
.cr-ship .icon { color: var(--text-3); }
.cr-price { text-align: right; font-size: 14px; font-variant-numeric: tabular-nums; }
.cr-price small { display: block; font-size: 11px; color: var(--text-3); }
.cr-price s { font-size: 12px; }
.cr-qty .stepper input[type=number] { width: 56px; }
.cr-total { text-align: right; font-family: var(--font-head); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.cart-row.is-unavailable .cr-media, .cart-row.is-unavailable .cr-name { opacity: .55; }
.cart-row.is-over .stepper { border-color: var(--red); box-shadow: 0 0 0 3px rgba(196, 55, 44, .12); }
.bad-text { color: var(--red); font-weight: 600; }
.remove-btn { background: none; border: 0; font-size: 22px; line-height: 1; color: var(--text-4); cursor: pointer; padding: 4px; }
.remove-btn:hover { color: var(--red); }
.is-saving .cr-total, .is-saving [data-frag="lines"] { transition: opacity .2s; }
.cart-under { display: flex; flex-wrap: wrap; gap: 8px 16px; align-items: center; }
.cart-under a { margin-left: auto; }
.js-only { display: none; }
.js .js-only { display: inline; }
.cart-problems { margin-bottom: 16px; border: 1px solid rgba(178, 107, 0, .35); background: #fff8ec; border-radius: var(--radius); }
.cart-problems ul { list-style: none; margin: 0; padding: 0; }
.cart-problems li { display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; padding: 12px 16px; font-size: 14px; }
.cart-problems li + li { border-top: 1px solid rgba(178, 107, 0, .2); }
.cart-problems li.bad strong { color: var(--red); }
.cart-problems .btn { flex: none; }
.cart-undo { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; padding: 10px 16px; border-radius: var(--radius); background: #1f2412; color: #fff; font-size: 14px; }
.cart-undo .link { color: var(--green); font-weight: 700; }
.quick-add-card > summary { cursor: pointer; display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 15px; list-style: none; }
.quick-add-card > summary::-webkit-details-marker { display: none; }
.quick-add-card[open] > summary { margin-bottom: 12px; }
.quick-add { display: grid; gap: 8px; }
.quick-add textarea { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; }
.summary { position: sticky; top: 88px; }
.summary-row { display: flex; justify-content: space-between; padding: 5px 0; font-size: 15px; }
.summary-total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-family: var(--font-head); font-weight: 900; font-size: 24px; }
.summary-note { margin: 4px 0 0; font-size: 12px; color: var(--text-3); }
.summary-delivery { display: flex; gap: 8px; margin: 10px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--cream); font-size: 13px; line-height: 1.45; }
.summary-delivery .icon { color: var(--green-dark); flex: none; margin-top: 1px; }
.pref { border: 0; padding: 0; margin: 0; display: grid; gap: 6px; }
.pref legend { padding: 0; margin-bottom: 6px; }
.pref .check { font-weight: 500; font-size: 14px; align-items: flex-start; }
.pref .check input { margin-top: 3px; }
.pref .hint { display: block; margin: 0; }
.block-reason { margin: 0; font-size: 13px; font-weight: 600; color: var(--red); }
.cart-bar { display: none; }
.cart-empty { display: grid; gap: 20px; max-width: 760px; }
.cart-empty .dash-search { margin: 16px 0 20px; }
.again-mini { list-style: none; margin: 0; padding: 0; }
.again-mini li { display: grid; grid-template-columns: 48px minmax(0, 1fr) auto; gap: 12px; align-items: center; padding: 8px 0; border-top: 1px solid var(--line-soft); }
.again-mini li:first-child { border-top: 0; }
.again-mini .thumb { width: 48px; height: 48px; font-size: 18px; }
.again-mini a { display: grid; color: var(--text); text-decoration: none; font-size: 14px; font-weight: 600; }
.again-mini a:hover { color: var(--green-dark); }
.order-placed { display: flex; gap: 16px; align-items: flex-start; margin-bottom: 24px; border-color: rgba(155, 181, 58, .6); background: var(--green-tint); }
.order-placed h2 { font-size: 19px; margin-bottom: 4px; }
.order-placed p { margin-bottom: 12px; color: var(--text-2); }
.order-placed .icon-tile { background: var(--green); color: #fff; }

/* Order detail */
.timeline { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.timeline li { display: grid; grid-template-columns: 14px 1fr; gap: 12px; font-size: 14px; }
.timeline li::before { content: ""; width: 10px; height: 10px; border-radius: 50%; background: var(--green); margin-top: 6px; }
.filter-bar { display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end; margin-bottom: 18px; }
.filter-bar .field { min-width: 150px; }
.filter-bar .grow { flex: 1; min-width: 220px; }

/* Category tree */
.tree { max-height: 460px; overflow-y: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; background: #fff; }
.tree ul { list-style: none; margin: 0; padding-left: 22px; }
.tree > ul { padding-left: 0; }
.tree-row { display: flex; align-items: center; gap: 2px; padding: 2px 0; }
.tree-row label { font-weight: 400; cursor: pointer; display: inline-flex; align-items: center; gap: 2px; }
.tree-row .muted { font-size: 12px; margin-left: 4px; }
.tree-toggle, .tree-toggle-spacer { width: 22px; height: 22px; flex: none; }
.tree-toggle { background: none; border: 0; cursor: pointer; border-radius: 4px; color: var(--text-3); }
.tree-toggle::before { content: "▸"; }
.tree-toggle[aria-expanded="true"]::before { content: "▾"; }
.tree-toggle:hover { background: var(--cream); }
.tree input:disabled + .tree-name { color: var(--text-3); }
.tree-tools { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.tree-tools input { flex: 1; min-width: 180px; }

/* Mapping editors */
.map-table td { padding: 6px 8px; }
.map-table input, .map-table select { padding: 7px 10px; font-size: 14px; }
.preview-table { font-size: 12px; }
.preview-table td { max-width: 240px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* Auth pages */
.auth {
  min-height: calc(100vh - 130px); display: grid; place-items: center; padding: 40px 16px;
  background: linear-gradient(180deg, var(--cream) 0%, var(--bg) 100%);
}
.auth-card { width: 100%; max-width: 420px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 32px; box-shadow: var(--shadow); }
.auth-card h1 { font-size: 26px; }
.auth-card .sub { color: var(--text-2); margin-bottom: 22px; }
.auth-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 14px; }

/* Mail viewer */
.mail-frame { width: 100%; height: 640px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--cream); }

/* Utilities */
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.icon { flex: none; }
.link-quiet { color: var(--text-2); font-size: 14px; text-decoration: underline; text-decoration-color: var(--line); text-underline-offset: 3px; white-space: nowrap; }
.link-quiet:hover { color: var(--text); text-decoration-color: currentColor; }
.hint { color: var(--text-3); font-size: 12px; margin: 6px 0 0; }

/* Nav: dot on "Feeds" when a file is ready */
.nav-dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; background: var(--green); margin-left: 6px; vertical-align: 2px; box-shadow: 0 0 0 3px rgba(155, 181, 58, .25); }

/* Catalog header with the export menu */
.catalog-head { align-items: center; }
.export-menu { position: relative; }
.export-menu > summary { list-style: none; }
.export-menu > summary::-webkit-details-marker { display: none; }
.export-menu[open] > summary { background: var(--green-tint); }
.export-menu[open] > summary .icon:last-child { transform: rotate(180deg); }
.export-panel {
  position: absolute; right: 0; top: calc(100% + 8px); z-index: 70; width: 360px;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 12px 40px rgba(0, 0, 0, .12);
  padding: 8px;
}
.export-section { padding: 10px 10px 6px; }
.export-section + .export-section { border-top: 1px solid var(--line-soft); }
.export-label { font-size: 11px; font-weight: 600; letter-spacing: .06em; text-transform: uppercase; color: var(--text-3); margin-bottom: 8px; }
.export-hint { font-size: 12px; color: var(--text-3); margin: 8px 0 0; min-height: 1.5em; }
.segmented { display: flex; background: var(--cream); border-radius: 8px; padding: 3px; gap: 2px; }
.segmented label { flex: 1; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 7px 6px; border-radius: 6px; font-size: 14px; font-weight: 500; color: var(--text-2); }
.segmented input:checked + span { background: #fff; color: var(--text); font-weight: 600; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.segmented input:focus-visible + span { outline: 3px solid rgba(155, 181, 58, .45); }
.export-option {
  display: flex; gap: 12px; align-items: center; width: 100%; text-align: left; font: inherit; color: var(--text);
  background: none; border: 0; border-radius: 8px; padding: 9px 8px; cursor: pointer;
}
.export-option:hover:not(:disabled), .export-option:focus-visible { background: var(--cream); }
.export-option:disabled { opacity: .5; cursor: not-allowed; }
.export-option strong { display: block; font-size: 15px; }
.export-option small { display: block; color: var(--text-3); font-size: 13px; }
.export-option[aria-busy="true"] small::after { content: " · preparing…"; }
.icon-tile { width: 38px; height: 38px; border-radius: 9px; display: grid; place-items: center; background: var(--green-tint); color: var(--green-dark); flex: none; }
.export-foot { display: block; border-top: 1px solid var(--line-soft); padding: 10px 10px 4px; font-size: 13px; color: var(--text-2); text-decoration: none; }
.export-foot:hover { color: var(--text); }

/* Delivery time: stepped track (1–2 · ≤3 · ≤5 · ≤7 · Any) */
.lead-steps { position: relative; display: grid; grid-template-columns: repeat(5, 1fr); margin: 0 -4px; }
.lead-steps::before, .lead-steps::after {
  content: ""; position: absolute; top: 12px; left: 10%; height: 3px; border-radius: 3px;
}
.lead-steps::before { right: 10%; background: rgba(0, 0, 0, .1); }
.lead-steps::after { width: calc(var(--fill, 100%) * .8); background: var(--green); transition: width .25s ease; }
.lead-step {
  position: relative; z-index: 1; display: grid; justify-items: center; align-content: start; gap: 5px;
  color: var(--text-2); text-decoration: none; text-align: center; padding: 0 2px 4px; border-radius: 8px;
}
.lead-dot {
  width: 14px; height: 14px; margin-top: 6px; border-radius: 50%; background: #fff;
  border: 2px solid rgba(0, 0, 0, .22); transition: all .15s ease;
}
.lead-step.passed .lead-dot { background: var(--green); border-color: var(--green); }
.lead-step.active .lead-dot {
  width: 22px; height: 22px; margin-top: 2px; background: var(--green); border-color: var(--green);
  box-shadow: 0 0 0 4px rgba(155, 181, 58, .22);
}
.lead-step:hover .lead-dot { border-color: var(--green); }
.lead-label { font-size: 13px; font-weight: 700; line-height: 1.1; color: var(--text); white-space: nowrap; }
.lead-label small { display: block; font-size: 11px; font-weight: 400; color: var(--text-3); margin-top: 1px; }
.lead-step.active .lead-label { color: var(--green-dark); }
.lead-count { font-size: 11px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.lead-step.disabled { opacity: .4; cursor: not-allowed; }
.lead-step:focus-visible { outline-offset: 0; }

/* Product card */
.product-card {
  display: grid; grid-template-columns: 96px minmax(0, 1fr) 190px 214px; gap: 22px; align-items: center;
  background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px;
  transition: border-color .15s, box-shadow .15s;
}
.product-card:hover { border-color: rgba(155, 181, 58, .6); box-shadow: 0 4px 18px rgba(0, 0, 0, .05); }
.pc-media { display: block; }
.pc-media .thumb { width: 96px; height: 96px; object-fit: contain; border-radius: 8px; }
.pc-media .placeholder { font-size: 30px; }
.pc-info { min-width: 0; display: grid; gap: 5px; }
.pc-name {
  font-weight: 600; font-size: 15px; line-height: 1.35; color: var(--text); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pc-name:hover { color: var(--green-dark); text-decoration: underline; text-underline-offset: 2px; }
.pc-sub { display: flex; flex-wrap: wrap; gap: 2px 12px; font-size: 13px; color: var(--text-3); }
.pc-brand { color: var(--text-2); font-weight: 600; }
.pc-ids { display: flex; flex-wrap: wrap; gap: 6px; }
.copy-id {
  font: 500 11px/1.4 var(--font); color: var(--text-4); background: var(--cream); border: 0; border-radius: 4px;
  padding: 2px 7px; cursor: copy; letter-spacing: .02em;
}
.copy-id span { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 12px; color: var(--text-2); margin-left: 2px; }
.copy-id:hover { background: var(--green-tint); }
.pc-avail { display: grid; gap: 7px; align-content: center; }
.avail { display: flex; align-items: center; gap: 7px; font-size: 14px; font-weight: 600; }
.avail-dot { width: 8px; height: 8px; border-radius: 50%; background: currentColor; flex: none; }
.avail.in { color: var(--green-dark); }
.avail.low { color: #b26b00; }
.avail.out { color: var(--red); }
.ship { display: flex; gap: 7px; align-items: flex-start; font-size: 13px; color: var(--text-2); line-height: 1.35; }
.ship .icon { color: var(--text-3); margin-top: 1px; }
.ship-by { display: block; font-size: 12px; color: var(--text-3); }
.pc-buy { display: grid; justify-items: end; gap: 8px; }
.pc-price { font-family: var(--font-head); font-weight: 800; font-size: 21px; line-height: 1.1; text-align: right; }
.pc-price small { display: block; font-family: var(--font); font-weight: 400; font-size: 11px; color: var(--text-3); margin-top: 2px; }
.buy-form { display: flex; gap: 6px; }
.stepper { display: inline-flex; align-items: stretch; border: 1px solid rgba(0, 0, 0, .18); border-radius: 8px; overflow: hidden; background: #fff; }
.stepper:focus-within { border-color: var(--green); box-shadow: 0 0 0 3px rgba(155, 181, 58, .25); }
.stepper button { width: 30px; border: 0; background: none; font-size: 17px; color: var(--text-2); cursor: pointer; }
.stepper button:hover { background: var(--cream); color: var(--text); }
.stepper input[type=number] {
  width: 44px; border: 0; border-radius: 0; padding: 7px 0; text-align: center; font-weight: 600; -moz-appearance: textfield;
}
.stepper input[type=number]:focus { outline: 0; box-shadow: none; }
.stepper input::-webkit-outer-spin-button, .stepper input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.buy-btn { padding: 7px 12px; gap: 6px; }
.in-cart { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; color: var(--green-dark); text-decoration: none; }
.in-cart:hover { text-decoration: underline; }

/* Catalog sidebar: facets */
.filters { gap: 0; }
.facet { padding: 18px 0; border-top: 1px solid var(--line-soft); }
.facet:first-child { border-top: 0; padding-top: 0; }
.facet h3 { display: flex; align-items: baseline; gap: 6px; margin-bottom: 10px; }
.facet-note { text-transform: none; letter-spacing: 0; font-weight: 400; color: var(--text-4); }
.facet-count { margin-left: auto; padding-left: 10px; font-size: 12px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.facet-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; }

/* Category navigation: way back + current level */
.cat-nav { display: grid; gap: 1px; margin-bottom: 10px; }
.cat-back { display: block; font-size: 13px; color: var(--text-3); text-decoration: none; padding: 2px 8px 6px; }
.cat-back:hover { color: var(--text); }
.cat-link {
  display: flex; align-items: baseline; gap: 4px; padding: 6px 8px 6px calc(8px + var(--level, 0) * 12px);
  border-radius: var(--radius-sm); color: var(--text); text-decoration: none; font-size: 14px; line-height: 1.35;
}
.cat-link:hover { background: var(--cream); }
.cat-link.ancestor { color: var(--text-2); }
.cat-link.current { font-weight: 700; color: var(--text); background: var(--green-tint); }
.cat-link.current .facet-count { color: var(--green-dark); }
.cat-level { list-style: none; margin: 0; padding: 0; display: grid; gap: 1px; }
.cat-group + .cat-group { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.cat-group-title {
  display: flex; align-items: baseline; gap: 4px; padding: 6px 8px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-weight: 700; font-size: 14px;
}
.cat-group-title:hover { background: var(--cream); }
.cat-group .cat-more > summary { padding-left: 20px; }
.cat-more > summary {
  list-style: none; cursor: pointer; font-size: 13px; font-weight: 600; color: var(--green-dark);
  padding: 6px 8px; border-radius: var(--radius-sm);
}
.cat-more > summary::-webkit-details-marker { display: none; }
.cat-more > summary::after { content: " ▾"; font-size: 11px; }
.cat-more > summary:hover { background: var(--cream); }
.cat-more[open] > summary { display: none; }

/* Checkbox-style options (brands, several selected categories) */
.facet-list { list-style: none; margin: 0 0 10px; padding: 0; display: grid; gap: 1px; }
.facet-option {
  display: flex; align-items: center; gap: 10px; padding: 5px 8px; border-radius: var(--radius-sm);
  color: var(--text); text-decoration: none; font-size: 14px;
}
.facet-option:hover { background: var(--cream); }
.facet-option .box {
  width: 16px; height: 16px; flex: none; border: 1.5px solid rgba(0, 0, 0, .3); border-radius: 4px;
  display: grid; place-items: center; background: #fff; color: #fff;
}
.facet-option:hover .box { border-color: var(--green); }
.facet-option.checked .box { background: var(--green); border-color: var(--green); }
.facet-option.checked { font-weight: 600; }

/* Search-as-you-type boxes */
.combobox { position: relative; }
.combobox input[type=search] { padding: 8px 10px 8px 32px; font-size: 14px; background: #fff; }
.combobox-icon { position: absolute; left: 10px; top: 19px; transform: translateY(-50%); color: var(--text-4); display: flex; pointer-events: none; }
.facet > .combobox:first-of-type { margin-bottom: 10px; }
/* Results open in the flow (not floating), so the scrolling sidebar never clips them. */
.combobox-list {
  margin: 6px 0 0; padding: 4px; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
  max-height: 320px; overflow-y: auto;
}
.combobox-list [role="option"] { display: flex; align-items: center; gap: 8px; padding: 7px 8px; border-radius: var(--radius-sm); cursor: pointer; }
.combobox-list [role="option"].active { background: var(--cream); }
.opt-main { min-width: 0; flex: 1; display: grid; }
.opt-label { font-size: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.opt-label mark { background: none; color: inherit; font-weight: 700; text-decoration: underline; text-decoration-color: var(--green); text-underline-offset: 3px; }
.opt-sub { font-size: 12px; color: var(--text-4); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; direction: rtl; text-align: left; }
.opt-count { font-size: 12px; color: var(--text-4); font-variant-numeric: tabular-nums; }
.opt-add {
  flex: none; width: 26px; height: 26px; border-radius: 6px; border: 1px solid var(--line); background: #fff;
  color: var(--green-dark); font-size: 17px; font-weight: 600; line-height: 1; cursor: pointer;
}
.opt-add:hover { border-color: var(--green); background: var(--green-tint); }
.combobox-empty { padding: 10px; font-size: 13px; color: var(--text-3); }

/* Catalog filters */
.token-list { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.step-chips { display: flex; flex-wrap: wrap; gap: 6px; }
.step-chip { padding: 5px 11px; border: 1px solid var(--line); border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--text-2); text-decoration: none; background: #fff; }
.step-chip:hover { border-color: var(--green); color: var(--text); }
.step-chip.active { background: var(--green-tint); border-color: var(--green); color: var(--text); font-weight: 600; }
.filters .price-range { display: grid; grid-template-columns: 1fr auto 1fr auto; gap: 6px; align-items: center; }
.filters .price-range input { padding: 7px 9px; font-size: 14px; }
.search-row { display: flex; gap: 10px; margin-bottom: 16px; }
.search-row .search-bar { flex: 1; margin: 0; }
.ean-summary { display: flex; flex-wrap: wrap; gap: 6px 16px; align-items: baseline; background: var(--cream); border-radius: var(--radius); padding: 12px 16px; margin-bottom: 14px; font-size: 14px; }
.ean-summary summary { cursor: pointer; color: var(--green-dark); }
.ean-summary textarea { margin-top: 8px; font-size: 12px; }

/* Modal */
.modal { border: 0; border-radius: 14px; padding: 24px; width: min(520px, calc(100vw - 32px)); box-shadow: 0 20px 60px rgba(0, 0, 0, .2); color: var(--text); }
.modal::backdrop { background: rgba(0, 0, 0, .35); }
.modal h2 { margin-bottom: 4px; }
.modal p { margin: 0; font-size: 14px; }
.modal-actions { display: flex; gap: 10px; align-items: center; justify-content: flex-end; }
.modal-actions > :first-child { margin-right: auto; }
dialog.modal[open]:not(:modal) { position: static; margin: 0 0 20px; width: 100%; box-shadow: none; border: 1px solid var(--line); }

/* Progress */
.progress { height: 6px; background: var(--line-soft); border-radius: 999px; overflow: hidden; margin: 4px 0 6px; max-width: 260px; }
.progress span { display: block; height: 100%; background: var(--green); border-radius: inherit; transition: width .6s ease; }

/* My feeds */
.feeds-table td { padding-top: 14px; padding-bottom: 14px; }
.feed-main { min-width: 240px; }
.feed-status { min-width: 280px; }
.feed-status .badge { margin-bottom: 4px; }
.feed-actions { text-align: right; white-space: nowrap; }
.feed-actions > * + * { margin-left: 14px; }
.feed-row.flash td { animation: row-flash 1.6s ease; }
@keyframes row-flash { from { background: var(--green-tint); } }
.empty-icon { width: 56px; height: 56px; border-radius: 14px; margin: 0 auto 14px; display: grid; place-items: center; background: var(--green-tint); color: var(--green-dark); }
.empty-icon .icon { width: 26px; height: 26px; }

/* Floating progress card for background exports */
.tracker { position: fixed; right: 20px; bottom: 20px; z-index: 90; display: grid; gap: 10px; width: 320px; }
.tracker-item { position: relative; background: #fff; border: 1px solid var(--line); border-radius: 12px; box-shadow: 0 10px 30px rgba(0, 0, 0, .12); padding: 14px 16px; }
.tracker-item[data-state="ready"] { border-color: rgba(155, 181, 58, .7); }
.tracker-title { font-weight: 700; font-size: 15px; padding-right: 20px; }
.tracker-sub { margin: 2px 0 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tracker-ready { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.tracker-close { position: absolute; top: 8px; right: 10px; background: none; border: 0; font-size: 20px; line-height: 1; color: var(--text-4); cursor: pointer; padding: 2px 4px; }
.tracker-close:hover { color: var(--text); }
.tracker .progress { max-width: none; }

/* Print (order PDF) */
@media print {
  .site-header, .site-footer, .no-print { display: none !important; }
  body { font-size: 12px; }
  .page { padding: 0; }
  .card, .table-wrap { border: 0; padding: 0; }
}

/* Responsive */
@media (max-width: 1100px) {
  .catalog { grid-template-columns: 250px minmax(0, 1fr); gap: 20px; }
  .product-row { grid-template-columns: 64px minmax(0, 1fr) auto; gap: 8px 14px; }
  .product-row .thumb { width: 64px; height: 64px; }
  .product-row > a:first-child { grid-row: span 2; }
  .product-row > .add-form { grid-column: 2 / 4; justify-content: flex-start; }
}
@media (max-width: 1180px) {
  .product-card { grid-template-columns: 84px minmax(0, 1fr) 200px; grid-template-areas: "media info buy" "media avail buy"; gap: 10px 18px; }
  .pc-media { grid-area: media; align-self: start; }
  .pc-media .thumb { width: 84px; height: 84px; }
  .pc-info { grid-area: info; }
  .pc-avail { grid-area: avail; display: flex; flex-wrap: wrap; gap: 4px 18px; }
  .pc-buy { grid-area: buy; }
}
@media (max-width: 1000px) {
  .cart-grid { grid-template-columns: 1fr; }
  .summary { position: static; }
  /* Phones and tablets: the order box moves under the lines; a bar keeps the total in sight. */
  .cart-bar {
    display: flex; align-items: center; justify-content: space-between; gap: 12px;
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 40; padding: 10px 16px calc(10px + env(safe-area-inset-bottom));
    background: rgba(254, 254, 254, .96); backdrop-filter: blur(8px); border-top: 1px solid var(--line); box-shadow: 0 -4px 18px rgba(0, 0, 0, .06);
  }
  .cart-bar > div { display: grid; }
  .cart-bar strong { font-family: var(--font-head); font-size: 19px; }
  body:has(.cart-bar) .site-footer { padding-bottom: 84px; }
}
@media (max-width: 760px) {
  .export-panel { position: fixed; left: 0; right: 0; bottom: 0; top: auto; width: auto; border-radius: 16px 16px 0 0; padding: 12px 8px calc(12px + env(safe-area-inset-bottom)); max-height: 85vh; overflow-y: auto; }
  .export-menu[open]::before { content: ""; position: fixed; inset: 0; background: rgba(0, 0, 0, .3); z-index: 69; }
  .search-row { flex-wrap: wrap; }
  .product-card { grid-template-columns: 72px minmax(0, 1fr); grid-template-areas: "media info" "avail avail" "buy buy"; padding: 14px; }
  .pc-media .thumb { width: 72px; height: 72px; }
  .pc-buy { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; border-top: 1px solid var(--line-soft); padding-top: 10px; }
  .pc-price { text-align: left; }
  .search-row .btn-ghost { width: 100%; }
  .tracker { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .feeds-table { border: 0; background: none; }
  .feeds-table thead { display: none; }
  .feeds-table table, .feeds-table tbody, .feeds-table tr, .feeds-table td { display: block; }
  .feeds-table tr { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 10px; }
  .feeds-table td { border: 0; padding: 0; min-width: 0; }
  .feeds-table td + td { margin-top: 8px; }
  .feeds-table .feed-when { color: var(--text-3); font-size: 13px; margin-top: 2px; }
  .feeds-table .feed-actions { text-align: left; display: flex; align-items: center; gap: 14px; margin-top: 12px; }
  .feeds-table .feed-actions > * + * { margin-left: 0; }
  .catalog { grid-template-columns: 1fr; gap: 16px; }
  .filter-panel { position: static; }
  .filter-panel > summary { display: flex; }
  .filter-panel[open] > summary { margin-bottom: 18px; }
  .product-row { grid-template-columns: 56px minmax(0, 1fr); }
  .product-row > .price-col { grid-column: 2; }
}
@media (max-width: 860px) {
  .menu-toggle { display: block; }
  .header-inner { flex-wrap: wrap; }
  .main-nav { display: none; flex-basis: 100%; flex-direction: column; align-items: stretch; padding-bottom: 12px; }
  .main-nav.open { display: flex; }
  .nav-spacer { display: none; }
  .dropdown-menu { position: static; box-shadow: none; border: 0; padding: 0 0 0 12px; }
  .grid-2 { grid-template-columns: 1fr; }
  .dash-main { grid-template-columns: 1fr; }
  .dash-aside { position: static; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }
  .dash-greeting { font-size: 19px; }
  .dash-greeting span { display: block; margin-top: 2px; }
  .dash-search .btn { padding: 10px 14px; }
  .product-card.mini { grid-template-columns: 48px minmax(0, 1fr); grid-template-areas: "media info" "buy buy"; padding: 12px; }
  .product-card.mini .pc-media .thumb { width: 48px; height: 48px; }
  .product-card.mini .pc-buy { justify-content: space-between; border-top: 1px solid var(--line-soft); padding-top: 8px; }
  .product-card.mini .pc-price { text-align: left; }
}

/* Admin bar: a calm dark strip above the site header, admins only */
.admin-bar { background: #1c2310; color: rgba(255, 255, 255, .78); font-size: 13px; }
.admin-bar-inner { display: flex; align-items: center; gap: 14px; min-height: 40px; }
.admin-bar-label { font-weight: 700; font-size: 11px; letter-spacing: .08em; text-transform: uppercase; color: var(--green); flex: none; }
.admin-bar-nav { display: flex; gap: 2px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; }
.admin-bar-nav::-webkit-scrollbar { display: none; }
.admin-bar-nav a { color: inherit; text-decoration: none; padding: 6px 10px; border-radius: 6px; white-space: nowrap; font-weight: 500; }
.admin-bar-nav a:hover { background: rgba(255, 255, 255, .08); color: #fff; }
.admin-bar-nav a.active { background: rgba(155, 181, 58, .22); color: #fff; font-weight: 600; }
.admin-bar a:focus-visible { outline: 2px solid var(--green); outline-offset: 1px; }
.admin-bar-status { display: flex; gap: 6px; flex: none; }
.admin-pill { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; font-size: 12px; font-weight: 600; text-decoration: none; white-space: nowrap; color: #fff; background: rgba(255, 255, 255, .1); }
.admin-pill::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
a.admin-pill:hover { background: rgba(255, 255, 255, .18); color: #fff; }
.admin-pill.ok { color: rgba(255, 255, 255, .55); background: none; font-weight: 500; }
.admin-pill.ok::before { background: var(--green); }
.admin-pill.busy::before { background: #5cc4ea; animation: pulse 1.4s ease-in-out infinite; }
.admin-pill.bad { background: #8f271f; }
.admin-pill.act::before { background: var(--green); }
@keyframes pulse { 50% { opacity: .3; } }

/* Admin lists */
.list-tools { display: flex; flex-wrap: wrap; gap: 12px 20px; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.list-tools .tabs { margin-bottom: 0; }
.list-search { display: flex; gap: 8px; flex: 0 1 340px; }
.list-search.wide { flex-basis: 440px; }
.list-search input { flex: 1; min-width: 0; padding: 8px 12px; }
.list-count { margin: -6px 0 12px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; margin-bottom: 16px; border-bottom: 1px solid var(--line); }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { padding: 8px 12px; color: var(--text-2); text-decoration: none; font-size: 14px; font-weight: 500; white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -1px; }
.tabs a:hover { color: var(--text); }
.tabs a.active { color: var(--text); font-weight: 600; border-bottom-color: var(--green); }
.tab-count { font-size: 12px; color: var(--text-4); font-variant-numeric: tabular-nums; margin-left: 2px; }
.tabs a.active .tab-count { color: var(--green-dark); }
.admin-table tbody tr { position: relative; }
.admin-table tbody tr:hover { background: #fcfcf7; }
.row-link { font-weight: 600; color: var(--text); text-decoration: none; }
.row-link:hover { color: var(--green-dark); text-decoration: underline; }
.admin-table .badge { margin-left: 6px; vertical-align: 1px; }
.is-muted td { color: var(--text-3); }
.is-muted .row-link { color: var(--text-2); }
.thumb-cell { width: 56px; padding-right: 0; }
.thumb-cell .thumb { width: 40px; height: 40px; font-size: 15px; }
.admin-section { margin-top: 32px; }
.status-form { display: flex; gap: 6px; align-items: center; }
.status-select { width: auto; padding: 5px 28px 5px 10px; font-size: 13px; font-weight: 600; border-radius: 999px; }
.status-select.status-submitted { background-color: var(--blue-tint); border-color: rgba(0, 146, 200, .35); }
.status-select.status-cancelled { background-color: var(--red-tint); }
.js .no-js { display: none; }

/* Admin forms */
.card-title { margin: 0; display: flex; align-items: baseline; gap: 10px; font-size: 18px; }
.card-title .muted { font-family: var(--font); font-weight: 400; }
.card .card-title + p, .card .card-title + .muted { margin: 4px 0 0; }
.field > .label { font-weight: 600; font-size: 14px; }
.step-no { display: inline-grid; place-items: center; width: 24px; height: 24px; border-radius: 50%; background: var(--green-tint); color: var(--green-dark); font-size: 13px; font-weight: 800; flex: none; align-self: center; }
.edit-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 20px; align-items: start; }
.edit-layout > .form-grid .card + .card { margin-top: 0; }
.access-card .tree { max-height: 520px; }
.access-summary { margin: 0; font-weight: 600; font-size: 14px; }
.save-bar {
  grid-column: 1 / -1; position: sticky; bottom: 0; z-index: 20; display: flex; flex-wrap: wrap; gap: 12px; align-items: center;
  background: rgba(254, 254, 254, .94); backdrop-filter: blur(8px); border-top: 1px solid var(--line); padding: 12px 0; margin-top: 4px;
}
.input-with-button { display: flex; gap: 8px; }
.input-with-button input { flex: 1; min-width: 0; }
.advanced { border-top: 1px solid var(--line-soft); padding-top: 12px; }
.advanced > summary { cursor: pointer; font-weight: 600; font-size: 14px; color: var(--green-dark); list-style: none; }
.advanced > summary::-webkit-details-marker { display: none; }
.advanced > summary::before { content: "▸"; display: inline-block; width: 16px; transition: transform .15s; }
.advanced[open] > summary::before { transform: rotate(90deg); }
.advanced[open] > summary { margin-bottom: 14px; }
.req { font-size: 11px; font-weight: 600; color: var(--green-dark); background: var(--green-tint); border-radius: 4px; padding: 1px 6px; margin-left: 4px; }
.map-table tr.is-unmapped td:first-child { color: var(--text-3); }
.map-table tr.is-missing td { background: var(--red-tint); }
.map-table tr.is-missing .req { background: #fff; color: var(--red); }
.row-tools { display: flex; gap: 2px; justify-content: flex-end; }
.icon-btn { background: none; border: 0; width: 28px; height: 28px; border-radius: 6px; color: var(--text-3); cursor: pointer; font-size: 15px; }
.icon-btn:hover { background: var(--cream); color: var(--text); }
.danger-zone { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between; margin-top: 48px; padding: 18px 20px; border: 1px solid rgba(196, 55, 44, .25); border-radius: var(--radius); }
.danger-zone h2 { font-size: 16px; margin: 0 0 2px; }
.danger-zone p { margin: 0; }

/* Sources and imports */
.source-list { display: grid; gap: 12px; }
.source-card { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 2fr) auto; gap: 8px 24px; align-items: center; padding: 18px 20px; }
.source-card.is-failed { border-color: rgba(196, 55, 44, .4); }
.source-name { font-family: var(--font-head); font-weight: 800; font-size: 17px; color: var(--text); text-decoration: none; }
.source-name:hover { color: var(--green-dark); text-decoration: underline; }
.source-facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 0; font-size: 14px; }
.source-facts dt { font-size: 12px; color: var(--text-3); }
.source-facts dd { margin: 2px 0 0; font-weight: 500; }
.source-facts dd a { text-decoration: none; }
.source-error { grid-column: 1 / -1; margin: 4px 0 0; padding: 10px 12px; border-radius: var(--radius-sm); background: var(--red-tint); color: #7a1f17; font-size: 13px; }
.number-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(110px, 1fr)); border: 1px solid var(--line); border-radius: var(--radius); background: #fff; margin-bottom: 8px; }
.number-strip > div { padding: 14px 16px; border-left: 1px solid var(--line-soft); }
.number-strip > div:first-child { border-left: 0; }
.number-strip b { display: block; font-family: var(--font-head); font-weight: 800; font-size: 22px; line-height: 1.1; }
.number-strip span { font-size: 13px; color: var(--text-3); }
.number-strip .is-zero b { color: var(--text-4); }
.lead-text { font-size: 15px; color: var(--text-2); }
.issue-list { margin: 12px 0 0; padding: 0; list-style: none; max-height: 420px; overflow-y: auto; font-size: 13px; }
.issue-list li { padding: 6px 0; border-top: 1px solid var(--line-soft); overflow-wrap: anywhere; }

/* Mail outbox */
.mail-layout { display: grid; grid-template-columns: 340px minmax(0, 1fr); gap: 20px; align-items: start; }
.mail-list { display: grid; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; max-height: 720px; overflow-y: auto; }
.mail-list a { display: grid; gap: 2px; padding: 10px 14px; border-top: 1px solid var(--line-soft); color: var(--text); text-decoration: none; font-size: 14px; }
.mail-list a:first-child { border-top: 0; }
.mail-list a:hover { background: var(--cream); }
.mail-list a.active { background: var(--green-tint); box-shadow: inset 3px 0 0 var(--green); }
.mail-meta { margin: 0 0 10px; }

@media (max-width: 1180px) {
  /* Image beside name and buy box; the details below both. */
  .pd { grid-template-columns: minmax(0, 340px) minmax(0, 1fr); column-gap: 32px; grid-template-areas: "media head" "media buy" "details details"; grid-template-rows: auto auto auto; }
  .pd-media, .pd-buy { position: static; }
  .pd-buy { margin-top: 20px; }
  .pd-related-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
  .pd { grid-template-columns: minmax(0, 1fr); grid-template-areas: "media" "head" "buy" "details"; }
  .pd-image { max-width: 240px; margin: 0 auto 20px; padding: 16px; }
  .pd-title { font-size: 22px; }
  .pd-price strong { font-size: 30px; }
  .pd-buy { padding: 18px; }
  .pd-qty .stepper button { width: 44px; }
  .pd-specs > div { grid-template-columns: 120px minmax(0, 1fr); }
  .pd-related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
}
@media (max-width: 1100px) {
  .cart-row { grid-template-columns: 56px minmax(0, 1fr) 96px 120px 92px 28px; gap: 12px; }
  .cr-media .thumb { width: 56px; height: 56px; }
}
@media (max-width: 760px) {
  .cart-table { padding: 0 14px; }
  .cart-row-head { display: none; }
  .cart-row { grid-template-columns: 48px minmax(0, 1fr) auto auto; grid-template-areas: "media info info remove" "price price qty total"; gap: 8px 12px; }
  .cart-row > .remove-btn { justify-self: end; }
  [data-frag="lines"] > .cart-row:first-child { border-top: 0; }
  .cr-media { grid-area: media; align-self: start; }
  .cr-media .thumb { width: 48px; height: 48px; font-size: 18px; }
  .cr-info { grid-area: info; }
  .cart-row > .remove-btn { grid-area: remove; align-self: start; }
  .cr-price { grid-area: price; text-align: left; }
  .cr-qty { grid-area: qty; justify-self: center; }
  .cr-total { grid-area: total; }
  .cart-problems li { flex-wrap: wrap; }
  .cart-head .actions { width: 100%; }
}
@media (max-width: 1000px) {
  .source-card { grid-template-columns: minmax(0, 1fr) auto; }
  .source-facts { grid-column: 1 / -1; grid-row: 2; }
  .edit-layout { grid-template-columns: 1fr; }
  .mail-layout { grid-template-columns: 1fr; }
  .mail-list { max-height: 260px; }
}
@media (max-width: 640px) {
  .admin-bar-inner { flex-wrap: wrap; gap: 4px 10px; padding-top: 4px; padding-bottom: 4px; }
  .admin-bar-status { order: 3; flex-basis: 100%; overflow-x: auto; padding-bottom: 4px; }
  .list-search, .list-search.wide { flex-basis: 100%; }
  .source-facts { grid-template-columns: 1fr 1fr; }
  .input-with-button { flex-wrap: wrap; }
  .input-with-button .btn { width: 100%; }
  .admin-table thead { display: none; }
  .admin-table, .admin-table tbody, .admin-table tr, .admin-table td { display: block; }
  .admin-table tr { padding: 12px 14px; border-bottom: 1px solid var(--line-soft); }
  .admin-table td { border: 0; padding: 2px 0; text-align: left; }
  .admin-table td.num { text-align: left; }
  .admin-table .thumb-cell { float: left; width: auto; padding: 0 12px 0 0; }
}

/* Demo feeds */
.demo-estimate { margin: 0; font-size: 14px; color: var(--text-2); transition: opacity .2s; }
.demo-estimate strong { color: var(--text); }
.demo-estimate.is-updating { opacity: .45; }
.picker .chips { margin: 8px 0 0; gap: 6px; }
.picker .chips:empty { display: none; }
.pick-chip { cursor: pointer; gap: 6px; padding: 4px 10px 4px 8px; }
.pick-chip input { width: 14px; height: 14px; margin: 0; }
.picker .combobox-list { position: absolute; left: 0; right: 0; z-index: 30; margin-top: 4px; }
.range-inputs, .input-suffix { display: flex; align-items: center; gap: 8px; }
.range-inputs input { flex: 1; min-width: 0; }
.input-suffix input { width: 120px; flex: none; }
.input-suffix span, .range-inputs span { color: var(--text-3); font-size: 14px; }
.radio-row { display: flex; flex-wrap: wrap; gap: 8px 24px; }
.radio-row .check { font-weight: 500; }
input.tiny-input { width: 64px; padding: 5px 8px; margin: 0 2px; }
.radio-row .check { white-space: nowrap; }
.check-list { display: grid; gap: 10px; }
.check-list .check { font-weight: 500; flex-wrap: wrap; }
.check .hint { font-weight: 400; margin-left: 4px; }
.inline-form { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.inline-form select { width: auto; padding: 6px 28px 6px 10px; font-size: 14px; }
.format-switch { flex-wrap: wrap; max-width: 640px; }
.format-switch label { flex: 1 0 auto; }
.format-switch span { padding: 7px 14px; }
.file-list { list-style: none; margin: 0; padding: 0; }
.file-list li { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; border-top: 1px solid var(--line-soft); font-size: 14px; }
.file-list li:first-child { border-top: 0; }
.file-list li > span { display: grid; gap: 1px; }
.file-list a { display: inline-flex; align-items: center; gap: 5px; font-weight: 600; text-decoration: none; white-space: nowrap; }
.copy-field { display: flex; gap: 8px; }
.copy-field input { flex: 1; min-width: 0; font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; font-size: 13px; background: var(--cream); }
.page-head .btn .muted { font-weight: 400; margin-left: 4px; }

/* Catalog card with several offers: product on top, its offers underneath (best first) */
.product-card.has-offers {
  grid-template-columns: 96px minmax(0, 1fr) auto; grid-template-areas: "media info summary" "media offers offers";
  align-items: start; row-gap: 14px;
}
.has-offers .pc-media { grid-area: media; }
.has-offers .pc-info { grid-area: info; }
.pc-summary { grid-area: summary; text-align: right; }
.pc-from { font-family: var(--font-head); font-weight: 800; font-size: 21px; line-height: 1.1; white-space: nowrap; }
.pc-from small { font-family: var(--font); font-size: 13px; font-weight: 500; color: var(--text-3); }
.pc-offer-count { margin-top: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.pc-offers { grid-area: offers; min-width: 0; padding: 4px 14px; background: #f9faf3; border: 1px solid var(--line-soft); border-radius: 12px; }
.offer {
  display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr) minmax(0, .8fr) auto; gap: 12px;
  align-items: center; min-height: 52px; padding: 8px 0; border-top: 1px solid var(--line-soft);
}
.offer-head { min-height: 0; padding: 8px 0 4px; border-top: 0; font-size: 11px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--text-3); }
.pc-offers > .offer-head + .offer { border-top: 0; }
.o-label { display: none; }
.o-price { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.o-price strong { font-family: var(--font-head); font-weight: 800; font-size: 16px; font-variant-numeric: tabular-nums; }
.o-tag { padding: 2px 7px; border-radius: 999px; font-size: 10px; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.o-tag.cheapest { background: var(--green-tint); color: var(--green-dark); }
.o-tag.fastest { background: var(--blue-tint); color: #00658a; }
.o-ship { font-size: 14px; font-weight: 600; font-variant-numeric: tabular-nums; }
.o-stock { font-size: 14px; font-variant-numeric: tabular-nums; }
.o-stock.in { color: var(--text); }
.o-stock.low { color: #b26b00; font-weight: 600; }
.o-stock.out { color: var(--red); font-weight: 600; }
.offer.is-out .o-price strong, .offer.is-out .o-ship { color: var(--text-4); }
.o-buy { display: grid; justify-items: end; gap: 3px; }
.o-buy .buy-form { gap: 6px; }
.o-buy .stepper input[type=number] { width: 42px; padding: 6px 0; }
.o-buy .buy-btn { padding: 7px 11px; }
.o-buy .in-cart { font-size: 11px; }
.offer-more > summary { list-style: none; cursor: pointer; display: flex; justify-content: flex-end; padding: 8px 0 6px; border-top: 1px solid var(--line-soft); font-size: 13px; font-weight: 600; color: var(--green-dark); }
.offer-more > summary::-webkit-details-marker { display: none; }
.offer-more > summary:hover { color: var(--text); }
.offer-more > summary > span { display: inline-flex; align-items: center; gap: 5px; }
.offer-more > summary > .offer-more-close, .offer-more[open] > summary > .offer-more-open { display: none; }
.offer-more[open] > summary > .offer-more-close { display: inline-flex; }
.offer-more[open] .icon { transform: rotate(180deg); }
@media (max-width: 1180px) {
  .product-card.has-offers { grid-template-columns: 84px minmax(0, 1fr) auto; grid-template-areas: "media info summary" "offers offers offers"; }
}
@media (max-width: 760px) {
  .product-card.has-offers { grid-template-columns: 64px minmax(0, 1fr); grid-template-areas: "media info" "summary summary" "offers offers"; }
  .has-offers .pc-media .thumb { width: 64px; height: 64px; }
  .pc-summary { display: flex; align-items: baseline; justify-content: space-between; text-align: left; }
  .pc-offers { padding: 2px 12px; }
  .offer-head { display: none; }
  .offer { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "price buy" "ship stock"; gap: 4px 12px; padding: 12px 0; }
  .pc-offers > .offer:nth-child(2) { border-top: 0; }
  .o-price { grid-area: price; }
  .o-buy { grid-area: buy; }
  .o-ship { grid-area: ship; font-weight: 500; font-size: 13px; white-space: nowrap; }
  .o-stock { grid-area: stock; font-size: 13px; text-align: right; }
  .o-label { display: inline; margin-right: 4px; font-weight: 400; color: var(--text-3); }
  .o-stock .o-label { display: none; }
}

/* Product page with several offers: offers as selectable cards, then quantity and add */
.pd-price strong small { font: 500 15px var(--font); color: var(--text-3); letter-spacing: 0; margin-right: 2px; }
.pd-offers-form { display: grid; gap: 12px; }
.pd-offers { display: grid; gap: 8px; margin: 0; padding: 0; border: 0; min-width: 0; }
.pd-offer {
  position: relative; display: grid; grid-template-columns: 20px minmax(0, 1fr); gap: 10px; align-items: start;
  padding: 12px 14px; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: 12px;
  transition: border-color .15s, background-color .15s, box-shadow .15s;
}
.pd-offer:hover { border-color: rgba(155, 181, 58, .7); }
.pd-offer:has(input:checked) { border-color: var(--green); background: #fbfcf5; box-shadow: 0 0 0 3px rgba(155, 181, 58, .18); }
.pd-offer:has(input:focus-visible) { outline: 3px solid rgba(155, 181, 58, .45); outline-offset: 2px; }
.pd-offer input[type=radio] { width: 18px; height: 18px; margin: 2px 0 0; accent-color: var(--green-dark); }
.pd-offer.is-out { cursor: not-allowed; background: #fafafa; }
.pd-offer.is-out .pd-offer-top strong { color: var(--text-4); }
.pd-offer-body { display: grid; gap: 4px; min-width: 0; }
.pd-offer-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.pd-offer-top strong { font: 800 18px/1.2 var(--font-head); font-variant-numeric: tabular-nums; }
.pd-offer-meta { display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; color: var(--text-2); }
.pd-offer-meta b { color: var(--text); font-weight: 600; }
.pd-offer-meta .low { color: #b26b00; font-weight: 600; }
.pd-offer-meta .out { color: var(--red); font-weight: 600; }
.pd-offer .in-cart { font-size: 12px; }
.pd-form-row { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 10px; }
.pd-offers-form .pd-line-total { margin: -4px 0 0; }
.cr-switch { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; margin-top: 6px; font-size: 13px; }
.cr-switch .btn { padding: 4px 10px; font-size: 13px; }
.pd-more-offers > summary { justify-content: flex-start; padding: 4px 2px; border-top: 0; }
.pd-more-offers[open] > summary { margin-bottom: 8px; }

/* Payments */
.admin-pill.warn::before { background: #f0a020; }
.pay-state { display: flex; gap: 14px; align-items: flex-start; margin-bottom: 20px; padding: 16px 18px; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.pay-state strong { display: block; font-size: 16px; }
.pay-state span { font-size: 14px; color: var(--text-2); }
.pay-state-dot { width: 12px; height: 12px; margin-top: 5px; border-radius: 50%; flex: none; background: var(--text-4); box-shadow: 0 0 0 4px rgba(0, 0, 0, .06); }
.pay-state-test { background: #fff8ec; border-color: rgba(178, 107, 0, .35); }
.pay-state-test .pay-state-dot { background: #f0a020; box-shadow: 0 0 0 4px rgba(240, 160, 32, .2); }
.pay-state-live { background: var(--green-tint); border-color: rgba(155, 181, 58, .5); }
.pay-state-live .pay-state-dot { background: var(--green); box-shadow: 0 0 0 4px rgba(155, 181, 58, .25); }
.pay-modes { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.pay-mode { display: flex; gap: 10px; align-items: flex-start; padding: 14px; cursor: pointer; border: 1px solid var(--line); border-radius: 12px; background: #fff; transition: border-color .15s, box-shadow .15s; }
.pay-mode:hover { border-color: rgba(155, 181, 58, .7); }
.pay-mode:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 3px rgba(155, 181, 58, .18); background: #fbfcf5; }
.pay-mode.test:has(input:checked) { border-color: #f0a020; box-shadow: 0 0 0 3px rgba(240, 160, 32, .18); background: #fffaf0; }
.pay-mode input { margin-top: 3px; accent-color: var(--green-dark); }
.pay-mode strong { display: block; font-size: 15px; }
.pay-mode small { display: block; margin-top: 2px; font-size: 13px; color: var(--text-3); }
.pay-keys input[type=password] { font-family: ui-monospace, "Cascadia Mono", Consolas, monospace; }
.pay-badge { display: inline-block; padding: 2px 9px; border-radius: 999px; font-size: 12px; font-weight: 700; white-space: nowrap; }
.pay-badge.paid { background: var(--green-tint); color: var(--green-dark); }
.pay-badge.pending { background: #fff3dc; color: #9a5c00; }
.pay-badge.test { background: #eef0f3; color: #4b5563; }
.pay-badge.fail { background: var(--red-tint); color: var(--red); }
.pay-summary { border-top: 1px dashed var(--line); padding-top: 6px; }
.pay-total { font-weight: 700; }
.pay-test-note { margin: 0; padding: 8px 10px; border-radius: 8px; background: #fff8ec; color: #7a4a00; font-size: 12px; line-height: 1.45; }
.admin-test-btn { font-size: 13px; color: var(--text-3); border-style: dashed; }
.pay-due { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 24px; border-color: rgba(178, 107, 0, .35); background: #fff8ec; }
.pay-due h2 { font-size: 18px; margin: 0 0 4px; }
.pay-due p { margin: 0; color: var(--text-2); }
@media (max-width: 760px) { .pay-modes { grid-template-columns: 1fr; } }
.badge-pending_payment { background: #fff3dc; color: #9a5c00; }
.pay-keys { align-content: start; }
.pay-keys .card-head { margin-bottom: 0; }

/* Company details, delivery address, order editing and refunds */
.details-missing { display: grid; gap: 6px; justify-items: start; padding: 12px 14px; border-radius: 10px; background: #fff8ec; border: 1px solid rgba(178, 107, 0, .3); font-size: 13px; color: #7a4a00; }
.details-missing strong { font-size: 14px; color: var(--text); }
.bill-to > div { display: flex; justify-content: space-between; align-items: baseline; }
.bill-to p { margin: 4px 0 0; font-size: 14px; }
.ship-to > summary { list-style: none; cursor: pointer; display: grid; grid-template-columns: auto 1fr auto; gap: 4px 8px; align-items: baseline; font-size: 14px; }
.ship-to > summary::-webkit-details-marker { display: none; }
.ship-line { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text-2); }
.ship-change { color: var(--green-dark); font-weight: 600; }
.ship-to[open] .ship-change { display: none; }
.ship-to textarea { margin-top: 8px; }
.ship-to .hint { display: block; margin-top: 4px; }
.qty-edit { width: 76px; padding: 5px 8px; text-align: right; }
.lines-edit { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 12px; }
.refund-box { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line); }
.refund-box .input-suffix input { width: 110px; }
/* A long company name must not push the header wider than the screen. */
.main-nav { min-width: 0; }
@media (max-width: 1100px) { .account > summary { max-width: 150px; } }
.bill-to .label, .ship-to .label { font-weight: 600; font-size: 14px; color: var(--text); }
.bill-to a { color: var(--green-dark); font-weight: 600; text-decoration: none; }
.bill-to a:hover, .ship-change:hover { text-decoration: underline; }
.bill-to p { color: var(--text-2); }

/* Invoice document: A4, prints on one or more pages, saved as PDF from the print dialog */
.invoice-body { display: block; background: #eef0ea; }
.invoice-tools { max-width: 210mm; margin: 24px auto 12px; display: flex; justify-content: space-between; align-items: center; font-size: 14px; }
.invoice-tools a { color: var(--text-2); }
.invoice { max-width: 210mm; margin: 0 auto 40px; padding: 18mm 16mm; background: #fff; box-shadow: 0 2px 20px rgba(0, 0, 0, .08); font-size: 13px; line-height: 1.45; color: #111; }
.inv-head { display: flex; justify-content: space-between; gap: 24px; padding-bottom: 18px; border-bottom: 2px solid var(--green); }
.inv-title { text-align: right; }
.inv-title h1 { font-size: 20px; margin: 0; text-transform: uppercase; letter-spacing: .02em; }
.inv-sub { margin: 2px 0 10px; color: var(--text-3); text-transform: uppercase; font-size: 11px; letter-spacing: .08em; }
.inv-meta { display: grid; grid-template-columns: auto auto; gap: 2px 14px; justify-content: end; margin: 0; }
.inv-meta dt { color: var(--text-3); }
.inv-meta dd { margin: 0; text-align: left; }
.inv-parties { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; margin: 22px 0; }
.inv-parties h2 { font: 700 11px var(--font); text-transform: uppercase; letter-spacing: .08em; color: var(--green-dark); margin: 0 0 6px; }
.inv-party-name { display: block; font-size: 15px; margin-bottom: 4px; }
.inv-parties dl { display: grid; grid-template-columns: max-content 1fr; gap: 1px 10px; margin: 0; }
.inv-parties dt { color: var(--text-3); font-size: 12px; }
.inv-parties dd { margin: 0; }
.inv-lines { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.inv-lines th { background: #f4f6e8; font-size: 11px; text-transform: none; letter-spacing: 0; color: var(--text-2); padding: 7px 8px; }
.inv-lines td { padding: 7px 8px; border-bottom: 1px solid #e6e6e6; vertical-align: top; }
.inv-sku { color: var(--text-3); font-size: 11px; }
.inv-bottom { display: grid; grid-template-columns: 1fr 280px; gap: 24px; margin-top: 16px; align-items: start; }
.inv-notes p { margin: 0 0 8px; }
.inv-vat-note { padding: 8px 10px; background: #f4f6e8; border-radius: 6px; }
.inv-paid { color: var(--green-dark); font-weight: 600; }
.inv-footer { color: var(--text-3); font-size: 12px; }
.inv-totals { width: 100%; border-collapse: collapse; }
.inv-totals td { padding: 5px 0; border: 0; }
.inv-grand td { border-top: 2px solid #111; padding-top: 8px; font: 800 16px var(--font-head); }
.inv-list a { font-weight: 600; text-decoration: none; }
.vat-status { display: block; margin-top: 4px; }
.vat-status.ok { color: var(--green-dark); }
@media print {
  .invoice-body { background: #fff; }
  .invoice { box-shadow: none; margin: 0; padding: 0; max-width: none; }
  @page { size: A4; margin: 14mm; }
}
@media (max-width: 760px) {
  .invoice { padding: 20px 16px; }
  .inv-head, .inv-parties, .inv-bottom { display: grid; grid-template-columns: 1fr; }
  .inv-title { text-align: left; }
  .inv-meta { justify-content: start; }
}

/* Admin → Emails */
.mail-meta-row { display: flex; gap: 12px; align-items: flex-start; justify-content: space-between; margin-bottom: 10px; }
.mail-list .pay-badge { font-size: 11px; padding: 1px 7px; margin-left: 4px; }

/* Product photos: gallery (product page) */
.gallery { display: grid; gap: 10px; }
.g-stage {
  position: relative; aspect-ratio: 1; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 16px;
}
.g-main { display: grid; place-items: center; width: 100%; height: 100%; padding: 28px; cursor: zoom-in; }
.g-main img { width: 100%; height: 100%; object-fit: contain; }
.g-stage .pd-image-empty { position: absolute; inset: 28px; width: auto; height: auto; }
.g-nav, .g-expand {
  position: absolute; display: grid; place-items: center; padding: 0; cursor: pointer;
  background: rgba(255, 255, 255, .94); color: var(--text); border: 1px solid var(--line); border-radius: 50%;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .08); transition: opacity .15s, background-color .15s;
}
.g-nav { top: 50%; width: 40px; height: 40px; margin-top: -20px; opacity: 0; }
.g-nav.prev { left: 10px; }
.g-nav.next { right: 10px; }
.g-expand { right: 10px; bottom: 10px; width: 36px; height: 36px; opacity: 0; }
.g-stage:hover .g-nav, .g-stage:hover .g-expand, .g-nav:focus-visible, .g-expand:focus-visible { opacity: 1; }
.g-nav:hover, .g-expand:hover { background: #fff; border-color: var(--green); }
.g-count {
  position: absolute; left: 12px; bottom: 12px; padding: 3px 9px; border-radius: 999px; pointer-events: none;
  background: rgba(0, 0, 0, .62); color: #fff; font: 600 12px/1.4 var(--font); font-variant-numeric: tabular-nums;
}
.g-thumbs { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; margin: 0; padding: 0; list-style: none; }
.g-thumb {
  position: relative; display: block; aspect-ratio: 1; padding: 4px; overflow: hidden;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; transition: border-color .15s, box-shadow .15s;
}
.g-thumb img { width: 100%; height: 100%; object-fit: contain; }
.g-thumb:hover { border-color: rgba(0, 0, 0, .3); }
.g-thumb.is-active { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.g-more span {
  position: absolute; inset: 0; display: grid; place-items: center;
  background: rgba(255, 255, 255, .8); color: var(--text); font: 800 15px var(--font-head);
}
.g-all {
  justify-self: start; display: inline-flex; align-items: center; gap: 7px; padding: 7px 12px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; font: 600 13px var(--font); color: var(--text);
}
.g-all:hover { border-color: var(--green); background: var(--green-tint); }
.js .g-thumb[href] { cursor: pointer; }
@media (hover: none) {
  .g-nav, .g-expand { display: none; }
}

/* Photo viewer: fullscreen, zoom, all-photos grid */
.viewer {
  position: fixed; inset: 0; width: 100%; height: 100%; max-width: none; max-height: none; margin: 0; padding: 0; border: 0;
  background: #fff; color: var(--text); grid-template-rows: auto minmax(0, 1fr) auto; grid-template-columns: minmax(0, 1fr); overflow: hidden;
}
.viewer[open] { display: grid; }
/* Controls hidden with the hidden attribute stay hidden, whatever display their class sets. */
.gallery [hidden], .viewer [hidden] { display: none !important; }
/* The page behind doesn't scroll while the viewer is open. */
html:has(.viewer[open]) { overflow: hidden; }
.viewer::backdrop { background: rgba(0, 0, 0, .55); }
.v-bar { display: flex; align-items: center; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line-soft); }
.v-title { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.v-count { color: var(--text-3); font-size: 14px; font-variant-numeric: tabular-nums; }
.v-btn {
  display: inline-flex; align-items: center; gap: 6px; height: 38px; padding: 0 12px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: 8px; font: 600 13px var(--font); color: var(--text);
}
.v-btn:hover { border-color: var(--green); }
.v-btn[aria-pressed="true"] { background: var(--green-tint); border-color: var(--green); }
.v-close { width: 38px; padding: 0; justify-content: center; }
.v-stage { position: relative; overflow: hidden; touch-action: none; }
/* The photo box always fills the stage and the photo fits inside it (object-fit), whatever its size;
   it only gets bigger than the screen when zoomed. */
.v-img {
  position: absolute; top: 16px; bottom: 36px; left: 84px; right: 84px; width: calc(100% - 168px); height: calc(100% - 52px);
  object-fit: contain; cursor: zoom-in; user-select: none; transition: transform .18s ease-out;
}
.v-stage.is-zoomed .v-img { cursor: grab; transition: none; }
.v-nav {
  position: absolute; z-index: 2; top: 50%; width: 48px; height: 48px; margin-top: -24px; display: grid; place-items: center; padding: 0;
  background: #fff; border: 1px solid var(--line); border-radius: 50%; box-shadow: var(--shadow); cursor: pointer; color: var(--text);
}
.v-nav:hover { border-color: var(--green); }
.v-nav.prev { left: 20px; }
.v-nav.next { right: 20px; }
.v-hint { position: absolute; bottom: 10px; left: 0; right: 0; margin: 0; text-align: center; font-size: 12px; color: var(--text-4); pointer-events: none; }
.v-stage.is-zoomed .v-hint { visibility: hidden; }
.v-strip { display: flex; gap: 8px; padding: 12px 16px; overflow-x: auto; border-top: 1px solid var(--line-soft); justify-content: safe center; }
.v-strip button, .v-grid button {
  flex: none; padding: 3px; cursor: pointer; background: #fff; border: 1px solid var(--line); border-radius: 8px;
}
.v-strip button { width: 64px; height: 64px; }
.v-strip img, .v-grid img { width: 100%; height: 100%; object-fit: contain; }
.v-strip button.is-active { border-color: var(--green); box-shadow: inset 0 0 0 1px var(--green); }
.v-grid {
  grid-row: 2 / 4; overflow-y: auto; padding: 16px; display: grid; gap: 12px; align-content: start;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
}
.v-grid[hidden] { display: none; }
.v-grid button { position: relative; aspect-ratio: 1; padding: 10px; border-radius: 12px; cursor: zoom-in; }
.v-grid button:hover { border-color: var(--green); }
.v-grid span {
  position: absolute; left: 8px; top: 8px; min-width: 22px; padding: 1px 6px; border-radius: 999px;
  background: rgba(0, 0, 0, .55); color: #fff; font: 600 11px/1.5 var(--font);
}
.viewer.is-grid .v-stage, .viewer.is-grid .v-strip { display: none; }
@media (max-width: 760px) {
  .v-img { left: 8px; right: 8px; width: calc(100% - 16px); }
  .v-nav, .v-hint { display: none; }
  .v-strip button { width: 52px; height: 52px; }
  .v-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; padding: 10px; }
  .v-btn span { display: none; }
  .v-btn[data-v-grid] { width: 38px; padding: 0; justify-content: center; }
}

/* Catalog and cart thumbnails: photo count and the hover preview */
.pc-media { position: relative; }
.pc-photos {
  position: absolute; right: 2px; bottom: 2px; display: inline-flex; align-items: center; gap: 3px; padding: 1px 6px 1px 5px;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--line); border-radius: 999px;
  font: 600 11px/1.45 var(--font); color: var(--text-2); font-variant-numeric: tabular-nums; pointer-events: none;
}
.photo-pop {
  position: fixed; z-index: 60; width: 300px; height: 300px; padding: 14px; display: grid; grid-template-rows: minmax(0, 1fr) auto; gap: 8px;
  background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: 0 14px 44px rgba(0, 0, 0, .16); pointer-events: none;
}
.photo-pop img { width: 100%; height: 100%; object-fit: contain; }
.pp-dots { display: flex; justify-content: center; gap: 5px; }
.pp-dots span { width: 6px; height: 6px; border-radius: 50%; background: rgba(0, 0, 0, .15); }
.pp-dots span.on { background: var(--green); }

@media (max-width: 760px) {
  .pd-media .gallery { max-width: 420px; margin: 0 auto 20px; }
  .g-main { padding: 16px; }
  .g-thumbs { display: flex; overflow-x: auto; scrollbar-width: none; }
  .g-thumbs li { flex: none; width: 56px; }
}
@media (prefers-reduced-motion: reduce) {
  .v-img, .g-nav, .g-expand, .g-thumb { transition: none; }
}

