/* Shop: product grid, filters, categories, product page, phone bottom bar.
   Colours come from the theme tokens in style.css (--surface-rgb, --accent-rgb, --text, --muted, --border);
   the --shop-* tokens below are the only place a day theme needs to override. */

:root {
  --shop-card-bg: rgba(var(--surface-rgb), 0.78);
  --shop-card-line: rgba(var(--accent-rgb), 0.18);
  --shop-card-line-hover: rgba(var(--accent-rgb), 0.55);
  --shop-tile-bg: #eef1f5;
  --shop-chip-bg: rgba(var(--accent-rgb), 0.1);
  --shop-chip-text: var(--text-soft, var(--text));
  --shop-sale: #ff5a6e;
  --shop-ok: #3ddc97;
  --shop-warn: #ffb86b;
  --shop-sheet-bg: rgba(var(--surface-rgb), 0.98);
  --shop-gap: 0.6rem;
}

/* ---- Page frame ----------------------------------------------------------- */
.shop, .pd, .catscreen { min-width: 0; }
.shop-head { display: flex; align-items: baseline; justify-content: space-between; gap: 0.75rem; margin: 0 0 0.4rem; }
.shop-head h1 { margin: 0; font-size: 1.25rem; }
.shop-count { color: var(--muted); font-size: 0.8rem; white-space: nowrap; }

/* ---- Category strip --------------------------------------------------------- */
.cat-strip {
  display: flex; gap: 0.4rem; overflow-x: auto; margin: 0 0 0.5rem; padding: 0 0 0.25rem;
  scrollbar-width: none;
}
.cat-strip::-webkit-scrollbar { display: none; }
.cat-chip {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 0.4rem; height: 2rem; padding: 0 0.7rem;
  border: 1px solid var(--shop-card-line); border-radius: 999px; background: var(--shop-card-bg);
  color: var(--text-soft, var(--text)); font-size: 0.8rem; text-decoration: none; white-space: nowrap;
}
.cat-chip small { color: var(--muted); font-size: 0.7rem; }
.cat-chip:hover { border-color: var(--shop-card-line-hover); text-decoration: none; }
.cat-chip.on { border-color: var(--accent); color: var(--accent); background: rgba(var(--accent-rgb), 0.12); }

/* ---- Sort / filter bar ------------------------------------------------------- */
.shop-bar { display: flex; gap: 0.5rem; margin: 0 0 0.6rem; align-items: stretch; }
.shop-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.4rem; height: 2.4rem; padding: 0 0.8rem;
  border: 1px solid var(--shop-card-line); border-radius: 8px; background: var(--shop-card-bg);
  color: var(--text-soft, var(--text)); font: inherit; font-size: 0.82rem; cursor: pointer; list-style: none;
  white-space: nowrap; box-shadow: none;
}
.shop-btn::-webkit-details-marker { display: none; }
.shop-btn:hover { border-color: var(--shop-card-line-hover); }
.shop-btn svg { width: 16px; height: 16px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.shop-btn-n { min-width: 1.2rem; padding: 0 0.3rem; border-radius: 999px; background: var(--accent); color: #04121c; font-size: 0.7rem; line-height: 1.2rem; text-align: center; }
.sort-menu { position: relative; flex: 1 1 0; min-width: 0; }
.sort-menu .shop-btn { width: 100%; justify-content: flex-start; overflow: hidden; }
.sort-menu .shop-btn { height: auto; min-height: 44px; }
.sort-menu .sort-text { display: flex; flex-direction: column; align-items: flex-start; min-width: 0; line-height: 1.2; text-align: left; }
.sort-menu .sort-k { font-size: 0.68rem; color: var(--muted); }
.sort-menu .sort-v { white-space: normal; overflow-wrap: anywhere; overflow: visible; }  /* never cut: wraps instead */
.sort-list {
  position: absolute; z-index: 30; top: calc(100% + 4px); left: 0; min-width: 100%; width: max-content; max-width: 90vw;
  display: flex; flex-direction: column; padding: 0.25rem; border: 1px solid var(--shop-card-line-hover);
  border-radius: 8px; background: var(--shop-sheet-bg); backdrop-filter: blur(14px);
}
.sort-list a { padding: 0.5rem 0.7rem; border-radius: 6px; color: var(--text-soft, var(--text)); font-size: 0.85rem; text-decoration: none; }
.sort-list a:hover { background: rgba(var(--accent-rgb), 0.1); text-decoration: none; }
.sort-list a.on { color: var(--accent); }
#filterOpen { flex: 1 1 0; min-width: 0; }

/* ---- Layout: sidebar on desktop, bottom sheet on phones ------------------------ */
.shop-layout { display: block; }
.shop-results { min-width: 0; }
.filters-form { display: flex; flex-direction: column; min-height: 0; max-height: inherit; }
.filters-head { display: flex; align-items: center; justify-content: space-between; padding: 0.7rem 0.9rem 0.4rem; }
.filters-close { width: 2rem; height: 2rem; padding: 0; border: 0; background: none; box-shadow: none; color: var(--muted); font-size: 1.5rem; line-height: 1; }
.filters-body { display: flex; flex-direction: column; gap: 0.7rem; padding: 0.3rem 0.9rem 0.6rem; overflow-y: auto; }
.f-field { display: flex; flex-direction: column; gap: 0.25rem; margin: 0; padding: 0; border: 0; min-width: 0; font-size: 0.78rem; color: var(--muted); }
.f-field legend { padding: 0; margin-bottom: 0.25rem; font-size: 0.78rem; color: var(--muted); }
.f-field input[type="search"], .f-field select, .f-range input {
  width: 100%; height: 2.3rem; padding: 0 0.6rem; border: 1px solid var(--shop-card-line); border-radius: 6px;
  background: rgba(var(--bg-rgb), 0.6); color: var(--text); font: inherit; font-size: 0.85rem; min-width: 0;
}
.f-range { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 0.4rem; }
.f-range legend { flex: 0 0 100%; }
.f-range input { flex: 1 1 0; width: auto; }
.f-check { display: flex; align-items: center; gap: 0.5rem; margin: 0; min-height: 1.9rem; color: var(--text-soft, var(--text)); font-size: 0.85rem; }
.f-check input { width: 1.05rem; height: 1.05rem; margin: 0; accent-color: var(--accent); }
.filters-foot { display: flex; gap: 0.6rem; align-items: center; padding: 0.6rem 0.9rem 0.8rem; border-top: 1px solid var(--shop-card-line); }
.f-reset { flex: 0 0 auto; color: var(--muted); font-size: 0.82rem; }
.f-apply { flex: 1; height: 2.5rem; border-radius: 8px; font-size: 0.88rem; }

@media (max-width: 767px) {
  .filters {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; max-height: 85vh; max-height: 85dvh;
    display: flex; flex-direction: column; border: 1px solid var(--shop-card-line-hover); border-bottom: 0;
    border-radius: 16px 16px 0 0; background: var(--shop-sheet-bg); backdrop-filter: blur(16px);
    transform: translateY(105%); visibility: hidden; transition: transform 0.22s ease, visibility 0s linear 0.22s;
  }
  .filters.open { transform: none; visibility: visible; transition: transform 0.22s ease; }
  .filters-form { overflow: hidden; }
  .filters-foot { padding-bottom: calc(0.8rem + env(safe-area-inset-bottom)); }
  .sheet-backdrop { position: fixed; inset: 0; z-index: 59; background: rgba(0, 0, 0, 0.55); }
  .sheet-backdrop[hidden] { display: none; }
  body.sheet-open { overflow: hidden; }
}

@media (min-width: 768px) {
  .shop-layout { display: grid; grid-template-columns: 15rem minmax(0, 1fr); gap: 1rem; align-items: start; }
  .filters {
    position: sticky; top: calc(var(--header-h, 56px) + 0.75rem); border: 1px solid var(--shop-card-line);
    border-radius: 10px; background: var(--shop-card-bg);
  }
  .filters-close, #filterOpen, .sheet-backdrop { display: none; }
  .sort-menu { flex: 0 0 auto; }
  .shop-bar { justify-content: flex-end; }
}

/* ---- Product grid ---------------------------------------------------------- */
.pgrid { display: grid; gap: var(--shop-gap); grid-template-columns: repeat(2, minmax(0, 1fr)); }
@media (min-width: 768px) { .pgrid { gap: 0.75rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 13.75rem), 1fr)); } }

.pc {
  position: relative; display: flex; flex-direction: column; min-width: 0; overflow: hidden;
  border: 1px solid var(--shop-card-line); border-radius: 10px; background: var(--shop-card-bg);
  backdrop-filter: blur(8px); transition: border-color 0.15s ease;
}
.pc:hover, .pc:focus-within { border-color: var(--shop-card-line-hover); }
.pc-link { display: flex; flex-direction: column; color: inherit; text-decoration: none; }
.pc-link:hover { text-decoration: none; }
.pc-media {
  position: relative; display: block; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; background: var(--shop-tile-bg);
}
.pc-media::before, .pd-main::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, 0.65) 50%, transparent 80%) -150% 0 / 60% 100% no-repeat, var(--shop-tile-bg);
  animation: shop-shimmer 1.3s linear infinite;
}
@keyframes shop-shimmer { to { background-position: 250% 0, 0 0; } }
@media (prefers-reduced-motion: reduce) { .pc-media::before, .pd-main::before { animation: none; } }
.pc-img, .pd-photo {
  position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; padding: 4%; box-sizing: border-box;
  opacity: 1; background: var(--shop-tile-bg);
}
.pc-img.ld, .pd-photo.ld { opacity: 1; }
@media (scripting: none) { .pc-img, .pd-photo { opacity: 1; } }
.pc-noimg { position: absolute; inset: 0; background: var(--shop-tile-bg); }

.pc-badge, .pc-off {
  position: absolute; top: 0.35rem; z-index: 2; max-width: 70%; padding: 0.1rem 0.4rem; border-radius: 4px; overflow: hidden;
  font-size: 0.68rem; font-weight: 700; line-height: 1.2rem; text-overflow: ellipsis; white-space: nowrap; color: #04121c;
  background: var(--accent);
}
.pc-badge { left: 0.35rem; }
.pc-badge-sale { background: var(--shop-sale); color: #fff; }
.pc-badge-hot { background: var(--shop-warn); }
.pc-badge-new { background: var(--shop-ok); }
.pc-badge-gift { background: #b48cff; color: #fff; }
.pc-badge-raffle { background: #ffd166; }

/* Light theme (see style.css): deeper badge colours, white on the deep accent */
html[data-theme="light"] {
  --shop-card-bg: #ffffff;
  --shop-card-line: rgba(0, 97, 143, 0.18);
  --shop-card-line-hover: rgba(0, 97, 143, 0.5);
  --shop-chip-bg: rgba(0, 97, 143, 0.08);
  --shop-sale: #d1253c;
  --shop-ok: #13663f;
  --shop-sheet-bg: rgba(255, 255, 255, 0.98);
}
:where(html[data-theme="light"]) .shop-btn-n,
:where(html[data-theme="light"]) .pc-badge,
:where(html[data-theme="light"]) .pc-badge-new { color: #fff; }
:where(html[data-theme="light"]) .pc-badge-hot,
:where(html[data-theme="light"]) .pc-badge-raffle { color: #04121c; }
.pc-off { right: 0.35rem; background: var(--shop-sale); color: #fff; }

.pc .pc-name {
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin: 0; padding: 0.45rem 0.55rem 0; height: 2.6em; box-sizing: content-box;
  font-size: 0.82rem; font-weight: 600; line-height: 1.3; color: var(--text-soft, var(--text)); letter-spacing: 0;
}
.pc-chips { display: flex; gap: 0.3rem; height: 1.25rem; margin: 0.35rem 0.55rem 0; overflow: hidden; }
.chip {
  flex: 0 1 auto; min-width: 0; padding: 0 0.4rem; border-radius: 4px; overflow: hidden; background: var(--shop-chip-bg);
  color: var(--shop-chip-text); font-size: 0.66rem; line-height: 1.25rem; text-overflow: ellipsis; white-space: nowrap;
}
.chip-in { color: var(--shop-ok); background: rgba(61, 220, 151, 0.12); }
.chip-out { color: var(--muted); background: rgba(128, 140, 160, 0.14); }
.pc-buy { display: flex; align-items: flex-end; justify-content: space-between; gap: 0.4rem; margin-top: auto; padding: 0.4rem 0.55rem 0.55rem; }
.pc-price { display: flex; flex-direction: column; justify-content: flex-end; min-width: 0; height: 2.35rem; }
.pc-now { font-size: 1rem; font-weight: 700; line-height: 1.25rem; color: var(--text); white-space: nowrap; }
.pc-old { height: 1rem; font-size: 0.72rem; line-height: 1rem; color: var(--muted); white-space: nowrap; }
.pc-buy form { flex: none; margin: 0; }
.pc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.35rem; width: 2.35rem; height: 2.35rem; padding: 0;
  border-radius: 8px; font-size: 0.8rem;
}
.pc-btn svg { width: 18px; height: 18px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.pc-btn span { display: none; }
@media (min-width: 768px) { .pc-btn { width: auto; padding: 0 0.7rem; } .pc-btn span { display: inline; } }
.shop-empty { padding: 2rem 0; text-align: center; color: var(--muted); }

/* ---- Category screen ------------------------------------------------------------ */
.catscreen-title { margin: 0 0 0.5rem; font-size: 1.25rem; }
.catscreen-body { display: grid; grid-template-columns: 5.6rem minmax(0, 1fr); gap: 0.5rem; min-height: calc(100vh - var(--header-h, 56px) - var(--bottom-nav-h, 64px) - 5rem); }
.cat-rail { display: flex; flex-direction: column; gap: 0.25rem; border-right: 1px solid var(--shop-card-line); padding-right: 0.4rem; }
.cat-rail-item {
  display: flex; flex-direction: column; align-items: center; gap: 0.25rem; padding: 0.55rem 0.2rem; border-radius: 8px;
  color: var(--muted); font-size: 0.68rem; line-height: 1.15; text-align: center; text-decoration: none; overflow-wrap: anywhere;
}
.cat-rail-item:hover { text-decoration: none; }
.cat-rail-item.on { color: var(--accent); background: rgba(var(--accent-rgb), 0.12); box-shadow: inset 2px 0 0 var(--accent); }
.cat-ico { width: 24px; height: 24px; flex: none; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.cat-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0.5rem; align-content: start; }
.cat-tile {
  display: flex; flex-direction: column; justify-content: center; gap: 0.2rem; min-height: 5.2rem; padding: 0.6rem; min-width: 0;
  border: 1px solid var(--shop-card-line); border-radius: 10px; background: var(--shop-card-bg); color: var(--text-soft, var(--text));
  text-decoration: none; overflow: hidden;
}
.cat-tile:hover { border-color: var(--shop-card-line-hover); text-decoration: none; }
.cat-tile .cat-ico { color: var(--accent); }
.cat-tile strong { font-size: 0.82rem; line-height: 1.25; overflow-wrap: anywhere; }
.cat-tile small { color: var(--muted); font-size: 0.7rem; }
.cat-tile-wide { grid-column: 1 / -1; min-height: 3.6rem; }
.cat-tile-sale { border-color: rgba(255, 90, 110, 0.5); }
.cat-panel[hidden] { display: none; }
@media (min-width: 768px) {
  .catscreen-body { grid-template-columns: 9rem minmax(0, 1fr); min-height: 0; }
  .cat-tiles { grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); }
}

/* ---- Product page ------------------------------------------------------------------ */
.pd { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); margin-bottom: 1.25rem; }
@media (min-width: 768px) { .pd { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: 1.5rem; } }
.pd-gallery { min-width: 0; }
.pd-main { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; border: 1px solid var(--shop-card-line); border-radius: 12px; background: var(--shop-tile-bg); }
@media (min-width: 768px) { .pd-main { max-width: 34rem; } }
.pd-info { min-width: 0; }
.pd-info h1 { margin: 0 0 0.5rem; font-size: 1.3rem; line-height: 1.3; }
.pd-chips { display: flex; flex-wrap: wrap; gap: 0.35rem; margin-bottom: 0.5rem; }
.pd-chips .chip { padding: 0 0.6rem; font-size: 0.78rem; line-height: 1.6rem; }
.pd-price .product-price { margin: 0.25rem 0; }
.pd-h { margin: 1.2rem 0 0.5rem; font-size: 1rem; }
.pd-specs { display: grid; grid-template-columns: minmax(7rem, 35%) 1fr; margin: 0; border: 1px solid var(--shop-card-line); border-radius: 8px; overflow: hidden; font-size: 0.85rem; }
.pd-specs dt, .pd-specs dd { margin: 0; padding: 0.45rem 0.7rem; border-bottom: 1px solid var(--shop-card-line); }
.pd-specs dt { color: var(--muted); background: rgba(var(--accent-rgb), 0.04); }
.pd-specs dt:last-of-type, .pd-specs dd:last-of-type { border-bottom: 0; }
.pd-similar { margin-bottom: 1rem; }

/* ---- Admin products list: compact, with filters and merchandising bulk bar ----------------- */
.product-filters { display: flex; flex-wrap: wrap; gap: 0.4rem; align-items: center; margin: 0 0 0.6rem; }
.product-filters input, .product-filters select { height: 2.1rem; padding: 0 0.5rem; font-size: 0.82rem; min-width: 0; }
.bulk-merch { display: contents; }
.bulk-merch > * { height: 40px; min-height: 40px; min-width: 0; margin: 0; font-size: 13px; white-space: nowrap; }
.bulk-merch > [hidden] { display: none; }
@media (min-width: 768px) { body.is-admin .bulk-actions { flex-wrap: wrap; } }
.product-admin-compact th, .product-admin-compact td { padding: 0.3rem 0.5rem; font-size: 0.82rem; }
.admin-sale-note { display: block; color: var(--muted); font-size: 0.7rem; }

.pd-thumbs{display:flex;gap:6px;margin-top:8px;overflow-x:auto}
.pd-thumb{flex:0 0 64px;width:64px;height:64px;padding:0;background:#f1f3f5;border:1px solid var(--border);border-radius:8px;overflow:hidden;cursor:pointer}
.pd-thumb img{width:100%;height:100%;object-fit:contain;display:block}
.pd-thumb.is-active{border-color:var(--accent)}
.pd-doc{margin:.6rem 0}.pd-doc a{font-weight:600}.pd-doc span{color:var(--muted);font-size:.85em;margin-left:.4rem}

/* ---- Cards (home-design-3): a small outlined cart icon button; its tap area stays 44 px -------------------------- */
body.site .pc .pc-btn, body.site .pc .pc-btn:hover {
  position: relative; width: 2rem; height: 2rem; padding: 0; border: 1.5px solid var(--accent); border-radius: 50%;
  background: transparent; color: var(--accent); box-shadow: none; transform: none;
}
body.site .pc .pc-btn::before { content: ""; position: absolute; inset: -6px; }
body.site .pc .pc-btn span { display: none; }
body.site .pc .pc-btn svg { width: 16px; height: 16px; }
body.site .pc .pc-btn:hover, body.site .pc .pc-btn:focus-visible { background: rgba(var(--accent-rgb), 0.12); }
body.site .pc .pc-btn:disabled { border-color: var(--border); color: var(--muted); background: transparent; }
@media (max-width: 767px) {  /* compact shop cards on phones */
  .pgrid { gap: 0.5rem; }
  .pc .pc-name { padding: 0.35rem 0.45rem 0; font-size: 0.76rem; }
  .pc-chips { margin: 0.3rem 0.45rem 0; height: 1.1rem; }
  .chip { font-size: 0.62rem; line-height: 1.1rem; padding: 0 0.3rem; }
  .pc-buy { padding: 0.3rem 0.45rem 0.45rem; }
  .pc-price { height: 2.2rem; }
  .pc-now { font-size: 0.92rem; line-height: 1.2rem; }
}
/* Eight categories no longer fit one row: on a mouse the strip has no scrollbar, so wrap instead. */
@media (min-width: 768px) {
  .cat-strip { flex-wrap: wrap; overflow-x: visible; }
}
/* ---- Shop interactions: compare, quick view, instant search ---- */
.pc { transition: transform 0.18s ease, box-shadow 0.18s ease; will-change: transform; }
.pc:hover, .pc:focus-within { transform: translateY(-3px); box-shadow: 0 18px 36px -22px rgba(0, 0, 0, 0.85); }
.pc .pc-img { transition: transform 0.35s ease; }
.pc:hover .pc-img { transform: scale(1.04); }
.pc.is-compared { outline: 2px solid var(--accent); outline-offset: -2px; }

.pc-compare, .pc-quick {
  position: absolute; z-index: 3; display: inline-flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; padding: 0; border-radius: 50%; cursor: pointer;
  border: 1px solid rgba(var(--accent-rgb), 0.28);
  background: rgba(6, 14, 24, 0.82); color: var(--text);
  opacity: 0; transform: translateY(-4px); transition: opacity 0.16s ease, transform 0.16s ease, background 0.16s ease;
}
.pc-compare { top: 0.45rem; right: 0.45rem; }
.pc-quick { top: 0.45rem; right: 2.55rem; }
.pc-compare svg, .pc-quick svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.pc:hover .pc-compare, .pc:hover .pc-quick, .pc:focus-within .pc-compare, .pc:focus-within .pc-quick { opacity: 1; transform: none; }
.pc-compare[aria-pressed="true"] { opacity: 1; transform: none; background: var(--accent); color: #04121c; border-color: transparent; }
@media (hover: none) { .pc-compare, .pc-quick { opacity: 1; transform: none; } }

.pc.is-filtered-out { display: none; }
.shop-found { margin: 0 0 0.6rem; color: var(--muted); font-size: 0.85rem; }

.compare-bar {
  position: fixed; left: 50%; bottom: 1rem; transform: translateX(-50%); z-index: 60;
  display: flex; align-items: center; gap: 0.6rem; padding: 0.55rem 0.7rem 0.55rem 1rem;
  border-radius: 999px; border: 1px solid rgba(var(--accent-rgb), 0.3);
  background: rgba(6, 14, 24, 0.94); backdrop-filter: blur(10px);
  box-shadow: 0 18px 40px -20px rgba(0, 0, 0, 0.9); color: var(--text); font-size: 0.88rem;
}
.compare-count b { color: var(--accent); }
.compare-go, .compare-clear {
  border-radius: 999px; padding: 0.35rem 0.85rem; font-size: 0.85rem; text-decoration: none; cursor: pointer;
  border: 1px solid rgba(var(--accent-rgb), 0.4); background: transparent; color: var(--text);
}
.compare-go { background: var(--accent); color: #04121c; border-color: transparent; font-weight: 600; }
.compare-clear:hover, .compare-go:hover { filter: brightness(1.08); }

.qv { position: fixed; inset: 0; z-index: 80; display: grid; place-items: center; padding: 1rem; }
.qv[hidden] { display: none; }
.qv-backdrop { position: absolute; inset: 0; background: rgba(2, 6, 12, 0.72); backdrop-filter: blur(4px); }
.qv-card {
  position: relative; z-index: 1; display: grid; grid-template-columns: minmax(0, 320px) minmax(0, 1fr);
  gap: 1.1rem; width: min(860px, 100%); max-height: 86vh; overflow: auto;
  padding: 1.1rem; border-radius: 16px; border: 1px solid rgba(var(--accent-rgb), 0.22);
  background: rgba(8, 16, 28, 0.98); box-shadow: 0 30px 70px -30px #000;
}
.qv-media { display: grid; place-items: center; background: var(--shop-tile-bg); border-radius: 12px; }
.qv-media img { max-width: 100%; max-height: 300px; object-fit: contain; }
.qv-body h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.qv-price { margin: 0 0 0.5rem; font-size: 1.25rem; font-weight: 700; color: var(--accent); }
.qv-price s { color: var(--muted); font-size: 0.95rem; font-weight: 400; }
.qv-desc { color: var(--text-soft, var(--text)); font-size: 0.9rem; line-height: 1.5; }
.qv-actions { display: flex; gap: 0.6rem; margin-top: 0.9rem; flex-wrap: wrap; }
.qv-close {
  position: absolute; top: 0.5rem; right: 0.6rem; width: 34px; height: 34px; border-radius: 50%;
  border: 1px solid var(--border); background: transparent; color: var(--text); font-size: 1.2rem; cursor: pointer;
}
body.qv-open { overflow: hidden; }
@media (max-width: 700px) {
  .qv-card { grid-template-columns: 1fr; }
  .qv-media img { max-height: 200px; }
  .compare-bar { left: 0.6rem; right: 0.6rem; transform: none; justify-content: space-between; }
}

/* ---- Compare page ---- */
.cmp h1 { margin-bottom: 0.9rem; }
.cmp-scroll { overflow-x: auto; }
.cmp-table { width: 100%; border-collapse: collapse; min-width: 520px; }
.cmp-table th, .cmp-table td { padding: 0.7rem 0.8rem; border-bottom: 1px solid var(--border); text-align: left; vertical-align: top; }
.cmp-table thead th { border-bottom: 1px solid rgba(var(--accent-rgb), 0.28); }
.cmp-table tbody th { width: 140px; color: var(--muted); font-weight: 500; font-size: 0.85rem; }
.cmp-head { display: flex; flex-direction: column; gap: 0.5rem; text-decoration: none; color: var(--text); }
.cmp-head img { width: 120px; height: 120px; object-fit: contain; background: var(--shop-tile-bg); border-radius: 10px; }
.cmp-price b { display: block; font-size: 1.05rem; color: var(--accent); }
.cmp-price s { color: var(--muted); font-size: 0.85rem; }
.cmp-desc { font-size: 0.86rem; line-height: 1.5; color: var(--text-soft, var(--text)); max-width: 320px; }
.cmp-actions { display: flex; gap: 0.6rem; margin-top: 1rem; }
.compare-bar[hidden] { display: none; }

/* Phones: the primary actions must be at least 44x44 (WCAG 2.5.5). */
@media (max-width: 767px) {
  .add-to-cart-form button,
  .pc-btn,
  .shop-btn,
  .cat-chip,
  .f-apply {
    min-height: 44px;
  }
  .add-to-cart-form input[type="number"] { min-height: 44px; }
  .hamburger, .filters-close { min-width: 44px; min-height: 44px; }
  .pc-compare, .pc-quick { width: 40px; height: 40px; }

  /* the phone's own search box sits under the title, above the categories */
  .shop-search-top { display: block; margin: 0.6rem 0 0.2rem; }
  .shop-search-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .shop-search-top input {
    width: 100%; height: 44px; padding: 0 0.9rem;
    border: 1px solid var(--shop-card-line); border-radius: 999px;
    background: var(--shop-card-bg); color: var(--text); font-size: 0.95rem;
  }
  .shop-search-top input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
}

@media (min-width: 768px) {
  .shop-search-top { display: none; }
}
