/**
 * css/product-catalog.css — 产品列表页与详情页样式
 * 配合 js/components/product-catalog.js 使用
 */

/* ========== 分类标签栏 ========== */
.pc-category-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

.pc-cat-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 18px;
  border: 1px solid #dee2e6;
  border-radius: 24px;
  background: #fff;
  color: #495057;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.25s ease;
}

.pc-cat-btn:hover {
  border-color: var(--primary-color, #033b79);
  color: var(--primary-color, #033b79);
  background: #f0f4ff;
}

.pc-cat-btn.active {
  background: var(--primary-color, #033b79);
  border-color: var(--primary-color, #033b79);
  color: #fff;
}

.pc-cat-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 20px;
  padding: 0 6px;
  border-radius: 10px;
  background: rgba(0, 0, 0, 0.08);
  font-size: 11px;
  font-weight: 600;
}

.pc-cat-btn.active .pc-cat-count {
  background: rgba(255, 255, 255, 0.25);
}

/* ========== 产品卡片网格 ========== */
.pc-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.pc-card-wrapper {
  display: block;
}

/* ========== 产品卡片 ========== */
.pc-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border: 1px solid #e9ecef;
  border-radius: 14px;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
  height: 100%;
}

.pc-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(3, 59, 121, 0.12);
  border-color: var(--primary-color, #033b79);
}

.pc-card-img {
  position: relative;
  width: 100%;
  height: 200px;
  background: #f1f3f5;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.pc-card-img img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 16px;
  transition: transform 0.4s ease;
}

.pc-card:hover .pc-card-img img {
  transform: scale(1.05);
}

.pc-img-placeholder::before {
  content: "暂无图片";
  color: #adb5bd;
  font-size: 14px;
}

.pc-card-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 18px 20px 16px;
}

.pc-card-model {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-color, #033b79);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.pc-card-name {
  font-size: 17px;
  font-weight: 700;
  color: #1a1b1c;
  margin: 0 0 8px 0;
  line-height: 1.3;
}

.pc-card-summary {
  font-size: 13px;
  color: #6b7280;
  line-height: 1.6;
  margin: 0 0 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========== 卡片参数 ========== */
.pc-params {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 12px;
  padding: 10px 12px;
  background: #f8f9fa;
  border-radius: 8px;
}

.pc-param {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-size: 12px;
  line-height: 1.5;
}

.pc-param-label {
  color: #868e96;
  flex-shrink: 0;
  margin-right: 8px;
}

.pc-param-value {
  color: #343a40;
  font-weight: 500;
  text-align: right;
}

/* ========== 卡片标签 ========== */
.pc-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.pc-tag {
  display: inline-block;
  padding: 3px 10px;
  background: #eef2ff;
  color: #4f46e5;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 500;
}

/* ========== 卡片底部 ========== */
.pc-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid #f1f3f5;
}

.pc-detail-btn {
  font-size: 14px;
  font-weight: 600;
  color: var(--primary-color, #033b79);
}

.pc-arrow {
  width: 16px;
  height: 16px;
  color: var(--primary-color, #033b79);
  transition: transform 0.25s ease;
}

.pc-card:hover .pc-arrow {
  transform: translateX(4px);
}

/* ========== 空状态 ========== */
.pc-empty {
  text-align: center;
  padding: 60px 20px;
  color: #868e96;
}

.pc-empty svg {
  width: 48px;
  height: 48px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.pc-empty p {
  font-size: 16px;
  font-weight: 500;
  color: #495057;
  margin: 0 0 8px 0;
}

.pc-empty span {
  font-size: 13px;
}

/* ========== 列表页头部 ========== */
.pc-page-header {
  padding: 48px 0 32px;
  text-align: center;
}

.pc-page-header .pc-breadcrumb {
  font-size: 13px;
  color: #868e96;
  margin-bottom: 12px;
}

.pc-page-header .pc-breadcrumb a {
  color: #868e96;
  text-decoration: none;
}

.pc-page-header .pc-breadcrumb a:hover {
  color: var(--primary-color, #033b79);
}

.pc-page-header h1 {
  font-size: 32px;
  font-weight: 700;
  color: #1a1b1c;
  margin: 0 0 12px 0;
}

.pc-page-header .pc-brand-en {
  font-size: 14px;
  color: #868e96;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 16px;
}

.pc-page-header .pc-summary {
  font-size: 15px;
  color: #6b7280;
  max-width: 640px;
  margin: 0 auto;
  line-height: 1.7;
}

.pc-page-stats {
  display: flex;
  justify-content: center;
  gap: 32px;
  margin-top: 24px;
}

.pc-stat {
  text-align: center;
}

.pc-stat-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--primary-color, #033b79);
}

.pc-stat-label {
  font-size: 12px;
  color: #868e96;
  margin-top: 2px;
}

/* ========== 详情页动态内容 ========== */
.pd-detail-loading {
  text-align: center;
  padding: 80px 20px;
  color: #868e96;
}

.pd-detail-loading .spinner {
  display: inline-block;
  width: 32px;
  height: 32px;
  border: 3px solid #e9ecef;
  border-top-color: var(--primary-color, #033b79);
  border-radius: 50%;
  animation: pc-spin 0.8s linear infinite;
  margin-bottom: 16px;
}

@keyframes pc-spin {
  to { transform: rotate(360deg); }
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
  .pc-grid {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }

  .pc-card-img {
    height: 160px;
  }

  .pc-page-header h1 {
    font-size: 24px;
  }

  .pc-page-stats {
    gap: 20px;
  }

  .pc-category-bar {
    padding: 12px;
    gap: 8px;
  }

  .pc-cat-btn {
    padding: 6px 14px;
    font-size: 13px;
  }
}

@media (max-width: 480px) {
  .pc-grid {
    grid-template-columns: 1fr;
  }
}
