/**
 * 产品页面样式 - 与 product.html 保持一致
 */

/* ===== 产品列表区域 ===== */
.product-list-section {
  padding: 30px 0 60px;
}

/* 产品列表容器，确保内容不超出 */
.product-list-section .container {
  max-width: 1600px;
  padding: 0 24px;
  overflow: hidden;
}

.product-layout {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 24px;
  align-items: start;
}

/* 上下布局：顶部分类栏 + 下方产品区 */
.product-layout-top-bottom {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.product-category-topbar {
  background: #fff;
  border-radius: 8px;
  border: 1px solid #e8e8e8;
  overflow: hidden;
}

.category-topbar-inner {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  padding: 14px 20px;
}

.category-topbar-title {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-right: 16px;
  margin-right: 8px;
  border-right: 1px solid #e8e8e8;
  color: #1a7f37;
  font-size: 15px;
  font-weight: 600;
}

.category-topbar-title i {
  font-size: 16px;
}

.category-topbar-nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.category-topbar-link {
  display: inline-block;
  padding: 6px 16px;
  border-radius: 6px;
  font-size: 14px;
  color: #444;
  text-decoration: none;
  transition: all 0.2s;
}

.category-topbar-link:hover {
  background: #f0f9f0;
  color: #1a7f37;
}

.category-topbar-link.active {
  background: #1a7f37;
  color: #fff;
}

.product-sidebar {
  position: sticky;
  top: 155px;
  z-index: 100; /* 确保侧边栏弹窗显示在产品列表上方，不被遮挡 */
}

.sidebar-panel {
  background: #fff;
  border-radius: 8px;
  overflow: visible; /* 必须为 visible，否则右侧悬停弹窗会被裁剪 */
  border: 1px solid #e8e8e8;
}

.sidebar-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 14px 16px;
  background: #1a7f37;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
}

.sidebar-header i {
  font-size: 14px;
}

.sidebar-nav {
  padding: 8px 0;
}

/* 弹窗式分类 - 全部加载展示 */
.sidebar-nav-popout .sidebar-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 16px;
  color: #444;
  font-size: 14px;
  text-decoration: none;
  transition: all 0.2s;
  border-left: 3px solid transparent;
  min-height: 44px;
}

.sidebar-nav-popout .sidebar-item:hover {
  background: #f9f9f9;
  color: #1a7f37;
  border-left-color: #1a7f37;
  padding-left: 20px;
}

.sidebar-nav-popout .sidebar-item.active {
  background: #f0f9f0;
  color: #1a7f37;
  border-left-color: #1a7f37;
  font-weight: 500;
}

.sidebar-nav-popout .sidebar-arrow {
  color: #ccc;
  font-size: 12px;
  transition: all 0.2s;
  flex-shrink: 0;
  margin-left: 8px;
}

.sidebar-nav-popout .sidebar-item:hover .sidebar-arrow,
.sidebar-nav-popout .sidebar-item.active .sidebar-arrow {
  color: #1a7f37;
  transform: translateX(3px);
}

/* 有子分类的项 - 弹窗在右侧 */
.sidebar-category {
  position: relative;
}

.sidebar-dropdown {
  display: none;
  position: absolute;
  left: 100%;
  top: 0;
  z-index: 999;
  width: 360px;
  min-width: 320px;
  max-height: 80vh;
  overflow-y: auto;
  background: #fff;
  border-radius: 0 8px 8px 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border: 1px solid #e8e8e8;
  margin-left: -1px;
}

.sidebar-category:hover .sidebar-dropdown {
  display: block;
}

/* 当子分类被选中时，父级也高亮 */
.sidebar-category.active > .sidebar-item {
  background: #f0f9f0;
  color: #1a7f37;
  border-left-color: #1a7f37;
  font-weight: 500;
}

.dropdown-content {
  padding: 0;
}

.dropdown-group {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.dropdown-group:last-child {
  border-bottom: none;
}

.dropdown-group-title {
  font-size: 12px;
  font-weight: 600;
  color: #1a7f37;
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e8e8e8;
}

.dropdown-group-title a.dropdown-title-link {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  display: inline-block;
}

.dropdown-group-title a.dropdown-title-link:hover {
  text-decoration: underline;
}

.dropdown-group-title a.dropdown-title-link.active {
  color: #15803d;
}

.dropdown-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.dropdown-links a {
  display: block;
  padding: 6px 10px;
  font-size: 12px;
  color: #555;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.dropdown-links a:hover,
.dropdown-links a.active {
  background: #f0f9f0;
  color: #1a7f37;
}

/* 嵌套分组：子分类有下级时，以该分类为主体显示分组 */
.dropdown-links .dropdown-group {
  grid-column: 1 / -1;
  padding: 8px 0 0 0;
  margin-top: 4px;
  border-top: 1px dashed #e8e8e8;
  border-bottom: none;
}

.dropdown-links .dropdown-group .dropdown-group-title {
  font-size: 11px;
  margin-bottom: 6px;
}

.product-main {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  overflow: hidden;
  position: relative;
  z-index: 1; /* 低于侧边栏，避免遮挡分类弹窗 */
}

/* AJAX 加载状态 */
.product-main.product-loading {
  position: relative;
  min-height: 200px;
}

.product-main.product-loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 40px;
  height: 40px;
  margin: -20px 0 0 -20px;
  border: 3px solid #e2e8f0;
  border-top-color: #1a7f37;
  border-radius: 50%;
  animation: product-spin 0.8s linear infinite;
}

@keyframes product-spin {
  to { transform: rotate(360deg); }
}

/* ===== 产品过滤栏 ===== */
.product-filter-bar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  flex-wrap: wrap;
  padding: 12px 16px;
  background: #fff;
  border-radius: 8px;
  border: 1px solid #eee;
  margin-bottom: 16px;
  gap: 14px;
}

.product-filter-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

/* 高端化学品 - 搜索栏内下拉（悬停显示子分类，箭头样式） */
.filter-category-wrap {
  position: relative;
  display: inline-block;
}

.filter-category-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 20px 8px 16px;
  background: #fff;
  color: #1a7f37;
  border: 1px solid #1a7f37;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}

.filter-category-btn:hover {
  background: #1a7f37;
  color: #fff;
}

.filter-category-btn .fa-th {
  font-size: 14px;
}

.filter-category-btn .fa-chevron-down {
  font-size: 10px;
  margin-left: 2px;
  transition: transform 0.25s ease;
}

.filter-category-wrap:hover .filter-category-btn .fa-chevron-down {
  transform: rotate(180deg);
}

.filter-category-dropdown {
  display: none;
  position: absolute;
  left: 0;
  top: 100%;
  z-index: 999;
  width: 360px;
  min-width: 320px;
  max-height: 70vh;
  overflow-y: auto;
  margin-top: 2px;
  background: #fff;
  border-radius: 0 8px 8px 8px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
  border: 1px solid #e8e8e8;
}

.filter-category-wrap:hover .filter-category-dropdown {
  display: block;
  animation: filterDropdownFade 0.2s ease;
}

@keyframes filterDropdownFade {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}

.filter-category-dropdown .dropdown-content {
  padding: 12px 0;
}

.filter-category-dropdown .dropdown-group {
  padding: 12px 16px;
  border-bottom: 1px solid #f0f0f0;
}

.filter-category-dropdown .dropdown-group:last-child {
  border-bottom: none;
}

.filter-category-dropdown .dropdown-group-title {
  font-size: 12px;
  font-weight: 600;
  color: #1a7f37;
  margin: 0 0 10px 0;
  padding-bottom: 6px;
  border-bottom: 1px dashed #e8e8e8;
}

.filter-category-dropdown .dropdown-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
}

.filter-category-dropdown .dropdown-links a {
  display: block;
  padding: 6px 10px;
  font-size: 12px;
  color: #555;
  text-decoration: none;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.filter-category-dropdown .dropdown-links a:hover,
.filter-category-dropdown .dropdown-links a.active {
  background: #f0f9f0;
  color: #1a7f37;
}

.product-search-inline {
  display: flex;
  align-items: center;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
  overflow: hidden;
  transition: all 0.2s ease;
}

.product-search-inline:focus-within {
  border-color: #1a7f37;
  box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.1);
}

.inline-search-input {
  width: 200px;
  padding: 8px 14px;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #333;
  outline: none;
}

.inline-search-input::placeholder {
  color: #94a3b8;
}

.inline-search-btn {
  padding: 8px 14px;
  background: transparent;
  border: none;
  color: #64748b;
  cursor: pointer;
  transition: all 0.2s ease;
}

.inline-search-btn:hover {
  background: #1a7f37;
  color: #fff;
}

.product-sort {
  display: flex;
  align-items: center;
  gap: 8px;
}

.product-sort select {
  height: 34px;
  padding: 0 32px 0 12px;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 13px;
  background: #fff;
  cursor: pointer;
  outline: none;
  min-width: 130px;
}

.product-sort select:hover {
  border-color: #1a7f37;
}

.product-sort select:focus {
  border-color: #1a7f37;
  box-shadow: 0 0 0 3px rgba(26, 127, 55, 0.1);
}

.product-result-count {
  font-size: 13px;
  color: #64748b;
  margin-bottom: 16px;
}

.product-result-count strong {
  color: #1a7f37;
  font-weight: 600;
}

/* ===== 产品展示固定样式 ===== */
/* 固定每行5张卡片、内容不超出红框 */
.product-card-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 8px;
  margin-top: 16px;
  margin-bottom: 16px;
  width: 100%;
  overflow: hidden;
}

.product-card {
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.05);
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer;
  border: 1px solid #e2e8f0;
  min-width: 0;
}

.product-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
  border-color: #bbf7d0;
}

.product-card-image {
  position: relative;
  height: 180px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* 无图时统一显示纯白空白区域（图1样式） */
.product-card-no-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: #fff;
  z-index: 0;
}

.product-card-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
  object-fit: contain;
  transition: transform 0.4s ease;
  image-rendering: -webkit-optimize-contrast;
  image-rendering: crisp-edges;
}

.product-card:hover .product-card-image img {
  transform: scale(1.05);
}

.product-card-image .product-icon {
  position: absolute;
  width: 50px;
  height: 50px;
  background: linear-gradient(135deg, #bbf7d0, #dcfce7);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: #1a7f37;
  transition: all 0.25s ease;
}

.product-card-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 10px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3px;
  z-index: 5;
}

.product-card-badge.in-stock {
  background: linear-gradient(135deg, #22c55e 0%, #16a34a 100%);
  color: #fff;
}

.product-card-badge.low-stock {
  background: linear-gradient(135deg, #eab308 0%, #ca8a04 100%);
  color: #fff;
}

.product-card-content {
  padding: 8px 6px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  min-width: 0;
  width: 100%;
  overflow: hidden;
}

.product-card-title {
  font-size: 13px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.35;
  height: 36px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  margin: 0;
  transition: all 0.2s ease;
  text-align: center;
  width: 100%;
  max-width: 100%;
  word-break: break-all;
}

.product-card:hover .product-card-title {
  color: #1a7f37;
}

.product-card-english {
  font-size: 13px;
  color: #64748b;
  font-style: italic;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
  margin-top: 2px;
}

.product-card-meta {
  display: flex;
  justify-content: center;
  align-items: center;
  padding-bottom: 6px;
  border-bottom: 1px solid #f1f5f9;
  gap: 6px;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

.product-card-cas {
  font-size: 14px;
  color: #64748b;
  font-family: 'SF Mono', 'Monaco', 'Consolas', monospace;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 100%;
}

.product-card-purity {
  font-size: 10px;
  color: #1a7f37;
  font-weight: 600;
  background: #dcfce7;
  padding: 2px 8px;
  border-radius: 10px;
  flex-shrink: 0;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-card-specs {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 4px 12px;
  width: 100%;
  min-width: 0;
  min-height: 64px; /* 预留两行规格高度，保证多卡片时底部按钮平行对齐 */
  overflow: hidden;
}

.product-card-spec-item {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  max-width: 100%;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  padding: 4px 10px;
  border-radius: 6px;
  background: #f1f5f9;
}

.product-card-spec-item .spec-package {
  color: #64748b;
}

.product-card-spec-item .spec-price {
  font-weight: 700;
  color: #1a7f37;
}

.product-card-spec-item .spec-unit {
  font-size: 11px;
  color: #94a3b8;
}

.product-card-spec-item:nth-child(odd) {
  background: #e2e8f0;
}

.product-card-spec-item:nth-child(even) {
  background: #f1f5f9;
}

.product-card-price {
  font-size: 16px;
  font-weight: 700;
  color: #1a7f37;
  display: flex;
  justify-content: center;
  align-items: baseline;
  gap: 2px;
}

.product-card-price span {
  font-size: 12px;
  font-weight: 400;
  color: #64748b;
}

.product-card-actions {
  display: flex;
  justify-content: center;
  gap: 4px;
  margin-top: 2px;
  width: 100%;
  min-width: 0;
}

.product-card-btn {
  flex: 1;
  min-width: 0;
  max-width: 50%;
  padding: 4px 3px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  text-align: center;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  white-space: nowrap;
  text-decoration: none;
  font-family: inherit;
  overflow: hidden;
}

/* 详情按钮：与加入购物车同风格，绿色背景 */
.product-card-btn.detail {
  background: linear-gradient(135deg, #1a7f37 0%, #16a34a 100%);
  color: #fff;
  border: 1px solid #1a7f37;
}

.product-card-btn.detail:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
  color: #fff;
  border-color: #16a34a;
}

.product-card-btn.cart {
  background: linear-gradient(135deg, #1a7f37 0%, #16a34a 100%);
  color: #fff;
  border: 1px solid #1a7f37;
}

.product-card-btn.cart:hover {
  background: linear-gradient(135deg, #16a34a 0%, #15803d 100%);
}

.product-card-btn.cart:active {
  transform: scale(0.98);
}

.product-card-btn i {
  font-size: 9px;
  flex-shrink: 0;
}

/* ===== 产品分页 ===== */
.product-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 30px;
  gap: 4px;
  padding: 16px 0;
}

.product-pagination a,
.product-pagination span {
  display: flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 6px;
  font-size: 13px;
  color: #334155;
  background: #fff;
  border: 1px solid #e2e8f0;
  text-decoration: none;
  transition: all 0.2s ease;
  font-weight: 500;
}

.product-pagination a:hover:not(.disabled):not(.active) {
  background: #dcfce7;
  border-color: #1a7f37;
  color: #1a7f37;
}

.product-pagination a.active {
  background: #1a7f37;
  border-color: #1a7f37;
  color: #fff;
}

.product-pagination a.disabled {
  opacity: 0.5;
  pointer-events: none;
  background: #f8fafc;
}

/* 空状态 */
.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #94a3b8;
}

.empty-state i {
  font-size: 64px;
  margin-bottom: 20px;
  color: #cbd5e1;
}

/* ===== 响应式设计（保持固定卡片样式） ===== */
@media (max-width: 1200px) {
  .product-card-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 1024px) {
  .product-layout:not(.product-layout-top-bottom) {
    grid-template-columns: 200px 1fr;
    gap: 20px;
  }

  .product-card-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
  }
}

@media (max-width: 768px) {
  .product-layout:not(.product-layout-top-bottom) {
    grid-template-columns: 1fr;
  }

  .product-sidebar {
    position: static;
  }

  /* 顶部分类栏移动端 */
  .category-topbar-inner {
    flex-direction: column;
    align-items: flex-start;
    padding: 12px 16px;
  }

  .category-topbar-title {
    border-right: none;
    margin-right: 0;
    padding-right: 0;
    margin-bottom: 4px;
  }

  .category-topbar-nav {
    width: 100%;
  }

  /* 移动端弹窗改为下方展开 */
  .sidebar-dropdown {
    left: 0;
    top: 100%;
    width: 100%;
    min-width: 100%;
    border-radius: 0 0 8px 8px;
  }

  .sidebar-category:hover .sidebar-dropdown {
    display: block;
  }

  .product-filter-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .product-search-inline {
    width: 100%;
  }

  .inline-search-input {
    flex: 1;
    width: auto;
  }

  /* 移动端保持2列，卡片结构不变 */
  .product-card-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

/* ===== 产品详情页面 ===== */
.product-detail-section {
  padding: 40px 0;
}

.product-detail-layout {
  display: block;
}

.product-detail-main {
  width: 100%;
}

.product-detail-header {
  display: grid;
  grid-template-columns: 400px 1fr;
  gap: 40px;
  margin-bottom: 40px;
  background: #fff;
  padding: 30px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
}

.product-detail-image {
  position: relative;
  padding-top: 100%;
  background: #f8fafc;
  border-radius: 8px;
  overflow: hidden;
}

.product-detail-image img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
}

.no-image-large {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #94a3b8;
}

.no-image-large i {
  font-size: 64px;
  margin-bottom: 10px;
}

.product-detail-info {
  display: flex;
  flex-direction: column;
}

.product-detail-title {
  font-size: 28px;
  font-weight: 700;
  margin: 0 0 10px;
  color: #1e293b;
}

.product-detail-english {
  font-size: 16px;
  color: #64748b;
  margin: 0 0 20px;
}

.product-detail-meta {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

.meta-item {
  display: flex;
  font-size: 14px;
}

.meta-label {
  font-weight: 600;
  color: #64748b;
  margin-right: 8px;
}

.meta-value {
  color: #1e293b;
}

.product-detail-price {
  padding: 20px 0;
  border-top: 1px solid #e2e8f0;
  border-bottom: 1px solid #e2e8f0;
  margin-bottom: 20px;
}

.product-detail-price .price-value {
  font-size: 32px;
  font-weight: 700;
  color: #1a7f37;
}

.product-detail-actions {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-top: auto;
}

.quantity-control {
  display: flex;
  align-items: center;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  overflow: hidden;
}

.qty-btn {
  padding: 10px 15px;
  background: #f8fafc;
  border: none;
  cursor: pointer;
  transition: background 0.3s;
}

.qty-btn:hover {
  background: #e2e8f0;
}

.qty-input {
  width: 60px;
  padding: 10px;
  border: none;
  border-left: 1px solid #e2e8f0;
  border-right: 1px solid #e2e8f0;
  text-align: center;
  font-size: 14px;
}

.btn-add-cart-large {
  flex: 1;
  padding: 12px 24px;
  background: #1a7f37;
  color: #fff;
  border: none;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.3s;
}

.btn-add-cart-large:hover {
  background: #15803d;
}

.btn-add-cart-large:disabled {
  background: #94a3b8;
  cursor: not-allowed;
}

.btn-inquiry {
  padding: 12px 24px;
  background: #fff;
  color: #1a7f37;
  border: 2px solid #1a7f37;
  border-radius: 6px;
  font-size: 16px;
  cursor: pointer;
  transition: all 0.3s;
}

.btn-inquiry:hover {
  background: #1a7f37;
  color: #fff;
}

/* Tabs */
.product-detail-tabs {
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  margin-bottom: 30px;
  border: 1px solid #e2e8f0;
}

.tabs-nav {
  display: flex;
  border-bottom: 1px solid #e2e8f0;
}

.tab-btn {
  padding: 15px 30px;
  background: none;
  border: none;
  font-size: 16px;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s;
  position: relative;
}

.tab-btn.active {
  color: #1a7f37;
  font-weight: 600;
}

.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: -1px;
  left: 0;
  right: 0;
  height: 2px;
  background: #1a7f37;
}

.tabs-content {
  padding: 30px;
}

.tab-pane {
  display: none;
}

.tab-pane.active {
  display: block;
}

.specs-table {
  width: 100%;
  border-collapse: collapse;
}

.specs-table th,
.specs-table td {
  padding: 12px;
  border: 1px solid #e2e8f0;
  text-align: left;
}

.specs-table th {
  background: #f8fafc;
  font-weight: 600;
  width: 180px;
}

.description-content {
  line-height: 1.8;
  color: #64748b;
}

.empty-description {
  text-align: center;
  color: #94a3b8;
  padding: 40px 0;
}

/* 产品详情分页导航 */
.product-detail-pagination {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 16px;
  background: #fff;
  padding: 20px 24px;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  border: 1px solid #e2e8f0;
  margin-bottom: 30px;
}

.product-pagination-prev,
.product-pagination-next {
  flex: 1;
  min-width: 140px;
}

.product-pagination-prev {
  text-align: left;
}

.product-pagination-next {
  text-align: right;
}

.product-pagination-info {
  padding: 0 16px;
  font-size: 14px;
  color: #64748b;
  white-space: nowrap;
}

.product-pagination-info strong {
  color: #1a7f37;
  font-weight: 600;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: #f8fafc;
  color: #1e293b;
  text-decoration: none;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  font-size: 14px;
  transition: all 0.2s ease;
}

.pagination-btn:hover:not(.disabled) {
  background: #1a7f37;
  color: #fff;
  border-color: #1a7f37;
}

.pagination-btn.disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-btn.back {
  flex-shrink: 0;
}

.pagination-label {
  font-size: 12px;
  color: #94a3b8;
}

.pagination-btn:hover .pagination-label {
  color: rgba(255, 255, 255, 0.9);
}

.pagination-btn.disabled .pagination-label {
  color: inherit;
}

.pagination-title {
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

/* 兼容旧版 nav-btn */
.nav-btn {
  padding: 12px 20px;
  background: #f8fafc;
  color: #1e293b;
  text-decoration: none;
  border-radius: 6px;
  transition: all 0.3s;
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-btn:hover {
  background: #1a7f37;
  color: #fff;
}

.nav-btn.disabled {
  opacity: 0.3;
  pointer-events: none;
}

.nav-btn span {
  max-width: 200px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 相关产品 */
.related-products-section {
  margin-top: 40px;
}

.section-title {
  font-size: 24px;
  font-weight: 700;
  margin: 0 0 20px;
  color: #1e293b;
}

.related-products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
}

.related-products-grid .product-card {
  padding: 0;
}

.related-products-grid .product-link {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: inherit;
}

.related-products-grid .product-image {
  position: relative;
  padding-top: 100%;
  background: #f8fafc;
  overflow: hidden;
  border-radius: 8px 8px 0 0;
}

.related-products-grid .product-image img {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

.related-products-grid .no-image {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: #94a3b8;
}

.related-products-grid .product-info {
  padding: 12px;
}

.related-products-grid .product-name {
  font-size: 14px;
  font-weight: 600;
  color: #1e293b;
  margin: 0 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.related-products-grid .product-cas {
  font-size: 12px;
  color: #64748b;
  margin: 0 0 8px;
}

.related-products-grid .product-price .price-value {
  font-size: 16px;
  font-weight: 700;
  color: #1a7f37;
}

/* 产品卡片收藏按钮 */
.product-card {
  position: relative;
}

.product-card-favorite {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  color: #999;
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.product-card-favorite:hover {
  color: #f43f5e;
  background: #fff;
}

.product-card-favorite.active {
  color: #f43f5e;
}

.product-card-favorite.active i {
  font-weight: 900;
}

.product-card-favorite i {
  font-size: 14px;
}

@media (max-width: 768px) {
  .product-detail-pagination {
    flex-direction: column;
    align-items: stretch;
  }

  .product-pagination-prev,
  .product-pagination-next {
    min-width: auto;
    text-align: center;
  }

  .product-pagination-info {
    padding: 8px 0;
    text-align: center;
  }

  .product-pagination-next .pagination-btn {
    justify-content: center;
  }

  .product-pagination-prev .pagination-btn {
    justify-content: center;
  }
}
