/* shop.buy-it.gr storefront — matched to buy-it.gr's design system:
   shadcn/ui tokens, blue-600 primary (#2563EB), light slate background,
   white cards with 8px radius + subtle border + soft shadow,
   Space Grotesk headings / Inter body. */

:root {
  /* buy-it.gr shadcn tokens (HSL channels) */
  --background: 210 20% 98%;
  --foreground: 222 47% 11%;
  --card: 0 0% 100%;
  --card-foreground: 222 47% 11%;
  --primary: 221 83% 53%;
  --primary-foreground: 210 40% 98%;
  --secondary: 199 89% 48%;
  --muted: 210 40% 96.1%;
  --muted-foreground: 215 16% 47%;
  --border: 214 32% 91%;
  --ring: 221 83% 53%;
  --radius: .5rem;

  --bg: hsl(var(--background));
  --surface: hsl(var(--card));
  --surface-2: hsl(var(--muted));
  --ink: hsl(var(--foreground));
  --ink-soft: hsl(215 20% 35%);
  --ink-faint: hsl(var(--muted-foreground));
  --line: hsl(var(--border));
  --primary-c: hsl(var(--primary));
  --primary-ink: hsl(var(--primary-foreground));
  --primary-weak: hsl(221 83% 53% / .08);
  --accent-c: hsl(var(--secondary));
  --ok: hsl(142 71% 40%);
  --warn: hsl(32 90% 45%);
  --danger: hsl(0 72% 48%);
  --shadow-sm: 0 1px 2px hsl(222 47% 11% / .06), 0 1px 3px hsl(222 47% 11% / .04);
  --shadow-md: 0 4px 12px hsl(222 47% 11% / .08), 0 2px 4px hsl(222 47% 11% / .04);

  --maxw: 1200px;
  --font-head: "Space Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --background: 222 47% 6%;
    --foreground: 210 40% 96%;
    --card: 222 47% 9%;
    --card-foreground: 210 40% 96%;
    --primary: 217 91% 60%;
    --muted: 217 33% 15%;
    --muted-foreground: 215 20% 62%;
    --border: 217 33% 18%;
    --ink-soft: hsl(215 20% 72%);
    --primary-weak: hsl(217 91% 60% / .14);
    --shadow-sm: 0 1px 2px hsl(0 0% 0% / .4);
    --shadow-md: 0 6px 20px hsl(0 0% 0% / .45);
  }
}
:root[data-theme="dark"] {
  --background: 222 47% 6%; --foreground: 210 40% 96%; --card: 222 47% 9%;
  --card-foreground: 210 40% 96%; --primary: 217 91% 60%; --muted: 217 33% 15%;
  --muted-foreground: 215 20% 62%; --border: 217 33% 18%;
  --ink-soft: hsl(215 20% 72%); --primary-weak: hsl(217 91% 60% / .14);
  --shadow-sm: 0 1px 2px hsl(0 0% 0% / .4); --shadow-md: 0 6px 20px hsl(0 0% 0% / .45);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--font-body); font-size: 15px; line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;             /* nothing should ever scroll the page sideways */
}
h1, h2, h3, h4 { font-family: var(--font-head); font-weight: 700; line-height: 1.15;
  letter-spacing: -.02em; margin: 0 0 .5em; }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary-c); }
img { max-width: 100%; display: block; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--primary-c); outline-offset: 2px; border-radius: 3px; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: 20px; }

/* ---------- header ---------- */
.site-header { background: var(--surface); border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 30; }
.site-header .wrap { display: flex; align-items: center; gap: 16px; padding-block: 12px; }
.brand { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-head);
  font-weight: 700; font-size: 1.05rem; letter-spacing: -.02em; white-space: nowrap; color: var(--ink); flex: none; }
.brand-name { white-space: nowrap; }
.brand::before {
  content: ""; width: 30px; height: 30px; border-radius: 8px; flex: none;
  background: var(--primary-c) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='2.2' stroke-linecap='round'%3E%3Crect x='3' y='4' width='18' height='7' rx='1.5'/%3E%3Crect x='3' y='13' width='18' height='7' rx='1.5'/%3E%3Cline x1='7' y1='7.5' x2='7.01' y2='7.5'/%3E%3Cline x1='7' y1='16.5' x2='7.01' y2='16.5'/%3E%3C/svg%3E") center / 18px no-repeat;
}
.brand .dot { color: var(--primary-c); }
.brand:hover { color: var(--ink); }
.site-search { flex: 1; display: flex; min-width: 0; }
.site-search input {
  flex: 1; min-width: 0; font: inherit; padding: 9px 14px;
  border: 1px solid var(--line); border-right: 0; background: var(--bg); color: var(--ink);
  border-radius: var(--radius) 0 0 var(--radius);
}
.site-search input:focus { outline: none; border-color: var(--primary-c); box-shadow: 0 0 0 3px var(--primary-weak); }
.site-search button {
  font: inherit; font-weight: 600; padding: 9px 18px; border: 1px solid var(--primary-c);
  background: var(--primary-c); color: var(--primary-ink); cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
}
.site-search button:hover { filter: brightness(.94); }
.header-actions { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.lang-switch, .theme-toggle, .icon-btn {
  font: inherit; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  color: var(--ink-faint); cursor: pointer; line-height: 1;
}
.icon-btn { display: grid; width: 36px; height: 36px; place-items: center; padding: 0; }
.icon-btn:hover { color: var(--primary-c); border-color: var(--primary-c); }
.icon-btn[aria-pressed="true"] { color: var(--primary-c); border-color: var(--primary-c); background: var(--primary-weak); }
.vat-toggle .vat-ico { font-size: 1rem; font-weight: 700; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
/* the low-stock toggle exists only where there is a product grid to filter */
[data-lowstock-toggle] { display: none !important; }
body.has-listing [data-lowstock-toggle] { display: grid !important; }
/* low-stock cards hidden until the shopper opts in */
body:not(.show-lowstock) .grid > .card[data-stock="low"] { display: none; }

/* ---- instant search overlay ---- */
.search-overlay { position: fixed; inset: 0; z-index: 60; background: var(--bg);
  display: flex; flex-direction: column; }
.so-bar { display: flex; align-items: center; gap: 10px; padding: 12px 16px;
  border-bottom: 1px solid var(--line); background: var(--surface); }
.so-bar .so-ico { color: var(--ink-faint); flex: none; }
.so-bar input { flex: 1; font: inherit; font-size: 1.05rem; padding: 10px 4px; border: 0;
  background: none; color: var(--ink); outline: none; }
.so-bar button[data-search-close] { border: 0; background: none; color: var(--ink-faint);
  font-size: 1.3rem; cursor: pointer; padding: 6px 10px; }
.so-results { flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 6px 0; }
.so-row { display: flex; align-items: center; gap: 12px; padding: 10px 16px; }
.so-row:hover, .so-row:active { background: var(--surface-2); }
.so-row img { width: 48px; height: 48px; object-fit: contain; background: #fff;
  border: 1px solid var(--line); border-radius: 6px; flex: none; }
.so-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.so-name { font-size: .9rem; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.so-sub { font-size: .78rem; color: var(--ink-faint); }
.so-empty { text-align: center; color: var(--ink-faint); padding: 40px; }
.lang-switch:hover, .theme-toggle:hover { color: var(--ink); border-color: var(--ink-faint); }
.lang-switch { padding: 0 10px; height: 36px; display: inline-grid; place-items: center; }
.theme-toggle { width: 36px; height: 36px; display: grid; place-items: center; font-size: 14px; }
.cart-link { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--ink); padding: 6px 8px; }
.cart-link:hover { color: var(--primary-c); }
.cart-count { background: var(--primary-c); color: var(--primary-ink); font-size: .7rem; font-weight: 700;
  min-width: 18px; height: 18px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0 5px; }

/* ---------- shop layout ---------- */
.shop-layout { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: 32px; padding-block: 28px 64px; }
.shop-layout > main { min-width: 0; }
.filters h2 { font-size: .72rem; text-transform: uppercase; letter-spacing: .08em; color: var(--ink-faint); margin-bottom: .7em; }
.filters ul { list-style: none; margin: 0; padding: 0; }
.filters .dept-nav > li { margin-bottom: 2px; }
.filters a { display: flex; justify-content: space-between; gap: 8px; padding: 7px 10px; margin-inline: -10px;
  font-size: .88rem; color: var(--ink-soft); border-radius: 6px; }
.filters a:hover { background: var(--surface-2); color: var(--ink); }
.filters a.active { background: var(--primary-weak); color: var(--primary-c); font-weight: 600; }
.filters .count { color: var(--ink-faint); font-size: .76rem; font-variant-numeric: tabular-nums; }
.filters a.active .count { color: var(--primary-c); }
.filters .dept-all { font-weight: 600; }

/* department = <details>; summary is the row, nested <ul> is the sub-cats */
.filters .dept details > summary { list-style: none; display: flex; align-items: center; gap: 6px;
  cursor: pointer; padding: 7px 10px; margin-inline: -10px; border-radius: 6px; font-weight: 600;
  font-size: .88rem; color: var(--ink); }
.filters .dept details > summary::-webkit-details-marker { display: none; }
.filters .dept details > summary::before { content: "›"; font-size: 1rem; color: var(--ink-faint);
  transition: transform .15s; line-height: 1; }
.filters .dept details[open] > summary::before { transform: rotate(90deg); }
.filters .dept details > summary:hover { background: var(--surface-2); }
.filters .dept details > summary a { flex: 1; padding: 0; margin: 0; color: inherit; }
.filters .dept details > summary a:hover { background: none; }
.filters .dept details > summary .count { margin-left: auto; }
.filters .dept details > ul { padding-left: 14px; margin: 2px 0 6px; border-left: 1px solid var(--line); }
.filters .dept details > ul a { font-size: .84rem; }

.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px 16px; margin-bottom: 12px; flex-wrap: wrap; margin-top: 4px; }
.results-head h1, .results-head h2 { font-size: 1.5rem; margin: 0; }
.results-head .meta { color: var(--ink-faint); font-size: .85rem; white-space: nowrap; }

/* sort bar */
.sort { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 18px;
  font-size: .82rem; color: var(--ink-faint); }
.sort-lbl { font-weight: 600; }
.sort a { padding: 5px 10px; border: 1px solid var(--line); border-radius: 999px; color: var(--ink-soft); background: var(--surface); }
.sort a:hover { border-color: var(--ink-faint); color: var(--ink); }
.sort a.active { background: var(--primary-c); color: var(--primary-ink); border-color: var(--primary-c); }
.rating { display: inline-flex; align-items: center; gap: 3px; font-size: .74rem; color: var(--warn); }
.rating .rc { color: var(--ink-faint); }
.card.brand-hidden { display: none; }

/* price-drop badge on cards + banner on the PDP */
.card { position: relative; }
.drop-badge { position: absolute; top: 8px; left: 8px; z-index: 2;
  background: var(--danger); color: #fff; font-size: .72rem; font-weight: 700;
  padding: 3px 8px; border-radius: 999px; letter-spacing: .02em; }
.card .compare { color: var(--danger); }
.drop-banner { display: inline-flex; align-items: center; gap: 6px; font-size: .82rem;
  font-weight: 600; color: var(--danger); background: hsl(0 72% 48% / .1);
  border: 1px solid hsl(0 72% 48% / .25); border-radius: var(--radius);
  padding: 8px 12px; margin-bottom: 8px; }
.dept-deal { color: var(--danger) !important; font-weight: 700 !important; }
.dept-deal::before { content: "🔥 "; }

/* brand ribbon */
.brand-ribbon { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; margin-bottom: 16px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch; }
.brand-ribbon::-webkit-scrollbar { display: none; }
.brand-chip { flex: 0 0 auto; font: inherit; font-size: .8rem; font-weight: 600;
  border: 1px solid var(--line); border-radius: 999px; padding: 6px 12px; background: var(--surface);
  color: var(--ink-soft); cursor: pointer; white-space: nowrap; }
.brand-chip span { color: var(--ink-faint); font-weight: 400; margin-left: 4px; }
.brand-chip:hover { border-color: var(--ink-faint); color: var(--ink); }
.brand-chip.active { background: var(--primary-c); color: var(--primary-ink); border-color: var(--primary-c); }
.brand-chip.active span { color: var(--primary-ink); opacity: .8; }

/* PDP share */
.pdp-share { display: inline-flex; align-items: center; gap: 6px; margin-top: 12px;
  font: inherit; font-size: .82rem; font-weight: 600; color: var(--ink-soft);
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  padding: 8px 14px; cursor: pointer; }
.pdp-share:hover { border-color: var(--primary-c); color: var(--primary-c); }
.pdp-share.copied { color: var(--ok); border-color: var(--ok); }

/* ---------- product grid & cards ---------- */
/* Fluid at every width: column count falls out of the container width, so the
   grid reflows smoothly while dragging the window, not just at breakpoints.
   The 100% floor in minmax() stops a partial extra column from overflowing a
   narrow container. */
.grid { display: grid; gap: 16px; min-width: 0;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr)); }
.grid > .card { min-width: 0; }
.card {
  border: 1px solid var(--line); background: var(--surface); border-radius: var(--radius);
  display: flex; flex-direction: column; overflow: hidden; box-shadow: var(--shadow-sm);
  transition: box-shadow .15s, transform .15s;
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.card .thumb { aspect-ratio: 4 / 3; background: #fff; display: block; padding: 14px; overflow: hidden; }
.card .thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.card .body { padding: 14px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.card .brand-tag { font-size: .68rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--primary-c); }
.card .name { font-size: .9rem; font-weight: 500; line-height: 1.4; color: var(--ink);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.card .name:hover { color: var(--primary-c); }
.card .spacer { flex: 1; }
.card .price-row { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-top: 2px; }
.card .price { font-family: var(--font-head); font-weight: 700; font-size: 1.02rem; color: var(--ink); }
.card .price .vat { font-family: var(--font-body); font-weight: 400; font-size: .66rem; color: var(--ink-faint); }
.card .compare { text-decoration: line-through; color: var(--ink-faint); font-size: .8rem; }
.stock { font-size: .72rem; font-weight: 600; display: inline-flex; align-items: center; gap: 5px; }
.stock::before { content: ""; width: 7px; height: 7px; border-radius: 999px; background: currentColor; }
.stock.in { color: var(--ok); }
.stock.low { color: var(--warn); }
.stock.out { color: var(--ink-faint); }
.card .btn-add {
  margin-top: 10px; font: inherit; font-weight: 600; font-size: .82rem; padding: 9px 12px;
  border: 1px solid var(--primary-c); background: var(--primary-c); color: var(--primary-ink);
  cursor: pointer; border-radius: var(--radius);
}
.card .btn-add:hover { filter: brightness(.94); }
.card .btn-add:disabled { background: var(--surface-2); border-color: var(--line); color: var(--ink-faint); cursor: default; filter: none; }

/* ---------- pagination ---------- */
.pager { display: flex; gap: 8px; align-items: center; justify-content: center; margin-top: 40px; flex-wrap: wrap; }
.pager a, .pager span { padding: 8px 14px; border: 1px solid var(--line); border-radius: var(--radius);
  font-size: .85rem; background: var(--surface); }
.pager a:hover { border-color: var(--primary-c); color: var(--primary-c); }
.pager .current { background: var(--primary-c); color: var(--primary-ink); border-color: var(--primary-c); font-weight: 700; }
.pager .disabled { opacity: .4; }

/* ---------- product detail ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 16px 0; align-items: center; }
.crumbs .crumb {
  font-size: .82rem; font-weight: 600; color: var(--ink-soft); text-decoration: none;
  padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface);
}
.crumbs .crumb:hover { border-color: var(--primary-c); color: var(--primary-c); }
.crumbs .crumb + .crumb::before { content: none; }
.pdp { display: grid; grid-template-columns: 1fr 1fr; gap: 44px; padding-block: 20px 56px; align-items: start; }
.pdp .info .brand { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--primary-c); }
.pdp .info h1 { font-size: 1.6rem; margin: 8px 0 14px; }
.pdp .price-block { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface-2);
  padding: 20px; margin-block: 20px; }
.pdp .price-block .price { font-family: var(--font-head); font-weight: 700; font-size: 2rem; }
.pdp .price-block .price .vat { font-family: var(--font-body); font-weight: 400; font-size: .8rem; color: var(--ink-faint); }
.pdp .price-block .ex-vat { color: var(--ink-faint); font-size: .85rem; margin-top: 4px; }

/* PDP gallery */
.gallery .g-main { border: 1px solid var(--line); border-radius: var(--radius); background: #fff;
  aspect-ratio: 1; display: grid; place-items: center; padding: 32px; box-shadow: var(--shadow-sm); }
.gallery .g-main img { max-width: 100%; max-height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.gallery .g-thumbs { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.gallery .g-thumb { width: 60px; height: 60px; border: 1px solid var(--line); border-radius: 6px;
  background: #fff; padding: 4px; cursor: pointer; }
.gallery .g-thumb.active { border-color: var(--primary-c); box-shadow: 0 0 0 2px var(--primary-weak); }
.gallery .g-thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }

/* PDP content blocks */
.pdp-block { padding-block: 24px; border-top: 1px solid var(--line); }
.pdp-block h2 { font-size: 1.15rem; margin-bottom: 12px; }
.pdp-block .prose { color: var(--ink-soft); font-size: .92rem; line-height: 1.7; max-width: 72ch; }
.pdp-block .prose b, .pdp-block .prose strong { color: var(--ink); font-weight: 700; }
.pdp-block .prose ul { margin: 8px 0; padding-left: 20px; }
.pdp-block .prose li { margin: 3px 0; }
.pdp-block .prose p { margin: 8px 0; }
.mfr-link { margin: 14px 0 0; font-size: .85rem; }
.mfr-link a { color: var(--primary-c); font-weight: 600; }
.mfr-link a:hover { text-decoration: underline; }
.spec-table { width: 100%; border-collapse: collapse; max-width: 640px; }
.spec-table th, .spec-table td { text-align: left; padding: 8px 12px; border-bottom: 1px solid var(--line); font-size: .88rem; vertical-align: top; }
.spec-table th { color: var(--ink-faint); font-weight: 500; width: 40%; }
.doc-list { list-style: none; padding: 0; margin: 0; display: grid; gap: 8px; }
.doc-list a { display: inline-flex; align-items: baseline; gap: 8px; color: var(--primary-c); font-size: .9rem; }
.doc-list .doc-kind { font-size: .74rem; color: var(--ink-faint); text-transform: uppercase; letter-spacing: .04em; }
.pdp .meta-list { list-style: none; padding: 0; margin: 20px 0; display: grid; gap: 8px; font-size: .88rem; }
.pdp .meta-list li { display: flex; gap: 12px; }
.pdp .meta-list .k { color: var(--ink-faint); min-width: 130px; }
.pdp .meta-list .ref-code { font-family: var(--font-head); font-weight: 700; font-size: 1.05rem;
  letter-spacing: .04em; color: var(--primary-c); }
.qty-add { display: flex; gap: 10px; margin-top: 18px; }
.qty-add input { width: 72px; font: inherit; padding: 11px; border: 1px solid var(--line);
  border-radius: var(--radius); background: var(--bg); color: var(--ink); text-align: center; }
.qty-note { font-size: .78rem; color: var(--ink-faint); margin: 6px 0 0; }
.btn-primary {
  font: inherit; font-weight: 600; padding: 12px 26px; border: 1px solid var(--primary-c);
  background: var(--primary-c); color: var(--primary-ink); cursor: pointer; border-radius: var(--radius);
  display: inline-flex; align-items: center; gap: 8px;
}
.btn-primary:hover { filter: brightness(.94); }
.btn-primary:disabled { opacity: .5; cursor: default; filter: none; }

/* ---------- home ---------- */
.home { padding-block: 24px 64px; }
.home section { margin-bottom: 48px; }
.home-hero { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); display: grid; grid-template-columns: 1.15fr 1fr; overflow: hidden; }
.home-hero:not(:has(img)) { grid-template-columns: 1fr; }
.home-hero img { width: 100%; height: 100%; object-fit: cover; min-height: 240px; }
.home-hero .hh-text { padding: 44px; display: flex; flex-direction: column; justify-content: center; gap: 14px; }
.home-hero h1 { font-size: 2.2rem; margin: 0; line-height: 1.1; }
.home-hero h1 .accent { color: var(--primary-c); }
.home-hero p { margin: 0; color: var(--ink-soft); max-width: 44ch; }
.hero-usp { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 8px; }
.hero-usp li { font-size: .8rem; font-weight: 600; color: var(--primary-c); background: var(--primary-weak);
  border-radius: 999px; padding: 5px 12px; display: inline-flex; align-items: center; gap: 6px; }
.hero-usp li::before { content: "✓"; font-weight: 700; }
.home-hero .btn-primary { align-self: flex-start; margin-top: 8px; }

/* load more / show all */
.load-more-wrap { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 32px; }
.load-more { min-width: 200px; justify-content: center; }
.load-all { font-size: .85rem; color: var(--ink-faint); text-decoration: underline; }
.load-all:hover { color: var(--primary-c); }
.pager.hidden { display: none; }
.home-cats h2, .home-new h2 { font-size: 1.3rem; margin-bottom: 18px; }
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 16px; }
.cat-tile { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface);
  box-shadow: var(--shadow-sm); padding: 16px; display: flex; flex-direction: column; gap: 10px;
  transition: box-shadow .15s, transform .15s; }
.cat-tile:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); color: var(--ink); }
.cat-tile .ct-img { aspect-ratio: 1; background: #fff; border-radius: 6px; display: grid; place-items: center; overflow: hidden; }
.cat-tile .ct-img img { max-width: 80%; max-height: 80%; object-fit: contain; mix-blend-mode: multiply; }
.cat-tile .ct-name { font-family: var(--font-head); font-weight: 700; font-size: .9rem; }
.cat-tile .ct-n { font-size: .74rem; color: var(--ink-faint); font-variant-numeric: tabular-nums; }
.home-new .results-head { align-items: center; }

/* ---------- category editorial ---------- */
.cat-hero { border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin-bottom: 20px; max-height: 260px; box-shadow: var(--shadow-sm); }
.cat-hero img { width: 100%; height: 100%; object-fit: cover; }
.cat-intro { margin-bottom: 24px; color: var(--ink-soft); max-width: 70ch; font-size: .95rem; }
.cat-intro :first-child { margin-top: 0; }
.featured-strip { margin-bottom: 32px; }
.featured-strip h2 { font-size: .78rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
  color: var(--primary-ink); background: var(--primary-c); display: inline-block; padding: 5px 12px;
  border-radius: 999px; margin-bottom: 14px; }

/* ---------- cart / checkout ---------- */
.page-narrow { max-width: 840px; margin: 0 auto; padding-block: 28px 64px; }
.page-narrow h1 { font-size: 1.6rem; margin-bottom: 20px; }
.cart-table { width: 100%; border-collapse: collapse; }
.cart-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .06em;
  color: var(--ink-faint); border-bottom: 1px solid var(--line); padding: 10px 8px; }
.cart-table td { border-bottom: 1px solid var(--line); padding: 14px 8px; vertical-align: top; font-size: .9rem; }
.cart-table .ci-img img { width: 60px; height: 60px; object-fit: contain; background: #fff; border: 1px solid var(--line); border-radius: 6px; }
.cart-table input.qty { width: 58px; font: inherit; padding: 6px; text-align: center;
  border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 6px; }
.cart-table .rm { background: none; border: 0; color: var(--danger); cursor: pointer; font-size: .8rem; text-decoration: underline; padding: 0; }
.cart-totals { margin: 24px 0 0 auto; max-width: 340px; display: grid; gap: 8px; font-size: .9rem;
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; background: var(--surface); }
.cart-totals .row { display: flex; justify-content: space-between; }
.cart-totals .grand { border-top: 1px solid var(--line); padding-top: 10px; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 14px; margin-block: 16px; }
.form-grid label { display: flex; flex-direction: column; gap: 3px; font-size: .78rem; color: var(--ink-faint); }
.form-grid label.full { grid-column: 1 / -1; }
.form-grid input, .form-grid textarea { font: inherit; padding: 8px 10px; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink); border-radius: var(--radius); }
.form-grid input:focus, .form-grid textarea:focus { outline: none; border-color: var(--primary-c); box-shadow: 0 0 0 3px var(--primary-weak); }
.form-grid textarea { min-height: 84px; resize: vertical; }
.form-section { font-size: .95rem; font-family: var(--font-head); margin: 18px 0 4px; }
.checkbox-row { display: flex; align-items: center; gap: 8px; font-size: .85rem; color: var(--ink);
  margin-block: 10px; cursor: pointer; }
.checkbox-row input { width: 16px; height: 16px; flex: none; }
.notice { padding: 14px 16px; border: 1px solid var(--line); border-left: 3px solid var(--primary-c);
  background: var(--surface-2); border-radius: 6px; font-size: .88rem; margin-block: 16px; }
.notice.err { border-left-color: var(--danger); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); margin-top: 40px; background: var(--surface); }
.site-footer .wrap { padding-block: 28px; display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap; font-size: .82rem; color: var(--ink-faint); }
.site-footer a:hover { color: var(--primary-c); }

.empty-state { text-align: center; padding: 80px 20px; color: var(--ink-faint); }
.empty-state h1 { color: var(--ink); }

/* ===================== mobile ===================== */
@media (max-width: 1024px) {
  .shop-layout { grid-template-columns: minmax(0, 1fr); gap: 0; padding-block: 16px 48px; }
  .shop-layout > .filters, .shop-layout > main { min-width: 0; max-width: 100%; }
  .pdp { grid-template-columns: 1fr; gap: 24px; }
  .home-hero { grid-template-columns: 1fr; }
}
@media (max-width: 768px) {
  body { font-size: 14px; }
  .wrap { padding-inline: 14px; }
  .site-header .wrap { gap: 8px; padding-block: 8px; }
  .brand { font-size: 1rem; }
  .header-actions { margin-left: auto; gap: 4px; }
  .site-search { display: none; }              /* replaced by the overlay */
  .icon-btn { display: grid; }
  .cart-label { display: none; }
  .vat-toggle { padding: 8px 9px; font-size: .72rem; }
  .lang-switch { padding: 8px 9px; font-size: .72rem; }
  .theme-toggle { width: 38px; height: 38px; }
  .cart-link { padding: 8px; }

  /* Header is sticky; the DEPARTMENT chip row sticks flush beneath it as one
     unit, no gap. Chips scroll horizontally inside a viewport-pinned strip. */
  .site-header { position: sticky; top: 0; z-index: 31; }
  .filters { position: sticky; top: 53px; z-index: 20; background: var(--surface);
    margin-inline: -14px; padding: 8px 12px; border-bottom: 1px solid var(--line);
    overflow: hidden; box-shadow: var(--shadow-sm); }
  .filters h2 { display: none; }
  .filters .dept-nav { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 1px;
    -webkit-overflow-scrolling: touch; scrollbar-width: none; }
  .filters .dept-nav::-webkit-scrollbar { display: none; }
  .filters .dept-nav > li { flex: 0 0 auto; margin: 0; }

  main { padding-top: 14px; }
  /* collapse each department to just its summary link, rendered as a chip */
  .filters .dept details > ul { display: none; }
  .filters .dept details > summary,
  .filters .dept-all {
    white-space: nowrap; border: 1px solid var(--line); border-radius: 999px;
    padding: 7px 13px; margin: 0; background: var(--surface); font-size: .82rem;
  }
  .filters .dept details > summary::before { display: none; }
  .filters .dept details > summary .count,
  .filters .dept-all .count { display: none; }
  .filters .dept details > summary:has(a.active),
  .filters .dept-all.active {
    background: var(--primary-c); color: var(--primary-ink); border-color: var(--primary-c);
  }
  .filters .dept details > summary:has(a.active) a { color: var(--primary-ink); }

  .results-head h1, .results-head h2 { font-size: 1.25rem; }

  /* exactly two columns on phones — never a clipped third */
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card { border-radius: 8px; }
  .card .thumb { aspect-ratio: 4 / 3; padding: 10px; }
  .card .body { padding: 10px; gap: 3px; }
  .card .brand-tag { font-size: .6rem; }
  .card .name { font-size: .8rem; line-height: 1.3; -webkit-line-clamp: 2; }
  .card .rating { font-size: .68rem; }
  .card .stock { font-size: .68rem; }
  .card .price { font-size: .9rem; }
  .card .price .vat { display: none; }               /* toggle in header covers this */
  .card .btn-add { margin-top: 8px; padding: 9px 8px; font-size: .76rem; white-space: nowrap;
    overflow: hidden; text-overflow: ellipsis; }

  .crumbs { padding-block: 8px 0; gap: 6px; }
  .crumbs .crumb { padding: 5px 10px; font-size: .78rem; }
  .pdp { padding-block: 8px 24px; gap: 10px; }
  /* fixed, modest height — the image fills what it can, no giant white void */
  .gallery { max-width: 100%; overflow: hidden; }
  .gallery .g-main { display: grid; place-items: center; width: 100%; max-width: 100%;
    padding: 16px; aspect-ratio: auto; height: 46vw; max-height: 300px; min-height: 190px;
    box-shadow: none; border-radius: 8px; overflow: hidden; }
  .gallery .g-main img { width: 100%; height: 100%; max-width: 100%; max-height: 100%;
    object-fit: contain; }
  .gallery .g-thumbs { margin-top: 6px; }
  .pdp .info h1 { font-size: 1.15rem; margin: 4px 0 8px; }
  .pdp .info .stock { font-size: .78rem; }
  .pdp .price-block { padding: 14px; margin-block: 10px; }
  .pdp .price-block .price { font-size: 1.5rem; }
  .pdp .meta-list { margin: 12px 0; gap: 6px; }
  .pdp-block { padding-block: 16px; }
  /* add-to-cart bar fixed to the bottom; body gets matching padding so nothing
     is ever hidden behind it */
  body.has-pdp { padding-bottom: 88px; }
  .qty-add { position: fixed; left: 0; right: 0; bottom: 0; background: var(--surface);
    padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line);
    z-index: 40; box-shadow: 0 -2px 12px hsl(222 47% 11% / .12); margin: 0; }
  .qty-add .btn-primary { flex: 1; justify-content: center; }
  .qty-note { margin: 6px 0 0; }

  .home { padding-block: 16px 48px; }
  .home section { margin-bottom: 32px; }
  .home-hero .hh-text { padding: 24px; }
  .home-hero h1 { font-size: 1.6rem; }
  .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .form-grid { grid-template-columns: 1fr 1fr; gap: 8px 10px; margin-block: 12px; }
  .page-narrow .cart-totals { padding: 12px 14px; gap: 4px; font-size: .86rem; }
  .page-narrow .cart-totals .row { padding: 1px 0; }
  .page-narrow h1 { font-size: 1.3rem; margin-bottom: 14px; }
  .page-narrow { padding-block: 16px 40px; }
  .page-narrow h1 { font-size: 1.35rem; margin-bottom: 12px; }
  /* compact cart rows: image + text on one line, qty/line/remove on the next */
  .cart-table thead { display: none; }
  .cart-table, .cart-table tbody { display: block; }
  .cart-table tr { display: grid; grid-template-columns: 52px 1fr auto;
    grid-template-areas: "img name price" "img qty rm";
    gap: 2px 10px; align-items: center; border: 1px solid var(--line);
    border-radius: 8px; margin-bottom: 8px; padding: 8px; }
  .cart-table td { display: block; border: 0; padding: 0; font-size: .84rem; }
  .cart-table .ci-img { grid-area: img; }
  .cart-table .ci-img img { width: 52px; height: 52px; }
  .cart-table td:nth-child(2) { grid-area: name; font-weight: 600; line-height: 1.25;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
  .cart-table td:nth-child(2) span { display: none; }   /* hide the SKU on mobile */
  .cart-table td:nth-child(3) { grid-area: price; text-align: right; color: var(--ink-faint); }
  .cart-table td:nth-child(4) { grid-area: qty; }
  .cart-table td:nth-child(5) { grid-area: rm; text-align: right; }
  .cart-table input.qty { width: 52px; padding: 5px; }
  .notice { padding: 10px 12px; font-size: .82rem; margin-block: 12px; }
  .cart-totals { max-width: none; margin-inline: 0; padding: 14px; }

  .site-footer .wrap { flex-direction: column; gap: 10px; }
  .pager a, .pager span { padding: 10px 14px; }  /* bigger tap targets */
}
/* very narrow: allow a single column rather than cramming two */
@media (max-width: 300px) {
  .grid { grid-template-columns: 1fr; }
}
/* desktop: hide the mobile-only search icon */
@media (min-width: 769px) { .search-open { display: none; } }  /* desktop has the search bar */

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
