/* ============================================================
   产品内页 Product Detail（templates/sets/product/detail.php 专用）
   · 左画廊（Swiper 主图 + 下方横向缩略图）/ 右产品信息（标题 + 短描述
     + WhatsApp / 询盘按钮）→ 内容卡 → 相关推荐 4 个。
   · 区块间距走全站 .section + --section-y，本文件只管布局与组件。
   · 内容排版复用 style.css 4.16 的 .page-content；相关推荐复用
     4.14 的 .product-tile（--four 变体在 style.css）。
   ============================================================ */

/* --- 产品主区布局：左画廊 / 右信息 --- */
.pd-layout {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sp-5);
  align-items: start;
}

/* --- 左：画廊 --- */
.pd-gallery {
  min-width: 0;
}

.pd-stage {
  min-width: 0;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  overflow: hidden;
}

.pd-stage img {
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  background: var(--c-white);
}

/* 缩略图行：容器管外边距 + 箭头定位 */
.pd-thumbs {
  position: relative;
  margin-top: 14px;
}

.pd-thumbs-swiper {
  min-width: 0;
}

.pd-thumbs-swiper .swiper-slide {
  aspect-ratio: 1 / 1;
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-sm);
  overflow: hidden;
  cursor: pointer;
  opacity: .65;
  transition: border-color var(--dur) var(--ease), opacity var(--dur) var(--ease),
    box-shadow var(--dur) var(--ease);
}

.pd-thumbs-swiper .swiper-slide img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pd-thumbs-swiper .swiper-slide:hover {
  opacity: 1;
}

/* Swiper thumbs 联动自动给当前缩略图加 .swiper-slide-thumb-active */
.pd-thumbs-swiper .swiper-slide-thumb-active {
  opacity: 1;
  border-color: var(--c-green-600);
  box-shadow: 0 0 0 1px var(--c-green-600) inset;
}

/* 缩略图左右箭头：两端半露的圆形按钮，超出可滑时才出现（Swiper 加
   swiper-button-disabled 变透明、swiper-button-lock 无溢出时隐藏） */
.pd-thumbs__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 1px solid var(--c-line);
  border-radius: 50%;
  background: rgba(255, 255, 255, .94);
  color: var(--c-ink);
  font-size: 12px;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(16, 46, 32, .12);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.pd-thumbs__nav--prev {
  left: -10px;
}

.pd-thumbs__nav--next {
  right: -10px;
}

.pd-thumbs__nav:hover {
  background: var(--c-green-600);
  border-color: var(--c-green-600);
  color: var(--c-white);
}

.pd-thumbs__nav.swiper-button-disabled {
  opacity: 0;
  pointer-events: none;
}

/* --- 右：产品信息（白卡承载，与下方内容卡呼应） --- */
.pd-info {
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: var(--sp-5);
  box-shadow: 0 10px 30px rgba(16, 46, 32, .05);
}

.pd-title {
  margin: 0 0 var(--sp-3);
  padding-bottom: var(--sp-3);
  border-bottom: 1px solid var(--c-line);
  font-family: var(--font-display);
  font-size: 28px;
  font-weight: var(--fw-bold);
  line-height: 1.3;
  color: var(--c-ink);
}

.pd-short {
  margin-bottom: var(--sp-4);
  font-size: 16px;
  line-height: 1.75;
  color: var(--c-body);
}

.pd-short > :last-child {
  margin-bottom: 0;
}

.pd-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  padding-top: var(--sp-4);
  border-top: 1px solid var(--c-line);
}

/* WhatsApp 按钮（品牌绿，仅本页使用，放页面级样式） */
.btn--whatsapp {
  background: #25d366;
  color: var(--c-white);
}

.btn--whatsapp:hover {
  background: #1eb455;
  color: var(--c-white);
  box-shadow: 0 12px 28px rgba(37, 211, 102, .28);
}

/* --- 产品内容卡（排版复用 .page-content） --- */
/* .pd-card {
  background: var(--c-white);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: var(--sp-6);
} */

.pd-card__title {
  margin: 0 0 var(--sp-3);
  padding-bottom: 14px;
  border-bottom: 1px solid var(--c-line);
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: var(--fw-bold);
  color: var(--c-ink);
}

/* --- 相关推荐 --- */
/* .pd-related {
  margin-top: var(--sp-6);
} */

.pd-related__title {
  margin: 0 0 var(--sp-3);
  padding-left: 14px;
  border-left: 4px solid var(--c-lime);
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: var(--fw-bold);
  color: var(--c-ink);
}

/* --- 响应式 --- */
@media (max-width: 991.98px) {
  .pd-layout {
    /* 1fr 必须带 minmax(0,…)：裸 1fr 的 min-width:auto 会与主图
       aspect-ratio 循环计算，把画廊撑爆（实测 3300 万 px） */
    grid-template-columns: minmax(0, 1fr);
    gap: var(--sp-4);
  }

  .pd-thumbs-swiper .swiper-slide {
    aspect-ratio: auto;
    height: 84px;
  }
}

@media (max-width: 767.98px) {
  .pd-info {
    padding: var(--sp-4);
  }

  /* .pd-card {
    padding: var(--sp-4);
  } */

  .pd-title {
    font-size: 24px;
  }

  .pd-thumbs__nav {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
}
