/* 产品展示页专用样式 */
.products-page {
    padding: var(--spacing-lg) 0;
}

.products-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: var(--spacing-lg);
    margin-top: var(--spacing-lg);
}

/* 左侧分类导航 */
.category-sidebar {
    background-color: white;
    border-radius: var(--border-radius);
    padding: var(--spacing-md);
    box-shadow: var(--shadow);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.category-sidebar h3 {
    font-size: 1.3rem;
    margin-bottom: var(--spacing-md);
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
    color: var(--dark-color);
}

.category-sidebar h3:after {
    display: none;
}

/* 分类列表 */
.category-list {
    margin-bottom: var(--spacing-lg);
}

.main-category {
    margin-bottom: 5px;
    border-radius: var(--border-radius);
    overflow: hidden;
}

.category-header {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    background-color: var(--light-color);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.category-header:hover {
    background-color: #e9e9e9;
}

.main-category.active .category-header {
    background-color: var(--primary-color);
    color: white;
}

.category-header i:first-child {
    margin-right: 10px;
    width: 20px;
    text-align: center;
}

.category-header i:last-child {
    margin-left: auto;
    transition: transform 0.3s ease;
}

.main-category.active .category-header i:last-child {
    transform: rotate(180deg);
}

.sub-category-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
    background-color: #f9f9f9;
}

.main-category.active .sub-category-list {
    max-height: 300px;
}

.sub-category {
    padding: 10px 15px 10px 45px;
    cursor: pointer;
    transition: var(--transition);
    border-left: 3px solid transparent;
}

.sub-category:hover {
    background-color: #f0f0f0;
    color: var(--primary-color);
}

.sub-category.active {
    background-color: rgba(139, 69, 19, 0.1);
    color: var(--primary-color);
    border-left-color: var(--primary-color);
    font-weight: 500;
}

/* 价格筛选器 */
.price-filter {
    margin-bottom: var(--spacing-lg);
}

.price-range {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.price-inputs {
    display: flex;
    align-items: center;
    gap: 5px;
    flex: 1;
}

.price-inputs input {
    width: 100%;
    padding: 8px 10px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
}

.price-inputs span {
    color: #777;
}

.btn-small {
    padding: 8px 15px;
    font-size: 0.9rem;
}

.price-presets {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.price-preset {
    padding: 8px 12px;
    background-color: #f5f5f5;
    border: 1px solid #eee;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.9rem;
    text-align: left;
}

.price-preset:hover {
    background-color: #e9e9e9;
    border-color: #ddd;
}

.price-preset.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 热门产品 */
.hot-products {
    margin-top: var(--spacing-lg);
}

.hot-product-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    transition: var(--transition);
}

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

.hot-product-item:hover {
    transform: translateX(5px);
}

.hot-product-img {
    width: 60px;
    height: 60px;
    border-radius: var(--border-radius);
    overflow: hidden;
    flex-shrink: 0;
}

.hot-product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hot-product-info h4 {
    font-size: 1rem;
    margin-bottom: 5px;
    font-weight: 500;
}

.hot-product-price {
    color: var(--primary-color);
    font-weight: 600;
    font-size: 0.95rem;
}

/* 右侧产品列表区域 */
.products-main {
    flex: 1;
}

.current-category-info {
    background-color: white;
    padding: var(--spacing-md);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    margin-bottom: var(--spacing-md);
}

.current-category-info h2 {
    margin-bottom: 10px;
}

#currentCategoryDesc {
    color: #666;
    margin-bottom: 0;
}

/* 产品控制栏 */
.products-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-md);
    padding: 15px;
    background-color: white;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
}

.sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.sort-options label {
    font-weight: 500;
}

.sort-options select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    background-color: white;
    font-size: 0.95rem;
    cursor: pointer;
}

.view-options {
    display: flex;
    gap: 10px;
}

.view-btn {
    padding: 8px 15px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-size: 0.95rem;
    display: flex;
    align-items: center;
    gap: 5px;
}

.view-btn:hover {
    background-color: #e9e9e9;
}

.view-btn.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

/* 产品网格视图 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.products-grid.active {
    display: grid;
}

.products-grid:not(.active) {
    display: none;
}

/* 产品卡片 */
.product-card {
    background-color: white;
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: var(--transition);
    position: relative;
}

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

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}

.product-badge.hot {
    background-color: #FF6B6B;
    color: white;
}

.product-badge.new {
    background-color: #4ECDC4;
    color: white;
}

.product-badge.sale {
    background-color: #FFD166;
    color: #333;
}

.product-img {
    height: 200px;
    overflow: hidden;
    position: relative;
}

.product-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

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

.product-info {
    padding: var(--spacing-md);
}

.product-info h3 {
    font-size: 1.2rem;
    margin-bottom: 10px;
    height: 2.8em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-description {
    color: #666;
    font-size: 0.95rem;
    margin-bottom: 15px;
    height: 3.6em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
}

.product-price {
    font-size: 1.5rem;
    color: var(--primary-color);
    font-weight: 700;
    margin-bottom: 15px;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 0.9rem;
    color: #777;
}

.product-meta span {
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-actions {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #f5f5f5;
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.btn-icon:hover {
    background-color: var(--primary-color);
    color: white;
}

.wishlist-btn.active i {
    color: #FF6B6B;
}

/* 产品列表视图 */
.products-list {
    display: none;
    flex-direction: column;
    gap: var(--spacing-md);
    margin-bottom: var(--spacing-lg);
}

.products-list.active {
    display: flex;
}

.products-list .product-card {
    display: flex;
    height: 180px;
}

.products-list .product-img {
    width: 200px;
    height: 100%;
    flex-shrink: 0;
}

.products-list .product-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.products-list .product-info h3 {
    height: auto;
    margin-bottom: 10px;
}

.products-list .product-description {
    height: auto;
    margin-bottom: 10px;
    -webkit-line-clamp: 2;
}

.products-list .product-meta {
    margin-bottom: 10px;
}

.products-list .product-actions {
    margin-top: auto;
}

/* 分页控件 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    margin-top: var(--spacing-lg);
}

.pagination-btn {
    padding: 10px 20px;
    background-color: white;
    border: 1px solid #ddd;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
    display: flex;
    align-items: center;
    gap: 5px;
}

.pagination-btn:hover:not(:disabled) {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

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

.page-numbers {
    display: flex;
    gap: 5px;
}

.page-number {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: var(--transition);
    font-weight: 500;
}

.page-number:hover:not(.active) {
    background-color: #f5f5f5;
}

.page-number.active {
    background-color: var(--primary-color);
    color: white;
}

/* 响应式设计 */
@media (max-width: 992px) {
    .products-layout {
        grid-template-columns: 1fr;
    }
    
    .category-sidebar {
        position: static;
        margin-bottom: var(--spacing-md);
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
    
    .products-list .product-card {
        height: auto;
        flex-direction: column;
    }
    
    .products-list .product-img {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 768px) {
    .products-controls {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
}