/* ==========================================================================
   MZEL — Products catalogue page (products.php)
   依赖 en.css 的变量与基础组件
   ========================================================================== */

.shop-page { background: var(--bg); }

/* ---------- page head ---------- */
.shop-head {
  padding: 108px 0 28px;
  background:
    radial-gradient(900px 320px at 78% -30%, rgba(108, 92, 231, .10), transparent 70%),
    linear-gradient(180deg, #fbfaff 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--line);
}
.crumb {
  display: flex; align-items: center; gap: 7px;
  font-size: 12.5px; color: var(--ink-3);
}
.crumb a { color: var(--ink-3); transition: color .2s; }
.crumb a:hover { color: var(--accent); }
.crumb span { color: rgba(22, 20, 29, .22); }
.crumb em { font-style: normal; color: var(--ink); font-weight: 550; }

.shop-head-in {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 26px; flex-wrap: wrap; margin-top: 12px;
}
.shop-head h1 {
  margin: 0;
  font-size: clamp(28px, 3.4vw, 40px);
  font-weight: 700; letter-spacing: -.032em; line-height: 1.12;
}
.shop-sub {
  margin: 10px 0 0; max-width: 640px;
  font-size: 14.5px; line-height: 1.7; color: var(--ink-2);
}

.shop-search { position: relative; display: flex; align-items: center; flex: none; }
.shop-search svg {
  position: absolute; left: 16px; width: 16px; height: 16px;
  fill: none; stroke: var(--ink-3); stroke-width: 1.9; stroke-linecap: round;
  pointer-events: none;
}
.shop-search input {
  width: 292px; padding: 12px 18px 12px 43px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff; font-size: 13.5px; outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.shop-search input::placeholder { color: var(--ink-3); }
.shop-search input:focus {
  border-color: rgba(108, 92, 231, .55);
  box-shadow: 0 0 0 4px rgba(108, 92, 231, .10);
}

/* ---------- layout ---------- */
.shop-body { padding: 28px 0 56px; }
.shop { display: grid; grid-template-columns: 248px minmax(0, 1fr); gap: 30px; align-items: start; }

/* ---------- sidebar ---------- */
.shop-side { position: sticky; top: 84px; }
.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 16px 12px 14px;
  box-shadow: var(--sh-sm);
}
.side-card h2 {
  margin: 2px 8px 10px;
  font-size: 11px; font-weight: 700; letter-spacing: .13em;
  text-transform: uppercase; color: var(--ink-3);
}
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list li + li { margin-top: 1px; }
.cat-list a {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 8px 10px; border-radius: 10px;
  font-size: 13px; color: var(--ink-2);
  transition: background .18s, color .18s;
}
.cat-list a:hover { background: rgba(22, 20, 29, .045); color: var(--ink); }
.cat-list a.on { background: var(--accent-soft); color: var(--accent-2); font-weight: 600; }
.cat-list b {
  font-size: 11px; font-weight: 600; color: var(--ink-3);
  background: rgba(22, 20, 29, .05);
  padding: 2px 7px; border-radius: 999px; flex: none;
}
.cat-list a.on b { background: rgba(108, 92, 231, .16); color: var(--accent-2); }

.side-cta {
  margin-top: 14px; padding: 18px 18px 20px;
  background: var(--dark); color: rgba(255, 255, 255, .62);
  border-radius: var(--r-md);
}
.side-cta h3 { margin: 0; font-size: 14px; color: #fff; font-weight: 650; letter-spacing: -.01em; }
.side-cta p { margin: 8px 0 16px; font-size: 12.5px; line-height: 1.65; }
.side-cta .btn { width: 100%; padding: 11px 16px; font-size: 13px; }
.side-note {
  margin: 14px 4px 0; font-size: 11.5px; color: var(--ink-3); line-height: 1.6;
}
.side-note a { color: var(--accent); }

/* ---------- toolbar ---------- */
.shop-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 16px;
}
.shop-count { font-size: 13px; color: var(--ink-2); }
.shop-count b { color: var(--ink); font-weight: 700; }
.shop-count .dim { color: var(--ink-3); }
.clear-q {
  margin-left: 8px; font-size: 12px; color: var(--accent);
  border-bottom: 1px solid rgba(108, 92, 231, .3); padding-bottom: 1px;
}
.shop-sort { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-3); }
.shop-sort select {
  padding: 8px 30px 8px 13px;
  border: 1px solid var(--line); border-radius: 999px;
  background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238b8797' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E") no-repeat right 10px center / 13px;
  font-size: 12.5px; color: var(--ink); cursor: pointer;
  -webkit-appearance: none; appearance: none; outline: none;
}
.shop-sort select:focus { border-color: rgba(108, 92, 231, .5); }

/* ---------- product grid ---------- */
.pgrid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}
.pcard {
  display: flex; flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: transform .28s ease, box-shadow .28s ease, border-color .28s ease;
}
.pcard:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 34px rgba(22, 20, 29, .10);
  border-color: rgba(108, 92, 231, .30);
}
.pcard-img {
  position: relative;
  flex: none;
  aspect-ratio: 1 / 1;
  background: #fff;
  overflow: hidden;
  border-bottom: 1px solid rgba(22, 20, 29, .05);
}
.pcard-img img {
  width: 100%; height: 100%;
  object-fit: contain;
  padding: 9px;
  transition: transform .55s cubic-bezier(.22, .61, .36, 1);
}
.pcard:hover .pcard-img img { transform: scale(1.05); }
.pcard-go {
  position: absolute; right: 9px; bottom: 9px;
  width: 26px; height: 26px; border-radius: 50%;
  background: var(--accent); color: #fff;
  display: grid; place-items: center;
  opacity: 0; transform: translateY(5px) scale(.9);
  transition: opacity .25s ease, transform .25s ease;
  box-shadow: 0 6px 14px rgba(108, 92, 231, .34);
}
.pcard-go svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.pcard:hover .pcard-go { opacity: 1; transform: none; }

.pcard-body { padding: 11px 12px 13px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.pcard-body h3 {
  margin: 0;
  font-size: 12.8px; font-weight: 560; line-height: 1.45;
  color: var(--ink); letter-spacing: -.005em;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.9em;
}
.pcard-price { font-size: 15px; font-weight: 750; letter-spacing: -.015em; color: var(--ink); }
.pcard-moq { font-size: 11.5px; color: var(--ink-3); }

/* ---------- home page block ---------- */
#prodGrid { margin-top: 26px; }
#prodGrid.is-loading { opacity: .6; transition: opacity .18s ease; }
.prod-more {
  display: flex; align-items: center; gap: 18px; flex-wrap: wrap;
  margin-top: 26px;
}
.prod-more .btn { padding: 13px 26px; font-size: 13.5px; }
.prod-more .btn b { font-weight: 750; }
.prod-more span { font-size: 12.5px; line-height: 1.6; color: var(--ink-3); max-width: 440px; }

/* ---------- empty ---------- */
.shop-empty {
  padding: 44px 26px; text-align: center;
  background: var(--surface); border: 1px dashed rgba(22, 20, 29, .16);
  border-radius: var(--r-md);
}
.shop-empty h3 { margin: 0 0 8px; font-size: 17px; letter-spacing: -.01em; }
.shop-empty p { margin: 0 auto 18px; max-width: 460px; font-size: 13.5px; color: var(--ink-2); }

/* ---------- pager ---------- */
.pager {
  display: flex; align-items: center; justify-content: center;
  gap: 6px; flex-wrap: wrap; margin-top: 34px;
}
.pg-num, .pg-arrow {
  min-width: 36px; height: 36px; padding: 0 11px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--line); border-radius: 10px;
  background: #fff; font-size: 13px; font-weight: 550; color: var(--ink-2);
  transition: border-color .2s, color .2s, background .2s;
}
.pg-num:hover, .pg-arrow:hover { border-color: rgba(108, 92, 231, .45); color: var(--accent); }
.pg-num.on { background: var(--ink); border-color: var(--ink); color: #fff; }
.pg-arrow.off { opacity: .35; }
.pg-arrow svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 2.1; stroke-linecap: round; }
.pg-gap { color: var(--ink-3); padding: 0 2px; }

.shop-legal {
  margin: 26px 0 0; font-size: 11.5px; line-height: 1.7;
  color: var(--ink-3); max-width: 720px;
}

/* ---------- bottom cta ---------- */
.shop-cta { padding: 0 0 56px; }
.shop-cta-in {
  display: flex; align-items: center; justify-content: space-between;
  gap: 26px; flex-wrap: wrap;
  padding: 30px 34px;
  background: linear-gradient(135deg, #efeaff 0%, #f7f4ff 55%, #fff 100%);
  border: 1px solid rgba(108, 92, 231, .14);
  border-radius: var(--r-lg);
}
.shop-cta h2 { margin: 0; font-size: clamp(20px, 2.2vw, 26px); letter-spacing: -.025em; }
.shop-cta p { margin: 8px 0 0; font-size: 13.5px; color: var(--ink-2); max-width: 560px; }

/* ---------- responsive ---------- */
@media (max-width: 1180px) {
  .pgrid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .shop { grid-template-columns: 214px minmax(0, 1fr); gap: 24px; }
}
@media (max-width: 980px) {
  .shop-head { padding-top: 96px; }
  .shop { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .shop-side { position: static; }
  .side-card { padding: 12px; }
  .cat-list { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
  .cat-list li + li { margin-top: 0; }
  .cat-list a { white-space: nowrap; padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; }
  .cat-list a.on { border-color: transparent; }
  .cat-list b { display: none; }
  .side-cta, .side-note { display: none; }
  .shop-search input { width: 100%; }
  .shop-search { width: 100%; }
}
@media (max-width: 760px) {
  .pgrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; }
  .pcard-body { padding: 10px 10px 12px; }
  .pcard-body h3 { font-size: 12.2px; }
  .pcard-price { font-size: 14px; }
  .shop-cta-in { padding: 24px 22px; }
}
@media (max-width: 420px) {
  .pcard-moq { font-size: 11px; }
  .pg-num, .pg-arrow { min-width: 32px; height: 32px; font-size: 12.5px; }
}

/* ---------- 首页产品：一行 5 个 × 4 行 ---------- */
#prodGrid { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; }
#prodGrid .pcard-body { padding: 10px 10px 12px; }
#prodGrid .pcard-body h3 { font-size: 12.2px; }
#prodGrid .pcard-price { font-size: 14px; }
#prodGrid .pcard-moq { font-size: 11px; }
@media (max-width: 1180px) { #prodGrid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 980px) { #prodGrid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 760px) { #prodGrid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 11px; } }

/* 本地筛选时隐藏的卡片 / 空状态 */
.pcard.hide { display: none; }
.prod-empty {
  margin-top: 18px; padding: 28px 24px; text-align: center;
  background: var(--surface); border: 1px dashed rgba(22, 20, 29, .16);
  border-radius: var(--r-md);
}
.prod-empty p { margin: 0 0 14px; font-size: 13.5px; color: var(--ink-2); }
