/* 筛选页面左右布局样式 */
.filter-page-layout {
  width: 100%;
  margin: 0 auto;
  padding: 20px;
}

.filter-layout-container {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

@media screen and (max-width: 768px) {
  .filter-layout-container {
    flex-direction: column-reverse; /* 移动端筛选器在上方 */
  }
}

/* 左侧商品列表区域 */
.filter-left-content {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* 筛选页面专用：覆盖首页的row-reverse布局，改为column */
@media screen and (min-width: 768px) {
  .filter-page-layout .goodpart {
    flex-direction: column !important;
  }
}

.filter-left-content .goods-container {
  width: 100%;
}

.filter-left-content .goods-section {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
  padding: 0;
}

@media screen and (max-width: 1200px) {
  .filter-left-content .goods-section {
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 16px;
  }
}

@media screen and (max-width: 768px) {
  .filter-left-content .goods-section {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }
}

/* 确保商品卡片在grid布局中正常显示 */
.filter-left-content .goods-section .goods {
  width: 100%;
}

/* 右侧筛选器区域 */
.filter-right-sidebar {
  width: 420px;
  flex-shrink: 0;
}

@media screen and (max-width: 768px) {
  .filter-right-sidebar {
    width: 100%;
    position: relative;
    top: 0;
  }
}

/* 调整筛选器在右侧时的样式 */
.filter-right-sidebar.filter {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  height: auto;
  padding: 0 16px;
}

@media screen and (max-width: 768px) {
  .filter-right-sidebar.filter {
    position: relative;
    top: 0;
    max-height: none;
    height: auto;
  }
}

/* 优化筛选器内部滚动 */
.filter-right-sidebar .parttwo-show {
  max-height: calc(100vh - 220px);
  overflow-y: auto;
}

@media screen and (max-width: 768px) {
  .filter-right-sidebar .parttwo-show {
    max-height: none;
  }
}

/* 筛选标签容器样式 */
.filter-left-content .factorbox {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
  padding: 0;
  background: transparent;
  width: 100%;
  order: -1; /* 确保标签容器显示在最上方 */
}

.filter-left-content .factorbox .factor {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  background: #fff;
  border: 1px solid #ff5252;
  border-radius: 16px;
  font-size: 14px;
  color: #ff5252;
  cursor: default;
  transition: all 0.2s ease;
  margin: 0;
  font-weight: 400;
}

.filter-left-content .factorbox .factor:hover {
  background: #fff5f5;
  box-shadow: 0 2px 6px rgba(255, 82, 82, 0.2);
}

.filter-left-content .factorbox .factor#factor-tab {
  background: #ff5252;
  color: #fff;
  border: 1px solid #ff5252;
  font-weight: 500;
  cursor: default;
}

.filter-left-content .factorbox .factor#factor-tab:hover {
  background: #ff3838;
  border-color: #ff3838;
  box-shadow: 0 2px 6px rgba(255, 82, 82, 0.3);
}

.filter-left-content .factorbox .factorclose {
  width: 14px;
  height: 14px;
  cursor: pointer;
  fill: #ff5252;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.filter-left-content .factorbox .factorclose:hover {
  fill: #ff3838;
  transform: scale(1.15);
}

@media screen and (max-width: 768px) {
  .filter-left-content .factorbox {
    gap: 8px;
    padding: 0;
    margin-bottom: 16px;
  }
  
  .filter-left-content .factorbox .factor {
    font-size: 12px;
    padding: 5px 12px;
    gap: 6px;
  }
  
  .filter-left-content .factorbox .factorclose {
    width: 12px;
    height: 12px;
  }
}
