:root {
  --bg: #f4f5f3;
  --surface: #ffffff;
  --ink: #15202b;
  --ink-2: #2a3a48;
  --muted: #5d6a76;
  --line: #dde2e5;
  --tag: #ffc72c;
  --ok: #23704a;
  --bad: #b3261e;
  --radius: 6px;
  --radius-lg: 12px;
  --shadow: 0 1px 2px rgba(21,32,43,.06), 0 6px 18px rgba(21,32,43,.07);
  --shadow-lg: 0 18px 48px rgba(21,32,43,.18);
  --font: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --max: 1280px;
  --gutter: clamp(1rem, 3vw, 2rem);
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body { margin: 0; overflow-x: hidden; background: var(--bg); color: var(--ink); font: 400 16px/1.5 var(--font); }
body.storefront > main { min-height: 60vh; }
a { color: inherit; }
img { max-width: 100%; display: block; }
svg { flex-shrink: 0; }
:focus-visible { outline: 3px solid var(--ink); outline-offset: 2px; }
h1, h2, h3 { font-stretch: 78%; font-weight: 750; line-height: 1.1; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5vw, 3.2rem); }
h2 { font-size: 1.4rem; }
.wrap { max-width: var(--max); margin: 0 auto; padding: 1.25rem var(--gutter) 4rem; }
.narrow { max-width: 440px; }
.muted { color: var(--muted); }
.skip { position: absolute; left: -999px; top: .5rem; z-index: 100; background: var(--tag); padding: .5rem .8rem; border-radius: var(--radius); font-weight: 700; }
.skip:focus { left: .5rem; }

/* ---------- admin shell: sidebar on desktop, top bar + drawer on small screens ---------- */
:root { --side-w: 250px; }
.admin-side { position: fixed; inset: 0 auto 0 0; width: var(--side-w); z-index: 30; background: var(--surface); border-right: 1px solid var(--line); display: flex; flex-direction: column; overflow-y: auto; }
.admin-side > .brand, .admin-top .brand { position: relative; display: flex; align-items: baseline; gap: .45rem; padding-left: .85rem; font-weight: 800; font-stretch: 75%; font-size: 1.45rem; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; line-height: 1; }
.admin-side > .brand { margin: 1.3rem 1.25rem 1.1rem; }
.admin-side > .brand::before, .admin-top .brand::before { content: ""; position: absolute; left: 0; top: .05em; bottom: .05em; width: .3rem; background: var(--tag); border-radius: 2px; }
.admin-side .brand small, .admin-top .brand small { font: 700 .68rem var(--font); font-stretch: 100%; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.side-nav { display: grid; gap: .15rem; padding: 0 .75rem; }
.side-label { display: block; padding: 1rem .65rem .4rem; font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.side-nav a { display: flex; align-items: center; gap: .7rem; padding: .55rem .65rem; border-radius: var(--radius); text-decoration: none; font-weight: 600; color: var(--ink-2); transition: background .15s, color .15s; }
.side-nav a:hover { background: var(--bg); color: var(--ink); }
.side-nav a.on { background: var(--ink); color: #fff; }
.side-nav a.on svg { color: var(--tag); }
.side-nav svg { width: 1.2rem; height: 1.2rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; color: var(--muted); }
.side-nav a:hover svg { color: var(--ink); }
.side-foot { margin-top: auto; padding: 1rem .75rem 1.1rem; border-top: 1px solid var(--line); display: grid; gap: .6rem; }
.side-foot form { margin: 0; }
.side-user { display: flex; align-items: center; gap: .65rem; padding: .45rem .5rem; border-radius: var(--radius); text-decoration: none; min-width: 0; }
.side-user:hover, .side-user.on { background: var(--bg); }
.side-user > span:last-child { min-width: 0; }
.side-user strong, .side-user small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.side-user small { color: var(--muted); font-size: .8rem; }
.avatar { display: grid; place-items: center; width: 2.2rem; height: 2.2rem; border-radius: 50%; background: var(--tag); font-weight: 800; flex-shrink: 0; }
.admin-top { display: none; position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); padding: .5rem var(--gutter); align-items: center; gap: .5rem; }
.admin-top .brand { margin-right: auto; font-size: 1.3rem; min-width: 0; overflow: hidden; }
.admin-drawer .side-foot { margin-top: 1rem; }
body.admin { padding-left: var(--side-w); }
body.admin .wrap { max-width: 1240px; padding-top: 1.75rem; }
body.admin .flashes { max-width: 1240px; padding-top: 1.5rem; }
@media (max-width: 900px) {
  body.admin { padding-left: 0; }
  .admin-side { display: none; }
  .admin-top { display: flex; }
}

/* ---------- shop header ---------- */
.icon-btn { display: inline-grid; place-items: center; width: 2.5rem; height: 2.5rem; border: 0; border-radius: 50%; background: none; color: inherit; cursor: pointer; padding: 0; }
.icon-btn:hover { background: rgba(21,32,43,.07); }
.icon-btn svg, .hdr-search svg, .filters-btn svg, .chev { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-header { position: sticky; top: 0; z-index: 30; background: var(--surface); border-bottom: 1px solid var(--line); transition: box-shadow .2s; }
.site-header.scrolled { box-shadow: var(--shadow); }
.hdr-main { max-width: var(--max); margin: 0 auto; padding: .7rem var(--gutter); display: flex; align-items: center; gap: 1rem; }
.site-header .brand, .drawer .brand, .site-footer .brand { font-weight: 800; font-stretch: 75%; font-size: 1.55rem; letter-spacing: -.01em; text-decoration: none; white-space: nowrap; line-height: 1; }
.site-header .brand { position: relative; padding-left: .85rem; }
.site-header .brand::before { content: ""; position: absolute; left: 0; top: .1em; bottom: .1em; width: .3rem; background: var(--tag); border-radius: 2px; }
.hdr-search { flex: 1; max-width: 560px; margin: 0 auto; position: relative; }
.hdr-search svg { position: absolute; left: .85rem; top: 50%; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.hdr-search input { padding: .65rem 1rem .65rem 2.6rem; border-radius: 99px; background: var(--bg); border-color: transparent; }
.hdr-search input:focus { background: var(--surface); border-color: var(--ink); outline: none; }
.hdr-actions { display: flex; align-items: center; gap: .5rem; margin-left: auto; }
.menu-btn, .search-toggle { display: none; }

.hdr-nav { border-top: 1px solid var(--line); }
.hdr-nav ul { list-style: none; margin: 0 auto; padding: 0 var(--gutter); max-width: var(--max); display: flex; gap: .25rem; align-items: stretch; overflow-x: auto; scrollbar-width: none; }
.hdr-nav ul::-webkit-scrollbar { display: none; }
.nav-link { display: inline-flex; align-items: center; gap: .3rem; padding: .7rem .75rem; font: 600 .95rem var(--font); color: var(--ink-2); text-decoration: none; background: none; border: 0; cursor: pointer; white-space: nowrap; position: relative; }
.nav-link::after { content: ""; position: absolute; left: .75rem; right: .75rem; bottom: 0; height: 3px; background: var(--tag); border-radius: 3px 3px 0 0; transform: scaleX(0); transition: transform .18s; }
.nav-link:hover::after, .nav-link.on::after, .nav-link[aria-expanded=true]::after { transform: scaleX(1); }
.nav-link:hover, .nav-link.on { color: var(--ink); }
.nav-link .chev { width: 1rem; height: 1rem; transition: transform .18s; }
.nav-link[aria-expanded=true] .chev { transform: rotate(180deg); }
.mega { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-top: 1px solid var(--line); box-shadow: var(--shadow-lg); animation: drop .16s ease-out; }
@keyframes drop { from { opacity: 0; transform: translateY(-6px); } }
.mega-inner { max-width: var(--max); margin: 0 auto; padding: 1.75rem var(--gutter) 2rem; display: grid; grid-template-columns: 220px 1fr; gap: 2.5rem; max-height: 70vh; overflow-y: auto; }
.mega h3, .drawer-nav h3, .site-footer h3, .filters h3 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; font-stretch: 100%; font-weight: 700; color: var(--muted); margin: 0 0 .75rem; }
.mega-col > a { display: block; padding: .35rem 0; text-decoration: none; font-weight: 500; }
.mega-col > a:hover { text-decoration: underline; }
.mega-cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: .25rem 1.5rem; }
.mega-cat-grid a { display: flex; justify-content: space-between; gap: .5rem; padding: .45rem .6rem; margin: 0 -.6rem; border-radius: var(--radius); text-decoration: none; font-weight: 500; }
.mega-cat-grid a:hover { background: var(--bg); }
.mega-cat-grid span, .drawer-nav a span, .f-cats span { color: var(--muted); font-size: .85rem; font-variant-numeric: tabular-nums; }

/* drawers */
dialog.drawer { margin: 0; padding: 0; border: 0; height: 100%; max-height: 100%; width: min(340px, 88vw); max-width: 100%; background: var(--surface); color: var(--ink); box-shadow: var(--shadow-lg); overflow-y: auto; }
dialog.drawer.left { inset: 0 auto 0 0; }
dialog.drawer[open] { animation: slide-in .22s ease-out; }
dialog.drawer::backdrop { background: rgba(10,15,20,.5); }
@keyframes slide-in { from { transform: translateX(-100%); } }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: .9rem 1rem; border-bottom: 1px solid var(--line); }
.drawer-search { padding: 1rem; }
.drawer-search input { border-radius: 99px; background: var(--bg); }
.drawer-nav { padding: 0 1rem 2rem; }
.drawer-nav a { display: flex; justify-content: space-between; align-items: center; padding: .7rem 0; border-bottom: 1px solid var(--line); text-decoration: none; font-weight: 600; }
.drawer-nav a.on { box-shadow: inset 3px 0 0 var(--tag); padding-left: .6rem; }
.drawer-nav h3 { margin-top: 1.5rem; }

/* ---------- footer ---------- */
.site-footer { background: var(--ink); color: #cfd6dc; margin-top: 3rem; }
.ftr-grid { max-width: var(--max); margin: 0 auto; padding: 3rem var(--gutter) 2rem; display: grid; gap: 2rem; grid-template-columns: 1.6fr repeat(3, 1fr); }
.site-footer .brand { color: #fff; }
.ftr-about p { max-width: 34ch; margin: .9rem 0 0; }
.site-footer h3 { color: #8f9ba6; }
.site-footer nav a, .site-footer div > a { display: block; padding: .25rem 0; text-decoration: none; color: #e7ebee; overflow-wrap: anywhere; }
.site-footer a:hover { color: var(--tag); }
.site-footer p { margin: .25rem 0; }
.ftr-more { background: none; border: 0; padding: .25rem 0; color: var(--tag); font: inherit; cursor: pointer; }
.ftr-bottom { max-width: var(--max); margin: 0 auto; padding: 1.1rem var(--gutter); border-top: 1px solid rgba(255,255,255,.12); display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; font-size: .88rem; color: #8f9ba6; }
.ftr-bottom a { text-decoration: none; }

.flashes { list-style: none; margin: 0 auto; padding: 1rem var(--gutter) 0; max-width: var(--max); display: grid; gap: .5rem; }
.flash { padding: .7rem 1rem; border-radius: var(--radius); border-left: 5px solid var(--ok); background: var(--surface); }
.flash.error { border-color: var(--bad); }

/* ---------- forms & buttons ---------- */
input, select, textarea { font: inherit; color: inherit; padding: .55rem .7rem; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); width: 100%; }
textarea { min-height: 9rem; resize: vertical; }
label { display: block; font-weight: 600; margin-bottom: .3rem; }
.field { margin-bottom: 1rem; }
.check { display: inline-flex; align-items: center; gap: .45rem; font-weight: 500; margin: 0; cursor: pointer; }
.check input { width: auto; accent-color: var(--ink); }
.btn, button.btn { display: inline-flex; align-items: center; justify-content: center; gap: .4rem; font: 600 .95rem var(--font); padding: .55rem 1rem; border-radius: var(--radius); border: 1px solid var(--ink); background: var(--ink); color: #fff; text-decoration: none; cursor: pointer; white-space: nowrap; transition: background .15s, border-color .15s; }
.btn:hover { background: var(--ink-2); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--ink); }
.btn.ghost-light { background: transparent; color: #fff; border-color: rgba(255,255,255,.4); }
.btn.ghost-light:hover { border-color: #fff; }
.btn.tag { background: var(--tag); color: var(--ink); border-color: var(--tag); }
.btn.tag:hover { background: #ffd457; }
.btn.danger { background: transparent; color: var(--bad); border-color: var(--bad); }
.btn.sm { padding: .3rem .7rem; font-size: .85rem; }
.btn.block { width: 100%; }
.btn svg { width: 1.1rem; height: 1.1rem; }
.row { display: flex; gap: .6rem; flex-wrap: wrap; align-items: center; }
.grid2 { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* price tag: the one loud element */
.tag-price { position: relative; display: inline-block; background: var(--tag); color: var(--ink); font-weight: 800; font-stretch: 85%; padding: .2rem .75rem .2rem 1.35rem; clip-path: polygon(.7rem 0, 100% 0, 100% 100%, .7rem 100%, 0 50%); }
.tag-price::before { content: ""; position: absolute; left: .55rem; top: 50%; width: .32rem; height: .32rem; margin-top: -.16rem; border-radius: 50%; background: var(--bg); }
.tag-price.big { font-size: 1.7rem; padding: .3rem 1rem .3rem 1.9rem; clip-path: polygon(1rem 0, 100% 0, 100% 100%, 1rem 100%, 0 50%); }
.tag-price.big::before { left: .8rem; width: .45rem; height: .45rem; margin-top: -.22rem; }

.stock { font-size: .9rem; font-weight: 600; display: inline-flex; align-items: center; gap: .35rem; }
.stock::before { content: ""; width: .55rem; height: .55rem; border-radius: 50%; background: currentColor; }
.stock.in { color: var(--ok); }
.stock.out { color: var(--bad); }

/* ---------- hero ---------- */
.hero { position: relative; overflow: hidden; background: var(--ink); color: #fff; border-radius: var(--radius-lg); padding: clamp(1.75rem, 5vw, 3.5rem); margin: .5rem 0 2rem; display: grid; gap: 2rem; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); align-items: center; }
.hero::after { content: ""; position: absolute; right: -6rem; top: -6rem; width: 22rem; height: 22rem; border-radius: 50%; border: 3rem solid var(--tag); opacity: .14; pointer-events: none; }
.hero h1 { font-size: clamp(1.9rem, 4.4vw, 3.3rem); max-width: 18ch; margin-bottom: 1.4rem; }
.eyebrow { color: var(--tag); font-weight: 700; text-transform: uppercase; letter-spacing: .1em; font-size: .8rem; margin: 0 0 .75rem; }
.hero-cats { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .6rem; position: relative; z-index: 1; }
.hero-cats a { display: block; padding: .85rem 1rem; border-radius: var(--radius); background: rgba(255,255,255,.07); border: 1px solid rgba(255,255,255,.12); text-decoration: none; transition: background .15s, border-color .15s; }
.hero-cats a:hover { background: rgba(255,199,44,.14); border-color: var(--tag); }
.hero-cats strong { display: block; font-stretch: 85%; font-size: 1.05rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hero-cats span { font-size: .82rem; color: #a9b4be; }

/* ---------- shop listing ---------- */
.crumbs { display: flex; flex-wrap: wrap; gap: .45rem; font-size: .88rem; color: var(--muted); margin: .25rem 0 .75rem; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; color: var(--ink); }
.crumbs [aria-current] { color: var(--ink); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 40ch; }
.shop-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; margin-bottom: 1.25rem; scroll-margin-top: 8rem; }
.shop-head h1 { font-size: clamp(1.8rem, 4vw, 2.6rem); margin: 0 0 .2rem; }
.shop-head p { margin: 0; }
.shop { display: grid; grid-template-columns: 240px minmax(0, 1fr); gap: 2rem; align-items: start; }
.filters { position: sticky; top: 8.5rem; max-height: calc(100vh - 9.5rem); overflow-y: auto; padding-right: .25rem; }
.filters-head { display: none; }
.f-group { padding: 0 0 1.25rem; margin-bottom: 1.25rem; border-bottom: 1px solid var(--line); }
.f-cats { list-style: none; margin: 0; padding: 0; }
.f-cats a { display: flex; justify-content: space-between; gap: .5rem; padding: .4rem .9rem; margin: 0 -.6rem; border-radius: var(--radius); text-decoration: none; }
.f-cats a:hover { background: var(--surface); }
.f-cats a.on { background: var(--ink); color: #fff; font-weight: 600; }
.f-cats a.on span { color: #cfd6dc; }
.f-form { display: grid; gap: .5rem; }
.f-form .f-group { margin-bottom: .75rem; }
.price-range { display: flex; align-items: center; gap: .4rem; }
.price-range input { min-width: 0; }
.filters-backdrop { display: none; }
.btn.filters-btn { display: none; }

.toolbar { display: flex; align-items: center; gap: .75rem; flex-wrap: wrap; margin-bottom: 1.25rem; }
.chips { display: flex; gap: .4rem; flex-wrap: wrap; flex: 1; min-width: 0; }
.chip { display: inline-flex; align-items: center; gap: .4rem; padding: .3rem .4rem .3rem .75rem; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-size: .88rem; font-weight: 600; text-decoration: none; }
.chip b { display: inline-grid; place-items: center; width: 1.3rem; height: 1.3rem; border-radius: 50%; background: var(--bg); font-weight: 700; }
.chip:hover { border-color: var(--ink); }
.sort { display: flex; align-items: center; gap: .5rem; margin: 0 0 0 auto; }
.sort label { margin: 0; font-weight: 500; color: var(--muted); white-space: nowrap; }
.sort select { width: auto; padding-right: 2rem; }

.cards { list-style: none; padding: 0; margin: 0; display: grid; gap: 1.75rem 1.25rem; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.card > a { text-decoration: none; display: flex; flex-direction: column; height: 100%; }
.card-img { position: relative; aspect-ratio: 1; background: var(--surface); border-radius: var(--radius-lg); overflow: hidden; box-shadow: 0 0 0 1px var(--line); transition: box-shadow .2s; }
.card a:hover .card-img { box-shadow: 0 0 0 1px var(--line), var(--shadow); }
.card-img img { width: 100%; height: 100%; object-fit: contain; padding: .5rem; background: var(--surface); transition: transform .4s ease, opacity .3s; }
.card-img img.alt { position: absolute; inset: 0; opacity: 0; }
@media (hover: hover) {
  .card a:hover .card-img img { transform: scale(1.04); }
  .card a:hover .card-img img.alt { opacity: 1; }
}
.card.sold-out .card-img img { filter: grayscale(.6); opacity: .8; }
.badge { position: absolute; left: .6rem; top: .6rem; padding: .15rem .55rem; border-radius: 99px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.badge.out { background: var(--surface); color: var(--bad); box-shadow: var(--shadow); }
.card-img .count { position: absolute; right: .6rem; bottom: .6rem; background: rgba(21,32,43,.82); color: #fff; font-size: .75rem; padding: .1rem .5rem; border-radius: 99px; }
.noimg { display: grid; place-items: center; height: 100%; color: var(--muted); font-size: .85rem; }
.card-body { padding: .8rem .1rem 0; display: flex; flex-direction: column; flex: 1; }
.card-cat { display: inline-block; font-size: .75rem; text-transform: uppercase; letter-spacing: .07em; font-weight: 700; color: var(--muted); margin-bottom: .25rem; text-decoration: none; }
a.card-cat:hover { color: var(--ink); }
.card h2 { font-size: 1.12rem; margin: 0 0 .6rem; }
.card a:hover h2 { text-decoration: underline; text-underline-offset: 3px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; gap: .5rem; flex-wrap: wrap; margin-top: auto; }
.empty { padding: 3rem 1rem; text-align: center; color: var(--muted); background: var(--surface); border-radius: var(--radius-lg); border: 1px dashed var(--line); }
.empty p { margin: 0 0 1rem; }
.pager { display: flex; gap: .5rem; justify-content: center; align-items: center; margin-top: 2.5rem; }

/* ---------- product page ---------- */
.product { display: grid; gap: clamp(1.25rem, 4vw, 3rem); grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); align-items: start; margin-top: .5rem; }
.gallery { position: sticky; top: 8.5rem; }
.gallery-main { background: var(--surface); border: 0; box-shadow: 0 0 0 1px var(--line); border-radius: var(--radius-lg); aspect-ratio: 1; display: grid; place-items: center; overflow: hidden; cursor: zoom-in; padding: 0; width: 100%; }
.gallery-main img { max-height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: .5rem; margin-top: .6rem; overflow-x: auto; padding: 2px 2px .25rem; }
.thumbs button { flex: 0 0 72px; height: 72px; padding: 0; border: 2px solid transparent; border-radius: var(--radius); overflow: hidden; background: var(--surface); cursor: pointer; }
.thumbs button[aria-current=true] { border-color: var(--ink); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.details { padding-top: .5rem; }
.details h1 { font-size: clamp(1.9rem, 4vw, 2.8rem); }
.details .sku { color: var(--muted); font-size: .9rem; }
.details .meta { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; margin: 1.1rem 0 1.5rem; padding-bottom: 1.5rem; border-bottom: 1px solid var(--line); }
.desc { white-space: pre-line; max-width: 65ch; }
.assure { list-style: none; padding: 1rem 1.1rem; margin: 1.75rem 0 0; background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 0 0 1px var(--line); display: grid; gap: .5rem; }
.assure li { padding-left: 1.6rem; position: relative; }
.assure li::before { content: ""; position: absolute; left: .2rem; top: .25em; width: .4rem; height: .75rem; border: solid var(--ok); border-width: 0 2.5px 2.5px 0; transform: rotate(45deg); }
.related { margin-top: 4rem; }
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; margin-bottom: 1.1rem; }
.section-head h2 { font-size: 1.7rem; margin: 0; }
.section-head a { font-weight: 600; }
dialog.lightbox { border: 0; padding: 0; background: transparent; max-width: 100vw; max-height: 100vh; width: 100vw; height: 100vh; }
dialog.lightbox::backdrop { background: rgba(10,15,20,.92); }
.lightbox img { width: 100%; height: 100%; object-fit: contain; }
.lb-btn { position: fixed; background: rgba(255,255,255,.14); color: #fff; border: 0; width: 3rem; height: 3rem; border-radius: 50%; font-size: 1.5rem; cursor: pointer; }
.lb-prev { left: 1rem; top: 50%; } .lb-next { right: 1rem; top: 50%; } .lb-close { right: 1rem; top: 1rem; }
.hidden-note { background: var(--tag); padding: .5rem .8rem; border-radius: var(--radius); font-weight: 600; margin-bottom: 1rem; }

/* ---------- responsive: tablet ---------- */
@media (max-width: 1000px) {
  .shop { grid-template-columns: 1fr; }
  .btn.filters-btn { display: inline-flex; }
  .filters { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(340px, 88vw); max-height: none; padding: 0 1.25rem 2rem; background: var(--bg); box-shadow: var(--shadow-lg); transform: translateX(105%); transition: transform .25s ease, visibility .25s; visibility: hidden; }
  .filters-head { display: flex; justify-content: space-between; align-items: center; position: sticky; top: 0; background: var(--bg); padding: .9rem 0; margin-bottom: .5rem; border-bottom: 1px solid var(--line); z-index: 1; }
  .filters-head h2 { margin: 0; font-size: 1.3rem; }
  .filters-backdrop { position: fixed; inset: 0; z-index: 55; background: rgba(10,15,20,.5); }
  .filters-open .filters { transform: none; visibility: visible; }
  .filters-open .filters-backdrop { display: block; }
  body.filters-open { overflow: hidden; }
  .ftr-grid { grid-template-columns: 1fr 1fr; }
  .ftr-about { grid-column: 1 / -1; }
  .gallery { position: static; }
}

/* ---------- responsive: phone ---------- */
@media (max-width: 720px) {
  .menu-btn, .search-toggle { display: inline-grid; }
  .hdr-main { gap: .5rem; padding-block: .5rem; flex-wrap: wrap; }
  .site-header .brand { font-size: 1.35rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  .hdr-search { order: 5; flex-basis: 100%; max-width: none; display: none; }
  .search-open .hdr-search { display: block; }
  .hdr-nav { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); }
  .product { grid-template-columns: minmax(0, 1fr); }
  .toolbar { flex-wrap: nowrap; }
  .chips { display: none; }
  .sort select { max-width: 11rem; }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.25rem .75rem; }
  .card h2 { font-size: 1rem; }
  .tag-price { font-size: .92rem; }
  .sort label { display: none; }
  .ftr-grid { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------- admin ---------- */
.panel { background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 0 0 1px var(--line), 0 1px 2px rgba(21,32,43,.04); padding: 1.25rem; }
.panel + .panel { margin-top: 1rem; }
.panel h2 { font-size: 1.15rem; }
.page-head { display: flex; justify-content: space-between; align-items: end; gap: 1rem; flex-wrap: wrap; margin: 0 0 1.5rem; }
.page-head h1 { font-size: clamp(1.8rem, 3.5vw, 2.4rem); margin: 0; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(170px, 1fr)); gap: 1rem; margin-bottom: 2rem; }
.stats div { position: relative; overflow: hidden; padding: 1.1rem 1.2rem; background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 0 0 1px var(--line); }
.stats div::before { content: ""; position: absolute; left: 0; top: 1.1rem; bottom: 1.1rem; width: 3px; border-radius: 0 3px 3px 0; background: var(--line); }
.stats div:first-child::before, .stats div:nth-child(4)::before { background: var(--tag); }
.stats strong { display: block; font-size: 2rem; font-stretch: 80%; line-height: 1.1; margin-bottom: .2rem; }
.stats span { color: var(--muted); font-size: .88rem; }
.grid2 > section > h2 { font-size: 1.2rem; margin-bottom: .75rem; }
.search { display: flex; gap: .5rem; flex-wrap: wrap; align-items: center; padding: .75rem; background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 0 0 1px var(--line); }
.search input[type=search] { flex: 1 1 240px; width: auto; }
.search input, .search select { background: var(--bg); border-color: transparent; }
.search input:focus, .search select:focus { background: var(--surface); border-color: var(--ink); outline: none; }
.table-wrap { overflow-x: auto; background: var(--surface); border-radius: var(--radius-lg); box-shadow: 0 0 0 1px var(--line); }
table { width: 100%; border-collapse: collapse; font-size: .94rem; }
th, td { text-align: left; padding: .7rem .9rem; border-bottom: 1px solid var(--line); vertical-align: middle; }
th { font-size: .74rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); background: var(--surface); white-space: nowrap; }
tr:last-child td { border-bottom: 0; }
tbody tr:hover td, tr:has(td):hover td { background: #fafbfa; }
td a:not(.btn) { font-weight: 600; text-decoration: none; }
td a:not(.btn):hover { text-decoration: underline; }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }
.thumb-sm { width: 44px; height: 44px; max-width: none;object-fit: cover; border-radius: var(--radius); box-shadow: 0 0 0 1px var(--line); }
.pill { display: inline-block; font-size: .8rem; font-weight: 600; padding: .15rem .65rem; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); cursor: pointer; font-family: inherit; color: var(--muted); }
.pill:hover { border-color: var(--ink); }
.pill.on { background: #e7f3ec; color: var(--ok); border-color: #c4e2d0; }
.inline { display: inline; margin: 0; }
.photos { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .9rem; }
.photo { border-radius: var(--radius-lg); overflow: hidden; background: var(--surface); box-shadow: 0 0 0 1px var(--line); }
.photo img { aspect-ratio: 1; object-fit: cover; width: 100%; }
.photo .row { padding: .4rem; gap: .3rem; }
.photo .cover-mark { font-size: .78rem; font-weight: 600; padding: .25rem .4rem; background: var(--tag); }
.barcode svg { max-width: 260px; width: 100%; height: auto; background: #fff; }
.form-layout { display: grid; gap: 1.25rem; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .form-layout { grid-template-columns: 1fr; } }
.toggles { display: grid; gap: .6rem; }

.scan-layout { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; }
@media (max-width: 860px) { .scan-layout { grid-template-columns: 1fr; } }
#reader { width: 100%; background: var(--ink); border-radius: var(--radius-lg); overflow: hidden; }
.order-btns { white-space: nowrap; width: 1%; }
.icon-btn.sm { width: 2rem; height: 2rem; }
.icon-btn.sm svg { width: 1.1rem; height: 1.1rem; }
.icon-btn:disabled { opacity: .3; cursor: default; background: none; }
.cat-snippet { font-size: .85rem; margin-top: .15rem; }
.cat-desc { max-width: 65ch; margin: .25rem 0 .4rem; white-space: pre-line; }
.toggles .check { padding: .6rem .7rem; border-radius: var(--radius); background: var(--bg); }
.narrow > form.panel { padding: 1.5rem; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--ink); box-shadow: 0 0 0 3px rgba(255,199,44,.45); }
#reader:empty { display: none; }
.seg { display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--ink); border-radius: var(--radius); overflow: hidden; }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label { margin: 0; text-align: center; padding: .65rem .3rem; cursor: pointer; font-weight: 600; }
.seg input:checked + label { background: var(--ink); color: #fff; }
.seg input:focus-visible + label { outline: 3px solid var(--tag); outline-offset: -3px; }
.result { display: grid; grid-template-columns: 84px 1fr; gap: .9rem; align-items: center; }
.result img, .result .noimg { width: 84px; height: 84px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--line); }
.qty-big { font-size: 2.6rem; font-weight: 800; font-stretch: 80%; line-height: 1; }
.change.up { color: var(--ok); font-weight: 700; } .change.down { color: var(--bad); font-weight: 700; }
.log { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.log li { padding: .4rem 0; border-bottom: 1px solid var(--line); display: flex; justify-content: space-between; gap: .5rem; }
.scan-flash { animation: scanflash .6s ease-out; }
@keyframes scanflash { from { background: var(--tag); } to { background: var(--surface); } }
@media (prefers-reduced-motion: reduce) { .scan-flash { animation: none; } }

/* ---------- Test-mode badge (hidden when APP_ENV=production) ---------- */
.env-badge {
  position: fixed; right: 1rem; bottom: calc(1rem + env(safe-area-inset-bottom, 0px)); z-index: 200;
  background: #b42318; color: #fff; font-weight: 700; font-size: .75rem; letter-spacing: .06em;
  text-transform: uppercase; padding: .4rem .75rem; border-radius: 999px;
  box-shadow: 0 4px 14px rgb(0 0 0 / .2); pointer-events: none;
}
