/* style.css - 页面特有样式 */

/* 顶部 Banner */
.page-banner {
  width: 100%;
  height: 5.58rem;
  background: url("/images/banner1.png") no-repeat center center / cover;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}
/* 由于没有真实图片，这里用渐变色模拟工厂背景图，真实项目中替换为 url(...) */
.page-banner {
  /* background:
    linear-gradient(rgba(0, 0, 0, 0.3), rgba(0, 0, 0, 0.3)),
    linear-gradient(to right, #1a3a5c, #8da4b9); */
  background-image: var("/images/banner1.png");
}
.page-banner h1 {
  font-weight: bold;
  font-size: 0.54rem;
  color: #ffffff;
}

/* 主体布局 */
.main-wrapper {
  display: flex;
  margin-top: 0.4rem;
  padding-top: 0.4rem;
  padding-bottom: 1rem;
  /* background-color: #f8f8f8; */
  gap: 0.4rem;
}

/* 左侧边栏 */
.sidebar {
  width: 2.6rem;
  flex-shrink: 0;
}
.search-box {
  display: flex;
  align-items: center;
  background: #f8f8f8;
  margin-bottom: 0.3rem;
  padding-right: 0.15rem;
}
.search-box input {
  flex: 1;
  border: none;
  background: transparent;
  padding: 0.3rem 0.3rem;
  font-size: var(--font16);
  color: #3d3d3d;
}
.search-box button {
  background: transparent;
  border: none;
  width: 0.3rem;
  height: 0.3rem;
  background-image: url("/images/icons/search.png");
  background-size: cover;
  background-position: center;
  cursor: pointer;
  color: #3d3d3d;
}

.category-title {
  font-size: 0.24rem;
  font-weight: normal;
  margin-bottom: 0.2rem;
  color: #181c25;
}
.category-list {
  border-top: 0.01rem solid #d8d8d8;
}
.category-item {
  padding: 0.2rem 0.2rem;
  border-bottom: 0.01rem solid #d8d8d8;
}
.category-item > .cat-name {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0.14rem 0;
  cursor: pointer;
  font-size: 0.24rem;
  font-weight: bold;
  color: #181c25;
}
.category-item > .cat-name .icon {
  font-weight: 300;
  font-size: 0.24rem;
}

.category-item .sub-list {
  padding-bottom: 0.1rem;
}
.category-item .sub-list li {
  padding: 0.1rem 0 0.1rem 0.15rem;
  font-size: 0.16rem;
  color: #333333;
  cursor: pointer;
  transition: all 0.2s;
}
.category-item .sub-list li:hover {
  color: #013a95;
}
.category-item .sub-list li.active {
  color: #fff;
}
/* 默认第一个子项选中效果 */
.category-item .sub-list li.active {
  background-color: #013a95;
  padding-left: 0.15rem;
}

/* 右侧内容区 */
.product-area {
  flex: 1;
}
.product-area h2 {
  font-size: var(--font30);
  font-weight: normal;
  margin-bottom: 0.25rem;
  color: #181c25;
}

/* 产品网格 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.2rem;
}
.product-item {
  background: #f2f2f2;
  display: flex;
  flex-direction: column;
  border: 0.01rem solid #f2f2f2;
}
/* 模拟产品图占位 */
.product-img {
  width: 100%;
  /* height: 2.45rem; */

  /* background-color: #fff; */
  display: flex;
  align-items: center;
  justify-content: center;
}
.product-item .img-placeholder-box {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-item .img-placeholder-box img {
  width: 100%;
  object-fit: cover;
  /* width: 1.64rem;
  height: 1.42rem; */
  /* max-width:100%;
  max-height:100%; */
}

.product-label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 1.43rem;
  letter-spacing: 0.01rem;
}

.product-label:hover {
  color: #013a95;
}

/* 分页 */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 0.1rem;
  margin-top: 0.5rem;
  margin-bottom: 0.3rem;
}
.pagination button,
.pagination span {
  min-width: 0.4rem;
  height: 0.4rem;
  border: 0.01rem solid #999999;
  color: #666666;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.16rem;
}
.pagination span.active {
  background: #013a95;
  border: 0.01rem solid #013a95;
  font-size: 0.16rem;
  color: #ffffff;
}

.pagination-list {
  display: flex;
  gap: 0.1rem;
}

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

/* 大屏优化 (>1600px) - 保持现有设计 */
@media (min-width: 1601px) {
  .page-banner {
    height: 6rem;
  }
  .page-banner h1 {
    font-size: 0.64rem;
  }
  .product-grid {
    gap: 0.3rem;
  }
  .product-img {
    /* height: 2.8rem; */
  }
  .product-label {
    /* height: 1.6rem; */
    /* font-size: 0.22rem; */
  }
}

/* 中屏适配 (1280px - 1600px) */
@media (max-width: 1600px) and (min-width: 1281px) {
  .page-banner {
    height: 4.8rem;
  }
  .page-banner h1 {
    font-size: 0.48rem;
  }

  .main-wrapper {
    gap: 0.3rem;
    margin-top: 0.3rem;
  }

  .sidebar {
    width: 2.3rem;
  }

  .category-title {
    font-size: 0.22rem;
  }
  .category-item > .cat-name {
    font-size: 0.22rem;
    padding: 0.12rem 0;
  }
  .category-item .sub-list li {
    font-size: 0.15rem;
    padding: 0.09rem 0 0.09rem 0.12rem;
  }

  .search-box input {
    /* font-size: 0.15rem; */
    /* padding: 0.1rem 0.12rem; */
  }

  .product-area h2 {
    /* font-size: 0.17rem; */
    margin-bottom: 0.2rem;
  }

  .product-grid {
    gap: 0.18rem;
  }

  .product-img {
    /* height: 2.2rem; */
  }
  .product-item .img-placeholder-box img {
    /* width: 1.48rem;
    height: 1.28rem; */
  }

  .product-label {
    /* height: 1.28rem; */
    /* font-size: 0.18rem; */
  }

  .pagination button,
  .pagination span {
    min-width: 0.36rem;
    height: 0.36rem;
    font-size: 0.15rem;
  }
}

/* 平板适配 (768px - 1280px) */
@media (max-width: 1280px) and (min-width: 769px) {
  .page-banner {
    height: 4rem;
  }
  .page-banner h1 {
    font-size: 0.42rem;
  }

  .main-wrapper {
    flex-direction: column;
    margin-top: 0.25rem;
    gap: 0.25rem;
  }

  .sidebar {
    width: 100%;
  }

  .search-box {
    margin-bottom: 0.2rem;
  }
  .search-box input {
    /* font-size: 0.14rem; */
    /* padding: 0.10rem 0.12rem; */
  }

  .category-title {
    font-size: 0.2rem;
    margin-bottom: 0.15rem;
  }
  .category-item {
    padding: 0.15rem;
  }
  .category-item > .cat-name {
    font-size: 0.18rem;
    padding: 0.1rem 0;
  }
  .category-item > .cat-name .icon {
    font-size: 0.2rem;
  }
  .category-item .sub-list li {
    font-size: 0.15rem;
    padding: 0.08rem 0 0.08rem 0.12rem;
  }

  .product-area h2 {
    /* font-size: 0.18rem; */
    margin-bottom: 0.2rem;
  }

  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 0.15rem;
  }

  .product-img {
    /* height: 2.00rem; */
  }
  .product-item .img-placeholder-box img {
    /* width: 1.40rem;
    height: 1.20rem; */
  }

  .product-label {
    /* height: 1.10rem; */
    /* font-size: 0.16rem; */
  }

  .pagination {
    margin-top: 0.35rem;
    gap: 0.08rem;
  }
  .pagination button,
  .pagination span {
    min-width: 0.34rem;
    height: 0.34rem;
    font-size: 0.14rem;
  }
}

/* 手机适配 (<768px) */
@media (max-width: 768px) {
  .page-banner {
    height: 3rem;
  }
  .page-banner h1 {
    font-size: 0.24rem;
  }

  .main-wrapper {
    flex-direction: column;
    margin-top: 0.15rem;
    gap: 0.15rem;
    padding: 0 0.15rem;
  }

  .sidebar {
    width: 100%;
  }

  .search-box {
    margin-bottom: 0.15rem;
    padding-right: 0.1rem;
  }
  .search-box input {
    /* font-size: 0.14rem; */
    /* padding: 0.10rem 0.12rem; */
  }
  .search-box button {
    width: 0.18rem;
    height: 0.18rem;
  }

  .category-title {
    font-size: var(--font28);
    margin-bottom: 0.12rem;
  }
  .category-list {
    border-top: 0.01rem solid #d8d8d8;
  }
  .category-item {
    padding: 0.12rem;
    border-bottom: 0.01rem solid #d8d8d8;
  }
  .category-item > .cat-name {
    font-size: 0.16rem;
    padding: 0.1rem 0;
  }
  .category-item > .cat-name .icon {
    font-size: 0.18rem;
  }
  .category-item .sub-list li {
    font-size: 0.14rem;
    padding: 0.08rem 0 0.08rem 0.1rem;
  }
  .category-item .sub-list li.active {
    padding-left: 0.1rem;
  }

  .product-area h2 {
    /* font-size: .16rem; */
    margin-bottom: 0.15rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.1rem;
  }

  .product-item {
    border: 0.01rem solid #f2f2f2;
  }

  .product-img {
    /* height: 1.50rem; */
  }
  .product-item .img-placeholder-box img {
    /* width: 1.00rem;
    height: 0.85rem; */
  }

  .product-label {
    height: 0.9rem;
    /* font-size: 0.13rem; */
    letter-spacing: 0;
  }

  .pagination {
    margin-top: 0.3rem;
    margin-bottom: 0.2rem;
    gap: 0.08rem;
  }
  .pagination button,
  .pagination span {
    min-width: 0.32rem;
    height: 0.32rem;
    font-size: 0.13rem;
    border: 0.01rem solid #999999;
  }
  .pagination button img {
    width: 0.12rem;
    height: 0.12rem;
  }
}

/* 小屏手机 (<480px) */
@media (max-width: 480px) {
  .page-banner {
    height: 2.5rem;
  }
  .page-banner h1 {
    font-size: 0.2rem;
  }

  .main-wrapper {
    margin-top: 0.1rem;
    gap: 0.1rem;
    padding: 0 0.1rem;
  }

  .category-title {
    /* font-size: var(--font28); */
  }
  .category-item > .cat-name {
    font-size: 0.15rem;
  }
  .category-item .sub-list li {
    font-size: 0.13rem;
    padding: 0.07rem 0 0.07rem 0.08rem;
  }

  .product-area h2 {
    /* font-size: 0.15rem; */
    margin-bottom: 0.12rem;
  }

  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.08rem;
  }

  .product-img {
    /* height: 1.20rem; */
  }
  .product-item .img-placeholder-box img {
    /* width: 0.80rem;
    height: 0.70rem; */
  }

  .product-label {
    /* height: 0.65rem; */
    /* font-size: 0.12rem; */
  }

  .pagination button,
  .pagination span {
    min-width: 0.28rem;
    height: 0.28rem;
    font-size: 0.12rem;
  }
}
