/* Products Detail Page Styles */

/* Products Hero Section */
.products-hero {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 4rem 0;
    text-align: center;
    margin-top: 80px;
}

.products-hero h1 {
    font-size: 3rem;
    margin-bottom: 1rem;
    font-weight: bold;
}

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

/* Category Title - SEO H2 */
.products-category-title {
    font-size: 1.1rem;
    color: #555;
    text-align: center;
    margin-bottom: 1.5rem;
    font-weight: 500;
    line-height: 1.5;
}

/* Category Tabs */
.products-categories {
    background: white;
    padding: 2rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    position: static;
}

.category-tabs {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.tab-btn {
    padding: 12px 24px;
    border: 2px solid #667eea;
    background: white;
    color: #667eea;
    border-radius: 25px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.3s ease;
    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);
}

/* Products Detail Grid */
.products-detail-grid {
    padding: 4rem 0;
    background: #f8f9fa;
}

.category-content {
    display: none;
}

.category-content.active {
    display: block;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

/* Product Detail Card */
.product-detail-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

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

/* Product Image Container */
.product-image-container {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    text-align: center;
    border-radius: 12px;
    margin-bottom: 1rem;
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
}

/* Image loading animation */
.product-image-container {
    position: relative;
}

.product-image {
    opacity: 0;
    transform: scale(0.95);
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.product-image.loaded {
    opacity: 1;
    transform: scale(1);
    position: relative;
    z-index: 9999;
}

/* Loading placeholder animation */
.product-image-container::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(90deg, #f0f0f0 25%, transparent 25%, transparent 50%, #f0f0f0 50%, #f0f0f0 75%, transparent 75%, transparent);
    background-size: 20px 20px;
    animation: loading 1s linear infinite;
    border-radius: 8px;
    z-index: 1;
}

.product-image-container.loaded::before {
    display: none;
}

@keyframes loading {
    0% { background-position: 0 0; }
    100% { background-position: 20px 0; }
}

.product-image {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem;
    text-align: center;
    border-bottom: 1px solid #e9ecef;
}

.detail-img {
    width: 100%;
    max-height: 220px;
    object-fit: contain;
    border-radius: 8px;
}

.product-img-placeholder {
    font-size: 4rem;
    margin-bottom: 1rem;
    display: block;
}

.product-info {
    padding: 2rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.product-info h3 {
    font-size: 1.4rem;
    margin-bottom: 1rem;
    color: #333;
    font-weight: bold;
}

.product-specs {
    background: #f8f9fa;
    padding: 1rem;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.product-specs p {
    margin: 0.5rem 0;
    color: #555;
    font-size: 0.9rem;
}

.product-specs strong {
    color: #667eea;
    margin-right: 0.5rem;
}

.product-description {
    color: #666;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
}

.product-features {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-top: auto;
}

.feature-tag {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 0.3rem 0.8rem;
    border-radius: 15px;
    font-size: 0.8rem;
    font-weight: 500;
}

/* Product Inquiry Section */
.product-inquiry {
    background: white;
    padding: 4rem 0;
    text-align: center;
}

.product-inquiry h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: #333;
}

.product-inquiry p {
    font-size: 1.2rem;
    color: #666;
    margin-bottom: 2rem;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-hero h1 {
        font-size: 2rem;
    }
    
    .products-hero p {
        font-size: 1rem;
    }
    
    .category-tabs {
        gap: 0.5rem;
    }
    
    .tab-btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: 1.5rem;
    }
    
    .product-detail-card {
        margin: 0 1rem;
    }
    
    .product-info {
        padding: 1.5rem;
    }
    
    .product-inquiry h2 {
        font-size: 2rem;
    }
}

@media (max-width: 480px) {
    .products-hero {
        padding: 3rem 0;
        margin-top: 60px;
    }
    
    .products-categories {
        padding: 1rem 0;
    }
    
    .category-tabs {
        flex-direction: column;
        align-items: center;
    }
    
    .tab-btn {
        width: 200px;
        text-align: center;
    }
    
    .products-detail-grid {
        padding: 2rem 0;
    }
    
    .product-image {
        padding: 1.5rem;
    }
    
    .product-img-placeholder {
        font-size: 3rem;
    }
    
    .product-info h3 {
        font-size: 1.2rem;
    }
    
    .product-inquiry {
        padding: 2rem 0;
    }
}

/* Animation for tab switching */
.category-content {
    animation: fadeIn 0.5s ease-in-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Loading state for products */
.product-loading {
    text-align: center;
    padding: 2rem;
    color: #666;
}

/* 确保产品图片立即显示 */
.product-detail-card {
    opacity: 1 !important;
    transform: translateY(0) !important;
}

.product-image {
    min-height: 220px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.detail-img {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
    width: 100% !important;
    max-height: 220px !important;
}

.product-loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

@keyframes dots {
    0%, 20% {
        content: '.';
    }
    40% {
        content: '..';
    }
    60% {
        content: '...';
    }
    80%, 100% {
        content: '';
    }
}
