/* 产品展示页专用样式 */
:root {
    --primary-color: #2e7d32;
    --primary-dark: #1b5e20;
    --primary-light: #4caf50;
    --secondary-color: #ff9800;
    --text-dark: #333333;
    --text-light: #666666;
    --background-light: #f8f9fa;
    --white: #ffffff;
    --border-color: #e0e0e0;
    --shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    --border-radius: 8px;
}

/* 页面标题区域 */
.page-header {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--primary-dark) 100%);
    color: var(--white);
    padding: 100px 0 40px;
    margin-top: 99px;
    text-align: center;
}

.breadcrumb {
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1rem;
    font-size: 0.9rem;
}

.breadcrumb a {
    color: rgba(255, 255, 255, 0.8);
    text-decoration: none;
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--white);
}

.breadcrumb .separator {
    margin: 0 0.5rem;
    opacity: 0.6;
}

.breadcrumb .current {
    color: var(--white);
    font-weight: 600;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    line-height: 1.2;
}

.page-subtitle {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 筛选区域 */
.filter-section {
    background: var(--background-light);
    padding: 2rem 0;
    border-bottom: 1px solid var(--border-color);
}

.filter-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 2rem;
    flex-wrap: wrap;
}

.search-box {
    position: relative;
    flex: 1;
    min-width: 250px;
}

.search-input {
    width: 100%;
    padding: 0.8rem 1.5rem;
    border: 2px solid var(--border-color);
    border-radius: 25px;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.3s;
}

.search-input:focus {
    border-color: var(--primary-color);
}

.search-btn {
    position: absolute;
    right: 10px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    padding: 0.5rem;
    color: var(--text-light);
}

.search-btn:hover {
    color: var(--primary-color);
}

.filter-options {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.filter-select {
    padding: 0.8rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius);
    background: var(--white);
    font-size: 1rem;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s;
}

.filter-select:focus {
    border-color: var(--primary-color);
}

/* 产品网格 */
.products-section {
    padding: 3rem 0;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
}

.product-card {
    background: var(--white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    transition: all 0.3s ease;
    position: relative;
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
}

.product-image {
    position: relative;
    width: 100%;
    height: 200px;
    overflow: hidden;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s;
}

.product-card:hover .product-image img {
    transform: scale(1.05);
}

.product-badge {
    position: absolute;
    top: 10px;
    left: 10px;
    background: var(--secondary-color);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 2;
}

.product-content {
    padding: 1.5rem;
}

.product-category {
    display: inline-block;
    background: var(--primary-light);
    color: var(--white);
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 600;
    margin-bottom: 0.8rem;
}

.product-title {
    font-size: 1.2rem;
    margin-bottom: 0.5rem;
    color: var(--text-dark);
}

.product-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.3s;
}

.product-title a:hover {
    color: var(--primary-color);
}

.product-desc {
    color: var(--text-light);
    font-size: 0.9rem;
    line-height: 1.5;
    margin-bottom: 1rem;
}

.product-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1rem;
}

.product-price {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 1.1rem;
}

.product-stock {
    font-size: 0.9rem;
    color: var(--text-light);
}

.product-actions {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.add-to-cart-btn, .view-details-btn {
    padding: 0.6rem 1.2rem;
    border: none;
    border-radius: var(--border-radius);
    font-size: 0.9rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    flex: 1;
    min-width: 120px;
}

.add-to-cart-btn {
    background: var(--primary-color);
    color: var(--white);
}

.add-to-cart-btn:hover {
    background: var(--primary-dark);
}

.view-details-btn {
    background: var(--background-light);
    color: var(--text-dark);
    border: 1px solid var(--border-color);
}

.view-details-btn:hover {
    background: var(--primary-light);
    color: var(--white);
    border-color: var(--primary-light);
}

/* 分页样式 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 2rem;
}

.page-btn {
    padding: 0.8rem 1.2rem;
    border: 1px solid var(--border-color);
    background: var(--white);
    color: var(--text-dark);
    border-radius: var(--border-radius);
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 600;
}

.page-btn:hover:not(.disabled):not(.active) {
    border-color: var(--primary-color);
    color: var(--primary-color);
}

.page-btn.active {
    background: var(--primary-color);
    color: var(--white);
    border-color: var(--primary-color);
}

.page-btn.disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-ellipsis {
    padding: 0.8rem 0.5rem;
    color: var(--text-light);
}

/* 分类区域 */
.categories-section {
    padding: 3rem 0;
    background: var(--background-light);
}

.section-title {
    text-align: center;
    font-size: 2rem;
    color: var(--primary-dark);
    margin-bottom: 2rem;
    position: relative;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: var(--secondary-color);
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 2rem;
}

.category-card {
    background: var(--white);
    padding: 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow);
    text-align: center;
    transition: transform 0.3s;
    border-top: 4px solid var(--primary-color);
}

.category-card:hover {
    transform: translateY(-5px);
}

.category-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    border-radius: var(--border-radius);
    margin-bottom: 1rem;
}

.category-card h3 {
    margin-bottom: 0.5rem;
    color: var(--primary-dark);
}

.category-card p {
    color: var(--text-light);
    margin-bottom: 1rem;
}

.category-link {
    display: inline-block;
    color: var(--primary-color);
    text-decoration: none;
    font-weight: 600;
    transition: color 0.3s;
}

.category-link:hover {
    color: var(--primary-dark);
}

/* 结果计数 */
.result-count {
    font-size: 0.9rem;
    color: var(--text-light);
    margin-left: auto;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .filter-content {
        flex-direction: column;
        align-items: stretch;
    }
    
    .search-box {
        min-width: 100%;
    }
    
    .filter-options {
        width: 100%;
        justify-content: space-between;
    }
    
    .filter-select {
        flex: 1;
        min-width: 120px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    }
    
    .product-actions {
        flex-direction: column;
    }
    
    .add-to-cart-btn, .view-details-btn {
        width: 100%;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .page-subtitle {
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-options {
        flex-direction: column;
    }
    
    .filter-select {
        width: 100%;
    }
    
    .pagination {
        flex-wrap: wrap;
    }
    
    .page-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
}

/* 图片懒加载样式 */
img[data-src] {
    opacity: 0;
    transition: opacity 0.3s;
}

img.loaded {
    opacity: 1;
}

/* 加载动画 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-out;
}

/* 性能优化 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}
