/* 商品分类页面样式 */


.category-page {
  background-color: #f5f5f5;
  box-sizing: border-box;
  position: relative;
  height: calc(100vh - 280rpx);
  overflow: hidden;
}

.category-container {
  display: flex;
  height:  calc(100vh - 280rpx);
  min-height: 0;
  overflow: hidden;
}

/* 左侧边栏容器 */
.category-sidebar-container {
  width: 176rpx;
  height: calc(100vh - 280rpx);
  background-color: #f5f5f5;
  overflow: hidden; 
}

/* 右侧内容区 */
.category-content {
  flex: 1;
  background-color: white;
  position: relative;
  padding: 20rpx;
  overflow-y: auto;
  min-height: 0;
  box-sizing: border-box; /* 确保padding包含在高度内 */
  -webkit-overflow-scrolling: touch; /* iOS滚动优化 */
}

/* 二级分类标签栏 */
.sub-category-tabbar {
  margin-bottom: 20rpx;
}

/* 二级分类网格布局 */
.sub-category-grid {
  display: grid;
  grid-template-columns: 33.33% 33.33% 33.33%;
  gap: 20rpx;
}

.sub-category-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 20rpx;
  border-radius: 16rpx;
  background-color: #fff;
  transition: all 0.3s ease;
}

.sub-category-item:active {
  background-color: #fff;
  transform: scale(0.95);
}

.sub-category-image-container {
  width: 144rpx;
  height: 144rpx;
  margin-bottom: 16rpx;
}

.sub-category-image {
  width: 100%;
  height: 100%;
  border-radius: 16rpx;
  overflow: hidden;
  background-color: #e0e0e0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.image-fallback {
  width: 80rpx;
  height: 80rpx;
  border-radius: 50%;
  background-color: #0071ce;
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32rpx;
  font-weight: bold;
}

.sub-category-name {
  font-size: 26rpx;
  color: #333;
  text-align: center;
  line-height: 1.4;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 广告图容器 */
.advertisement-container {
  position: fixed;
  bottom: 10%;
  right: 1%;
  z-index: 100;
  width: 510rpx;
  height: 700rpx;
  display: flex;
  justify-content: center;
}

.advertisement-image {
  border-radius: 16rpx;
  background-color: #fa4126;
  box-shadow: 0 4rpx 16rpx rgba(0, 0, 0, 0.1);
  margin: 0 auto;
  display: block;
}

.ad-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 24rpx;
}

/* 加载和错误状态 */
.loading, .error {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 200rpx;
  font-size: 28rpx;
  color: #666;
}

.error {
  color: #fa4126;
}

/* 响应式适配 */
@media (max-width: 750rpx) {
  .category-sidebar-container {
    width: 160rpx;
  }

  .sub-category-grid {
    grid-template-columns: 50% 50%;
    gap: 16rpx;
  }

  .sub-category-image-container {
    width: 120rpx;
    height: 120rpx;
  }
}