/* 商品列表页面样式 */

/* 容器和布局 */
.product-list-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 1rem;
}

.product-list-header {
    margin-bottom: 2rem;
}

.page-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: #2c3e50;
    margin-bottom: 1rem;
    text-align: center;
}

/* 分类筛选 */
.category-filter {
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.category-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    justify-content: center;
}

.category-btn {
    display: inline-flex;
    align-items: center;
    padding: 0.75rem 1.5rem;
    background: white;
    color: #6c757d;
    text-decoration: none;
    border-radius: 25px;
    font-weight: 500;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    border: 2px solid transparent;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

.category-btn:hover {
    color: #495057;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0,0,0,0.15);
    text-decoration: none;
}

.category-btn.active {
    background: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    box-shadow: 0 4px 15px rgba(74, 77, 72, 0.3);
}

/* 筛选和排序区域 */
.filter-sort-section {
    background: white;
    padding: 1.5rem;
    border-radius: 12px;
    margin-bottom: 2rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
}

.filter-form {
    display: flex;
    flex-wrap: wrap;
    gap: 0.75rem;
    align-items: end;
}



.filter-group {
    flex: 1;
    min-width: 200px;
    display: flex;
    flex-direction: column;
}

.filter-group:last-child {
    flex: 1.2;
    min-width: 250px;
}

.filter-label {
    font-weight: 500;
    color: #495057;
    margin-bottom: 0.4rem;
    font-size: 0.85rem;
}

.price-range {
    display: flex;
    gap: 0.5rem;
    align-items: center;
}

.price-input {
    flex: 1;
    padding: 0.6rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.85rem;
    transition: border-color 0.3s ease;
    min-width: 0;
}

.price-input:focus {
    outline: none;
    border-color: #007bff;
}

.price-separator {
    color: #6c757d;
    font-weight: 500;
}

.sort-select {
    padding: 0.6rem;
    border: 2px solid #e9ecef;
    border-radius: 6px;
    font-size: 0.85rem;
    background: white;
    transition: border-color 0.3s ease;
}

.sort-select:focus {
    outline: none;
    border-color: var(--primary-color);
}

.search-filter {
    display: flex;
    gap: 0.5rem;
    flex: 1;
}

.search-filter .price-input {
    flex: 1;
    min-width: 0;
}

.filter-btn {
    padding: 0.6rem 0.8rem;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-weight: 500;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 60px;
}

.filter-btn:hover {
    background: var(--primary-color-hover);
    transform: scale(1.05);
}

/* 商品网格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.5rem;
    margin-bottom: 3rem;
}

/* 商品卡片 */
.product-card {
    background: white;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
    transition: all 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.product-image-container {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    color: #adb5bd;
    font-size: 3rem;
}

.product-badge {
    position: absolute;
    padding: 0.4rem 0.8rem;
    border-radius: 15px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: white;
}

.product-badge.featured {
    top: 12px;
    left: 12px;
    background: linear-gradient(135deg, #dc3545, #c82333);
}

.product-badge.new {
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #28a745, #20c997);
}

.product-badge.discount {
    bottom: 12px;
    left: 12px;
    background: linear-gradient(135deg, #ffc107, #fd7e14);
}

.product-content {
    padding: 1.25rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.product-category {
    background: linear-gradient(135deg, #e3f2fd, #bbdefb);
    color: #1976d2;
    padding: 0.25rem 0.75rem;
    border-radius: 12px;
    font-size: 0.75rem;
    font-weight: 500;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    text-decoration: none;
    transition: all 0.3s ease;
    display: inline-block;
}

.product-category:hover {
    background: linear-gradient(135deg, #1976d2, #1565c0);
    color: white;
    text-decoration: none;
    transform: scale(1.05);
}

.product-title {
    margin-bottom: 0.75rem;
}

.product-title a {
    color: #2c3e50;
    text-decoration: none;
    font-size: 1.1rem;
    font-weight: 600;
    line-height: 1.4;
    transition: color 0.3s ease;
}

.product-title a:hover {
    color: #007bff;
    text-decoration: none;
}

.product-excerpt {
    color: #6c757d;
    font-size: 0.85rem;
    line-height: 1.5;
    margin-bottom: 0.75rem;
    display: none !important; /* 隐藏列表卡片中的描述，为图片腾出空间，并防止被聚合 CSS 覆盖 */
}

/* 隐藏商品卡片中的分类标签，为图片和标题留出空间 */
.product-content .product-category {
    display: none !important;
}

.product-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.product-tag {
    background: linear-gradient(135deg, #fff3cd, #ffeaa7);
    color: #856404;
    padding: 0.25rem 0.6rem;
    border-radius: 10px;
    font-size: 0.7rem;
    font-weight: 500;
    text-decoration: none;
    transition: all 0.3s ease;
}

.product-tag:hover {
    background: linear-gradient(135deg, #856404, #6c5ce7);
    color: white;
    text-decoration: none;
    transform: scale(1.05);
}

.product-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
}

.product-price {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.current-price {
    color: #dc3545;
    font-weight: 700;
    font-size: 1.1rem;
}

.original-price {
    color: #6c757d;
    font-size: 0.85rem;
    text-decoration: line-through;
}

.view-details-btn {
    background: var(--primary-color);
    color: white;
    padding: 0.5rem 1rem;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 500;
    transition: all 0.3s ease;
    border: none;
}

.view-details-btn:hover {
    background: var(--primary-color-hover);
    transform: scale(1.05);
    text-decoration: none;
    color: white;
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 4rem 2rem;
    color: #6c757d;
}

.empty-state i {
    font-size: 4rem;
    margin-bottom: 1rem;
    color: #dee2e6;
}

.empty-state h3 {
    font-size: 1.5rem;
    margin-bottom: 0.5rem;
    color: #495057;
}

.empty-state p {
    font-size: 1rem;
    margin-bottom: 0;
}

/* 分类介绍 */
.category-description {
    background: white;
    padding: 2rem;
    border-radius: 16px;
    margin-top: 3rem;
    box-shadow: 0 4px 20px rgba(0,0,0,0.08);
}

.category-description-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 1rem;
}

.category-description-text {
    color: #6c757d;
    line-height: 1.6;
    font-size: 1rem;
    margin-bottom: 0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .product-list-container {
        padding: 1rem 0.5rem;
    }
    
    .page-title {
        font-size: 2rem;
    }
    
    .filter-form {
        display: grid;
        grid-template-columns: 1fr 1fr 1fr;
        gap: 1rem;
    }

    .filter-group:first-child {
        grid-column: 1 / -1;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 0.75rem;
    }

    .filter-group:first-child .filter-label {
        grid-column: 1 / -1;
        margin-bottom: 0.5rem;
    }

    .filter-group:nth-child(2) {
        grid-column: 1;
        grid-row: 2;
    }

    .filter-group:last-child {
        grid-column: 2 / -1;
        grid-row: 2;
        min-width: auto;
        display: flex;
        gap: 0.75rem;
        align-items: end;
    }

    .filter-group:last-child .filter-label {
        display: none;
    }

    .filter-group:last-child .price-input {
        flex: 1;
        max-width: 120px;
    }

    .filter-group:last-child .filter-btn {
        flex: 0 0 auto;
        min-width: 60px;
    }

    .filter-group {
        min-width: auto;
    }
    
    .price-range {
        display: contents;
    }

    .price-range .price-input {
        max-width: none;
        min-width: 0;
    }

    .price-separator {
        display: none;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1rem;
    }
    
    .category-buttons {
        justify-content: center;
    }
    
    .category-btn {
        padding: 0.6rem 1.2rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 480px) {
    .product-list-container {
        padding: 0.5rem;
    }
    
    .page-title {
        font-size: 1.75rem;
    }
    
    .category-filter {
        padding: 1rem;
    }
    
    .filter-sort-section {
        padding: 0.75rem;
    }

    .filter-form {
        display: grid;
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .filter-group:first-child,
    .filter-group:nth-child(2),
    .filter-group:last-child {
        grid-column: 1;
    }

    .filter-group {
        min-width: auto;
    }

    .price-range {
        display: flex;
        gap: 0.5rem;
        align-items: center;
    }

    .price-separator {
        display: block;
    }
    
    .product-content {
        padding: 1rem;
    }
    
    .product-image-container {
        height: 160px;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
    }
}
