/* 产品目录：图 1:1 / 标签 3:1；列数变化时卡片伸缩，但限制最大宽度，避免过大 */
.product-catalog {
  padding-block: var(--space-6, 2rem);
}

.product-catalog__container {
  width: 100%;
  max-width: min(1680px, 96vw);
  margin-inline: auto;
  padding-inline: clamp(16px, 3vw, 48px);
  box-sizing: border-box;
}

.product-catalog__grid {
  display: grid;
  width: 100%;
  grid-template-columns: minmax(0, 360px);
  gap: clamp(16px, 2vw, 24px);
  align-items: start;
  justify-content: center;
}

/* 平板：两列，单卡不超过约 360 */
@media (min-width: 640px) {
  .product-catalog__grid--2,
  .product-catalog__grid--3,
  .product-catalog__grid--4 {
    grid-template-columns: repeat(2, minmax(0, 360px));
    gap: clamp(16px, 2vw, 28px);
  }
}

/* 桌面：按列数均分，但单卡有上限；列少时加大中间间距，避免挤在一起 */
@media (min-width: 1024px) {
  .product-catalog__grid--2 {
    grid-template-columns: repeat(2, minmax(0, 420px));
    gap: clamp(48px, 6vw, 96px);
  }

  .product-catalog__grid--3 {
    grid-template-columns: repeat(3, minmax(0, 380px));
    gap: clamp(32px, 3.5vw, 56px);
  }

  .product-catalog__grid--4 {
    grid-template-columns: repeat(4, minmax(0, 360px));
    gap: clamp(14px, 1.2vw, 24px);
  }
}

.product-catalog__card {
  display: flex;
  flex-direction: column;
  width: 100%;
  max-width: none;
  text-decoration: none;
  color: inherit;
  background: transparent;
  border: none;
  border-radius: 4px;
  overflow: hidden;
  transition: box-shadow .2s ease, transform .2s ease;
}

.product-catalog__card:hover {
  box-shadow: 0 10px 28px rgba(15, 40, 70, .08);
  transform: translateY(-2px);
}

/* 正方形图区：图片绝对定位，避免被 reset 的 height:auto 撑破比例 */
.product-catalog__media {
  position: relative;
  width: 100%;
  flex: none;
  aspect-ratio: 1 / 1;
  background: #fff;
  overflow: hidden;
}

.product-catalog__media img {
  position: absolute;
  inset: 0;
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  max-width: none;
  max-height: none;
  padding: 0;
  /* 贴边铺满；361×362 等接近方图会被轻微裁切，可接受 */
  object-fit: cover;
  display: block;
}

/* 标签区固定为宽度的 1/3（宽:高 = 3:1） */
.product-catalog__body {
  position: relative;
  width: 100%;
  flex: none;
  height: 0;
  padding-bottom: 33.333%;
  box-sizing: border-box;
  overflow: hidden;
  background: rgb(248, 248, 248);
}

.product-catalog__body-inner {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 6px;
  padding: 12px 16px;
  box-sizing: border-box;
  background: rgb(248, 248, 248);
  text-align: center;
}

.product-catalog__name {
  margin: 0;
  font-size: clamp(1.05rem, 1.1vw + 0.7rem, 1.35rem);
  font-weight: 700;
  line-height: 1.25;
  color: var(--color-text, #1a2b3c);
  letter-spacing: 0.01em;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.product-catalog__model {
  margin: 0;
  font-size: var(--text-sm, 0.9rem);
  line-height: 1.45;
  color: var(--color-text-muted, #6b7c8f);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}
