.product-section {
  padding: 32px 0;
  background: #fafbfc;
}

.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px 20px;
  max-width: 1100px;
  margin: 0 auto;
}

.product-item {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  text-align: center;
  padding: 20px 10px 16px 10px;
  transition: box-shadow 0.2s, transform 0.2s;
  border: 1px solid #eee;
}

.product-item:hover {
  box-shadow: 0 6px 24px rgba(0, 0, 0, 0.13);
  transform: translateY(-4px) scale(1.03);
}

.product-item img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin-bottom: 12px;
  border-radius: 6px;
  background: #f5f5f5;
  transition: box-shadow 0.2s;
}

.product-name {
  font-size: 1.1em;
  font-weight: 500;
  margin-bottom: 8px;
  color: #222;
  transition: color 0.2s;
}

.product-item a {
  color: inherit;
  text-decoration: none;
}

.product-item a:hover .product-name {
  color: #e67e22;
}

.product-price {
  color: #e67e22;
  font-weight: bold;
  font-size: 1.05em;
  margin-top: 4px;
}





/* ========== 商品頁面左側邊欄布局 ========== */

/* 主要布局容器 */
.shop-layout {
  display: flex;
  gap: 24px;
  min-height: 100vh;
  background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
  padding: 20px;
}

/* 左側邊欄 */
.category-sidebar {
  width: 300px;
  min-width: 300px;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  position: sticky;
  top: 20px;
  height: calc(100vh - 40px);
  overflow-y: auto;
  overflow-x: hidden;
  z-index: 10;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

/* 側邊欄標題 */
.sidebar-header {
  padding: 2rem 1.5rem;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 16px 16px 0 0;
  position: sticky;
  top: 0;
  z-index: 11;
  box-shadow: 0 4px 20px rgba(102, 126, 234, 0.3);
}

.sidebar-title {
  margin: 0;
  color: #fff;
  font-size: 1.2rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

.sidebar-title i {
  font-size: 1.2rem;
  background: rgba(255, 255, 255, 0.2);
  padding: 8px;
  border-radius: 8px;
}

/* 分類導航容器 */
.category-nav {
  padding: 1rem 0;
  background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
}

/* 分類項目 */
.category-item {
  margin: 0.5rem 1rem;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
  border: 1px solid #f1f3f4;
}

.category-item:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

.category-item:last-child {
  margin-bottom: 1rem;
}

/* 分類連結 */
.category-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.875rem 1.25rem;
  color: #495057;
  text-decoration: none;
  transition: all 0.3s ease;
  position: relative;
  border-left: 3px solid transparent;
}

.category-link:hover {
  background: linear-gradient(90deg, #f8f9ff 0%, rgba(0, 123, 255, 0.05) 100%);
  color: #007bff;
  border-left-color: #007bff;
  transform: translateX(2px);
}

/* 分類圖標 */
.category-icon {
  width: 18px;
  text-align: center;
  font-size: 1rem;
  transition: all 0.3s ease;
}

/* 分類名稱 */
.category-name {
  flex: 1;
  font-weight: 500;
  font-size: 0.95rem;
  line-height: 1.3;
}

/* 展開圖標 */
.expand-icon {
  font-size: 0.8rem;
  opacity: 0.6;
  transition: all 0.3s ease;
}

.category-item:hover .expand-icon {
  opacity: 1;
  transform: translateX(2px);
}

.category-item.expanded .expand-icon {
  transform: rotate(90deg);
}

/* 特色項目（超值搶購） */
.category-item.featured-item .category-link {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: #fff;
  font-weight: 600;
  border-left-color: #dc3545;
}

.category-item.featured-item .category-link:hover {
  background: linear-gradient(135deg, #ff5252 0%, #d84315 100%);
  transform: translateX(4px);
  box-shadow: 0 2px 8px rgba(255, 107, 107, 0.3);
}

.category-item.featured-item .category-icon {
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

/* 當前選中的分類 */
.category-item.current-category .category-link {
  background: linear-gradient(90deg, #e8f5e8 0%, rgba(40, 167, 69, 0.1) 100%);
  color: #28a745;
  border-left-color: #28a745;
  font-weight: 600;
}

.category-item.current-category .category-icon {
  color: #28a745;
  transform: scale(1.1);
}

/* 子分類列表 */
.subcat-list {
  display: none;
  list-style: none;
  margin: 0;
  padding: 0;
  background: #f8f9fa;
  border-top: 1px solid #e9ecef;
  animation: slideDown 0.3s ease;
}

.category-item.expanded .subcat-list {
  display: block;
}

@keyframes slideDown {
  from {
    opacity: 0;
    max-height: 0;
  }
  to {
    opacity: 1;
    max-height: 500px;
  }
}

/* 子分類項目 */
.subcat-item {
  border-bottom: 1px solid #f1f3f4;
}

.subcat-item:last-child {
  border-bottom: none;
}

/* 子分類連結 */
.subcat-link {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1.25rem 0.75rem 2.5rem;
  color: #6c757d;
  text-decoration: none;
  transition: all 0.2s ease;
  border-left: 3px solid transparent;
}

.subcat-link:hover {
  background: #fff;
  color: #495057;
  border-left-color: #007bff;
  transform: translateX(3px);
}

/* 子分類縮圖 */
.subcat-thumb {
  width: 32px;
  height: 32px;
  object-fit: contain;
  border-radius: 4px;
  border: 2px solid #e9ecef;
  transition: border-color 0.2s ease;
}

.subcat-thumb-placeholder {
  width: 32px;
  height: 32px;
  background: #e9ecef;
  border-radius: 4px;
  border: 2px solid #e9ecef;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 0.875rem;
  transition: all 0.2s ease;
}

.subcat-link:hover .subcat-thumb,
.subcat-link:hover .subcat-thumb-placeholder {
  border-color: #007bff;
}

/* 子分類資訊 */
.subcat-info {
  flex: 1;
  min-width: 0;
}

.subcat-name {
  font-size: 0.875rem;
  font-weight: 500;
  margin-bottom: 0.25rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.subcat-desc {
  font-size: 0.8rem;
  color: #adb5bd;
  line-height: 1.2;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 當前選中的子分類 */
.subcat-item.current-subcat .subcat-link {
  background: #fff;
  color: #28a745;
  border-left-color: #28a745;
  font-weight: 600;
}

.subcat-item.current-subcat .subcat-name {
  color: #28a745;
}

.current-indicator {
  color: #28a745;
  font-size: 0.75rem;
}

/* 右側主要內容區域 */
.main-content {
  flex: 1;
  background: #fff;
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
  overflow: hidden;
  min-height: calc(100vh - 40px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
}

/* 內容標題區域 */
.content-header {
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  padding: 2rem 2.5rem;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 20;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  backdrop-filter: blur(10px);
  border-radius: 16px 16px 0 0;
}

.content-title {
  margin: 0;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  font-size: 1.75rem;
  font-weight: 700;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.content-meta {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.product-count {
  color: #6c757d;
  font-size: 1rem;
  font-weight: 500;
  background: rgba(108, 117, 125, 0.1);
  padding: 0.5rem 1rem;
  border-radius: 20px;
  border: 1px solid rgba(108, 117, 125, 0.2);
}

/* 內容控制區域 */
.content-controls {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

/* 排序選項 */
.sort-options {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.sort-select {
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  background: #fff;
  color: #495057;
  font-size: 0.875rem;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.3s ease;
  min-width: 150px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.sort-select:hover {
  border-color: #007bff;
  box-shadow: 0 4px 8px rgba(0, 123, 255, 0.15);
}

.sort-select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.sort-select option {
  padding: 0.5rem;
  background: #fff;
  color: #495057;
}

/* 檢視選項 */
.view-options {
  display: flex;
  gap: 0.5rem;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  padding: 0.75rem;
  border-radius: 12px;
  border: 1px solid #dee2e6;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  backdrop-filter: blur(10px);
}

.view-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  border: none;
  background: #fff;
  color: #6c757d;
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 0.875rem;
  font-weight: 500;
  position: relative;
  overflow: hidden;
  min-width: 80px;
  justify-content: center;
  border: 1px solid transparent;
}

.view-btn:hover {
  color: #495057;
  background: #e9ecef;
  transform: translateY(-1px);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  border-color: #dee2e6;
}

.view-btn.active {
  background: linear-gradient(135deg, #007bff 0%, #0056b3 100%);
  color: #fff;
  box-shadow: 0 3px 12px rgba(0, 123, 255, 0.3);
  transform: translateY(-2px);
  border-color: #0056b3;
}

.view-btn.active:hover {
  background: linear-gradient(135deg, #0056b3 0%, #004085 100%);
  transform: translateY(-2px);
}

/* 網格檢視圖示特效 */
.view-btn.grid-view i {
  font-size: 1rem;
  position: relative;
}

.view-btn.grid-view.active i::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200%;
  height: 200%;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  animation: gridPulse 2s infinite;
}

/* 列表檢視圖示特效 */
.view-btn.list-view i {
  font-size: 1rem;
  position: relative;
}

.view-btn.list-view.active i::after {
  content: '';
  position: absolute;
  top: 0;
  left: -2px;
  width: calc(100% + 4px);
  height: 100%;
  background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.3) 50%, transparent 100%);
  animation: listShine 2s infinite;
}

.view-label {
  font-weight: 600;
  letter-spacing: 0.5px;
}

/* 動畫效果 */
@keyframes gridPulse {
  0%, 100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.8);
  }
  50% {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1.2);
  }
}

@keyframes listShine {
  0%, 100% {
    transform: translateX(-100%);
    opacity: 0;
  }
  50% {
    transform: translateX(100%);
    opacity: 1;
  }
}

/* 響應式調整 */
@media (max-width: 768px) {
  .view-options {
    gap: 0.25rem;
    padding: 0.25rem;
  }
  
  .view-btn {
    padding: 0.5rem 0.75rem;
    min-width: 70px;
    font-size: 0.8rem;
  }
  
  .view-label {
    display: none;
  }
  
  .view-btn i {
    font-size: 1.1rem;
  }
}

/* 商品區域 */
.product-section {
  padding: 2.5rem;
  background: linear-gradient(180deg, #fff 0%, #f8f9fa 100%);
  border-radius: 0 0 16px 16px;
  width: 100%;
  box-sizing: border-box;
  overflow-x: hidden; /* 防止水平溢出 */
}

/* 麵包屑導航 */
.content-breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: #6c757d;
  font-size: 0.875rem;
  margin-bottom: 1.5rem;
  background: rgba(248, 249, 250, 0.8);
  padding: 1rem 1.5rem;
  border-radius: 12px;
  border: 1px solid #e9ecef;
}

/* 商品網格容器 - 統一寬度 */
.product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
  margin-bottom: 3rem;
  max-width: 100%;
}

/* 商品卡片樣式 - 統一基礎樣式 */
.product-card {
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  border: 1px solid #f1f3f4;
  position: relative;
  backdrop-filter: blur(10px);
  width: 100%; /* 確保統一寬度 */
  max-width: 100%; /* 防止溢出 */
}

.product-card:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
  border-color: #667eea;
}

.product-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.product-card:hover::before {
  opacity: 1;
}

/* 商品圖片容器 */
.product-image {
  position: relative;
  width: 100%;
  height: 180px;
  overflow: hidden;
  background: #f8f9fa;
}

.product-thumb {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-card:hover .product-thumb {
  transform: scale(1.05);
}

.product-thumb-placeholder {
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #adb5bd;
  font-size: 2rem;
}

/* 商品資訊 */
.product-info {
  padding: 1.25rem;
}

.product-title {
  font-size: 1rem;
  font-weight: 600;
  color: #2c3e50;
  margin-bottom: 0.5rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-description {
  color: #6c757d;
  font-size: 0.875rem;
  margin-bottom: 1rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.current-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: #28a745;
}

.original-price {
  font-size: 1rem;
  color: #6c757d;
  text-decoration: line-through;
}

.discount-badge {
  background: #dc3545;
  color: #fff;
  padding: 0.25rem 0.5rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
}

/* 商品標籤 */
.product-badges {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.product-badge {
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fff;
}

/* 規格徽章 - 全部隱藏 */
.specs-badge {
  display: none !important;
}

.specs-badge i {
  font-size: 0.8rem;
}

.badge-new {
  background: #007bff;
}

.badge-hot {
  background: #dc3545;
}

.badge-sale {
  background: #fd7e14;
}

/* 商品操作按鈕 */
.product-actions {
  display: flex;
  gap: 0.5rem;
}

/* 統一按鈕樣式 - 提高特異性 */
.product-card .product-actions .btn {
  flex: 1;
  padding: 0.75rem 1rem !important;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem !important;
  text-decoration: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 44px; /* 確保按鈕最小高度 */
  box-sizing: border-box; /* 確保 padding 計算正確 */
}

.product-card .product-actions .btn-primary {
  background: #007bff !important;
  color: #fff !important;
}

.product-card .product-actions .btn-primary:hover {
  background: #0056b3 !important;
  transform: translateY(-1px);
}

.product-card .product-actions .btn-secondary {
  background: #6c757d !important;
  color: #fff !important;
}

.product-card .product-actions .btn-secondary:hover {
  background: #545b62 !important;
  transform: translateY(-1px);
}

.product-card .product-actions .btn:disabled {
  background: #6c757d !important;
  cursor: not-allowed;
  transform: none;
}

.product-card .product-actions .btn.success {
  background: #28a745 !important;
}

.product-card .product-actions .btn.success:hover {
  background: #1e7e34 !important;
}

/* 向後相容：舊的 btn-add-cart 樣式 */
.product-card .btn-add-cart {
  flex: 1;
  padding: 0.75rem 1rem !important;
  background: #007bff !important;
  color: #fff !important;
  border: none;
  border-radius: 8px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem !important;
  min-height: 44px; /* 確保按鈕最小高度 */
  box-sizing: border-box; /* 確保 padding 計算正確 */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.product-card .btn-add-cart:hover {
  background: #0056b3 !important;
  transform: translateY(-1px);
}

.product-card .btn-add-cart:disabled {
  background: #6c757d !important;
  cursor: not-allowed;
  transform: none;
}

.product-card .btn-add-cart.success {
  background: #28a745 !important;
}

.product-card .btn-add-cart.success:hover {
  background: #1e7e34 !important;
}

.product-card .btn-quick-view {
  padding: 0.75rem 1rem !important;
  background: #f8f9fa !important;
  color: #6c757d !important;
  border: 1px solid #dee2e6;
  border-radius: 8px;
  cursor: pointer;
  transition: all 0.2s ease;
  font-size: 0.8rem !important;
  white-space: nowrap;
  min-width: auto;
  min-height: 44px; /* 確保按鈕最小高度 */
  box-sizing: border-box; /* 確保 padding 計算正確 */
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.product-card .btn-quick-view:hover {
  background: #e9ecef !important;
  color: #495057 !important;
  transform: translateY(-1px);
}

/* 沒有商品時的顯示 */
.no-products {
  text-align: center;
  padding: 4rem 2rem;
  color: #6c757d;
}

.no-products-icon {
  font-size: 4rem;
  color: #dee2e6;
  margin-bottom: 1rem;
}

.no-products h3 {
  margin: 1rem 0 0.5rem 0;
  color: #495057;
  font-weight: 600;
}

.no-products p {
  font-size: 1rem;
  line-height: 1.6;
  max-width: 400px;
  margin: 0 auto;
}

/* 分頁樣式 */
.pagination-wrapper {
  display: flex;
  justify-content: center;
  padding: 2rem 0;
  border-top: 1px solid #e9ecef;
  margin-top: 2rem;
}

.pagination {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.pagination-btn,
.pagination-number {
  padding: 0.75rem 1rem;
  border: 1px solid #dee2e6;
  background: #fff;
  color: #495057;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
  font-weight: 500;
  min-width: 44px;
  text-align: center;
  display: inline-block;
}

.pagination-btn:hover,
.pagination-number:hover {
  background: #f8f9fa;
  border-color: #adb5bd;
  color: #007bff;
  transform: translateY(-1px);
}

.pagination-btn.active,
.pagination-number.current {
  background: #007bff;
  border-color: #007bff;
  color: #fff;
}

.pagination-btn.disabled {
  opacity: 0.5;
  cursor: not-allowed;
  pointer-events: none;
}

.pagination-ellipsis {
  padding: 0.75rem 0.5rem;
  color: #6c757d;
  font-weight: 500;
}

.pagination-info {
  color: #6c757d;
  font-size: 0.875rem;
  margin: 0 1rem;
  white-space: nowrap;
}

/* 響應式設計 */
@media screen and (max-width: 1200px) {
  .shop-layout {
    padding: 15px;
    gap: 20px;
  }
  
  .category-sidebar {
    width: 280px;
    min-width: 280px;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
  }
  
  .content-header {
    padding: 1.5rem 2rem;
  }
  
  .product-section {
    padding: 2rem;
  }
}

@media screen and (max-width: 992px) {
  .shop-layout {
    flex-direction: column;
    padding: 10px;
    gap: 20px;
  }
  
  .category-sidebar {
    width: 100%;
    min-width: 100%;
    height: auto;
    max-height: 400px;
    position: static;
    border-radius: 16px;
  }
  
  .main-content {
    min-height: auto;
  }
  
  .content-header {
    position: static;
    border-radius: 16px 16px 0 0;
  }
  
  /* 確保側邊欄切換按鈕不會顯示 */
  .sidebar-toggle {
    display: none !important;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }
  
  .product-section {
    padding: 1.5rem;
    border-radius: 0 0 16px 16px;
  }
}

@media screen and (max-width: 768px) {
  .desktop-only {
    display: none !important;
  }
  
  .shop-layout {
    padding: 8px;
    gap: 16px;
    display: block; /* 改為block布局，因為側邊欄已隱藏 */
  }
  
  .main-content {
    width: 100%; /* 確保主內容佔滿寬度 */
    min-height: auto;
  }
  
  .content-header {
    padding: 1.25rem 1.5rem;
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    border-radius: 12px 12px 0 0;
  }
  
  .content-meta {
    width: 100%;
    justify-content: space-between;
    gap: 1rem;
    flex-wrap: wrap;
  }
  
  .content-controls {
    gap: 1rem;
    flex-wrap: wrap;
  }
  
  .sort-options {
    order: 1;
    width: 100%;
  }
  
  .sort-select {
    width: 100%;
    min-width: auto;
  }
  
  .view-options {
    order: 2;
  }
  
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
  }
  
  .product-section {
    padding: 1.25rem;
    border-radius: 0 0 12px 12px;
  }
  
  /* 手機板文字大小調整 */
  .product-title {
    font-size: 0.9rem;
  }
  
  .current-price {
    font-size: 1rem;
  }
  
  /* 手機板隱藏多規格標籤 */
  .specs-badge {
    display: none !important;
  }
  
  /* 列表檢視在平板上的調整 */
  .product-grid.view-list .product-card {
    flex-direction: column;
    text-align: center;
    padding: 1.5rem;
    min-height: auto;
  }
  
  .product-grid.view-list .product-card .product-image {
    width: 100%;
    height: 200px;
    margin-right: 0;
    margin-bottom: 1.5rem;
    align-self: center;
    max-width: 300px;
  }
  
  .product-grid.view-list .product-card .product-info {
    height: auto;
    padding: 0;
  }
  
  .product-grid.view-list .product-card .product-actions {
    justify-content: center;
    max-width: none;
  }
}

@media screen and (max-width: 576px) {
  .content-header {
    padding: 0.75rem 1rem;
  }
  
  .content-title {
    font-size: 1.1rem;
  }
  
  .content-meta {
    flex-direction: column;
    align-items: stretch;
    gap: 1rem;
  }
  
  .content-controls {
    flex-direction: column;
    gap: 1rem;
  }
  
  .sort-options {
    order: 1;
    width: 100%;
  }
  
  .sort-select {
    width: 100%;
    padding: 0.6rem 0.8rem;
    font-size: 0.8rem;
  }
  
  .view-options {
    order: 2;
    justify-content: center;
  }
  
  .product-grid {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .product-info {
    padding: 0.8rem;
  }
  
  .product-title {
    font-size: 0.85rem;
  }
  
  .current-price {
    font-size: 0.95rem;
  }
  
  .product-actions {
    flex-direction: column;
    gap: 0.5rem;
  }
  
  .btn-quick-view {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  .btn-add-cart {
    padding: 0.5rem 0.75rem;
    font-size: 0.75rem;
  }
  
  /* 手機板隱藏多規格標籤 */
  .specs-badge {
    display: none !important;
  }
  
  /* 列表檢視在小螢幕的額外調整 */
  .product-grid.view-list {
    gap: 1rem; /* 減少卡片間距 */
  }
  
  .product-grid.view-list .product-card {
    padding: 0.75rem; /* 進一步減少內距 */
    margin: 0 0.25rem; /* 減少左右邊距 */
    border-radius: 8px; /* 減少圓角 */
  }
  
  .product-grid.view-list .product-card .product-image {
    height: 200px; /* 調大圖片高度 */
    margin-bottom: 12px;
  }
  
  .product-grid.view-list .product-card .product-title {
    font-size: 0.85rem; /* 縮小標題 */
    margin-bottom: 0.5rem;
  }
  
  .product-grid.view-list .product-card .product-price {
    font-size: 0.95rem; /* 縮小價格 */
    margin-bottom: 0.75rem;
  }
  
  .product-grid.view-list .product-card .product-actions .btn {
    padding: 0.5rem 0.75rem; /* 縮小按鈕 */
    font-size: 0.75rem;
  }
}

/* 滾動條樣式 */
.category-sidebar::-webkit-scrollbar {
  width: 8px;
}

.category-sidebar::-webkit-scrollbar-track {
  background: rgba(248, 249, 250, 0.5);
  border-radius: 4px;
}

.category-sidebar::-webkit-scrollbar-thumb {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-radius: 4px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.category-sidebar::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(135deg, #5a6fd8 0%, #6a4190 100%);
}

/* 動畫效果 */
@keyframes slideInLeft {
  from {
    opacity: 0;
    transform: translateX(-20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.category-sidebar {
  animation: slideInLeft 0.5s ease;
}

.product-card {
  animation: fadeInUp 0.5s ease forwards;
}

.product-card:nth-child(1) { animation-delay: 0.1s; }
.product-card:nth-child(2) { animation-delay: 0.2s; }
.product-card:nth-child(3) { animation-delay: 0.3s; }
.product-card:nth-child(4) { animation-delay: 0.4s; }
.product-card:nth-child(5) { animation-delay: 0.5s; }
.product-card:nth-child(6) { animation-delay: 0.6s; }

/* 響應式設計增強 */
@media screen and (max-width: 1024px) {
  .category-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 1rem;
  }
  
  .category-name {
    font-size: 1rem;
  }
}


@media screen and (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .category-section {
    display: none !important;
  }  
}

/* 分頁樣式 */
/* === 分頁樣式美化 === */
.pagination-wrapper {
  margin-top: 20px;
  text-align: center;
}

.pagination-container {
  background: linear-gradient(135deg, #f8f9ff 0%, #fff 50%, #f1f5ff 100%);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 8px 32px rgba(102, 126, 234, 0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  max-width: 800px;
  margin: 0 auto;
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-bottom: 12px;
  flex-wrap: wrap;
}

.pagination-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: white;
  border: none;
  border-radius: 12px;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  min-width: 85px;
  justify-content: center;
  box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
  position: relative;
  overflow: hidden;
}

.pagination-btn::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.3), transparent);
  transition: left 0.5s ease;
}

.pagination-btn:hover::before {
  left: 100%;
}

.pagination-btn:hover {
  transform: translateY(-2px) scale(1.05);
  box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.pagination-btn.disabled {
  background: linear-gradient(135deg, #e0e6ed 0%, #c3cfe2 100%);
  color: #a0a0a0;
  cursor: not-allowed;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pagination-btn.disabled:hover {
  transform: none;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

.pagination-btn.disabled::before {
  display: none;
}

.btn-text {
  font-weight: 600;
  letter-spacing: 0.5px;
}

.pagination-numbers {
  display: flex;
  align-items: center;
  gap: 3px;
  margin: 0 8px;
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.7);
  border-radius: 20px;
  backdrop-filter: blur(5px);
  box-shadow: inset 0 2px 8px rgba(0,0,0,0.05);
}

.pagination-number {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border: 2px solid transparent;
  border-radius: 10px;
  color: #4a5568;
  text-decoration: none;
  font-size: 12px;
  font-weight: 600;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  background: rgba(255, 255, 255, 0.8);
  box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.pagination-number:hover {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.3);
}

.pagination-number.current {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  border-color: #667eea;
  color: white;
  cursor: default;
  font-weight: 700;
  transform: scale(1.15);
  box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}

.pagination-number.current .active-indicator {
  position: absolute;
  bottom: -2px;
  left: 50%;
  transform: translateX(-50%);
  width: 12px;
  height: 3px;
  background: #fff;
  border-radius: 2px;
  box-shadow: 0 0 8px rgba(255,255,255,0.8);
}

.pagination-number.first-page,
.pagination-number.last-page {
  background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
  color: white;
  font-weight: 700;
}

.pagination-number.first-page:hover,
.pagination-number.last-page:hover {
  background: linear-gradient(135deg, #ff5252 0%, #d63031 100%);
  transform: translateY(-2px) scale(1.1);
  box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
}

.pagination-ellipsis {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: #667eea;
  font-size: 14px;
  animation: pulse 2s infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.6; }
  50% { opacity: 1; }
}

.pagination-info {
  border-top: 1px solid rgba(102, 126, 234, 0.1);
  padding-top: 12px;
  margin-top: 12px;
}

.pagination-stats {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.pagination-stats span {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #4a5568;
  font-size: 13px;
  font-weight: 500;
  padding: 4px 10px;
  background: rgba(255, 255, 255, 0.6);
  border-radius: 20px;
  backdrop-filter: blur(5px);
  box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.pagination-stats span i {
  color: #667eea;
  font-size: 12px;
}

.pagination-stats span strong {
  color: #667eea;
  font-weight: 700;
}

/* === 響應式設計 === */
@media screen and (max-width: 768px) {
  .pagination-container {
    padding: 12px;
    border-radius: 12px;
  }
  
  .pagination {
    flex-direction: column;
    gap: 8px;
  }
  
  .pagination-numbers {
    margin: 0;
    order: -1;
    padding: 6px 12px;
  }
  
  .pagination-btn {
    min-width: 120px;
    padding: 10px 20px;
    font-size: 13px;
  }
  
  .pagination-stats {
    flex-direction: column;
    gap: 8px;
    text-align: center;
  }
  
  .pagination-number {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }
}

@media screen and (max-width: 480px) {
  .pagination-container {
    padding: 8px;
    margin: 0 8px;
  }
  
  .pagination-numbers {
    gap: 2px;
    padding: 4px 8px;
  }
  
  .pagination-number {
    width: 26px;
    height: 26px;
    font-size: 10px;
  }
  
  .pagination-btn {
    padding: 8px 16px;
    font-size: 12px;
    min-width: 100px;
  }
  
  .btn-text {
    display: none;
  }
  
  .pagination-btn i {
    font-size: 14px;
  }
}

.no-products {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  color: #6c757d;
  font-size: 16px;
}

.no-products p {
  margin: 0;
  background: #f8f9fa;
  border: 2px dashed #dee2e6;
  border-radius: 8px;
  padding: 40px;
  display: inline-block;
}

/* 檢視模式樣式 */
.product-grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
  max-width: 100%;
  width: 100%; /* 確保容器寬度 */
  box-sizing: border-box; /* 包含 padding 在寬度計算中 */
}

.product-grid.view-list .product-card {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  padding: 2rem;
  width: 100%; /* 統一寬度 */
  max-width: 100%; /* 防止溢出 */
  min-height: 200px;
  background: linear-gradient(135deg, #fff 0%, #f8f9fa 100%);
  box-sizing: border-box; /* 包含 padding 在寬度計算中 */
  overflow: hidden; /* 防止內容溢出 */
}

.product-grid.view-list .product-card .product-image {
  flex-shrink: 0;
  width: 200px;
  height: 180px;
  margin-right: 2rem;
  margin-bottom: 0;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.product-grid.view-list .product-card .product-image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.3s ease;
}

.product-grid.view-list .product-card:hover .product-image img {
  transform: scale(1.05);
}

.product-grid.view-list .product-card .product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 160px;
  padding: 0.5rem 0;
}

.product-grid.view-list .product-card .product-title {
  margin-bottom: 1rem;
  font-size: 1.3rem;
  line-height: 1.4;
  font-weight: 600;
  color: #2c3e50;
}

.product-grid.view-list .product-card .product-price {
  font-size: 1.4rem;
  margin-bottom: 1.5rem;
  font-weight: 700;
}

.product-grid.view-list .product-card .product-actions {
  margin-top: auto;
  display: flex;
  gap: 1rem;
  max-width: 400px;
}

/* 響應式調整 */
@media screen and (max-width: 768px) {
  .product-grid.view-list .product-card {
    flex-direction: column;
    text-align: center;
    padding: 1rem; /* 減少內距 */
    margin: 0 0.5rem; /* 添加左右邊距防止觸邊 */
  }
  
  .product-grid.view-list .product-card .product-image {
    width: 100%;
    height: 220px;
    margin-right: 0;
    margin-bottom: 16px;
    max-width: 100%; /* 確保不會超出容器 */
  }
  
  .product-grid.view-list .product-card .product-info {
    height: auto;
    width: 100%; /* 確保不會超出容器 */
  }
  
  .product-grid.view-list .product-card .product-title {
    font-size: 1.1rem; /* 縮小標題字體 */
    margin-bottom: 0.75rem;
  }
  
  .product-grid.view-list .product-card .product-price {
    font-size: 1.2rem; /* 縮小價格字體 */
    margin-bottom: 1rem;
  }
  
  .product-grid.view-list .product-card .product-actions {
    max-width: 100%; /* 移除固定寬度限制 */
    flex-direction: column; /* 垂直排列按鈕 */
    gap: 0.5rem; /* 減少按鈕間距 */
    width: 100%; /* 確保按鈕區域佔滿寬度 */
  }
  
  .product-grid.view-list .product-card .product-actions .btn {
    width: 100%; /* 按鈕佔滿寬度 */
    max-width: 100%; /* 防止超出 */
  }
}

/* ===== 強制按鈕樣式覆蓋 ===== */
/* 這些樣式用於確保商品頁面按鈕不被其他全域樣式影響 */

.product-card .product-actions .btn,
.product-card .btn-add-cart,
.product-card .btn-quick-view {
  box-sizing: border-box !important;
  min-height: 44px !important;
  padding: 0.75rem 1rem !important;
  font-size: 0.8rem !important;
  line-height: 1.2 !important;
  font-weight: 600 !important;
  border-radius: 8px !important;
  border: none !important;
  cursor: pointer !important;
  transition: all 0.2s ease !important;
  text-decoration: none !important;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 0.5rem !important;
  white-space: nowrap !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
}

/* 確保主要按鈕顏色正確 */
.product-card .product-actions .btn-primary,
.product-card .btn-add-cart:not(.success) {
  background: #007bff !important;
  color: #fff !important;
}

.product-card .product-actions .btn-primary:hover,
.product-card .btn-add-cart:not(.success):hover {
  background: #0056b3 !important;
  transform: translateY(-1px) !important;
}

/* 確保次要按鈕顏色正確 */
.product-card .product-actions .btn-secondary,
.product-card .btn-quick-view {
  background: #f8f9fa !important;
  color: #6c757d !important;
  border: 1px solid #dee2e6 !important;
}

.product-card .product-actions .btn-secondary:hover,
.product-card .btn-quick-view:hover {
  background: #e9ecef !important;
  color: #495057 !important;
  transform: translateY(-1px) !important;
}

/* 成功狀態按鈕 */
.product-card .btn-add-cart.success {
  background: #28a745 !important;
  color: #fff !important;
}

.product-card .btn-add-cart.success:hover {
  background: #1e7e34 !important;
}

/* 禁用狀態按鈕 */
.product-card .product-actions .btn:disabled,
.product-card .btn-add-cart:disabled {
  background: #6c757d !important;
  color: #fff !important;
  cursor: not-allowed !important;
  transform: none !important;
}

/* 無限滾動載入指示器 */
.infinite-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background: transparent;
}

.infinite-loading .loading-spinner {
  margin-bottom: 16px;
}

.infinite-loading .spinner {
  width: 40px;
  height: 40px;
  border: 3px solid #f3f4f6;
  border-top: 3px solid #007bff;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

.infinite-loading .loading-text {
  color: #6b7280;
  font-size: 14px;
  margin: 0;
  font-weight: 500;
}

/* 沒有更多商品的提示 */
.no-more-products {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  background: transparent;
  color: #6b7280;
  border-top: 1px solid #e5e7eb;
  margin-top: 20px;
}

.no-more-products i {
  font-size: 24px;
  color: #10b981;
  margin-bottom: 12px;
}

.no-more-products p {
  margin: 0;
  font-size: 14px;
  font-weight: 500;
}

/* 響應式設計 */
@media (max-width: 768px) {
  .infinite-loading,
  .no-more-products {
    padding: 30px 15px;
  }
  
  .infinite-loading .spinner {
    width: 32px;
    height: 32px;
    border-width: 2px;
  }
  
  .infinite-loading .loading-text,
  .no-more-products p {
    font-size: 13px;
  }
  
  .no-more-products i {
    font-size: 20px;
  }
}