/* 商品分类页样式 */

/* 面包屑导航 */
.breadcrumb {
    background: #f8f8f8;
    padding: 15px 0;
    font-size: 14px;
}

.breadcrumb .container {
    display: flex;
    align-items: center;
    gap: 10px;
}

.breadcrumb a {
    color: #666;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: #e74c3c;
}

.breadcrumb .separator {
    color: #999;
}

.breadcrumb .current {
    color: #333;
    font-weight: bold;
}

/* 分类页面主体 */
.category-page {
    padding: 30px 0;
    background: #f5f5f5;
}

.category-layout {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 20px;
}

/* 左侧筛选栏 */
.filter-sidebar {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
    height: fit-content;
}

.filter-section {
    margin-bottom: 25px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.filter-section:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.filter-title {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    margin-bottom: 15px;
}

.category-list li,
.price-list li,
.discount-list li {
    margin-bottom: 10px;
}

.category-list a,
.price-list a,
.discount-list a {
    color: #666;
    font-size: 14px;
    transition: color 0.3s;
}

.category-list a:hover,
.price-list a:hover,
.discount-list a:hover,
.category-list li.active a {
    color: #e74c3c;
}

.category-list li.active a {
    font-weight: bold;
}

/* 价格筛选 */
.price-filter {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 15px;
}

.price-input {
    width: 70px;
    padding: 8px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    font-size: 13px;
}

.price-separator {
    color: #999;
}

.price-btn {
    padding: 8px 15px;
    background: #e74c3c;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 13px;
}

.price-btn:hover {
    background: #c0392b;
}

/* 品牌筛选 */
.brand-list li {
    margin-bottom: 10px;
}

.brand-list label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    color: #666;
    font-size: 14px;
}

.brand-list input[type="checkbox"] {
    width: 16px;
    height: 16px;
    cursor: pointer;
}

/* 右侧商品列表 */
.product-content {
    background: #fff;
    border-radius: 8px;
    padding: 20px;
}

/* 排序栏 */
.sort-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
    margin-bottom: 20px;
}

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

.sort-options a {
    padding: 8px 15px;
    color: #666;
    font-size: 14px;
    border-radius: 4px;
    transition: all 0.3s;
}

.sort-options a:hover {
    color: #e74c3c;
}

.sort-options a.active {
    background: #e74c3c;
    color: #fff;
}

.page-info {
    color: #666;
    font-size: 14px;
}

.page-info .page-num {
    margin-left: 10px;
    color: #e74c3c;
    font-weight: bold;
}

/* 商品网格 - 分类页 */
.category-grid {
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

.category-grid .product-card {
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s;
}

.category-grid .product-card:hover {
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.category-grid .product-link {
    display: block;
}

.category-grid .product-img {
    padding: 0;
    background: #f8f8f8;
}

.category-grid .product-img img {
    width: 100%;
    height: 200px;
    object-fit: cover;
}

.category-grid .product-info {
    padding: 15px;
}

.category-grid .product-name {
    font-size: 14px;
    color: #333;
    margin-bottom: 10px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.category-grid .price-box {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.category-grid .current-price {
    font-size: 18px;
    color: #e74c3c;
    font-weight: bold;
}

.category-grid .original-price {
    font-size: 12px;
    color: #999;
    text-decoration: line-through;
}

.category-grid .product-tags {
    display: flex;
    gap: 5px;
}

.category-grid .tag {
    background: #e74c3c;
    color: #fff;
    padding: 2px 8px;
    font-size: 12px;
    border-radius: 4px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding-top: 20px;
    border-top: 1px solid #f0f0f0;
}

.page-btn,
.page-num {
    padding: 8px 15px;
    border: 1px solid #e5e5e5;
    border-radius: 4px;
    color: #666;
    font-size: 14px;
    transition: all 0.3s;
}

.page-btn:hover:not(.disabled),
.page-num:hover:not(.active) {
    border-color: #e74c3c;
    color: #e74c3c;
}

.page-btn.disabled {
    color: #ccc;
    cursor: not-allowed;
}

.page-num.active {
    background: #e74c3c;
    border-color: #e74c3c;
    color: #fff;
}

.page-ellipsis {
    color: #999;
}

/* 响应式设计 */
@media (max-width: 1200px) {
    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 992px) {
    .category-layout {
        grid-template-columns: 1fr;
    }

    .filter-sidebar {
        display: none; /* 移动端可以添加一个筛选按钮来显示 */
    }

    .category-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 768px) {
    .category-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .sort-bar {
        flex-direction: column;
        gap: 10px;
        align-items: flex-start;
    }

    .sort-options {
        overflow-x: auto;
        width: 100%;
    }

    .sort-options a {
        white-space: nowrap;
    }
}

@media (max-width: 480px) {
    .category-grid {
        grid-template-columns: 1fr;
    }

    .pagination {
        flex-wrap: wrap;
    }
}