/* 商品列表页面样式 - 惠多多 */

/* 分类页面头部 */
.category-header {
    background: linear-gradient(135deg, #ff6b6b 0%, #ffa500 100%);
    color: white;
    padding: 40px 0;
}

.category-info {
    display: flex;
    align-items: center;
    gap: 30px;
}

.category-icon {
    width: 100px;
    height: 100px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 48px;
    color: white;
}

.category-details h1 {
    font-size: 36px;
    font-weight: 700;
    margin-bottom: 10px;
}

.category-details p {
    font-size: 18px;
    opacity: 0.9;
    margin-bottom: 10px;
}

.product-count {
    font-size: 16px;
    opacity: 0.8;
}

/* 面包屑导航 */
.breadcrumb {
    background: #f8f9fa;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb ol {
    display: flex;
    list-style: none;
    margin: 0;
    padding: 0;
    align-items: center;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '/';
    margin: 0 10px;
    color: #7f8c8d;
}

.breadcrumb a {
    color: #7f8c8d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #ff6b6b;
}

.breadcrumb .active {
    color: #2c3e50;
    font-weight: 500;
}

/* 主要内容区域 */
.main-content {
    padding: 30px 0;
    min-height: 600px;
}

.shop-layout {
    display: grid;
    grid-template-columns: 250px 1fr;
    gap: 30px;
}

/* 侧边栏 */
.sidebar {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.filter-section {
    margin-bottom: 30px;
}

.filter-section:last-child {
    margin-bottom: 0;
}

.filter-section h3 {
    font-size: 18px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 15px;
    padding-bottom: 10px;
    border-bottom: 2px solid #ff6b6b;
}

/* 分类列表 */
.category-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    color: #7f8c8d;
    text-decoration: none;
    border-radius: 8px;
    transition: all 0.3s ease;
    font-size: 14px;
}

.category-list a:hover {
    background: #f8f9fa;
    color: #ff6b6b;
}

.category-list li.active a {
    background: #ff6b6b;
    color: white;
}

.category-list a i {
    margin-right: 10px;
    width: 16px;
    text-align: center;
}

.category-list .count {
    margin-left: auto;
    font-size: 12px;
    opacity: 0.7;
}

/* 价格筛选 */
.price-filter {
    padding: 15px 0;
}

#price-range {
    width: 100%;
    height: 6px;
    border-radius: 3px;
    background: #e9ecef;
    outline: none;
    -webkit-appearance: none;
}

#price-range::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff6b6b;
    cursor: pointer;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

#price-range::-moz-range-thumb {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: #ff6b6b;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(255, 107, 107, 0.3);
}

.price-display {
    text-align: center;
    margin-top: 15px;
    font-size: 14px;
    color: #7f8c8d;
}

/* 商品区域 */
.products-area {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* 工具栏 */
.toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.toolbar-left h2 {
    font-size: 24px;
    font-weight: 700;
    color: #2c3e50;
    margin: 0 0 5px 0;
}

.product-count {
    color: #7f8c8d;
    font-size: 14px;
}

.toolbar-right {
    display: flex;
    align-items: center;
    gap: 20px;
}

/* 排序下拉框 */
.sort-dropdown select {
    padding: 8px 12px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    background: white;
    color: #2c3e50;
    font-size: 14px;
    cursor: pointer;
    transition: border-color 0.3s ease;
}

.sort-dropdown select:focus {
    outline: none;
    border-color: #ff6b6b;
}

/* 视图切换 */
.view-toggle {
    display: flex;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    overflow: visible;
}

.view-btn {
    padding: 8px 12px;
    border: none;
    background: white;
    color: #7f8c8d;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.view-btn:hover {
    background: #f8f9fa;
    color: #ff6b6b;
}

.view-btn.active {
    background: #ff6b6b;
    color: white;
}

/* 商品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 40px;
}

.products-grid.list-view {
    grid-template-columns: 1fr;
}

.products-grid.list-view .product-card {
    display: flex;
    flex-direction: row;
    align-items: center;
}

.products-grid.list-view .product-image {
    width: 200px;
    height: 150px;
    flex-shrink: 0;
}

.products-grid.list-view .product-info {
    flex: 1;
    padding: 20px;
}

/* 无商品状态 */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #7f8c8d;
}

.no-products i {
    font-size: 64px;
    color: #e9ecef;
    margin-bottom: 20px;
}

.no-products h3 {
    font-size: 24px;
    margin-bottom: 10px;
    color: #2c3e50;
}

.no-products p {
    font-size: 16px;
    margin-bottom: 30px;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
}

.page-btn {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    color: #7f8c8d;
    text-decoration: none;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
    gap: 5px;
}

.page-btn:hover {
    border-color: #ff6b6b;
    color: #ff6b6b;
    transform: translateY(-2px);
}

.page-btn.active {
    background: #ff6b6b;
    border-color: #ff6b6b;
    color: white;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .shop-layout {
        grid-template-columns: 200px 1fr;
        gap: 20px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .shop-layout {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .sidebar {
        position: static;
        order: 2;
    }
    
    .products-area {
        order: 1;
    }
    
    .toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: flex-start;
    }
    
    .toolbar-right {
        width: 100%;
        justify-content: space-between;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 15px;
    }
    
    .products-grid.list-view .product-card {
        flex-direction: column;
    }
    
    .products-grid.list-view .product-image {
        width: 100%;
        height: 200px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 20px 0;
    }
    
    .sidebar,
    .products-area {
        padding: 20px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .toolbar-left h2 {
        font-size: 20px;
    }
    
    .pagination {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .page-btn {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 40px;
}

.loading::after {
    content: '';
    width: 40px;
    height: 40px;
    border: 4px solid #e9ecef;
    border-top: 4px solid #ff6b6b;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 筛选器动画 */
.filter-section {
    animation: slideInLeft 0.6s ease-out;
}

@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* 商品卡片悬停效果 */
.product-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}
