/* ---- Wider shop wrap ---- */
.shop-wrap { max-width: min(1920px, 95vw); margin: 0 auto; padding: 0 40px; }

/* ---- Two-column layout ---- */
.shop { display: grid; grid-template-columns: 268px 1fr; gap: 40px; align-items: start; padding: 40px 0 92px; }

/* ---- Category sidebar ---- */
.sidebar { position: sticky; top: 134px; z-index: 50; }
.cat-trigger { display: none; }
.cat-sheet-backdrop { display: none; }
.cat-sheet-close { display: none; }
.cat-nav { background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg); box-shadow: var(--sh-sm); }
.cat-nav .head { padding: 18px 22px 16px; border-bottom: 1px solid var(--line-2); }
.cat-nav .head h2 { font-size: 16px; letter-spacing: -.01em; }
.cat-list { list-style: none; margin: 0; padding: 8px; display: grid; gap: 2px; }
.cat-item {
  display: flex; align-items: center; gap: 13px; width: 100%; text-align: left;
  padding: 13px 14px; border: none; background: none; border-radius: var(--r-sm);
  font-family: inherit; font-size: 15px; font-weight: 600; color: var(--ink-2);
  cursor: pointer; transition: .14s;
}
.cat-item .ico { width: 34px; height: 34px; border-radius: 9px; background: var(--bg-2); color: var(--blue-600); display: grid; place-items: center; flex: none; transition: .14s; }
.cat-item .ico svg { width: 18px; height: 18px; }
.cat-item .lbl { flex: 1; }
.cat-item .qty { font-size: 12.5px; font-weight: 700; color: var(--muted); background: var(--bg-2); padding: 3px 9px; border-radius: var(--r-pill); transition: .14s; }
.cat-item:hover { background: var(--sky-2); color: var(--blue-700); }
.cat-item:hover .ico { background: #fff; }
.cat-item.active { background: var(--blue); color: #fff; box-shadow: var(--sh-blue); }
.cat-item.active .ico { background: rgba(255,255,255,.2); color: #fff; }
.cat-item.active .qty { background: rgba(255,255,255,.22); color: #fff; }

/* ---- Category hover preview ---- */
.cat-li { position: relative; }
.cat-preview {
  position: absolute; left: calc(100% + 14px); top: 0; z-index: 40;
  width: 300px; background: #fff; border: 1px solid var(--line); border-radius: var(--r-lg);
  box-shadow: var(--sh-lg); padding: 16px;
  opacity: 0; visibility: hidden; transform: translateX(-6px);
  transition: opacity .16s ease, transform .16s ease, visibility 0s linear .16s;
  pointer-events: none;
}
.cat-li:hover .cat-preview {
  opacity: 1; visibility: visible; transform: translateX(0); pointer-events: auto;
  transition: opacity .16s ease, transform .16s ease;
}
.cat-preview-head { font-size: 13px; font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 12px; }
.cat-preview-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.cat-preview-item { display: flex; flex-direction: column; gap: 6px; }
.cat-preview-thumb { display: block; border-radius: 9px; overflow: hidden; border: 1px solid var(--line-2); background: var(--bg-2); aspect-ratio: 1/1; }
.cat-preview-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.cat-preview-thumb .ph { display: block; width: 100%; height: 100%; }
.cat-preview-item:hover .cat-preview-thumb { border-color: var(--blue); }
.cat-preview-name { font-size: 12.5px; font-weight: 600; color: var(--ink-2); line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.side-help { margin-top: 18px; background: var(--sky); border-radius: var(--r-lg); padding: 22px; }
.side-help h3 { font-size: 16px; margin-bottom: 7px; }
.side-help p { font-size: 13.5px; color: var(--ink-2); margin-bottom: 16px; line-height: 1.6; }
.side-help .btn { font-size: 14px; padding: 11px 18px; }

/* ---- Results head ---- */
.results-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.results-head h1 { font-size: clamp(24px, 3vw, 32px); }
.count { font-size: 14.5px; color: var(--muted); font-weight: 600; white-space: nowrap; }
.count b { color: var(--ink); }

/* ---- Card grid ---- */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 26px; }
.grid-group-title {
  grid-column: 1 / -1; font-size: 16px; font-weight: 700; color: var(--ink);
  padding-bottom: 10px; margin-top: 8px; border-bottom: 1px solid var(--line-2);
}
.grid-group-title:first-child { margin-top: 0; }

.pcard { overflow: visible; display: flex; flex-direction: column; border: none; background: transparent; box-shadow: none; border-radius: 0; }
.pcard:hover { transform: translateY(-4px); }
.pcard .imgwrap { position: relative; border-radius: 14px; overflow: hidden; border: 1px solid var(--line); background: #fff; box-shadow: 0 6px 16px rgba(11,27,43,.28), 0 2px 6px rgba(11,27,43,.16); transition: box-shadow .2s ease, border-color .2s ease; }
.pcard:hover .imgwrap { box-shadow: 0 10px 24px rgba(11,27,43,.34), 0 3px 9px rgba(11,27,43,.18); border-color: transparent; }
.pcard .ph { aspect-ratio: 1/1; }
.pcard .body { padding: 12px 4px 2px; display: flex; flex-direction: column; gap: 4px; }
.pcard h3 { font-size: 14.5px; font-weight: 700; line-height: 1.35; color: var(--ink); }
.pcard .code { font-size: 13px; color: var(--muted); font-weight: 600; display: inline-flex; align-items: center; gap: 6px; }
.pcard .code b { color: var(--blue-700); font-size: 13.5px; font-weight: 800; letter-spacing: .02em; font-family: ui-monospace, "SF Mono", Menlo, monospace; }

/* ---- Responsive ---- */
@media (max-width: 1080px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 920px) {
  .shop { grid-template-columns: minmax(0, 1fr); gap: 22px; padding-top: 24px; }
  .sidebar, .results { min-width: 0; }
  .sidebar { position: static; }
  .side-help { display: none; }
  .cat-preview { display: none; }

  /* Trigger button replaces the inline category list on mobile */
  .cat-trigger {
    display: flex; align-items: center; gap: 13px; width: 100%;
    padding: 14px 16px; background: #fff; border: 1px solid var(--line);
    border-radius: var(--r-lg); box-shadow: var(--sh-sm);
    font-family: inherit; text-align: left; cursor: pointer;
  }
  .cat-trigger-ico { width: 38px; height: 38px; border-radius: 10px; background: var(--sky); color: var(--blue-600); display: grid; place-items: center; flex: none; }
  .cat-trigger-ico svg { width: 19px; height: 19px; }
  .cat-trigger-txt { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
  .cat-trigger-txt b { font-size: 15.5px; font-weight: 700; color: var(--ink); }
  .cat-trigger-txt span { font-size: 13px; color: var(--muted); font-weight: 600; }
  .cat-trigger-txt span b { font-size: 13px; color: var(--muted); font-weight: 700; }
  .cat-trigger .chev { margin-left: auto; width: 20px; height: 20px; color: var(--muted); flex: none; }

  /* Full-page category picker */
  .cat-sheet-backdrop.open { display: block; position: fixed; inset: 0; z-index: 200; background: rgba(11,27,43,.4); }
  .cat-nav {
    position: fixed; inset: 0; z-index: 210; border-radius: 0; box-shadow: none;
    display: flex; flex-direction: column; overflow-y: auto;
    transform: translateY(100%); transition: transform .28s ease;
  }
  .cat-nav.open { transform: none; }
  .cat-nav .head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line-2); }
  .cat-sheet-close { display: grid; place-items: center; width: 38px; height: 38px; border-radius: 50%; background: var(--bg-2); border: none; cursor: pointer; color: var(--ink); }
  .cat-sheet-close svg { width: 18px; height: 18px; }
  .cat-list { padding: 10px 14px; gap: 6px; }
  .cat-item { padding: 15px 14px; }
}
@media (max-width: 720px) {
  .grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .pcard .body { padding: 8px 2px 2px; gap: 2px; }
}
@media (max-width: 560px) {
  .shop-wrap { padding: 0 10px; }
}
