/* 分类页面和搜索页面样式 */

/* 基础样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
    background-color: #f8f9fa;
    color: #2c3e50;
    line-height: 1.6;
}

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 面包屑导航 */
.breadcrumb {
    
    border-bottom: 1px solid #e9ecef;
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item a {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb-item a:hover {
    color: #495057;
}

.breadcrumb-item.active {
    color: #2c3e50;
    font-weight: 500;
}

.breadcrumb-separator {
    margin: 0 12px;
    color: #adb5bd;
}

/* 子分类导航 */
.subcategory-nav {
    padding-bottom: 24px;
    border-radius: 8px;
}

.subcategory-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: #2c3e50;
}

.subcategory-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 16px;
}

.subcategory-item {
    display: flex;
    align-items: center;
    padding: 16px 20px;
    background: #f8f9fa;
    border-radius: 6px;
    text-decoration: none;
    color: #495057;
    transition: all 0.3s ease;
    border: 1px solid transparent;
}

.subcategory-item:hover {
    background: #e9ecef;
    border-color: #dee2e6;
    transform: translateY(-1px);
}

.subcategory-icon {
    width: 24px;
    height: 24px;
    margin-right: 12px;
    background: #6c757d;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 12px;
    overflow: hidden;
}

.subcategory-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 主要内容区域 */
.main-content {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: 32px;
    margin-bottom: 40px;
}

/* 筛选侧边栏 */
.filter-sidebar {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    height: fit-content;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
    position: sticky;
    top: 20px;
}

.filter-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 24px;
    color: #2c3e50;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.filter-reset {
    font-size: 14px;
    color: #6c757d;
    cursor: pointer;
    text-decoration: underline;
}

.filter-reset:hover {
    color: #495057;
}

.filter-group {
    margin-bottom: 28px;
}

.filter-group-title {
    font-size: 16px;
    font-weight: 500;
    margin-bottom: 16px;
    color: #495057;
}

.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-option {
    display: flex;
    align-items: center;
}

.filter-option input[type="checkbox"] {
    margin-right: 10px;
    accent-color: #495057;
}

.filter-option label {
    font-size: 14px;
    color: #6c757d;
    cursor: pointer;
    flex: 1;
}

.price-range {
    display: flex;
    gap: 12px;
    align-items: center;
}

.price-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    width: 100px;
}

.price-separator {
    color: #6c757d;
}

.form-select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    font-size: 14px;
    color: #495057;
    width: 100%;
}

/* 产品列表区域 */
.product-area {
    background: #ffffff;
    border-radius: 8px;
    padding: 24px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.product-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 24px;
    padding-bottom: 16px;
    border-bottom: 1px solid #e9ecef;
}

.product-count {
    font-size: 16px;
    color: #6c757d;
}

.sort-options {
    display: flex;
    gap: 16px;
    align-items: center;
}

.sort-label {
    font-size: 14px;
    color: #6c757d;
}

.sort-select {
    padding: 8px 12px;
    border: 1px solid #dee2e6;
    border-radius: 4px;
    background: white;
    font-size: 14px;
    color: #495057;
}

/* 产品网格 */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 24px;
}

.product-card {
    background: #ffffff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    box-shadow: 0 8px 24px rgba(0,0,0,0.1);
    transform: translateY(-2px);
    border-color: #dee2e6;
}

.product-image {
    width: 100%;
    height: 220px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #adb5bd;
    font-size: 48px;
    position: relative;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.product-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    background: #495057;
    color: white;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.product-info {
    padding: 20px;
}

.product-category {
    font-size: 12px;
    color: #6c757d;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    margin-bottom: 8px;
}

.product-title {
    font-size: 16px;
    font-weight: 500;
    color: #2c3e50;
    margin-bottom: 12px;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.product-title a {
    color: #2c3e50;
    text-decoration: none;
}

.product-title a:hover {
    color: #0056b3;
}

.product-price {
    font-size: 20px;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 16px;
}

.product-price .original-price {
    font-size: 14px;
    color: #adb5bd;
    text-decoration: line-through;
    margin-left: 8px;
    font-weight: normal;
}

.product-actions {
    display: flex;
    gap: 12px;
}

.btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-primary {
    background: #495057;
    color: white;
    flex: 1;
}

.btn-primary:hover {
    background: #343a40;
}

.btn-outline {
    background: transparent;
    color: #6c757d;
    border: 1px solid #dee2e6;
}

.btn-outline:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

/* 分页 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 8px;
}

.pagination-btn {
    padding: 10px 16px;
    border: 1px solid #dee2e6;
    background: white;
    color: #6c757d;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.3s ease;
}

.pagination-btn:hover {
    background: #f8f9fa;
    border-color: #adb5bd;
}

.pagination-btn.active {
    background: #495057;
    color: white;
    border-color: #495057;
}

.pagination-btn.disabled {
    opacity: 0.5;
    pointer-events: none;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .main-content {
        grid-template-columns: 1fr;
        gap: 24px;
    }
    
    .filter-sidebar {
        position: static;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0 16px;
    }
    
    .subcategory-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
        gap: 12px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
        gap: 16px;
    }
    
    .product-header {
        flex-direction: column;
        gap: 16px;
        align-items: stretch;
    }
} 