/* =========================================
   商城页面现代化布局
   ========================================= */
.mall-container {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

/* 顶部 Banner */
.mall-banner {
  position: relative;
  width: 100%;
  height: 280px;
  border-radius: 20px;
  overflow: hidden;
  display: flex;
  align-items: center;
  padding: 0 50px;
  box-shadow: 0 10px 30px rgba(0,0,0,0.05);
  background: linear-gradient(135deg, #FFF3E0 0%, #FFCC80 100%);
}

.mall-banner::before {
  content: '';
  position: absolute;
  right: -50px;
  bottom: -50px;
  width: 400px;
  height: 400px;
  background: url('../images/g1.png') center/contain no-repeat;
  opacity: 0.3;
  mix-blend-mode: multiply;
  pointer-events: none;
}

.mall-banner-content {
  position: relative;
  z-index: 2;
  max-width: 500px;
}

.mall-banner-tag {
  display: inline-block;
  background: #FF5252;
  color: white;
  padding: 4px 12px;
  border-radius: 12px 0 12px 0;
  font-size: 14px;
  font-weight: bold;
  margin-bottom: 16px;
  box-shadow: 0 4px 10px rgba(255, 82, 82, 0.3);
}

.mall-banner-title {
  font-size: 36px;
  font-weight: 800;
  color: #333;
  margin-bottom: 12px;
  line-height: 1.3;
}

.mall-banner-desc {
  font-size: 16px;
  color: #555;
  margin-bottom: 24px;
}

.mall-banner-btn {
  background: #FF5252;
  color: white;
  border: none;
  padding: 12px 32px;
  border-radius: 30px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
  box-shadow: 0 6px 15px rgba(255, 82, 82, 0.4);
  transition: all 0.3s;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.mall-banner-btn:hover {
  background: #E53935;
  transform: translateY(-2px);
}

/* 主体分栏 */
.mall-layout {
  display: flex;
  gap: 24px;
  align-items: flex-start;
}

/* =========================================
   左侧分类与筛选面板
   ========================================= */
.mall-sidebar {
  width: 260px;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  gap: 20px;
  position: sticky;
  top: 90px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

.mall-sidebar::-webkit-scrollbar {
  width: 4px;
}
.mall-sidebar::-webkit-scrollbar-thumb {
  background-color: rgba(0,0,0,0.1);
  border-radius: 4px;
}

/* 分类菜单 */
.category-menu {
  background: var(--white);
  border-radius: 16px;
  padding: 20px 0;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.menu-title {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-primary);
  padding: 0 20px 15px;
  margin-bottom: 10px;
  border-bottom: 1px solid #f0f0f0;
}

.menu-list {
  display: flex;
  flex-direction: column;
}

.menu-item {
  padding: 12px 20px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--text-secondary);
  font-size: 14px;
  border-left: 3px solid transparent;
}

.menu-item:hover {
  background: #f9fbf9;
  color: var(--primary-color);
}

.menu-item.active {
  background: rgba(76, 175, 80, 0.08);
  color: var(--primary-color);
  font-weight: bold;
  border-left-color: var(--primary-color);
}

.menu-item i {
  font-size: 12px;
  color: #ccc;
}

/* 条件筛选卡片 */
.filter-card {
  background: var(--white);
  border-radius: 16px;
  padding: 20px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.03);
}

.filter-group {
  margin-bottom: 20px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-name {
  font-size: 14px;
  font-weight: bold;
  color: var(--text-primary);
  margin-bottom: 12px;
}

.filter-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-tag {
  background: #f5f5f5;
  color: #666;
  padding: 6px 12px;
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.filter-tag:hover {
  background: #fff;
  color: var(--primary-color);
  border-color: var(--primary-color);
}

.filter-tag.active {
  background: var(--primary-color);
  color: #fff;
  border-color: var(--primary-color);
}

/* 带有Checkbox的特殊筛选 */
.checkbox-filter {
  display: flex;
  align-items: center;
  gap: 8px;
  cursor: pointer;
  font-size: 13px;
  color: var(--text-primary);
  margin-top: 15px;
  padding: 10px;
  background: #FFF8E1;
  border-radius: 8px;
  border: 1px solid #FFE0B2;
}

.checkbox-filter input {
  accent-color: #FF9800;
  width: 16px;
  height: 16px;
}

/* =========================================
   右侧商品展示区域
   ========================================= */
.mall-main {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* 排序控制条 */
.sort-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--white);
  padding: 15px 24px;
  border-radius: 16px;
  box-shadow: 0 4px 15px rgba(0,0,0,0.02);
}

.sort-options {
  display: flex;
  gap: 24px;
}

.sort-item {
  font-size: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color 0.2s;
}

.sort-item:hover, .sort-item.active {
  color: var(--primary-color);
  font-weight: bold;
}

.sort-item.active i {
  color: var(--primary-color);
}

/* 商品网格 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

/* 商品卡片全新设计 */
.product-card {
  background: var(--white);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 5px 20px rgba(0,0,0,0.03);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  border: 1px solid transparent;
  display: flex;
  flex-direction: column;
  position: relative;
  cursor: pointer;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 15px 35px rgba(0,0,0,0.08);
  border-color: rgba(76, 175, 80, 0.3);
}

/* 图片区 */
.product-img-box {
  width: 100%;
  height: 220px;
  position: relative;
  background: #fcfcfc;
  padding: 8px; /* 留一点间距 */
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-img {
  width: 100%;
  height: 100%;
  object-fit: cover; /* 自适应填充 */
  border-radius: 12px; /* 添加点圆角 */
  transition: transform 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-card:hover .product-img {
  transform: scale(0.96);
}

.badge-top-left {
  position: absolute;
  top: 12px;
  left: 12px;
  background: linear-gradient(135deg, #FF5252, #D32F2F);
  color: white;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 10px;
  border-radius: 8px 0 8px 0;
  z-index: 2;
  box-shadow: 0 4px 10px rgba(255, 82, 82, 0.3);
}

.badge-top-right {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(255,255,255,0.9);
  color: #FF9800;
  font-size: 12px;
  font-weight: bold;
  padding: 4px 8px;
  border-radius: 4px;
  border: 1px solid #FFE0B2;
  z-index: 2;
}

/* 信息区 */
.product-info {
  padding: 16px 20px;
  display: flex;
  flex-direction: column;
  flex: 1;
  position: relative;
  background: var(--white);
  z-index: 2;
  transition: transform 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.product-title {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color 0.2s;
}

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

.product-specs {
  display: flex;
  gap: 8px;
  margin-bottom: auto;
  flex-wrap: wrap;
}

.spec-tag {
  background: #f5f5f5;
  color: #666;
  font-size: 11px;
  padding: 2px 6px;
  border-radius: 4px;
}

.product-price-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed #eee;
}

.price-main {
  color: #FF5252;
  font-size: 20px;
  font-weight: bold;
}

.price-main small {
  font-size: 14px;
}

.price-old {
  font-size: 12px;
  color: #999;
  text-decoration: line-through;
  margin-left: 6px;
}

.sales-vol {
  font-size: 12px;
  color: #999;
}

/* 底部操作 */
.product-actions {
  display: flex;
  gap: 10px;
  padding: 16px 20px 20px;
  opacity: 0;
  transform: translateY(10px);
  transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  background: var(--white);
  z-index: 1;
}

.product-card:hover .product-actions {
  opacity: 1;
  transform: translateY(0);
}

.product-card:hover .product-info {
  transform: translateY(-64px);
}

.btn-buy-sm {
  flex: 1;
  background: var(--primary-color);
  color: white;
  border: none;
  padding: 8px 0;
  border-radius: 8px;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.2s;
}

.btn-buy-sm:hover {
  background: var(--primary-dark);
}

.btn-cart-sm {
  width: 36px;
  height: 36px;
  background: #f5f5f5;
  color: #333;
  border: none;
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-cart-sm:hover {
  background: #FFF3E0;
  color: #FF9800;
}

/* 响应式 */
@media (max-width: 1024px) {
  .mall-layout {
    flex-direction: column;
  }
  .mall-sidebar {
    width: 100%;
    position: static;
    max-height: none;
  }
  .mall-banner {
    height: 220px;
    padding: 0 30px;
  }
}

@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(1, 1fr);
  }
  .mall-banner-title {
    font-size: 28px;
  }
  .sort-options {
    gap: 15px;
  }
  .product-card:hover .product-actions {
    position: static;
    opacity: 1;
    transform: none;
    padding: 0 20px 20px;
  }
  .product-card:hover .product-info {
    transform: none;
  }
  .product-actions {
    position: static;
    opacity: 1;
    transform: none;
    padding: 0 20px 20px;
  }
}
