/* 优化后的产品卡片组件样式 */
/* 专为产品列表页面设计的现代化产品卡片样式 */

.product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: var(--border-radius-lg);
  overflow: hidden;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  position: relative;
  transition: all 0.3s ease;
  transform: translateY(0);
}

.products-grid:not(.list-view) .product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
  border-color: var(--primary-color);
}

/* 产品图片容器 */
.product-image-wrapper {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary-color);
  border-radius: var(--border-radius) var(--border-radius) 0 0;
}

.product-image {
  width: 100%;
  height: 220px;
  object-fit: cover;
  transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  transform: scale(1);
}

.products-grid:not(.list-view) .product-card:hover .product-image {
  transform: scale(1.05);
  filter: brightness(1.05) contrast(1.05);
}

/* 快速查看按钮 */
.quick-view-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.9);
  border: none;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s ease;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
  z-index: 10;
}

.product-card:hover .quick-view-btn {
  opacity: 1;
  transform: translateY(0);
}

.quick-view-btn:hover {
  background: white;
  transform: scale(1.1);
}

.quick-view-btn i {
  color: var(--text-color);
  font-size: 0.9rem;
}

/* 产品标签 */
.product-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 0.25rem 0.5rem;
  border-radius: var(--border-radius);
  font-size: 0.75rem;
  font-weight: 600;
  z-index: 5;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.featured-badge {
  background: linear-gradient(135deg, #fbbf24, #f59e0b);
  color: white;
}

.discount-badge {
  background: linear-gradient(135deg, #ef4444, #dc2626);
  color: white;
}

.out-of-stock-badge {
  background: linear-gradient(135deg, #6b7280, #4b5563);
  color: white;
  top: 40px;
}

/* 产品信息区域 */
.product-info {
  padding: 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

/* 产品名称 */
.product-name {
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: var(--text-color);
  font-size: 1.1rem;
  line-height: 1.3;
}

.product-name a {
  color: inherit;
  text-decoration: none;
  transition: color 0.3s ease;
}

.product-name a:hover {
  color: var(--primary-color);
}

/* 产品描述 */
.product-description {
  color: var(--text-secondary-color);
  font-size: 0.9rem;
  line-height: 1.5;
  margin-bottom: 1rem;
  flex: 1;
}

/* 产品元数据 */
.product-meta {
  margin-top: auto;
}

.product-price-section {
  margin-bottom: 1.25rem;
}

.price-section {
  margin-bottom: 0.75rem;
}

/* 产品价格 */
.product-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--primary-color);
  background: linear-gradient(45deg, var(--primary-color), var(--primary-hover-color));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

.product-compare-price {
  text-decoration: line-through;
  color: var(--text-secondary-color);
  font-size: 0.9rem;
  margin-left: 0.5rem;
}

.product-code,
.stock-info {
  color: var(--text-secondary-color);
  font-size: 0.85rem;
  margin-bottom: 0.25rem;
}

/* 产品操作按钮 */
.product-actions {
  display: flex;
  gap: 0.75rem;
  margin-top: 1rem;
}

.view-details-btn,
.inquiry-btn,
.add-to-cart {
  flex: 1;
  min-width: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.6rem 1rem;
  font-size: 0.9rem;
  border-radius: var(--border-radius);
  transition: all 0.3s ease;
  text-decoration: none;
  text-align: center;
}

.view-details-btn {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.view-details-btn:hover {
  background: var(--bg-secondary-color);
  border-color: var(--primary-color);
}

.inquiry-btn {
  background: var(--card-bg);
  color: var(--text-color);
  border: 1px solid var(--border-color);
}

.inquiry-btn:hover {
  background: var(--bg-secondary-color);
  border-color: var(--primary-color);
}

.add-to-cart {
  background: var(--primary-color);
  color: white;
  border: none;
}

.add-to-cart:hover {
  background: var(--primary-hover-color);
}

.btn-text {
  display: inline;
}

/* 列表视图特殊样式 */
.products-grid.list-view .product-card {
  flex-direction: row;
}

.products-grid.list-view .product-image-wrapper {
  flex: 0 0 250px;
  height: auto;
  border-radius: var(--border-radius) 0 0 var(--border-radius);
}

.products-grid.list-view .product-image {
  height: 100%;
  object-fit: cover;
}

.products-grid.list-view .product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 1.5rem;
}

.products-grid.list-view .product-meta {
  margin-top: auto;
}

/* 响应式设计 */
@media (max-width: 1200px) {
  .product-image {
    height: 200px;
  }
}

@media (max-width: 992px) {
  .product-image {
    height: 180px;
  }
  
  .product-actions {
    flex-direction: column;
  }
  
  .view-details-btn,
  .inquiry-btn,
  .add-to-cart {
    width: 100%;
  }
}

@media (max-width: 768px) {
  .product-image {
    height: 160px;
  }
  
  .product-info {
    padding: 1rem;
  }
  
  .product-name {
    font-size: 1rem;
  }
  
  .product-price {
    font-size: 1.1rem;
  }
  
  /* 优化移动端触摸体验 */
  .view-details-btn,
  .inquiry-btn,
  .add-to-cart {
    min-height: 44px; /* 确保足够的触摸区域 */
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
  
  .quick-view-btn {
    width: 44px;
    height: 44px;
  }
}

@media (max-width: 576px) {
  .products-grid.list-view .product-card,
  .products-grid:not(.list-view) .product-card {
    flex-direction: column;
  }
  
  .products-grid.list-view .product-image-wrapper {
    flex: none;
    height: 200px;
    border-radius: var(--border-radius) var(--border-radius) 0 0;
  }
  
  .products-grid.list-view .product-info {
    padding: 1rem;
  }
  
  .product-image {
    height: 200px;
  }
  
  .product-actions {
    flex-direction: column;
  }
  
  .view-details-btn,
  .inquiry-btn,
  .add-to-cart {
    width: 100%;
    min-height: 44px; /* 确保足够的触摸区域 */
    font-size: 1rem;
    padding: 0.75rem 1rem;
  }
  
  /* 优化移动端产品名称显示 */
  .product-name {
    font-size: 1.1rem;
    line-height: 1.4;
  }
  
  /* 优化价格显示 */
  .product-price {
    font-size: 1.25rem;
  }
  
  /* 优化产品描述 */
  .product-description {
    font-size: 0.95rem;
    line-height: 1.5;
  }
}

/* 配色方案支持 */
[data-color-scheme] .product-card:hover {
  border-color: var(--primary-color);
  box-shadow: 0 5px 20px rgba(0, 123, 255, 0.15);
}

/* 暗色主题支持 */
[data-theme="dark"] .product-card {
  background: var(--card-bg);
  border-color: var(--border-color);
}

/* 兼容性支持 */
.no-css-variables .product-card {
  background-color: #ffffff;
  border: 1px solid #dee2e6;
}

.no-css-variables .product-card:hover {
  border-color: #007bff;
}