/* 产品分类展示页面样式 */

/* 页面标题 */
.page-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 80px 0 60px;
    text-align: center;
}

.page-header h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: 700;
}

.page-header p {
    font-size: 1.2rem;
    opacity: 0.9;
    max-width: 600px;
    margin: 0 auto;
}

/* 分类标签 */
.category-tabs {
    background: #f8f9fa;
    padding: 2rem 0;
    border-bottom: 1px solid #e0e0e0;
}

.tab-navigation {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 0.8rem 2rem;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 30px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 600;
    font-size: 1rem;
}

.tab-btn.active,
.tab-btn:hover {
    background: #667eea;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

/* 产品展示区域 */
.product-gallery {
    padding: 3rem 0;
    min-height: 60vh;
}

/* 加载状态 */
.loading-container {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 4rem 2rem;
    color: #666;
}

.loading-spinner {
    width: 50px;
    height: 50px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 1rem;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

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

.product-item {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    cursor: pointer;
    position: relative;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.product-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255, 255, 255, 0.1) 50%, transparent 70%);
    transform: translateX(-100%);
    transition: transform 0.6s ease;
    z-index: 2;
}

.product-item:hover::before {
    transform: translateX(100%);
}

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

.product-item:hover .product-image {
    transform: scale(1.05);
}

.product-info {
    padding: 1.5rem;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.product-category {
    display: inline-block;
    padding: 0.3rem 0.8rem;
    background: #667eea;
    color: white;
    border-radius: 15px;
    font-size: 0.8rem;
    margin-bottom: 1rem;
}

.product-description {
    color: #666;
    font-size: 0.9rem;
    line-height: 1.5;
}

/* 分页控制 */
.pagination-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 3rem;
    padding: 2rem 0;
    border-top: 1px solid #e0e0e0;
}

.pagination-info {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    color: #666;
    font-size: 0.9rem;
}

.pagination-controls {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.page-btn {
    padding: 0.6rem 1.2rem;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-btn:hover:not(:disabled) {
    background: #667eea;
    color: white;
}

.page-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.page-numbers {
    display: flex;
    gap: 0.5rem;
}

.page-number {
    width: 40px;
    height: 40px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: 500;
}

.page-number:hover {
    border-color: #667eea;
    color: #667eea;
}

.page-number.active {
    background: #667eea;
    border-color: #667eea;
    color: white;
}

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

.empty-icon {
    font-size: 4rem;
    margin-bottom: 1rem;
}

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

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

/* 图片预览模态框 */
.image-modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    backdrop-filter: blur(5px);
}

.modal-content {
    position: relative;
    margin: 2% auto;
    width: 90%;
    max-width: 1000px;
    background: white;
    border-radius: 15px;
    overflow: hidden;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.close-btn {
    position: absolute;
    top: 15px;
    right: 20px;
    color: white;
    font-size: 2rem;
    font-weight: bold;
    cursor: pointer;
    z-index: 1001;
    background: rgba(0, 0, 0, 0.5);
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
}

.close-btn:hover {
    background: rgba(0, 0, 0, 0.8);
}

.modal-image-container {
    position: relative;
    flex: 1;
    max-height: 70vh;
}

#modal-image {
    width: 100%;
    height: auto;
    max-height: 60vh;
    object-fit: contain;
    background: #f8f9fa;
}

.image-info {
    padding: 1.5rem;
    background: #f8f9fa;
    border-top: 1px solid #e0e0e0;
}

.image-info h3 {
    margin-bottom: 0.5rem;
    color: #333;
    font-size: 1.3rem;
}

.image-info p {
    color: #666;
    margin-bottom: 1rem;
    line-height: 1.5;
}

.image-meta {
    display: flex;
    gap: 1rem;
    font-size: 0.9rem;
    color: #888;
}

.modal-navigation {
    padding: 1.5rem;
    display: flex;
    gap: 1rem;
    justify-content: center;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.nav-btn {
    padding: 0.8rem 2rem;
    border: 2px solid #667eea;
    background: transparent;
    color: #667eea;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.nav-btn:hover {
    background: #667eea;
    color: white;
}

.nav-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .page-header h1 {
        font-size: 2rem;
    }
    
    .page-header p {
        font-size: 1rem;
    }
    
    .tab-navigation {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn {
        width: 200px;
    }
    
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 1.5rem;
    }
    
    .pagination-container {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
    
    .pagination-controls {
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .page-numbers {
        order: -1;
        margin-bottom: 1rem;
    }
    
    .modal-content {
        width: 95%;
        margin: 5% auto;
    }
    
    .modal-navigation {
        flex-direction: column;
    }
    
    .image-meta {
        flex-direction: column;
        gap: 0.5rem;
    }
}

@media (max-width: 480px) {
    .page-header {
        padding: 60px 0 40px;
    }
    
    .product-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .product-item {
        margin: 0 1rem;
    }
    
    .product-info {
        padding: 1rem;
    }
    
    .tab-btn {
        width: 150px;
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }
    
    .page-numbers {
        gap: 0.3rem;
    }
    
    .page-number {
        width: 35px;
        height: 35px;
        font-size: 0.9rem;
    }
}

/* 图片加载错误 */
.image-error {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 200px;
    background: #f8f9fa;
    color: #666;
    border: 2px dashed #ddd;
    border-radius: 10px;
    font-size: 0.9rem;
}

/* 懒加载效果 */
.product-image[data-src] {
    opacity: 0;
    transition: opacity 0.3s ease;
}

.product-image.loaded {
    opacity: 1;
}

/* 分类标签颜色 */
.product-category.bucket {
    background: #4CAF50;
}

.product-category.hat {
    background: #FF9800;
}

/* 动画效果 */
.product-item {
    animation: fadeInUp 0.6s ease forwards;
    opacity: 0;
    transform: translateY(30px);
}

.product-item:nth-child(1) { animation-delay: 0.1s; }
.product-item:nth-child(2) { animation-delay: 0.2s; }
.product-item:nth-child(3) { animation-delay: 0.3s; }
.product-item:nth-child(4) { animation-delay: 0.4s; }

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}
