﻿@keyframes cardFadeInUp {
  0% {
    opacity: 0;
    transform: translateY(30px)
  }

  100% {
    opacity: 1;
    transform: translateY(0)
  }
}

html {
  scroll-behavior: smooth
}

[id] {
  scroll-margin-top: 110px
}

@media(max-width:768px) {
  [id] {
    scroll-margin-top: 150px
  }
}

.products-layout {
  display: flex;
  gap: 2rem;
  align-items: stretch;
  flex-direction: column;
  position: relative
}

.sidebar-toggle {
  display: none;
  align-items: center;
  gap: .55rem;
  padding: .5rem 1.1rem;
  background: #fff;
  color: #333;
  border: 1px solid #d9dde3;
  border-radius: 0;
  font-size: .9rem;
  font-weight: 500;
  cursor: pointer;
  margin-bottom: 1.2rem;
  transition: color .25s ease, border-color .25s ease, background .25s ease
}

.sidebar-toggle:hover {
  color: #e53e3e;
  border-color: #e53e3e;
  background: #fff0f0
}

.sidebar-toggle-icon {
  font-size: 1rem;
  line-height: 1
}

.sidebar-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 999
}

.sidebar-overlay.active {
  display: block
}

.products-sidebar {
  width: 290px;
  min-width: 290px;
  background: #fff;
  border-radius: 0;
  border: 1px solid #e8ecf1;
  box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
  overflow: hidden;
  position: sticky;
  top: 120px;
  margin-top: 4.5rem
}

.sidebar-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.2rem;
  border-bottom: 1px solid #e8ecf1
}

.sidebar-header h3 {
  font-size: 1.05rem;
  color: #1a2a4a;
  margin: 0
}

.sidebar-close {
  background: none;
  border: none;
  font-size: 1.3rem;
  color: #999;
  cursor: pointer;
  padding: 0;
  line-height: 1
}

.sidebar-nav {
  list-style: none;
  padding: 0;
  margin: 0
}

.sidebar-category {
  border-bottom: 1px solid #f0f2f5
}

.sidebar-category:last-child {
  border-bottom: none
}

.sidebar-category-head {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: .9rem 1.2rem;
  cursor: pointer;
  transition: background .2s;
  user-select: none;
  background: #FFF;
  text-decoration: none;
  color: inherit
}

.sidebar-category-head:hover {
  background: #ececec
}

.sidebar-category.active > .sidebar-category-head,
.sidebar-category.active > a.sidebar-category-head {
  background: #ffe6e6
}

.sidebar-category.active > .sidebar-category-head .sidebar-category-name,
.sidebar-category.active > a.sidebar-category-head .sidebar-category-name {
  color: #e53e3e
}

.sidebar-category-name {
  flex: 1;
  font-size: .95rem;
  font-weight: 600;
  color: #000
}

.sidebar-arrow {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-right: 2.5px solid #999;
  border-bottom: 2.5px solid #999;
  transform: rotate(-45deg);
  transition: transform .35s cubic-bezier(.34, 1.56, .64, 1), border-color .3s;
  margin-right: 2px;
  flex-shrink: 0;
  vertical-align: middle;
  margin-top: -1px
}

.sidebar-category.active>.sidebar-category-head .sidebar-arrow,
.sidebar-category.open>.sidebar-category-head .sidebar-arrow {
  transform: rotate(45deg);
  border-color: #e53e3e
}

.sidebar-subnav {
  list-style: none;
  padding: 0;
  margin: 0;
  display: none;
  background: #f9f9f9;
  border-top: 1px solid #f0f2f5
}

.sidebar-category.active>.sidebar-subnav,
.sidebar-category.open>.sidebar-subnav {
  display: block
}

.sidebar-subitem {
  padding: 0;
  transition: background .2s;
  border-left: 3px solid transparent
}

.sidebar-subitem a {
  display: block;
  padding: .65rem 1.2rem .65rem 2.2rem;
  font-size: .9rem;
  color: #000;
  text-decoration: none
}

.sidebar-subitem.active {
  border-left-color: #e53e3e
}

.sidebar-subitem.active a {
  color: #e53e3e
}

.sidebar-subitem:hover {
  background: #ffe6e6;
  border-left-color: #e53e3e
}

.sidebar-subitem:hover a {
  color: #e53e3e
}

.products-content {
  flex: 1;
  min-width: 0
}

.category-header {
  margin-bottom: 1.5rem;
  padding-bottom: .8rem
}

.category-header h2 {
  font-size: 1.4rem;
  color: #1a2a4a;
  margin: 0;
  font-weight: 700;
  text-align: center
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 2rem
}

.product-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 2rem;
  background: #fff;
  border: 1px solid #e8ecf1;
  border-radius: 0;
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: all .3s;
  padding: 2rem;
  min-width: 0;
  animation: cardFadeInUp .5s ease both
}

.product-card:nth-child(1) {
  animation-delay: .05s
}

.product-card:nth-child(2) {
  animation-delay: .15s
}

.product-card:nth-child(3) {
  animation-delay: .25s
}

.product-card:nth-child(4) {
  animation-delay: .35s
}

.product-card:hover {
  transform: translateY(-3px);
  border-color: #e53e3e
}

.product-card-body {
  grid-column: 1;
  min-height: 0;
  justify-content: center;
  display: flex;
  flex-direction: column
}

.product-card-body h3 {
  font-size: 1.05rem;
  color: #1a2a4a;
  margin: 0 0 .5rem;
  font-weight: 600;
  line-height: 1.4
}

.product-card-body p,
.section-services .product-card-body p,
.page-products .product-card-body p,
.section-services.section--light .product-card-body p {
    font-size: .88rem;
    color: #666;
    line-height: 1.6;
    margin: 0 0 .8rem;
    flex: 1;
    display: block;
    overflow: visible;
    text-overflow: clip;
    -webkit-line-clamp: unset;
    -webkit-box-orient: unset;
}

.product-card-btn {
  display: inline-block;
  align-self: flex-start;
  font-size: .82rem;
  color: #e53e3e;
  font-weight: 600;
  border-bottom: 2px solid transparent;
  transition: border-color .3s
}

.product-card:hover .product-card-btn {
  border-bottom-color: #e53e3e
}

.product-card {
  overflow: hidden;
}

.product-card-img {
  width: 100%;
  max-width: 100%;
  height: 100%;
  min-height: 12.5rem;
  object-fit: cover;
  background: #ECECEC;
  grid-column: 2;
  align-self: center;
  display: block;
  transition: all 0.5s;
}

.product-card:hover .product-card-img {
  transform: scale(1.1);
}

@media(max-width:768px) {
  .products-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center
  }
  
  .products-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
    max-width: 600px;
    margin: 0 auto
  }
  
  .product-card {
    grid-template-columns: 1fr;
    width: 100% !important;
    max-width: 600px;
    margin: 0 auto
  }

  .product-card-body {
    grid-column: 1;
    margin-bottom: 1.5rem
  }

  .product-card-img {
    grid-column: 1;
    width: 100%;
    height: auto;
    min-height: 0;
    object-fit: contain;
    align-self: start
  }
  
  .product-card-body p,
  .section-services .product-card-body p,
  .page-products .product-card-body p,
  .section-services.section--light .product-card-body p {
    -webkit-line-clamp: unset
  }
}

.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  gap: .5rem;
  margin-top: 2.5rem;
  padding: 1.2rem 0;
  border-top: 1px solid #e8ecf1
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: .3rem
}

.page-btn {
  width: 38px;
  height: 38px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: 1.1rem;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
  line-height: 1;
  flex-shrink: 0
}

.page-btn:hover {
  border-color: #e53e3e;
  color: #e53e3e;
  background: #fff0f0
}

.page-icon {
  width: 55%;
  height: 55%;
  display: block;
  pointer-events: none
}


.page-num {
  min-width: 38px;
  height: 38px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 6px;
  cursor: pointer;
  font-size: .95rem;
  color: #666;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .3s;
  padding: 0 6px;
  font-weight: 500
}

.page-num:hover {
  border-color: #e53e3e;
  color: #e53e3e;
  background: #fff0f0
}

.page-num.active {
  background: #e53e3e;
  border-color: #e53e3e;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(229, 62, 62, .3)
}

@media (max-width:1199.9px) {
  .products-content {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center
  }
  
  .products-grid {
    grid-template-columns: 1fr;
    justify-items: center;
    width: 100%;
    max-width: 700px;
    margin: 0 auto
  }
  
  .product-card {
    grid-template-columns: 1fr;
    width: 100% !important;
    max-width: 700px;
    margin: 0 auto
  }
  
  .product-card-body {
    grid-column: 1;
    margin-bottom: 1.5rem
  }
  
  .product-card-img {
    grid-column: 1;
    width: 100%;
    height: auto;
    min-height: 0;
    object-fit: contain;
    align-self: start
  }
  
  .sidebar-toggle {
    display: inline-flex !important
  }

  .products-layout {
    flex-direction: column
  }

  .products-sidebar {
    position: fixed;
    top: var(--header-h, 0px);
    left: 0;
    width: 82%;
    max-width: 320px;
    min-width: 0;
    height: calc(100vh - var(--header-h, 0px));
    margin-top: 0;
    border-radius: 0;
    border: none;
    box-shadow: 2px 0 20px rgba(0, 0, 0, .15);
    z-index: 9000;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: none;
    -webkit-overflow-scrolling: touch
  }

  .products-sidebar.open {
    transform: translateX(0)
  }

  html.sidebar-anim-ready .products-sidebar {
    transition: transform .3s cubic-bezier(.4, 0, .2, 1)
  }

  .sidebar-overlay {
    top: var(--header-h, 0px);
    z-index: 8999
  }

  .sidebar-header {
    display: flex !important;
    position: sticky;
    top: 0;
    background: #fff;
    z-index: 2
  }

  .pagination-bar {
    flex-wrap: nowrap;
    gap: .4rem;
    width: fit-content;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto
  }

  .page-num {
    min-width: 44px;
    height: 44px;
    font-size: 1.1rem
  }

  .page-btn {
    width: 44px;
    height: 44px;
    min-width: 44px;
    min-height: 44px;
    font-size: 1rem;
    flex: 0 0 44px
  }
}

@media (min-width:1200px) {
  .products-sidebar {
    max-height: calc(100vh - 180px);
    overflow-y: auto
  }

  .products-sidebar::-webkit-scrollbar {
    width: 4px
  }

  .products-sidebar::-webkit-scrollbar-thumb {
    background: #d0d5dd;
    border-radius: 4px
  }

  .products-sidebar::-webkit-scrollbar-track {
    background: transparent
  }
}

.is-resizing .products-sidebar,
.is-resizing .sidebar-overlay {
  transition: none !important
}

/* ==================== 产品分类导航：改为上下结构（顶部水平导航 + 下方内容） ==================== */
/* 整体上下排列 */
.products-layout {
  flex-direction: column;
  align-items: stretch;
}

/* 分类导航移到顶部，横向铺满、水平排列 */
.products-sidebar {
  width: 100%;
  min-width: 0;
  position: static;
  top: auto;
  margin-top: 0;
  overflow: visible;
  padding: .6rem;
}

/* 导航列表横向排列：左对齐 + 项目间隔 */
.sidebar-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: .6rem;
}

/* 每个分类按内容宽度显示（左对齐 + 间隔），呈标签/按钮样式 */
.sidebar-category {
  flex: 0 0 auto;
  min-width: 0;
  border-bottom: none;
  border-right: none;
  border: 1px solid #e8ecf1;
  border-radius: 4px;
  overflow: hidden;
}

.sidebar-category:last-child {
  border-right: none;
}

/* 分类标题：居中文字、适当内边距 */
.sidebar-category-head {
  justify-content: center;
  gap: .5rem;
  height: 100%;
  padding: .55rem 1.4rem;
}

.sidebar-category-name {
  flex: 0 0 auto;
  text-align: center;
}

/* 上下结构下不再需要移动端抽屉，隐藏触发按钮/遮罩/抽屉头部 */
.sidebar-toggle,
.sidebar-overlay,
.sidebar-header {
  display: none !important;
}

/* 覆盖窄屏（<=1199.9px）时把导航变成抽屉的旧规则，保持顶部水平常显 */
@media (max-width:1199.9px) {
  .products-sidebar {
    position: static;
    top: auto;
    left: auto;
    width: 100%;
    max-width: none;
    min-width: 0;
    height: auto;
    margin-top: 0;
    border: 1px solid #e8ecf1;
    box-shadow: 0 2px 12px rgba(0, 0, 0, .04);
    transform: none;
    overflow: visible;
  }
}

/* 手机端：分类按内容宽度左对齐换行，缩小内边距 */
@media (max-width:768px) {
  .sidebar-category {
    flex: 0 0 auto;
    min-width: 0;
    border-bottom: 1px solid #e8ecf1;
  }

  .sidebar-category-head {
    padding: .5rem 1rem;
  }
}

/* ==================== 去掉白色背景框 + 选中态改为 #000000e6 ==================== */
/* 去掉导航整体白色背景与边框、阴影、内边距 */
.products-sidebar {
  background: transparent;
  border: none;
  box-shadow: none;
  padding: 0;
}

/* 去掉每个分类标签的白色背景与边框；未选中时用 #0000000d 背景、#000000b3 文字 */
.sidebar-category {
  border: none;
}

.sidebar-category-head {
  background: #0000000d;
}

.sidebar-category-head:hover {
  background: #0000001a;
}

/* 未选中文字颜色 */
.sidebar-category-name {
  color: #000000b3;
  font-weight: 500;
}

/* 选中（点击/激活）时背景变为 #000000e6，文字反白 */
.sidebar-category.active > .sidebar-category-head,
.sidebar-category.active > a.sidebar-category-head {
  background: #000000e6;
}

.sidebar-category.active > .sidebar-category-head .sidebar-category-name,
.sidebar-category.active > a.sidebar-category-head .sidebar-category-name {
  color: #fff;
}

/* 覆盖窄屏下给导航加回边框/阴影的旧规则 */
@media (max-width:1199.9px) {
  .products-sidebar {
    border: none;
    box-shadow: none;
  }
}

/* 手机端也去掉分类项底部边框 */
@media (max-width:768px) {
  .sidebar-category {
    border-bottom: none;
  }
}

/* ==================== 分页颜色与导航栏统一（黑色系 #000000xx） ==================== */
/* 未点击状态：浅底 #0000000d + 文字 #000000b3 */
.page-num,
.page-btn {
  background: #0000000d;
  border-color: transparent;
  color: #000000b3;
}

/* 悬浮状态：加深底色 #0000001a，文字 #000000e6 */
.page-num:hover,
.page-btn:hover {
  background: #0000001a;
  border-color: transparent;
  color: #000000e6;
}

/* 点击（当前页）状态：深底 #000000e6 + 白字 */
.page-num.active {
  background: #000000e6;
  border-color: transparent;
  color: #fff;
  box-shadow: none;
}


