/* ============================================================
   产品详情页重构样式（S16 敏宝安 参照设计）
   作用域：product-detail.html / product-detail-{slug}.html
   依赖 theme-classic3 的 CSS 变量（信谊红），仅新增 .pd-* 板块。
   ============================================================ */

/* ---- 徽标 / 副标题 ---- */
.pd-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 14px;
  border-radius: 999px;
  background: var(--color-accent-warm, #C4922A);
  color: #fff;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  margin-bottom: 12px;
}

.page-hero--brand .pd-badge,
#product-detail-hero .pd-badge {
  background: var(--color-accent-warm, #C4922A);
}

.pd-subtitle,
.product-detail-subtitle {
  color: var(--color-text-muted, #5C6B7A);
  font-weight: 500;
  line-height: 1.6;
}

#product-detail-hero .pd-subtitle { color: rgba(255, 255, 255, 0.92); }

.product-detail-subtitle {
  margin: 0 0 6px;
  font-size: 1rem;
}

.product-detail-copy h2 .pd-badge {
  margin-left: 10px;
  vertical-align: middle;
  font-size: 0.7rem;
  padding: 3px 10px;
}

/* ---- 通用板块骨架 ---- */
.pd-section {
  --pd-gap: clamp(14px, 2vw, 22px);
  padding: clamp(28px, 5vw, 56px) 0;
}

.pd-section + .pd-section { border-top: 1px solid var(--color-border, rgba(217, 35, 46, 0.14)); }

.pd-section-head {
  margin-bottom: clamp(18px, 3vw, 30px);
  text-align: center;
}

.pd-section-head .section-label {
  display: block;
  margin-bottom: 8px;
}

.pd-section-title {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 1.9rem);
  font-weight: 800;
  letter-spacing: 0.01em;
  color: var(--color-text, #1A2B3C);
}

/* ---- 产品信息条 ---- */
.pd-info-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--pd-gap);
}

.pd-info-item {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(217, 35, 46, 0.14));
  border-radius: var(--radius-md, 16px);
  padding: 20px 22px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.05));
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pd-info-item:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md, 0 8px 32px rgba(0, 0, 0, 0.1));
}

.pd-info-item strong {
  display: block;
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--color-primary, #D9232E);
  margin-bottom: 6px;
}

.pd-info-item span {
  color: var(--color-text-muted, #5C6B7A);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ---- 适用人群 ---- */
.pd-applicable-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--pd-gap);
}

.pd-applicable-card {
  position: relative;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(217, 35, 46, 0.14));
  border-radius: var(--radius-md, 16px);
  padding: 24px 22px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.05));
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.pd-applicable-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--color-primary, #D9232E);
}

.pd-applicable-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md, 0 8px 32px rgba(0, 0, 0, 0.1));
}

.pd-applicable-card strong {
  display: block;
  font-size: 1.1rem;
  font-weight: 800;
  color: var(--color-text, #1A2B3C);
  margin-bottom: 8px;
}

.pd-applicable-card p {
  margin: 0;
  color: var(--color-text-muted, #5C6B7A);
  font-size: 0.92rem;
  line-height: 1.7;
}

/* ---- 核心配方：tabs ---- */
.pd-formula-tabs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
  margin-bottom: clamp(20px, 3vw, 30px);
}

.pd-formula-tab {
  appearance: none;
  border: 1px solid var(--color-border, rgba(217, 35, 46, 0.14));
  background: var(--color-surface, #fff);
  color: var(--color-text-muted, #5C6B7A);
  font-size: 0.95rem;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pd-formula-tab:hover { color: var(--color-primary, #D9232E); border-color: var(--color-primary, #D9232E); }

.pd-formula-tab.is-active,
.pd-formula-tab[aria-selected="true"] {
  background: var(--color-primary, #D9232E);
  border-color: var(--color-primary, #D9232E);
  color: #fff;
}

/* ---- 核心配方：面板 ---- */
.pd-formula-panel { display: none; }
.pd-formula-panel.is-active { display: block; }

.pd-formula-desc {
  color: var(--color-text-muted, #5C6B7A);
  text-align: center;
  max-width: 760px;
  margin: 0 auto 24px;
  line-height: 1.7;
  font-size: 0.95rem;
}

.pd-strains {
  display: flex;
  gap: var(--pd-gap);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 12px;
  scrollbar-width: thin;
}

.pd-strains::-webkit-scrollbar { height: 6px; }
.pd-strains::-webkit-scrollbar-thumb { background: var(--color-border, rgba(217, 35, 46, 0.2)); border-radius: 999px; }

.pd-strain-card {
  flex: 0 0 min(78vw, 270px);
  scroll-snap-align: start;
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(217, 35, 46, 0.14));
  border-radius: var(--radius-md, 16px);
  padding: 22px 20px;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.05));
}

.pd-strain-badge {
  display: inline-block;
  background: rgba(217, 35, 46, 0.08);
  color: var(--color-primary, #D9232E);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 0.72rem;
  font-weight: 700;
  margin-bottom: 10px;
}

.pd-strain-code {
  display: block;
  font-family: 'Outfit', 'Noto Sans SC', sans-serif;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-text-muted, #5C6B7A);
  margin-bottom: 6px;
}

.pd-strain-name,
.pd-strain-name:any-link {
  display: block;
  font-size: 1.08rem;
  font-weight: 800;
  color: var(--color-text, #1A2B3C);
  margin-bottom: 8px;
  text-decoration: none;
}

a.pd-strain-name:hover { color: var(--color-primary, #D9232E); }

.pd-strain-summary {
  margin: 0;
  color: var(--color-text-muted, #5C6B7A);
  font-size: 0.9rem;
  line-height: 1.65;
}

/* ---- 菌株分页 ---- */
.pd-strain-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 14px;
}

.pd-strain-pager button {
  appearance: none;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--color-border, rgba(217, 35, 46, 0.14));
  background: var(--color-surface, #fff);
  color: var(--color-text, #1A2B3C);
  font-size: 1.2rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.2s ease;
}

.pd-strain-pager button:hover {
  background: var(--color-primary, #D9232E);
  border-color: var(--color-primary, #D9232E);
  color: #fff;
}

.pd-strain-pager button:disabled { opacity: 0.35; cursor: default; }
.pd-strain-pager button:disabled:hover { background: var(--color-surface, #fff); color: var(--color-text, #1A2B3C); border-color: var(--color-border); }

.pd-pager-indicator {
  font-family: 'Outfit', 'Noto Sans SC', sans-serif;
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--color-text, #1A2B3C);
  min-width: 52px;
  text-align: center;
}

/* ---- 科学循证提示 ---- */
.pd-evidence-note {
  margin: 28px auto 0;
  max-width: 720px;
  text-align: center;
  padding: 14px 20px;
  border-radius: var(--radius-sm, 8px);
  background: var(--color-bg-alt, #F5F7FA);
  color: var(--color-text-muted, #5C6B7A);
  font-size: 0.9rem;
  line-height: 1.6;
}

/* ---- FAQ ---- */
.pd-faq-list { max-width: 820px; margin: 0 auto; display: flex; flex-direction: column; gap: 12px; }

.pd-faq-item {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(217, 35, 46, 0.14));
  border-radius: var(--radius-sm, 8px);
  overflow: hidden;
}

.pd-faq-q {
  width: 100%;
  appearance: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  text-align: left;
  background: transparent;
  border: 0;
  padding: 16px 18px;
  cursor: pointer;
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--color-text, #1A2B3C);
  font-family: inherit;
}

.pd-faq-q:hover { color: var(--color-primary, #D9232E); }

.pd-faq-ico {
  flex: 0 0 auto;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--color-bg-alt, #F5F7FA);
  color: var(--color-primary, #D9232E);
  font-size: 1.1rem;
  line-height: 1;
  transition: transform 0.25s ease;
}

.pd-faq-item.is-open .pd-faq-ico { transform: rotate(45deg); }

.pd-faq-a { display: none; padding: 0 18px 18px; }
.pd-faq-item.is-open .pd-faq-a { display: block; }

.pd-faq-a p {
  margin: 0;
  color: var(--color-text-muted, #5C6B7A);
  font-size: 0.93rem;
  line-height: 1.75;
}

/* ---- 相关推荐 ---- */
.pd-related-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--pd-gap);
}

.pd-related-card {
  background: var(--color-surface, #fff);
  border: 1px solid var(--color-border, rgba(217, 35, 46, 0.14));
  border-radius: var(--radius-md, 16px);
  padding: 14px;
  text-decoration: none;
  box-shadow: var(--shadow-sm, 0 2px 8px rgba(0, 0, 0, 0.05));
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.pd-related-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md, 0 8px 32px rgba(0, 0, 0, 0.1));
}

.pd-related-card img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  border-radius: var(--radius-sm, 8px);
  background: var(--color-bg-alt, #F5F7FA);
  margin-bottom: 12px;
}

.pd-related-card strong {
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text, #1A2B3C);
  margin-bottom: 4px;
}

.pd-related-card p {
  margin: 0;
  color: var(--color-text-muted, #5C6B7A);
  font-size: 0.88rem;
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---- 响应式 ---- */
@media (max-width: 1024px) {
  .pd-info-grid,
  .pd-applicable-grid,
  .pd-related-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .pd-info-grid,
  .pd-applicable-grid,
  .pd-related-grid { grid-template-columns: 1fr; }

  .pd-strain-card { flex-basis: min(82vw, 260px); }
  .pd-section { padding: 28px 0; }
}

@media (prefers-reduced-motion: reduce) {
  .pd-info-item,
  .pd-applicable-card,
  .pd-related-card { transition: none; }
}