.productsPage {
  padding-top: 1rem;
  background: #fff;
}

.productsMain {
  padding: .8rem 0 1rem;
  display: grid;
  grid-template-columns: 3.2rem 12.4rem;
  gap: .4rem;
}

.productsSidebar {
  border: .01rem solid #ddd;
  border-radius: .05rem;
  overflow: hidden;
  align-self: start;
}

.productsSidebar h1 {
  height: .54rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--blue);
  color: #fff;
  font-size: clamp(16px, .2rem, 20px);
  font-weight: 500;
  text-transform: uppercase;
}

.categoryList {
  padding: 0 .15rem;
}

.categoryList a {
  height: .48rem;
  display: flex;
  align-items: center;
  padding: 0 .1rem;
  border-bottom: .01rem solid rgba(221, 221, 221, .97);
  color: var(--text);
  font-size: clamp(12px, .16rem, 16px);
  line-height: .28rem;
  transition: .2s;
}

.categoryList a::before {
  content: '';
  margin-right: .1rem;
  width: .2rem;
  height: .2rem;
  background: url(../images/pro-arrow.png) center center/contain no-repeat;
}

.categoryList a.active,
.categoryList a:hover {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}

.categoryList a.active::before,
.categoryList a:hover::before {
  filter: brightness(0) invert(1);
}

.productResults {
  min-width: 0;
}

#productPagination {
  min-height: .72rem;
  overflow: hidden;
}

#productPagination .page {
  max-width: 100%;
  flex-wrap: wrap;
}

#productPagination .pageMore {
  width: auto;
  min-width: .24rem;
  border-color: transparent;
  pointer-events: none;
}

#productPagination [aria-disabled="true"] {
  opacity: .45;
}

.productResults.is-loading #productGridContainer,
.productResults.is-loading #productPagination {
  opacity: .55;
  pointer-events: none;
}

.resultsTop {
  height: .5rem;
  display: flex;
  align-items: center;
}

.resultsTop h2 {
  height: .28rem;
  padding-left: .17rem;
  border-left: .03rem solid var(--blue);
  color: var(--text);
  font-size: clamp(18px, .2rem, 20px);
  font-weight: 500;
  line-height: .28rem;
  text-transform: uppercase;
}

.resultsSearch {
  width: 100%;
  height: .5rem;
  display: flex;
  overflow: hidden;
  border: .01rem solid #dcdcdc;
  border-radius: .25rem;
  background: #f6f6f6;
}

.resultsSearch input {
  flex: 1;
  padding: 0 .25rem;
  color: #999;
  font-size: .14rem;
}

.resultsSearch button {
  width: 1.2rem;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--yellow);
  border-radius: .25rem;
}

.resultsSearch button img {
  width: .28rem;
  height: .28rem;
}

.productGrid {
  margin-top: .4rem;
  display: grid;
  grid-template-columns: repeat(4, 2.95rem);
  gap: .2rem;
}

.productCard {
  height: auto;
  min-height: 4.9rem;
  padding: .15rem;
  display: flex;
  flex-direction: column;
  gap: .16rem;
  border: .01rem solid #ddd;
  border-radius: .05rem;
  background: #fff;
  color: var(--text);
  transition: transform .28s ease, border-color .28s ease, box-shadow .28s ease;
}

.productCard:hover {
  box-shadow: 0 .12rem .24rem rgba(6, 29, 41, .16);
}

.productPicture {
  height: 2.65rem;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(180deg, #f4fbff 0%, #ededed 100%);
}

.productPicture img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* 列表页与详情页隐藏斜向水印（保留类名，便于随时恢复） */
.productGrid .productWatermark::after,
.detailPage .productWatermark::after {
  content: none;
}

.productCard h3 {
  height: .4rem;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  color: var(--text);
  font-size: clamp(16px, .18rem, 18px);
  line-height: .2rem;
  font-weight: 600;
  word-break: break-word;
}

.productSpecs {
  display: flex;
  flex-direction: column;
  gap: .1rem;
}

.productSpecs p {
  display: flex;
  justify-content: space-between;
  padding-bottom: .1rem;
  border-bottom: .01rem solid rgba(235, 235, 235, .83);
  color: #666;
  font-size: clamp(12px, .13rem, 13px);
  line-height: .18rem;
  gap: .08rem;
  overflow-wrap: anywhere;
}

.productSpecs p > span {
  flex: 0 0 auto;
  white-space: nowrap;
}

.productSpecs b {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 400;
  text-align: right;
}

.detailBtn {
  height: .29rem;
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: .05rem;
  background: var(--blue);
  color: #fff;
  font-size: clamp(12px, .13rem, 13px);
  line-height: .29rem;
  transition: background .2s, color .2s;
}

.productCard:first-child h3 {
  color: var(--blue);
}

.productCard:hover .detailBtn {
  background: var(--yellow);
  color: var(--text);
}

@media (max-width: 1024px) {
  .productsMain {
    padding: .55rem 0 .8rem;
    grid-template-columns: 1fr;
    gap: .3rem;
  }

  .productsSidebar h1 {
    height: .62rem;
  }

  .categoryList {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: .08rem;
    padding: .15rem;
  }

  .categoryList a {
    height: .56rem;
    border: .01rem solid #eee;
    border-radius: .04rem;
  }

  .resultsTop {
    height: auto;
    flex-direction: column;
    align-items: stretch;
    gap: .25rem;
  }

  .resultsTop h2 {
    height: auto;
    line-height: 1.3;
  }

  .resultsSearch {
    width: 100%;
    height: .62rem;
    border-radius: .32rem;
  }

  .resultsSearch button {
    width: .9rem;
  }

  .productGrid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .22rem;
  }

  .productCard {
    height: auto;
    min-height: 5rem;
  }

  .productPicture {
    height: 2.5rem;
  }

  .productSpecs p {
    line-height: 1.35;
  }

  .detailBtn {
    height: .4rem;
  }
}

/* Product list filters: fixed desktop grid matching the Figma layout. */
.resultsFilterForm {
  margin-top: .4rem;
}

.filterConditions {
  position: relative;
  z-index: 70;
  margin-top: .2rem;
}

.filterTitle {
  margin-bottom: .12rem;
  color: var(--text);
  font-size: clamp(14px, .16rem, 16px);
  font-weight: 500;
  line-height: .22rem;
}

.filterRow {
  position: relative;
  z-index: 60;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: .2rem;
  align-items: start;
}

.filterItem {
  position: relative;
}

.filterItem.is-open {
  z-index: 50;
}

.filterSelectBtn {
  width: 100%;
  height: .5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 .12rem;
  border: .01rem solid #dedede;
  border-radius: .02rem;
  background: #f7f7f7;
  color: #999;
  font-size: clamp(12px, .14rem, 14px);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s;
}

.filterSelectBtn:hover {
  border-color: #bdbdbd;
}

.filterNumberInput {
  width: 100%;
  height: .5rem;
  padding: 0 .12rem;
  border: .01rem solid #dedede;
  border-radius: .02rem;
  outline: none;
  background: #fff;
  color: #999;
  font-size: clamp(12px, .14rem, 14px);
  transition: border-color .2s, color .2s;
  appearance: textfield;
}

.filterNumberInput::-webkit-inner-spin-button,
.filterNumberInput::-webkit-outer-spin-button {
  margin: 0;
  appearance: none;
}

.filterNumberInput:hover,
.filterNumberInput:focus {
  border-color: #bdbdbd;
}

.filterInputItem.has-value .filterNumberInput {
  color: var(--blue);
}

.filterSelectText {
  flex: 1;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: left;
}

.filterItem.has-value .filterSelectBtn {
  color: var(--blue);
}

.filterArrow {
  flex: none;
  width: .11rem;
  height: .09rem;
  background: #7d7d7d;
  clip-path: polygon(50% 100%, 0 0, 100% 0);
}

.filterItem.has-value .filterArrow {
  background: var(--blue);
}

.filterPanel {
  position: absolute;
  top: 100%;
  left: 0;
  z-index: 80;
  display: none;
  width: 100%;
  max-height: 3.2rem;
  overflow-y: auto;
  background: #fff;
  border-radius: 0 0 .02rem .02rem;
  border: .01rem solid #e4e4e4;
  box-shadow: 0 .02rem .08rem rgba(6, 29, 41, .14);
}

.filterItem.is-open .filterPanel {
  display: block;
}

.filterOption {
  display: flex;
  align-items: center;
  gap: 0;
  min-height: .4rem;
  height: auto;
  line-height: .18rem;
  padding: 0 .08rem;
  border-bottom: .01rem solid #f2f2f2;
  color: var(--text);
  font-size: clamp(12px, .14rem, 14px);
  cursor: pointer;
}

.filterOption:last-child {
  border-bottom: none;
}

.filterOption.is-active {
  background: var(--blue);
  color: #fff;
  font-weight: 600;
}

.filterOptionText {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.filterCheckbox {
  display: none;
}

.filterCheckbox::after {
  content: '';
  position: absolute;
  left: .045rem;
  top: .015rem;
  width: .06rem;
  height: .11rem;
  border: solid #888;
  border-width: 0 .02rem .02rem 0;
  transform: rotate(45deg);
}

.filterOption.is-active .filterCheckbox {
  border-color: transparent;
  background: transparent;
}

.filterOption.is-active .filterCheckbox::after {
  border-color: #fff;
}

.filterActions {
  position: relative;
  z-index: auto;
  display: flex;
  gap: .15rem;
  margin-top: .2rem;
}

.filterApply,
.filterClear {
  height: .4rem;
  padding: 0 .24rem;
  border: none;
  border-radius: .25rem;
  background: var(--yellow);
  color: var(--text);
  font-size: .16rem;
  font-weight: 400;
  letter-spacing: .005rem;
  text-transform: uppercase;
  cursor: pointer;
  transition: filter .2s;
}

.filterClear {
  min-width: .9rem;
}

/* Keep legacy markup harmless if cached templates still contain Apply. */
.filterApply {
  display: none;
}

.filterApply:hover,
.filterClear:hover {
  filter: brightness(.96);
}

@media (max-width: 1024px) {
  .filterRow {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: .15rem;
  }

  .filterSelectBtn,
  .filterNumberInput,
  .filterPanel {
    width: 100%;
  }

  .resultsSearch button {
    width: .9rem;
  }
}
