/* ==========================================================================
   产品详情页样式
   移动端：图集与信息变上下排列，规格表可横向滚动，标签页简化
   ========================================================================== */

.product-detail {
  padding: var(--space-7) 0;
}

.product-detail__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-7);
  margin-bottom: var(--space-7);
}

/* ---------- 产品图集 ---------- */
.product-gallery__main {
  aspect-ratio: 4 / 3;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-bg-alt);
  margin-bottom: var(--space-3);
}

.product-gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.product-gallery__thumbs {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-3);
}

.product-gallery__thumb {
  aspect-ratio: 1;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: all var(--transition-fast);
  background-color: var(--color-bg-alt);
}

.product-gallery__thumb.is-active {
  border-color: var(--color-primary);
}

.product-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- 产品信息 ---------- */
.product-info__name {
  font-size: var(--fs-2xl);
  margin-bottom: var(--space-3);
}

.product-info__desc {
  font-size: var(--fs-md);
  color: var(--color-text-2);
  line-height: var(--lh-relaxed);
  margin-bottom: var(--space-5);
}

.product-info__tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.product-info__tag {
  padding: 0.25rem 0.75rem;
  background-color: rgba(10, 77, 140, 0.1);
  color: var(--color-primary);
  font-size: var(--fs-xs);
  font-weight: var(--fw-semibold);
  border-radius: var(--radius-full);
}

/* 规格表 */
.spec-table {
  margin-bottom: var(--space-5);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--color-border);
}

.spec-table table {
  width: 100%;
}

.spec-table th,
.spec-table td {
  padding: 0.875rem 1.25rem;
  text-align: left;
  font-size: var(--fs-sm);
  border-bottom: 1px solid var(--color-border-light);
}

.spec-table th {
  background-color: var(--color-bg-alt);
  color: var(--color-text-2);
  font-weight: var(--fw-semibold);
  width: 35%;
}

.spec-table td {
  color: var(--color-text);
}

.spec-table tr:last-child th,
.spec-table tr:last-child td {
  border-bottom: none;
}

/* 操作按钮 */
.product-info__actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-bottom: var(--space-5);
}

/* 分享 */
.product-info__share {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding-top: var(--space-4);
  border-top: 1px solid var(--color-border-light);
}

.product-info__share span {
  font-size: var(--fs-sm);
  color: var(--color-text-light);
}

.share-link {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-full);
  background-color: var(--color-bg-alt);
  color: var(--color-text-2);
  font-size: var(--fs-sm);
  transition: all var(--transition-fast);
}

.share-link:hover {
  background-color: var(--color-primary);
  color: #fff;
}

/* ---------- 标签页 ---------- */
.product-tabs {
  border-top: 1px solid var(--color-border-light);
  padding-top: var(--space-6);
  margin-bottom: var(--space-7);
}

.tab-nav {
  display: flex;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
  border-bottom: 2px solid var(--color-border-light);
  overflow-x: auto;
  scrollbar-width: none;
}

.tab-nav::-webkit-scrollbar {
  display: none;
}

.tab-btn {
  padding: 0.75rem 1.5rem;
  font-size: var(--fs-base);
  font-weight: var(--fw-semibold);
  color: var(--color-text-light);
  border-bottom: 2px solid transparent;
  margin-bottom: -2px;
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.tab-btn.is-active {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.tab-pane {
  display: none;
  animation: fadeIn 0.3s ease;
}

.tab-pane.is-active {
  display: block;
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

/* 文章内容样式 */
.article {
  font-size: var(--fs-base);
  line-height: var(--lh-relaxed);
  color: var(--color-text-2);
}

.article h2 {
  font-size: var(--fs-xl);
  margin: var(--space-6) 0 var(--space-4);
}

.article h3 {
  font-size: var(--fs-lg);
  margin: var(--space-5) 0 var(--space-3);
}

.article p {
  margin-bottom: var(--space-4);
}

.article ul,
.article ol {
  margin-bottom: var(--space-4);
  padding-left: var(--space-5);
}

.article li {
  margin-bottom: var(--space-2);
  list-style: disc;
}

.article img {
  border-radius: var(--radius-md);
  margin: var(--space-4) 0;
}

.article table {
  margin: var(--space-4) 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.article th,
.article td {
  padding: 0.75rem 1rem;
  border: 1px solid var(--color-border);
  text-align: left;
  font-size: var(--fs-sm);
}

.article th {
  background-color: var(--color-bg-alt);
  font-weight: var(--fw-semibold);
}

/* ---------- 相关产品 ---------- */
.related {
  padding-top: var(--space-7);
  border-top: 1px solid var(--color-border-light);
}

.related__title {
  font-size: var(--fs-xl);
  margin-bottom: var(--space-5);
  text-align: center;
}

/* ==========================================================================
   产品详情页响应式
   ========================================================================== */
@media (max-width: 768px) {
  .product-detail__grid {
    grid-template-columns: 1fr;
    gap: var(--space-5);
  }

  .product-info__name {
    font-size: var(--fs-xl);
  }

  .product-info__desc {
    font-size: var(--fs-base);
  }

  /* 规格表移动端：可横向滚动 */
  .spec-table {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .spec-table table {
    min-width: 100%;
  }

  .product-info__actions {
    flex-direction: column;
  }

  .product-info__actions .btn {
    width: 100%;
  }

  .tab-btn {
    padding: 0.625rem 1rem;
    font-size: var(--fs-sm);
  }

  .article h2 {
    font-size: var(--fs-lg);
  }

  .article h3 {
    font-size: var(--fs-md);
  }
}
