/* ==========================================================================
   Products Page Styles (产品列表页面专属样式)
   Header / Footer / 通用布局样式继承自 common.css
   配色沿用全站金色系：--gold (#e5b54d)，深金 #dca32c / #b8860b
   ========================================================================== */

:root {
  --products-gold: #d4952c;
  --products-gold-deep: #b8860b;
  --products-gold-bright: #f5cb66;
  --products-ink: #221d13;
  --products-gray: #6e6759;
  --products-cream: #faf6ec;
  --products-line: #e9dfc8;
}

/* 页面主体使用浅色背景，与深色 header/footer 形成层次 */
.products-page main {
  background: #ffffff;
  color: var(--products-ink);
}

/* -------------------------------------------------------------
   Shared: Reveal Animation & Capsule Button (与首页一致)
------------------------------------------------------------- */
.reveal-on-scroll {
  opacity: 0;
  transform: translateY(48px);
  transition: opacity 1.25s cubic-bezier(0.16, 1, 0.3, 1), transform 1.25s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, transform;
}

.reveal-on-scroll.is-revealed {
  opacity: 1;
  transform: translateY(0) translateX(0) scale(1);
}

@media (prefers-reduced-motion: reduce) {
  .reveal-on-scroll {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
}

.btn-primary-capsule {
  position: relative;
  overflow: hidden;
  z-index: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  height: 44px;
  padding: 0 32px;
  border: 1.5px solid #dca32c;
  border-radius: 22px;
  background: #ffffff;
  color: #dca32c;
  font-size: 13.5px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 4px 14px rgba(220, 163, 44, 0.12);
  transition: color 0.45s ease, border-color 0.45s ease, transform 0.35s ease, box-shadow 0.35s ease;
}

.btn-primary-capsule::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #dca32c, #f5cb66);
  transform: translateX(-101%);
  transition: transform 0.75s cubic-bezier(0.16, 1, 0.3, 1);
  z-index: 1;
}

.btn-primary-capsule:hover::before {
  transform: translateX(0);
}

.btn-primary-capsule:hover {
  color: #ffffff;
  border-color: #dca32c;
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(220, 163, 44, 0.35);
}

.btn-primary-capsule span,
.btn-primary-capsule i {
  position: relative;
  z-index: 2;
}

/* -------------------------------------------------------------
   1. Products Hero Banner (首屏横幅)
------------------------------------------------------------- */
.products-hero {
  position: relative;
  min-height: clamp(320px, 36vw, 520px);
  display: flex;
  align-items: center;
  background: url("../images/aluminum-banner.png") center center / cover no-repeat, #f7f0dd;
}

.products-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(250, 246, 236, 0.88) 0%, rgba(250, 246, 236, 0.45) 45%, rgba(250, 246, 236, 0) 75%);
  pointer-events: none;
}

.products-hero__inner {
  position: relative;
  z-index: 1;
  padding-top: clamp(40px, 5vw, 72px);
  padding-bottom: clamp(40px, 5vw, 72px);
}

.products-hero__title {
  margin: 0 0 16px;
  font-size: clamp(44px, 5.4vw, 76px);
  font-weight: 800;
  letter-spacing: 3px;
  color: var(--products-gold-deep);
  text-shadow: 0 2px 12px rgba(255, 255, 255, 0.65);
}

.products-hero__sub {
  margin: 0;
  max-width: 560px;
  font-size: clamp(15px, 1.4vw, 19px);
  font-weight: 600;
  letter-spacing: 0.6px;
  color: var(--products-ink);
}

/* -------------------------------------------------------------
   2. 主体布局 (侧边栏 + 产品网格)
------------------------------------------------------------- */
.products-main {
  padding: clamp(48px, 5vw, 80px) 0 clamp(56px, 6vw, 96px);
  background: #ffffff;
}

.products-main__grid {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(28px, 3vw, 48px);
  align-items: start;
}

/* --- 左侧边栏：产品分类 --- */
.products-sidebar {
  display: flex;
  flex-direction: column;
  gap: 28px;
}

.sidebar-category__title {
  margin: 0;
  padding: 16px 22px;
  background: linear-gradient(135deg, var(--products-gold), var(--products-gold-deep));
  color: #ffffff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.6px;
  border-radius: 8px 8px 0 0;
}

.sidebar-category__list {
  margin: 0;
  padding: 0;
  list-style: none;
  border: 1px solid var(--products-line);
  border-top: none;
  border-radius: 0 0 8px 8px;
  overflow: hidden;
}

.sidebar-category__list li + li {
  border-top: 1px solid var(--products-line);
}

/* 一级分类项 */
.cat-item__head {
  display: flex;
  align-items: center;
}

.sidebar-category__list a {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 22px;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--products-ink);
  text-decoration: none;
  transition: color 0.3s ease, background 0.3s ease, padding-left 0.3s ease;
}

.cat-item__head a {
  flex: 1;
  min-width: 0;
}

.sidebar-category__list a::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--products-line);
  transition: background 0.3s ease;
}

.sidebar-category__list a:hover {
  color: var(--products-gold);
  background: var(--products-cream);
  padding-left: 28px;
}

.sidebar-category__list a:hover::before {
  background: var(--products-gold);
}

.sidebar-category__list a.is-active {
  position: relative;
  color: var(--products-gold-deep);
  background: linear-gradient(90deg, rgba(212, 149, 44, 0.16), rgba(212, 149, 44, 0.03));
  font-weight: 700;
}

.sidebar-category__list a.is-active::before {
  background: var(--products-gold);
}

/* 选中项左侧金色指示条 */
.sidebar-category__list a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  border-radius: 0 2px 2px 0;
  background: linear-gradient(180deg, var(--products-gold-bright), var(--products-gold-deep));
}

/* 包含选中子项的父分类自动高亮 (渐进增强) */
.cat-item:has(.cat-submenu a.is-active) > .cat-item__head > a {
  color: var(--products-gold-deep);
  font-weight: 700;
}

.cat-item:has(.cat-submenu a.is-active) > .cat-item__head .cat-toggle {
  color: var(--products-gold);
}

/* 展开/收起切换按钮 */
.cat-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  flex: none;
  border: none;
  background: transparent;
  color: var(--products-gray);
  font-size: 12px;
  cursor: pointer;
  transition: color 0.3s ease;
}

.cat-toggle i {
  transition: transform 0.35s ease;
}

.cat-toggle:hover {
  color: var(--products-gold);
}

.cat-item.is-open > .cat-item__head .cat-toggle i {
  transform: rotate(180deg);
}

.cat-item.is-open > .cat-item__head .cat-toggle {
  color: var(--products-gold);
}

/* 二级子分类菜单 (max-height 过渡实现展开动画) */
.cat-submenu {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 0;
  overflow: hidden;
  background: #fdfaf2;
  transition: max-height 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.cat-item.is-open > .cat-submenu {
  max-height: 420px;
}

.cat-submenu li + li {
  border-top: none;
}

.cat-submenu a {
  padding: 10px 22px 10px 40px;
  font-size: 13.5px;
  font-weight: 500;
}

.cat-submenu a::before {
  width: 5px;
  height: 5px;
}

.cat-submenu a:hover {
  padding-left: 46px;
}

.cat-submenu a.is-active {
  background: transparent;
  color: var(--products-gold-deep);
}

/* --- 左侧边栏：定制方案卡片 --- */
.sidebar-custom {
  border: 1px solid var(--products-line);
  border-radius: 10px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(184, 134, 11, 0.08);
}

.sidebar-custom__media {
  height: 170px;
  overflow: hidden;
}

.sidebar-custom__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.sidebar-custom:hover .sidebar-custom__media img {
  transform: scale(1.06);
}

.sidebar-custom__body {
  padding: 22px;
}

.sidebar-custom__title {
  margin: 0 0 10px;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: 1.4px;
  color: var(--products-ink);
}

.sidebar-custom__body p {
  margin: 0 0 18px;
  font-size: 13.5px;
  line-height: 1.7;
  color: var(--products-gray);
}

.sidebar-custom__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--products-gold), var(--products-gold-deep));
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.6px;
  text-decoration: none;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.sidebar-custom__btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(212, 149, 44, 0.4);
}

/* --- 右侧内容区 --- */
.products-breadcrumb {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 8px;
  margin-bottom: 22px;
  font-size: 13.5px;
}

.products-breadcrumb a {
  color: var(--products-gray);
  text-decoration: none;
  transition: color 0.3s ease;
}

.products-breadcrumb a:hover {
  color: var(--products-gold);
}

.breadcrumb-sep {
  color: var(--products-gold);
}

.breadcrumb-current {
  color: var(--products-gold-deep);
  font-weight: 700;
}

.products-content__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  flex-wrap: wrap;
  margin-bottom: 30px;
}

.products-content__title {
  position: relative;
  margin: 0;
  padding-bottom: 12px;
  font-size: clamp(20px, 2vw, 26px);
  font-weight: 800;
  letter-spacing: 1px;
  color: var(--products-ink);
}

.products-content__title::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 64px;
  height: 3px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--products-gold-deep), var(--products-gold-bright));
}

/* 排序下拉 */
.products-sort {
  position: relative;
  display: inline-flex;
  align-items: center;
}

.products-sort select {
  appearance: none;
  -webkit-appearance: none;
  height: 42px;
  padding: 0 42px 0 18px;
  border: 1px solid var(--products-line);
  border-radius: 6px;
  background: #ffffff;
  color: var(--products-ink);
  font-size: 13.5px;
  font-weight: 600;
  cursor: pointer;
  outline: none;
  transition: border-color 0.3s ease;
}

.products-sort select:hover,
.products-sort select:focus {
  border-color: var(--products-gold);
}

.products-sort i {
  position: absolute;
  right: 16px;
  font-size: 11px;
  color: var(--products-gold);
  pointer-events: none;
}

/* --- 产品卡片网格 --- */
.products-listing {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

.listing-card {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid var(--products-line);
  border-radius: 10px;
  overflow: hidden;
  transition: transform 0.4s ease, box-shadow 0.4s ease, border-color 0.4s ease;
}

.listing-card:hover {
  transform: translateY(-6px);
  border-color: rgba(212, 149, 44, 0.45);
  box-shadow: 0 18px 40px rgba(184, 134, 11, 0.16);
}

.listing-card__media {
  display: block;
  aspect-ratio: 1 / 0.82;
  overflow: hidden;
  background: var(--products-cream);
}

.listing-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.listing-card:hover .listing-card__media img {
  transform: scale(1.07);
}

.listing-card__name {
  margin: 0;
  padding: 16px 18px 6px;
  font-size: 14.5px;
  font-weight: 700;
  line-height: 1.45;
}

.listing-card__name a {
  color: var(--products-ink);
  text-decoration: none;
  transition: color 0.3s ease;
}

.listing-card:hover .listing-card__name a {
  color: var(--products-gold-deep);
}

.listing-card__link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin: 0 18px 18px;
  font-size: 13px;
  font-weight: 700;
  color: var(--products-gold);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.3s ease, gap 0.3s ease;
}

.listing-card__link i {
  font-size: 11px;
}

.listing-card__link:hover {
  color: var(--products-gold-deep);
  gap: 11px;
}

/* --- 分页 --- */
.products-pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 48px;
  flex-wrap: wrap;
}

.page-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border: 1px solid var(--products-line);
  border-radius: 8px;
  background: #ffffff;
  color: var(--products-ink);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  transition: color 0.3s ease, background 0.3s ease, border-color 0.3s ease, transform 0.3s ease;
}

.page-btn i {
  font-size: 12px;
}

.page-btn:hover {
  color: var(--products-gold-deep);
  border-color: var(--products-gold);
  transform: translateY(-2px);
}

.page-btn.is-active {
  background: linear-gradient(135deg, var(--products-gold), var(--products-gold-deep));
  border-color: var(--products-gold);
  color: #ffffff;
}

.page-ellipsis {
  color: var(--products-gray);
  letter-spacing: 2px;
}

/* -------------------------------------------------------------
   3. Custom CTA Banner (定制方案号召横幅)
------------------------------------------------------------- */
.products-cta {
  position: relative;
  padding: clamp(64px, 7vw, 110px) 0;
  background: url("../images/buer_building.jpg") center center / cover no-repeat, #2a2418;
}

.products-cta::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(34, 29, 19, 0.92) 0%, rgba(34, 29, 19, 0.72) 55%, rgba(34, 29, 19, 0.5) 100%);
}

.products-cta__inner {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 16px;
}

.products-cta__title {
  margin: 0;
  font-size: clamp(24px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: 1px;
  line-height: 1.3;
  color: #ffffff;
}

.products-cta__title::after {
  content: "";
  display: block;
  width: 72px;
  height: 3px;
  margin-top: 14px;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--products-gold), var(--products-gold-bright));
}

.products-cta__desc {
  margin: 0;
  max-width: 640px;
  font-size: clamp(14px, 1.3vw, 17px);
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.85);
}

.products-cta__btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  padding: 14px 36px;
  border-radius: 26px;
  background: linear-gradient(135deg, var(--products-gold), var(--products-gold-deep));
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.8px;
  text-transform: uppercase;
  text-decoration: none;
  box-shadow: 0 8px 24px rgba(212, 149, 44, 0.35);
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.products-cta__btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 14px 32px rgba(212, 149, 44, 0.5);
}

/* -------------------------------------------------------------
   Responsive (响应式适配)
------------------------------------------------------------- */
@media (max-width: 1200px) {
  .products-listing {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .products-main__grid {
    grid-template-columns: 260px 1fr;
  }

  .products-listing {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .products-main__grid {
    grid-template-columns: 1fr;
  }

  .products-sidebar {
    order: 2;
  }

  .products-content {
    order: 1;
  }

  .products-breadcrumb {
    justify-content: flex-start;
  }

  .products-content__head {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 560px) {
  .products-listing {
    grid-template-columns: 1fr;
  }

  .page-btn {
    min-width: 38px;
    height: 38px;
  }
}
