/* ========== Products Sidebar - Premium Styles ========== */

/* 侧边栏整体 */
.products-sidebar {
  position: sticky;
  top: 100px;
  width: 280px;
  flex-shrink: 0;
}

/* 分类区块 */
.sidebar-section {
  background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
  border-radius: 16px;
  padding: 28px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 1px solid rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
  transition: all 0.3s ease;
}

.sidebar-section:hover {
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.06);
  transform: translateY(-2px);
}

/* 分类标题 */
.sidebar-title {
  font-size: 18px;
  font-weight: 800;
  color: #1f2937;
  margin: 0 0 20px;
  padding-bottom: 16px;
  border-bottom: 2px solid rgba(196, 154, 108, 0.2);
  display: flex;
  align-items: center;
  gap: 10px;
  letter-spacing: -0.3px;
  position: relative;
}

.sidebar-title::before {
  content: '📂';
  font-size: 20px;
}

.sidebar-title::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg, #c49a6c 0%, transparent 100%);
}

/* 分类列表 */
.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.category-item {
  margin-bottom: 8px;
  position: relative;
}

.category-item a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(249, 250, 251, 0.6) 0%, rgba(243, 244, 246, 0.4) 100%);
  border-radius: 12px;
  color: #4b5563;
  text-decoration: none;
  font-weight: 600;
  font-size: 14px;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid transparent;
  position: relative;
  overflow: hidden;
}

.category-item a::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, #c49a6c 0%, #a67c52 100%);
  transform: scaleY(0);
  transition: transform 0.3s ease;
}

.category-item a::after {
  content: '›';
  position: absolute;
  right: 12px;
  font-size: 18px;
  color: #c49a6c;
  opacity: 0;
  transform: translateX(-10px);
  transition: all 0.3s ease;
}

.category-item:hover a {
  background: linear-gradient(135deg, rgba(196, 154, 108, 0.08) 0%, rgba(166, 124, 82, 0.04) 100%);
  border-color: rgba(196, 154, 108, 0.2);
  color: #1f2937;
  padding-left: 24px;
}

.category-item:hover a::before {
  transform: scaleY(1);
}

.category-item:hover a::after {
  opacity: 1;
  transform: translateX(0);
}

/* 当前激活项 */
.category-item.active a {
  background: linear-gradient(135deg, #c49a6c 0%, #a67c52 100%);
  color: #fff;
  box-shadow: 0 4px 12px rgba(196, 154, 108, 0.3);
  border-color: transparent;
}

.category-item.active a::after {
  content: '✓';
  opacity: 1;
  transform: translateX(0);
  color: #fff;
  font-weight: 700;
}

/* 数量徽章 */
.category-item .count {
  background: rgba(0, 0, 0, 0.06);
  padding: 4px 12px;
  border-radius: 12px;
  font-size: 12px;
  font-weight: 700;
  color: #9ca3af;
  transition: all 0.3s ease;
}

.category-item:hover .count {
  background: rgba(196, 154, 108, 0.15);
  color: #c49a6c;
}

.category-item.active .count {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* CTA 区块 */
.sidebar-cta {
  background: linear-gradient(135deg, #c49a6c 0%, #a67c52 100%);
  border-radius: 16px;
  padding: 28px;
  text-align: center;
  box-shadow: 0 8px 24px rgba(196, 154, 108, 0.3);
  position: relative;
  overflow: hidden;
}

.sidebar-cta::before {
  content: '';
  position: absolute;
  top: -50%;
  left: -50%;
  width: 200%;
  height: 200%;
  background: radial-gradient(circle, rgba(255,255,255,0.1) 0%, transparent 70%);
  animation: rotate 20s linear infinite;
}

@keyframes rotate {
  from { transform: rotate(0deg); }
  to { transform: rotate(360deg); }
}

.sidebar-cta-title {
  font-size: 20px;
  font-weight: 800;
  color: #fff;
  margin: 0 0 12px;
  position: relative;
  z-index: 1;
}

.sidebar-cta-text {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.9);
  margin: 0 0 20px;
  line-height: 1.6;
  position: relative;
  z-index: 1;
}

.sidebar-cta .btn {
  position: relative;
  z-index: 1;
  background: #fff;
  color: #a67c52;
  font-weight: 700;
  padding: 14px 28px;
  border-radius: 10px;
  text-decoration: none;
  display: inline-block;
  transition: all 0.3s ease;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.sidebar-cta .btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
}

/* 分类图标 */
.category-item.kitchen a::before {
  content: '🍳';
  position: absolute;
  left: 12px;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-item.bathroom a::before {
  content: '🛁';
  position: absolute;
  left: 12px;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-item.living-room a::before {
  content: '🛋️';
  position: absolute;
  left: 12px;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-item.bedroom a::before {
  content: '🛏️';
  position: absolute;
  left: 12px;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-item.storage a::before {
  content: '📦';
  position: absolute;
  left: 12px;
  font-size: 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.category-item:hover a::before {
  opacity: 1;
}

.category-item.active a::before {
  opacity: 1;
}

/* 骨架屏加载动画 */
@keyframes shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}

.sidebar-section.skeleton {
  background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
}

/* 响应式 */
@media (max-width: 1024px) {
  .products-sidebar {
    width: 100%;
    position: static;
    margin-bottom: 32px;
  }
  
  .sidebar-section {
    padding: 20px;
  }
  
  .category-item a {
    padding: 12px 14px;
  }
}

@media (max-width: 600px) {
  .sidebar-title {
    font-size: 16px;
  }
  
  .category-item .count {
    display: none;
  }
  
  .sidebar-cta {
    padding: 20px;
  }
  
  .sidebar-cta-title {
    font-size: 18px;
  }
  
  .sidebar-cta-text {
    font-size: 13px;
  }
}

/* 暗黑模式支持 */
@media (prefers-color-scheme: dark) {
  .sidebar-section {
    background: linear-gradient(180deg, #1f2937 0%, #111827 100%);
    border-color: rgba(255, 255, 255, 0.1);
  }
  
  .sidebar-title {
    color: #f9fafb;
    border-bottom-color: rgba(196, 154, 108, 0.3);
  }
  
  .category-item a {
    background: rgba(255, 255, 255, 0.03);
    color: #d1d5db;
  }
  
  .category-item:hover a {
    background: rgba(196, 154, 108, 0.1);
    color: #f9fafb;
  }
  
  .category-item .count {
    background: rgba(255, 255, 255, 0.08);
    color: #9ca3af;
  }
}

/* ========== FIX: Ensure Category List Displays ========== */
.sidebar-section .category-list {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
}

.sidebar-section .category-item {
  display: list-item !important;
  visibility: visible !important;
  opacity: 1 !important;
  margin-bottom: 8px !important;
}

.sidebar-section .category-item a {
  display: flex !important;
  justify-content: space-between !important;
  align-items: center !important;
  padding: 14px 18px !important;
  background: linear-gradient(135deg, rgba(249, 250, 251, 0.6) 0%, rgba(243, 244, 246, 0.4) 100%) !important;
  border-radius: 12px !important;
  color: #4b5563 !important;
  text-decoration: none !important;
  font-weight: 600 !important;
  font-size: 14px !important;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
  border: 1px solid transparent !important;
  position: relative !important;
  overflow: hidden !important;
}

.sidebar-section .category-item .count {
  display: inline-block !important;
  visibility: visible !important;
  opacity: 1 !important;
  background: rgba(0, 0, 0, 0.06) !important;
  padding: 4px 12px !important;
  border-radius: 12px !important;
  font-size: 12px !important;
  font-weight: 700 !important;
  color: #9ca3af !important;
  transition: all 0.3s ease !important;
}
