/* ── 产品页Banner ── */
.product-banner {
  position: relative;
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary) 0%, #1a4d7a 100%);
}

.product-banner-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1;
}

.product-banner-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.3;
}

.product-banner-overlay {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.2);
}

.product-banner-content {
  text-align: center;
  color: #fff;
  padding: 0 20px;
}

.product-banner-title {
  font-size: 2.8em;
  font-weight: 700;
  margin: 0 0 12px 0;
  letter-spacing: 0.08em;
  text-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.product-banner-subtitle {
  font-size: 1.15em;
  margin: 0;
  opacity: 0.95;
  font-weight: 400;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
  .product-banner {
    height: 220px;
  }
  .product-banner-title {
    font-size: 2em;
  }
  .product-banner-subtitle {
    font-size: 0.95em;
  }
}

/* ── 产品页：左侧分类树 + 右侧产品网格 ── */

.product-container {
  display: flex;
  max-width: 1400px;
  margin: 0 auto;
  padding: 24px 24px 60px;
  gap: 28px;
  min-height: 600px;
}

/* ── 左侧分类侧边栏 ── */
.product-sidebar {
  width: 230px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(var(--primary-rgb), 0.1);
  overflow-y: auto;
  align-self: flex-start;
  position: sticky;
  top: 80px;
  max-height: calc(100vh - 100px);
}

.sidebar-title {
  font-size: 1.1em;
  font-weight: 700;
  color: var(--primary);
  padding: 16px 18px 12px;
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.1);
  letter-spacing: 0.04em;
}

.sidebar-tree {
  list-style: none;
  margin: 0;
  padding: 8px 0;
}

.sidebar-tree .tree-l1 {
  border-bottom: 1px solid rgba(var(--primary-rgb), 0.06);
}
.sidebar-tree .tree-l1:last-child {
  border-bottom: none;
}

.tree-l1-label {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 18px;
  font-size: 0.95em;
  font-weight: 600;
  color: #333;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
  user-select: none;
}
.tree-l1-label:hover {
  background: rgba(var(--primary-rgb), 0.06);
}
.tree-l1-label.active {
  color: var(--accent);
}

.tree-l1-arrow {
  font-size: 0.6em;
  transition: transform 0.25s;
  color: #aaa;
  margin-left: 6px;
}
.tree-l1.open .tree-l1-arrow {
  transform: rotate(90deg);
}

.tree-l1-children {
  list-style: none;
  padding: 0 0 6px 0;
  margin: 0;
  display: none;
}
.tree-l1.open .tree-l1-children {
  display: block;
}

.tree-l2-item {
  padding: 9px 18px 9px 32px;
  font-size: 0.88em;
  color: #666;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  border-left: 3px solid transparent;
}
.tree-l2-item:hover {
  background: rgba(var(--primary-rgb), 0.04);
  color: #333;
}
.tree-l2-item.active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: rgba(var(--primary-rgb), 0.06);
  font-weight: 600;
}

/* ── 右侧产品主区域 ── */
.product-main {
  flex: 1;
  min-width: 0;
}

.product-main-header {
  display: flex;
  align-items: baseline;
  gap: 12px;
  margin-bottom: 20px;
  padding-bottom: 14px;
  border-bottom: 2px solid rgba(var(--primary-rgb), 0.15);
}

.product-main-title {
  font-size: 1.4em;
  font-weight: 700;
  color: var(--primary);
  margin: 0;
}

.product-main-count {
  font-size: 0.85em;
  color: #999;
}

/* ── 产品网格 ── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  min-height: 300px;
}

.product-card {
  background: #fff;
  border-radius: 10px;
  border: 1px solid rgba(var(--primary-rgb), 0.12);
  overflow: hidden;
  cursor: pointer;
  transition: border-color 0.25s, box-shadow 0.25s, transform 0.25s;
  display: flex;
  flex-direction: column;
}
.product-card:hover {
  border-color: rgba(var(--primary-rgb), 0.35);
  box-shadow: 0 6px 20px rgba(var(--primary-rgb), 0.1);
  transform: translateY(-3px);
}

.product-card-img {
  width: 100%;
  height: 180px;
  background: #fafafa;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  padding: 14px;
  box-sizing: border-box;
}
.product-card-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  transition: transform 0.35s;
}
.product-card:hover .product-card-img img {
  transform: scale(1.06);
}

.product-card-body {
  padding: 14px 16px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.product-card-name {
  font-size: 1em;
  font-weight: 700;
  color: #222;
  margin: 0;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-card-desc {
  font-size: 0.82em;
  color: #888;
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0;
}

.product-card-footer {
  margin-top: auto;
  padding-top: 10px;
  border-top: 1px solid rgba(var(--primary-rgb), 0.08);
  display: flex;
  gap: 10px;
}
.product-card-link {
  font-size: 0.8em;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
  transition: opacity 0.2s;
}
.product-card-link:hover {
  opacity: 0.7;
}

/* ── 空状态 ── */
.product-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #aaa;
  font-size: 1em;
}

/* ── 分页 ── */
.product-pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  margin-top: 28px;
  padding: 16px 0;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 6px;
  border: 1px solid rgba(var(--primary-rgb), 0.15);
  background: #fff;
  color: #555;
  font-size: 0.88em;
  cursor: pointer;
  transition: all 0.2s;
  user-select: none;
}
.page-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}
.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
}
.page-btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* ── 响应式 ── */
@media (max-width: 1100px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}
@media (max-width: 800px) {
  .product-container {
    flex-direction: column;
    margin-top: 60px;
    padding: 12px 12px 40px;
  }
  .product-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}
@media (max-width: 500px) {
  .product-grid {
    grid-template-columns: 1fr;
  }
}
