/* 商品列表页样式 */

/* 页面容器 */
.page-container {
  min-height: 100vh;
  background-color: var(--light-color);
}

/* 宣传图区域 */
.banner-section {
  position: relative;
  width: 100%;
  overflow: hidden;
}

.banner-image {
  width: 100%;
  height: auto;
  display: block;
  transition: transform 0.5s ease;
}

.banner-section:hover .banner-image {
  transform: scale(1.02);
}

/* 分类导航区域 */
.category-nav {
  background-color: var(--primary-color);
  padding: 12px 0;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 15px;
  padding: 0 15px;
}

.nav-item {
  padding: 8px 16px;
  color: white;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  border-radius: 20px;
  transition: all 0.3s ease;
  position: relative;
  white-space: nowrap;
}

.nav-item:hover {
  background-color: rgba(255, 255, 255, 0.1);
  transform: translateY(-2px);
}

.nav-item.active {
  background-color: var(--accent-color);
  color: white;
  box-shadow: 0 4px 8px rgba(146, 5, 8, 0.3);
}

/* 搜索区域 */
.search-section {
  padding: 15px 0;
  background-color: white;
  border-bottom: 1px solid var(--border-color);
}

.search-box {
  display: flex;
  gap: 10px;
  align-items: center;
  position: relative;
}

.search-input {
  flex: 0.7;
  padding: 10px 15px;
  border: 1px solid var(--border-color);
  border-radius: 25px;
  font-size: 14px;
  transition: all 0.3s ease;
  background-color: var(--light-color);
  width: 70%;
}

.search-input:focus {
  outline: none;
  border-color: var(--accent-color);
  box-shadow: 0 0 0 3px rgba(146, 5, 8, 0.1);
  background-color: white;
}

.search-btn {
  width: 30%;
  padding: 10px 15px;
  background-color: var(--accent-color);
  color: white;
  border: none;
  border-radius: 25px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.3s ease;
  white-space: nowrap;
  flex: 0.3;
}

.search-btn:hover {
  background-color: var(--primary-color);
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.search-btn:active {
  transform: translateY(0);
}

/* 花色列表区域 */
.product-list-section {
  padding: 20px 0;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--primary-color);
  margin-bottom: 20px;
  text-align: center;
  position: relative;
}

.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 60px;
  height: 3px;
  background-color: var(--accent-color);
  border-radius: 2px;
}

/* 商品网格布局 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 12px;
  margin-bottom: 20px;
}

/* 平板端 */
@media (max-width: 992px) {
  .product-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 15px;
  }
}

/* WAP端 */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
  }
}

/* 小屏手机 */
@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
}

/* 商品卡片样式 */
.product-card {
  background-color: white;
  border-radius: 6px;
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* 卡片图片容器 */
.product-image-container {
  position: relative;
  overflow: hidden;
  padding-top: 100%; /* 1:1 宽高比 */
}

.product-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.product-card:hover .product-image {
  transform: scale(1.1);
}

/* 分类标签 */
.product-category {
  position: absolute;
  top: 6px;
  left: 6px;
  background-color: var(--accent-color);
  color: white;
  padding: 3px 6px;
  border-radius: 2px;
  font-size: 10px;
  font-weight: 600;
  z-index: 10;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 商品标题 */
.product-title {
  padding: 8px;
  font-size: 12px;
  font-weight: 600;
  text-align: center;
  color: var(--primary-color);
  background-color: white;
  border-top: 1px solid var(--border-color);
  transition: background-color 0.3s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: auto;
  min-height: 36px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-overflow: ellipsis;
}

.product-card:hover .product-title {
  background-color: var(--light-color);
}

/* 加载更多指示器 */
.loading-indicator {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 20px 0;
  color: var(--primary-color);
  font-size: 14px;
  font-size: 16px;
}

.loading-indicator.hidden {
  display: none;
}

/* 底部信息 */
.footer {
  background-color: var(--primary-color);
  color: white;
  padding: 20px 0;
  text-align: center;
  margin-top: 30px;
}

.footer-text {
  font-size: 12px;
  margin: 0;
  color: rgba(255, 255, 255, 0.8);
}

/* CSS3动画效果 */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(50px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 动画效果由JavaScript控制，通过animateProductCards()函数实现交错动画 */

/* 空状态样式 */
.empty-state {
  text-align: center;
  padding: 50px 0;
  color: var(--primary-color);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 200px;
  width: 100vw;
  margin-left: calc(-50vw + 50%);
  left: 50%;
  position: relative;
}

.empty-state-icon {
  font-size: 48px;
  margin-bottom: 15px;
  opacity: 0.5;
}

.empty-state-text {
  font-size: 16px;
  margin-bottom: 10px;
}

.empty-state-subtext {
  font-size: 14px;
  color: #666;
}

/* 滚动条样式 */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: var(--light-color);
}

::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--accent-color);
}

/* 响应式设计 */
@media (max-width: 768px) {
  .nav-list {
    gap: 8px;
    padding: 0 10px;
  }
  
  .nav-item {
    padding: 6px 12px;
    font-size: 13px;
  }
  
  /* 确保搜索框和按钮在移动端也在同一行 */
  .search-box {
    flex-direction: row;
    align-items: center;
  }
  
  .search-input {
    width: 65%;
    flex: 0.65;
    font-size: 13px;
  }
  
  .search-btn {
    width: 35%;
    flex: 0.35;
    font-size: 12px;
  }
  
  .section-title {
    font-size: 18px;
  }
}

@media (max-width: 480px) {
  .product-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }
  
  .product-title {
    font-size: 12px;
    padding: 8px;
  }
  
  .product-category {
    font-size: 10px;
    padding: 3px 6px;
  }
}