/* 面包屑导航 */
.breadcrumb {
    background: #f5f5f5;
    padding: 15px 0;
    border-bottom: 1px solid #e0e0e0;
}

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

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

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

/* 商品页面布局 */
.products-page {
    padding: 40px 0;
    min-height: 60vh;
}

.page-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 30px;
}

/* 侧边栏样式 */
.sidebar {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    height: fit-content;
    position: sticky;
    top: 100px;
}

.category-filter,
.price-filter,
.brand-filter {
    margin-bottom: 30px;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}

.category-filter:last-child,
.price-filter:last-child,
.brand-filter:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

.category-filter h3,
.price-filter h3,
.brand-filter h3 {
    color: #333;
    font-size: 18px;
    margin-bottom: 15px;
    font-weight: 600;
}

.category-list {
    list-style: none;
}

.category-list li {
    margin-bottom: 8px;
}

.category-list a {
    display: block;
    padding: 10px 15px;
    color: #666;
    border-radius: 5px;
    transition: all 0.3s;
}

.category-list a:hover,
.category-list a.active {
    background: #e74c3c;
    color: #fff;
}

.price-range {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.price-range input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
}

.price-range span {
    text-align: center;
    color: #999;
}

.price-range button {
    background: #e74c3c;
    color: #fff;
    padding: 10px;
    border-radius: 5px;
    font-weight: 500;
    transition: background 0.3s;
}

.price-range button:hover {
    background: #c0392b;
}

.brand-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

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

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

/* 主内容区域 */
.main-content {
    background: #fff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

/* 商品工具栏 */
.product-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.result-count {
    color: #666;
    font-size: 14px;
}

.result-count strong {
    color: #e74c3c;
    font-size: 18px;
}

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

.sort-options span {
    color: #666;
    font-size: 14px;
}

.sort-options select {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 14px;
    background: #fff;
    cursor: pointer;
}

.view-toggle {
    display: flex;
    gap: 5px;
}

.view-toggle button {
    width: 35px;
    height: 35px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.view-toggle button:hover,
.view-toggle button.active {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

/* 商品网格视图 */
.products-grid-view {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.products-grid-view.product-item {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    transition: all 0.3s;
}

.products-grid-view.product-item:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
    transform: translateY(-5px);
}

.product-item-image {
    position: relative;
    height: 200px;
    background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
    overflow: hidden;
}

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

.product-item-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.products-grid-view.product-item:hover .product-item-overlay {
    opacity: 1;
}

.product-item-overlay .btn-view-detail,
.product-item-overlay .btn-add-to-cart {
    background: #fff;
    color: #333;
    padding: 10px 20px;
    border-radius: 5px;
    margin: 0 5px;
    font-weight: 500;
    transition: all 0.3s;
}

.product-item-overlay .btn-view-detail:hover,
.product-item-overlay .btn-add-to-cart:hover {
    background: #e74c3c;
    color: #fff;
}

.product-item-info {
    padding: 15px;
}

.product-item-category {
    color: #999;
    font-size: 12px;
    text-transform: uppercase;
}

.product-item-title {
    color: #333;
    font-size: 16px;
    margin: 10px 0;
    font-weight: 600;
}

.product-item-rating {
    color: #f39c12;
    font-size: 14px;
    margin-bottom: 10px;
}

.product-item-rating span {
    color: #999;
    margin-left: 5px;
}

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

.product-item-price {
    color: #e74c3c;
    font-size: 20px;
    font-weight: bold;
}

.product-item-sales {
    color: #999;
    font-size: 12px;
}

/* 商品列表视图 */
.products-list-view {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.products-list-view .product-item {
    display: flex;
    border: 1px solid #eee;
    border-radius: 10px;
    overflow: hidden;
    padding: 15px;
    background: #fff;
    transition: all 0.3s;
}

.products-list-view .product-item:hover {
    box-shadow: 0 5px 20px rgba(0,0,0,0.1);
}

.products-list-view .product-item-image {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
}

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

.products-list-view .product-item-title {
    font-size: 18px;
}

.products-list-view .product-item-description {
    color: #666;
    font-size: 14px;
    line-height: 1.6;
    margin: 10px 0;
}

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

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.pagination button {
    padding: 10px 20px;
    border: 1px solid #ddd;
    background: #fff;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s;
}

.pagination button:hover:not(:disabled) {
    background: #e74c3c;
    color: #fff;
    border-color: #e74c3c;
}

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

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

.page-numbers button {
    width: 40px;
    height: 40px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* 响应式设计 */
@media (max-width: 1024px) {
    .page-layout {
        grid-template-columns: 1fr;
    }

    .sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .product-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }

    .sort-options {
        justify-content: space-between;
    }

    .products-grid-view {
        grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
        gap: 15px;
    }

    .products-list-view .product-item {
        flex-direction: column;
    }

    .products-list-view .product-item-image {
        width: 100%;
        height: 200px;
    }

    .pagination {
        flex-wrap: wrap;
    }
}

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

    .sort-options {
        flex-direction: column;
        align-items: stretch;
    }

    .view-toggle {
        justify-content: center;
    }
}

/* 加载动画 */
.loading {
    text-align: center;
    padding: 40px;
    color: #999;
}

.loading::after {
    content: "";
    display: inline-block;
    width: 20px;
    height: 20px;
    border: 2px solid #e74c3c;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 60px 20px;
    color: #999;
}

.empty-state i {
    font-size: 60px;
    margin-bottom: 20px;
    color: #ddd;
}

.empty-state h3 {
    color: #666;
    margin-bottom: 10px;
}

.empty-state p {
    margin-bottom: 20px;
}

.empty-state button {
    background: #e74c3c;
    color: #fff;
    padding: 12px 30px;
    border-radius: 5px;
    border: none;
    cursor: pointer;
    transition: background 0.3s;
}

.empty-state button:hover {
    background: #c0392b;
}