/* ========================================
   中草集官网 — 产品中心样式（4大分类版）
   ======================================== */

/* ---------- 页面顶部标题区 ---------- */
.page-hero {
  padding: 130px 0 60px;
  text-align: center;
  background: linear-gradient(180deg, var(--color-bg-warm) 0%, var(--color-bg) 100%);
}

.page-hero h1 {
  font-family: var(--font-serif);
  font-size: 40px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 16px;
  letter-spacing: 4px;
}

.page-hero .section-tag {
  margin-bottom: 12px;
}

.page-hero-desc {
  font-size: 16px;
  color: var(--color-text-secondary);
  line-height: 1.8;
  max-width: 560px;
  margin: 0 auto;
}

.page-hero--banner {
  padding: 82px 0 0;
  line-height: 0;
  background: none;
}

.page-hero--banner img {
  width: 100%;
  height: auto;
  display: block;
}

/* ---------- 产品区块通用 ---------- */
.product-section {
  padding: 60px 0;
}

/* 4个区块交替背景 */
.product-section--ginseng { background: var(--color-bg); }
.product-section--herbs   { background: var(--color-bg-warm); }
.product-section--luxury  { background: var(--color-bg); }
.product-section--others  { background: var(--color-bg-warm); }

/* ---------- 标准产品卡片（所有区块通用） ---------- */
.product-section .product-card {
  background: var(--color-bg);
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border-light);
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  position: relative;
  text-decoration: none;
  color: inherit;
}

.product-section .product-card::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: var(--radius-lg);
  padding: 1.5px;
  background: linear-gradient(135deg, transparent 40%, transparent 60%);
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  transition: background 0.4s ease;
  pointer-events: none;
  z-index: 1;
}

.product-section .product-card:hover::before {
  background: linear-gradient(135deg, #C9A96E 0%, #E8D5B0 50%, #C9A96E 100%);
}

.product-section .product-card:hover {
  box-shadow: 0 12px 40px rgba(201, 169, 110, 0.15);
  transform: translateY(-6px);
  border-color: transparent;
}

/* 产品图片区 */
.product-section .product-img-wrap {
  position: relative;
  width: 100%;
  padding-bottom: 75%;
  overflow: hidden;
}

.product-section .product-img-wrap img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
  display: block;
  transition: transform var(--transition);
}

.product-section .product-card:hover .product-img-wrap img {
  transform: scale(1.05);
}

/* 产品信息区 */
.product-section .product-info {
  padding: 16px 14px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.product-section .product-info h3 {
  font-family: var(--font-serif);
  font-size: 17px;
  font-weight: 700;
  color: #111;
  margin-bottom: 8px;
}

.product-section .product-info p {
  font-size: 14px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  flex: 1;
}

.product-section .product-title-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 6px;
}

.product-section .product-title-row h3 {
  margin-bottom: 0;
}

.product-section .product-link {
  display: inline-flex;
  align-items: center;
  font-size: 13px;
  color: var(--color-accent);
  font-weight: 500;
  white-space: nowrap;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  gap: 0;
}

.product-section .product-card:hover .product-link {
  color: var(--color-accent-dark);
  gap: 6px;
  transform: translateX(4px);
}

/* ========================================
   网格布局：5种尺寸
   ======================================== */

/* 1. 大卡片网格（参类甄选 3×2） */
.product-grid--large {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

/* 2. 三列网格（花木润养 3列 / 日常护理 3列） */
.product-grid--triple {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* 3. 两列迷你网格（本草净肌 2列居中） */
.product-grid--mini {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 28px;
  max-width: 700px;
  margin: 0 auto;
}

/* 4. 单列居中小卡（水润基础 1列） */
.product-grid--solo {
  display: grid;
  grid-template-columns: 1fr;
  gap: 28px;
  max-width: 340px;
  margin: 0 auto;
}

/* 5. 四列网格（明星单品详情页 4列） */
.product-grid--quad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
}

/* ========================================
   大卡片专属样式（参类甄选）
   ======================================== */
.product-card--large {
  border-radius: var(--radius-xl) !important;
}

.product-card--large::before {
  border-radius: var(--radius-xl) !important;
}

.product-card--large:hover {
  box-shadow: 0 16px 48px rgba(201, 169, 110, 0.2);
  transform: translateY(-8px);
}

.product-card--large .product-img-wrap {
  padding-bottom: 85%;
  background: linear-gradient(180deg, #fafafa 0%, #f5f5f5 100%);
}

.product-card--large .product-img-wrap img {
  object-fit: contain;
  padding: 20px;
}

.product-card--large:hover .product-img-wrap img {
  transform: scale(1.08);
}

.product-card--large .product-info {
  padding: 20px 22px 24px;
}

.product-card--large .product-info h3 {
  font-size: 20px;
}

.product-card--large .product-info p {
  margin-bottom: 14px;
}

/* ========================================
   卡片角标（定位标签）
   ======================================== */
.product-card-badge {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 3;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #C9A96E, #A8893F);
  padding: 5px 12px;
  border-radius: 20px;
  letter-spacing: 1px;
  box-shadow: 0 2px 10px rgba(201, 169, 110, 0.3);
}

.product-card-badge--green {
  background: linear-gradient(135deg, #5B8C5A, #3D6B3C);
  box-shadow: 0 2px 10px rgba(91, 140, 90, 0.3);
}

.product-card-badge--purple {
  background: linear-gradient(135deg, #8B6BAE, #6B4D8E);
  box-shadow: 0 2px 10px rgba(139, 107, 174, 0.3);
}

.product-card-badge--red {
  background: linear-gradient(135deg, #D4887A, #B85C4A);
  box-shadow: 0 2px 10px rgba(212, 136, 122, 0.3);
}

.product-card-badge--blue {
  background: linear-gradient(135deg, #6BA3BE, #4A7D9E);
  box-shadow: 0 2px 10px rgba(107, 163, 190, 0.3);
}

.product-card-badge--gold {
  background: linear-gradient(135deg, #D4A853, #B8892E);
  box-shadow: 0 2px 10px rgba(212, 168, 83, 0.3);
}

/* ========================================
   明星单品入口卡片
   ======================================== */
.product-card--star-entry {
  background: linear-gradient(135deg, #FFF9F0 0%, #FFF 100%) !important;
  border-color: #E8D5B0 !important;
}

.product-card--star-entry .product-img-wrap {
  background: linear-gradient(180deg, #FFF9F0 0%, #FFF 100%);
}

/* ========================================
   明星单品价格
   ======================================== */
.product-price-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px dashed var(--color-border-light);
}

.product-price-vip {
  font-family: var(--font-serif);
  font-size: 20px;
  font-weight: 700;
  color: #C44D4D;
  letter-spacing: 1px;
}

.product-price-vip::before {
  content: '会员价 ';
  font-size: 11px;
  font-weight: 500;
  color: #C44D4D;
  vertical-align: middle;
  margin-right: 2px;
}

.product-price-retail {
  font-size: 13px;
  color: var(--color-text-light);
  text-decoration: line-through;
}

/* ========================================
   产品标签行
   ======================================== */
.product-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.product-tag {
  display: inline-block;
  font-size: 11px;
  font-weight: 500;
  color: var(--color-accent-dark);
  background: linear-gradient(135deg, rgba(201, 169, 110, 0.1) 0%, rgba(201, 169, 110, 0.04) 100%);
  border: 1px solid rgba(201, 169, 110, 0.2);
  padding: 3px 10px;
  border-radius: 14px;
  white-space: nowrap;
}

/* ========================================
   左侧分类导航栏
   ======================================== */
.products-layout {
  display: flex;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  padding-left: 16px;
  box-sizing: border-box;
}

.products-main-area {
  flex: 1;
  min-width: 0;
  width: 100%;
}

.products-left-nav {
  position: sticky;
  top: calc(var(--header-height) + 18px);
  width: 200px;
  flex-shrink: 0;
  z-index: 90;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  padding: 8px 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

.products-left-nav-inner {
  display: flex;
  flex-direction: column;
  padding: 0 8px;
}

.products-left-nav-link {
  position: relative;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 16px;
  border-radius: var(--radius-sm);
  color: var(--color-text-secondary);
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-left-nav-link:hover,
.products-left-nav-link.active {
  color: var(--color-accent-dark);
  background: rgba(201, 169, 110, 0.12);
  border: 1px solid var(--color-accent-light);
  font-weight: 600;
}

.products-left-nav-link.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--color-accent);
  border-radius: 0 2px 2px 0;
}

.products-left-nav-icon {
  font-size: 16px;
  width: 22px;
  text-align: center;
  flex-shrink: 0;
}

/* 详情页中的左侧导航 — fixed定位，不改变原有页面布局 */
.products-left-nav--detail {
  position: fixed;
  left: 16px;
  top: calc(var(--header-height) + 18px);
  width: 200px;
  z-index: 101;
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: 0 8px 30px rgba(0,0,0,0.1);
  padding: 8px 0;
  box-sizing: border-box;
  font-family: var(--font-sans);
}

/* 左侧导航分类标题（选中状态） */
.products-nav-cat.active {
  color: var(--color-accent-dark);
  background: rgba(201, 169, 110, 0.08);
  border-left: 3px solid var(--color-accent-light);
  font-weight: 600;
}

.products-nav-group {
  margin-bottom: 4px;
}

.products-nav-cat {
  font-weight: 600;
  padding: 10px 16px;
  margin-bottom: 2px;
}

.products-nav-sublinks {
  display: flex;
  flex-direction: column;
  padding: 0 0 4px 28px;
  border-left: 1px solid var(--color-border-light);
  margin-left: 16px;
}

.products-nav-sub {
  display: block;
  padding: 6px 12px;
  font-size: 13px;
  color: var(--color-text-secondary);
  text-decoration: none;
  border-radius: 4px;
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.products-nav-sub.active {
  color: var(--color-accent-dark);
  background: rgba(201, 169, 110, 0.12);
  border: 1px solid var(--color-accent-light);
  font-weight: 600;
}


/* ========================================
   响应式适配
   ======================================== */

/* 平板 */
@media (max-width: 1024px) {
  .products-left-nav {
    display: none;
  }

  .products-layout {
    display: block;
  }

  .page-hero {
    padding: 110px 0 48px;
  }

  .page-hero h1 {
    font-size: 32px;
  }

  /* 参类甄选 → 2列 */
  .product-grid--large {
    grid-template-columns: repeat(2, 1fr);
    gap: 24px;
  }

  .product-card--large .product-info h3 {
    font-size: 18px;
  }

  /* 三列 → 2列 */
  .product-grid--triple {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* 四列 → 2列 */
  .product-grid--quad {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }

  /* 两列居中放宽 */
  .product-grid--mini {
    max-width: 100%;
  }
}

/* 手机 */
@media (max-width: 768px) {
  .page-hero {
    padding: 90px 0 36px;
  }

  .page-hero h1 {
    font-size: 28px;
    letter-spacing: 2px;
  }

  .page-hero-desc {
    font-size: 14px;
  }

  .product-section {
    padding: 40px 0;
  }

  /* 参类甄选 → 2列 */
  .product-grid--large {
    grid-template-columns: repeat(2, 1fr);
    gap: 14px;
  }

  .product-card--large .product-img-wrap {
    padding-bottom: 90%;
  }

  .product-card--large .product-info {
    padding: 14px 12px 16px;
  }

  .product-card--large .product-info h3 {
    font-size: 15px;
  }

  .product-card--large .product-info p {
    font-size: 12px;
    margin-bottom: 10px;
  }

  .product-card-badge {
    top: 8px;
    right: 8px;
    font-size: 10px;
    padding: 4px 8px;
  }

  .product-tags {
    gap: 4px;
  }

  .product-tag {
    font-size: 10px;
    padding: 2px 8px;
  }

  /* 其他网格统一 → 2列 */
  .product-grid--triple,
  .product-grid--mini,
  .product-grid--quad {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    max-width: 100%;
  }

  /* 单列 → 全宽 */
  .product-grid--solo {
    max-width: 100%;
  }
}

/* 页面首图响应式 */
@media (max-width: 1024px) {
  .page-hero--banner img {
    max-height: 420px;
  }
}

@media (max-width: 768px) {
  .page-hero--banner img {
    max-height: 320px;
  }
}

@media (max-width: 480px) {
  .page-hero--banner img {
    max-height: 240px;
  }
}
