
/* 基础样式重置 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'PingFang SC', 'Microsoft YaHei', sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f8f9fa;
}

/* 商品列表主容器 */
.products-main {
    padding-top: 100px;
    padding-bottom: 80px;
    background-color: #f8fafc;
}

.products-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}


/* 面包屑导航 - 与list_news保持一致 */
.products-breadcrumb {
    margin-bottom: 30px;
    padding: 15px 0;
    border-bottom: 1px solid #eef2f7;
}

.breadcrumb-list {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: #666;
    text-decoration: none;
    font-size: 14px;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #1a56a7;
}

.breadcrumb-separator {
    margin: 0 10px;
    color: #ccc;
    font-size: 12px;
}

.breadcrumb-current {
    color: #1a56a7;
    font-weight: 500;
    font-size: 14px;
}

/* 主内容区域 */
.products-main-content {
    display: flex;
    gap: 30px;
}

@media (max-width: 992px) {
    .products-main-content {
        flex-direction: column;
    }
}

/* 筛选区域 */
.products-filter-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 20px;
}

.products-filter-title {
    font-size: 20px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #222;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

.products-filter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 20px;
}

@media (max-width: 768px) {
    .products-filter-grid {
        grid-template-columns: 1fr;
    }
}

.products-filter-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.products-filter-label {
    font-size: 14px;
    font-weight: 500;
    color: #555;
}

.products-filter-select {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: border-color 0.3s;
}

.products-filter-select:hover {
    border-color: #2c7be5;
}

.products-filter-select:focus {
    outline: none;
    border-color: #2c7be5;
    box-shadow: 0 0 0 2px rgba(44, 123, 229, 0.1);
}

.products-search-box {
    grid-column: span 2;
    display: flex;
    gap: 10px;
}

@media (max-width: 768px) {
    .products-search-box {
        grid-column: span 1;
    }
}

.products-search-input {
    padding: 10px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    flex: 1;
}

.products-search-input:focus {
    outline: none;
    border-color: #2c7be5;
    box-shadow: 0 0 0 2px rgba(44, 123, 229, 0.1);
}

.products-search-btn {
    padding: 10px 25px;
    background: #2c7be5;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
    margin-top: 24px;
}

.products-search-btn:hover {
    background: #1c65c9;
}

/* 商品列表区域 */
.products-list-section {
    flex: 1;
}

.products-list-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.products-list-title {
    font-size: 24px;
    font-weight: 700;
    color: #222;
}

.products-sort-options {
    display: flex;
    align-items: center;
    gap: 10px;
}

.products-sort-label {
    font-size: 14px;
    color: #666;
}

.products-sort-select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    background: white;
    cursor: pointer;
}

/* 商品网格布局 */
.products-list-content {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
}

@media (max-width: 768px) {
    .products-list-content {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    }
}

/* 商品项样式 */
.product-item {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    transition: all 0.3s;
    text-decoration: none;
    color: inherit;
    display: block;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
}

.product-image {
    height: 200px;
    overflow: hidden;
    position: relative;
    background: #f5f7fa;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s;
}

.product-item:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 15px;
    left: 15px;
    background: #e74c3c;
    color: white;
    padding: 4px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
}

.product-favorite {
    position: absolute;
    top: 15px;
    right: 15px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    cursor: pointer;
    transition: all 0.3s;
}

.product-favorite:hover {
    background: white;
    transform: scale(1.1);
}

.product-favorite.active {
    color: #e74c3c;
}

.product-content {
    padding: 20px;
}

.product-category {
    display: inline-block;
    font-size: 12px;
    color: #2c7be5;
    background: rgba(44, 123, 229, 0.1);
    padding: 4px 10px;
    border-radius: 4px;
    margin-bottom: 10px;
}

.product-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
    color: #333;
    line-height: 1.4;
    height: 50px;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-description {
    font-size: 14px;
    color: #666;
    margin-bottom: 15px;
    line-height: 1.5;
    height: 42px;
    overflow: hidden;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid #f0f0f0;
}

.product-price {
    font-size: 22px;
    font-weight: 700;
    color: #e74c3c;
}

.product-original-price {
    font-size: 16px;
    color: #999;
    text-decoration: line-through;
    margin-left: 5px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 5px;
}

.product-stars {
    color: #f39c12;
    font-size: 14px;
}

.product-rating-count {
    font-size: 14px;
    color: #666;
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.product-stock {
    font-size: 14px;
    color: #27ae60;
    font-weight: 500;
}

.product-add-cart {
    padding: 8px 16px;
    background: #2c7be5;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.3s;
}

.product-add-cart:hover {
    background: #1c65c9;
}

/* 侧边栏 */
.products-sidebar {
    width: 280px;
}

@media (max-width: 992px) {
    .products-sidebar {
        width: 100%;
    }
}

.sidebar-section {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    margin-bottom: 25px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #222;
    padding-bottom: 15px;
    border-bottom: 2px solid #f0f0f0;
}

/* 热门商品 */
.hot-products-list {
    list-style: none;
}

.hot-product-item {
    display: flex;
    gap: 15px;
    padding: 15px 0;
    border-bottom: 1px solid #f0f0f0;
    text-decoration: none;
    color: inherit;
}

.hot-product-item:last-child {
    border-bottom: none;
}

.hot-product-item:hover {
    background: #f8fafd;
}

.hot-product-rank {
    width: 24px;
    height: 24px;
    background: #2c7be5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.hot-product-rank.top1 {
    background: #e74c3c;
}

.hot-product-rank.top2 {
    background: #f39c12;
}

.hot-product-rank.top3 {
    background: #2c7be5;
}

.hot-product-content {
    flex: 1;
}

.hot-product-title {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 5px;
    display: block;
}

.hot-product-price {
    font-size: 16px;
    color: #e74c3c;
    font-weight: 600;
}

/* 分类列表 */
.category-list {
    list-style: none;
}

.category-item {
    margin-bottom: 10px;
}

.category-item:last-child {
    margin-bottom: 0;
}

.category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 15px;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
}

.category-link:hover {
    background: #f8fafd;
    color: #2c7be5;
}

.category-link.active {
    background: #2c7be5;
    color: white;
}

.category-count {
    font-size: 12px;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 8px;
    border-radius: 12px;
}

.category-link.active .category-count {
    background: rgba(255, 255, 255, 0.2);
}

/* 价格筛选 */
.price-filter-list {
    list-style: none;
}

.price-filter-item {
    margin-bottom: 8px;
}

.price-filter-link {
    display: block;
    padding: 10px 15px;
    color: #555;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s;
}

.price-filter-link:hover {
    background: #f8fafd;
    color: #2c7be5;
}

/* 分页 */

.products-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-top: 40px;
    gap: 10px;
}

.pagination-arrow {
    padding: 8px 16px;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.pagination-arrow:hover {
    background: #007bff;
    color: white;
}

.pagination-arrow.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.pagination-list {
    display: flex;
    gap: 5px;
    list-style: none;
    margin: 0;
    padding: 0;
}

.pagination-item {
    min-width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f5f5f5;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination-item a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: #333;
}

.pagination-item:hover {
    background: #e0e0e0;
}

.pagination-item.active {
    background: #007bff;
    color: white;
}

.pagination-item.active a {
    color: white;
}

.pagination-ellipsis {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    color: #999;
}


/* 无商品提示 */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-products-icon {
    font-size: 60px;
    margin-bottom: 20px;
    opacity: 0.3;
}

.no-products-text {
    font-size: 18px;
    margin-bottom: 10px;
}

/* 返回顶部按钮 */
.back-to-top {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 50px;
    height: 50px;
    background: #2c7be5;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s;
    box-shadow: 0 4px 12px rgba(44, 123, 229, 0.3);
    z-index: 1000;
}

.back-to-top.visible {
    opacity: 1;
    visibility: visible;
}

.back-to-top:hover {
    background: #1c65c9;
    transform: translateY(-3px);
}

/* 响应式调整 */
@media (max-width: 768px) {
    .products-main {
        padding: 15px;
    }

    .products-filter-section,
    .sidebar-section {
        padding: 20px;
    }

    .products-list-content {
        gap: 15px;
    }

    .pagination-list {
        flex-wrap: wrap;
        justify-content: center;
    }
}

