/* ==========================================================================
   商品卡片：桌面网格 / 移动端横向列表
   ========================================================================== */
.product-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(252px,1fr));
  gap:14px;
}

.product-card{
  position:relative;
  display:flex;
  flex-direction:column;
  min-width:0;
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow:var(--shadow);
  text-align:left;
  overflow:hidden;
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease;
  animation:cardIn .34s cubic-bezier(.22,.61,.36,1) both;
  animation-delay:var(--stagger,0ms);
}
@keyframes cardIn{from{opacity:0;transform:translateY(8px)}to{opacity:1;transform:none}}
.product-card:hover{
  border-color:#b9c9e6;
  box-shadow:0 6px 18px rgba(16,24,40,.09);
  transform:translateY(-2px);
}
.product-card.is-selected{border-color:var(--brand);box-shadow:0 0 0 1px var(--brand),0 6px 18px rgba(22,104,220,.14)}
.product-card:focus-visible{outline:2px solid var(--brand);outline-offset:2px}

/* 封面 */
.product-cover{
  position:relative;
  display:block;
  width:100%;
  aspect-ratio:16/10;
  background:var(--panel-2);
  border-bottom:1px solid var(--line);
  overflow:hidden;
}
.product-cover img{
  position:absolute;
  inset:0;
  width:100%;
  height:100%;
  object-fit:cover;
  opacity:1;
  transition:transform .5s cubic-bezier(.22,.61,.36,1),opacity .45s cubic-bezier(.22,.8,.28,1),filter .45s cubic-bezier(.22,.8,.28,1);
}
.product-cover img.is-await{opacity:0;filter:blur(6px);transform:scale(1.015)}
.product-card:hover .product-cover img{transform:scale(1.035)}
.product-icon{
  position:absolute;
  inset:0;
  display:none;
  place-items:center;
  background:var(--product-tint,#f2f4f7);
  color:var(--product-ink,#8b96a3);
}
.product-icon .icon{width:34px;height:34px;stroke-width:1.5}
.product-card.is-plain .product-cover img{display:none}
.product-card.is-plain .product-icon{display:grid}

.product-tag{
  position:absolute;
  left:7px;
  top:7px;
  z-index:1;
  padding:1px 6px;
  font-size:11.5px;
  line-height:1.6;
  color:#fff;
  background:rgba(24,29,36,.82);
  border-radius:2px;
  letter-spacing:.3px;
  backdrop-filter:blur(2px);
}

/* 文字区 */
.product-body{
  display:flex;
  flex-direction:column;
  gap:3px;
  padding:9px 12px 11px;
  min-width:0;
}
.product-name{
  display:-webkit-box;
  -webkit-line-clamp:2;
  -webkit-box-orient:vertical;
  overflow:hidden;
  font-size:16px;
  font-weight:600;
  line-height:1.45;
  color:var(--ink);
}
.product-subtitle{
  display:-webkit-box;
  -webkit-line-clamp:1;
  -webkit-box-orient:vertical;
  overflow:hidden;
  font-size:13px;
  color:var(--muted);
}
.product-foot{
  display:flex;
  align-items:flex-end;
  justify-content:space-between;
  gap:8px;
  margin-top:5px;
  min-width:0;
}
.product-tags{
  display:flex;
  flex-wrap:nowrap;
  gap:4px;
  min-width:0;
  overflow:hidden;
  padding-bottom:3px;
}
.product-tags .tagline:nth-child(n+3){display:none}
.tagline{
  display:inline-block;
  flex:0 0 auto;
  padding:0 5px;
  font-size:11px;
  line-height:1.72;
  color:#fff;
  background:#e0402a;
  border-radius:2px;
  white-space:nowrap;
  letter-spacing:.2px;
}
.tagline.is-cool{background:#2f6fb5}
.tagline.is-warm{background:#d9822b}
.product-price{
  display:flex;
  align-items:baseline;
  gap:2px;
  margin-top:0;
  margin-left:auto;
  flex:0 0 auto;
  font-size:20px;
  font-weight:700;
  color:var(--price);
  letter-spacing:-.4px;
  font-variant-numeric:tabular-nums;
}
.product-price .currency{font-size:12px;font-weight:600;margin-right:1px}
.product-price small{margin-left:3px;font-size:11.5px;font-weight:400;color:var(--muted);letter-spacing:0}
.product-price del{margin-left:6px;font-size:11.5px;font-weight:400;color:#a3aab4}

/* 选中标记 */
.selection-check{
  position:absolute;
  right:8px;
  top:8px;
  z-index:2;
  width:20px;
  height:20px;
  display:grid;
  place-items:center;
  border-radius:50%;
  background:var(--brand);
  color:#fff;
  opacity:0;
  transform:scale(.6);
  transition:opacity .16s ease,transform .18s cubic-bezier(.34,1.56,.64,1);
}
.selection-check .icon{width:12px;height:12px;stroke-width:2.6}
.product-card.is-selected .selection-check{opacity:1;transform:scale(1)}

/* 移动端：横向列表 */
@media (max-width:760px){
  .product-grid{grid-template-columns:1fr;gap:9px}
  .product-card{flex-direction:row;align-items:stretch;animation-delay:0ms}
  .product-cover{
    position:relative;
    width:96px;
    min-width:96px;
    height:auto;
    aspect-ratio:1;
    border-bottom:0;
    border-right:1px solid var(--line);
  }
  .product-tag{display:none}
  .product-body{flex:1;justify-content:center;padding:9px 12px;gap:2px}
  .product-name{font-size:15px;-webkit-line-clamp:2}
  .product-subtitle{-webkit-line-clamp:1}
  .product-foot{margin-top:4px;gap:6px}
  .product-tags{flex:1 1 auto;flex-wrap:nowrap;overflow:hidden;padding-bottom:2px}
  .product-tags .tagline:nth-child(n+3){display:none}
  .tagline{font-size:10.5px;line-height:1.6;padding:0 4px;flex:0 0 auto}
  .product-price{font-size:18px;margin-top:0}
  .selection-check{right:10px;top:50%;transform:translateY(-50%) scale(.6)}
  .product-card.is-selected .selection-check{transform:translateY(-50%) scale(1)}
  .product-card:hover{transform:none}
}
@media (max-width:640px){
  /* 左侧分类占位后，卡片收紧，避免文字被挤 */
  .product-cover{width:78px;min-width:78px}
  .product-body{padding:8px 10px;gap:1px}
  .product-name{font-size:14px;-webkit-line-clamp:2}
  .product-subtitle{display:none}
  .product-tags .tagline:nth-child(n+2){display:none}
  .product-price{font-size:16.5px}
  .product-price del{display:none}
  .selection-check{right:8px}
}
@media (max-width:380px){
  .product-cover{width:70px;min-width:70px}
  .product-name{font-size:13.5px}
}
