/* Products Page Styles */

/* Hero Section - Blue Theme */
.products-hero {
    background: linear-gradient(135deg, #004BB8 0%, #003a91 100%);
    color: white;
    padding: 100px 0;
    position: relative;
    overflow: hidden;
    min-height: 60vh;
    display: flex;
    align-items: center;
}

.products-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 900px;
    margin: 0 auto;
    animation: fadeInUp 0.8s ease-out;
}

.products-hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at 20% 80%, rgba(255, 255, 255, 0.05) 0%, transparent 50%),
                radial-gradient(circle at 80% 20%, rgba(255, 255, 255, 0.03) 0%, transparent 50%),
                linear-gradient(135deg, transparent 0%, rgba(255, 255, 255, 0.02) 100%);
    pointer-events: none;
}

.products-hero__content {
    position: relative;
    z-index: 2;
    text-align: center;
    max-width: 800px;
    margin: 0 auto;
}

.products-hero__badge {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    padding: var(--spacing-sm) var(--spacing-xl);
    border-radius: 50px;
    margin-bottom: var(--spacing-xl);
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid rgba(255, 255, 255, 0.15);
    animation: float 3s ease-in-out infinite;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.products-hero__title {
    font-size: 3.5rem;
    font-weight: 800;
    line-height: 1.1;
    color: white;
    margin-bottom: var(--spacing-lg);
}

.products-hero__description {
    font-size: 1.2rem;
    line-height: 1.6;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--spacing-2xl);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.products-hero__meta {
    display: flex;
    justify-content: center;
    gap: var(--spacing-xl);
    flex-wrap: wrap;
}

.meta-item {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-sm) var(--spacing-md);
    font-size: 0.9rem;
    color: white;
}

/* Products Layout */
.products-layout {
    display: grid;
    grid-template-columns: 280px 1fr;
    gap: var(--spacing-2xl);
    align-items: start;
    margin: var(--spacing-3xl) 0;
}

/* Product Categories */
.product-categories {
    padding: var(--spacing-3xl) 0;
    background-color: var(--background);
}

.section-header {
    text-align: center;
    margin-bottom: var(--spacing-2xl);
}

.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.section-description {
    font-size: 1.1rem;
    color: var(--text-secondary);
    max-width: 600px;
    margin: 0 auto;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-xl);
    margin-bottom: var(--spacing-2xl);
}

.category-card {
    background: linear-gradient(135deg, var(--background-light) 0%, #f8fafc 100%);
    border-radius: var(--border-radius-xl);
    padding: var(--spacing-2xl);
    text-align: center;
    cursor: pointer;
    transition: all var(--transition-smooth);
    border: 2px solid transparent;
    box-shadow: var(--shadow-sm);
    position: relative;
    overflow: hidden;
}

.category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 75, 184, 0.02) 100%);
    opacity: 0;
    transition: opacity var(--transition-smooth);
}

.category-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-lg);
    border-color: var(--primary-color);
}

.category-card:hover::before {
    opacity: 1;
}

.category-card.active {
    background: linear-gradient(135deg, #004BB8 0%, #003a91 100%);
    border-color: #004BB8;
    color: white;
    transform: translateY(-6px);
    box-shadow: 0 20px 40px rgba(0, 75, 184, 0.3);
}

.category-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, #60a5fa 100%);
    color: white;
    border-radius: var(--border-radius-xl);
    margin-bottom: var(--spacing-xl);
    transition: all var(--transition-smooth);
    position: relative;
    z-index: 2;
}

.category-card.active .category-card__icon {
    background: linear-gradient(135deg, white 0%, #f1f5f9 100%);
    color: var(--primary-color);
    box-shadow: 0 8px 25px rgba(255, 255, 255, 0.2);
}

.category-card__title {
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: var(--spacing-sm);
    color: var(--text-primary);
    position: relative;
    z-index: 2;
}

.category-card.active .category-card__title {
    color: white;
}

.category-card__description {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.5;
    position: relative;
    z-index: 2;
}

.category-card.active .category-card__description {
    color: rgba(255, 255, 255, 0.9);
}

/* Products Section */
.products-section {
    padding: var(--spacing-3xl) 0;
    background-color: var(--background-light);
}

/* Product Filters */
.products-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--spacing-2xl);
    flex-wrap: wrap;
    gap: var(--spacing-lg);
}

.filters-wrapper {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.filter-btn {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    background-color: var(--background);
    color: var(--text-secondary);
    border-radius: var(--border-radius-md);
    cursor: pointer;
    transition: all var(--transition-base);
    font-size: 0.9rem;
    font-weight: 500;
}

.filter-btn:hover,
.filter-btn.active {
    border-color: var(--primary-color);
    background-color: var(--primary-color);
    color: white;
}

.products-sort {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
}

.sort-select {
    padding: 0.5rem 1rem;
    border: 2px solid var(--border-color);
    border-radius: var(--border-radius-md);
    background-color: var(--background);
    color: var(--text-primary);
    cursor: pointer;
    font-size: 0.9rem;
}

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

/* Products Grid */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: var(--spacing-2xl);
    margin-bottom: var(--spacing-2xl);
}

.product-card {
    background: linear-gradient(135deg, var(--background) 0%, #f8fafc 100%);
    border-radius: var(--border-radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: all var(--transition-smooth);
    opacity: 1;
    transform: scale(1);
    border: 1px solid var(--border-light);
    position: relative;
}

.product-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, transparent 0%, rgba(0, 75, 184, 0.02) 100%);
    opacity: 0;
    transition: opacity var(--transition-smooth);
    pointer-events: none;
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 75, 184, 0.15);
    border-color: var(--primary-color);
}

.product-card:hover::before {
    opacity: 1;
}

.product-card.hidden {
    opacity: 0;
    transform: scale(0.9);
    pointer-events: none;
}

.product-card__image {
    height: 250px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
}

.product-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: var(--border-radius-lg) var(--border-radius-lg) 0 0;
    background-color: #f8f9fa;
    padding: var(--spacing-md);
    /* Ensure images scale properly on all devices */
    max-width: 100%;
    height: auto;
    min-height: 200px;
}

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

/* Image loading state */
.product-image[src=""] {
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    position: relative;
}

.product-image[src=""]:after {
    content: "📦";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    opacity: 0.5;
}

.product-card:hover .product-image {
    transform: scale(1.08);
}

.product-card__image::before {
    display: none;
}

.product-card__image::after {
    display: none;
}

.product-card__badge {
    position: absolute;
    top: var(--spacing-md);
    right: var(--spacing-md);
    background-color: var(--accent-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 600;
    z-index: 3;
}

.product-card__content {
    padding: var(--spacing-lg);
}

.product-card__title {
    font-size: 1.125rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-sm);
    line-height: 1.3;
}

.product-card__description {
    color: var(--text-secondary);
    margin-bottom: var(--spacing-md);
    font-size: 0.9rem;
    line-height: 1.5;
}

.product-card__specs {
    display: flex;
    flex-wrap: wrap;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.spec {
    background-color: var(--background-light);
    color: var(--text-secondary);
    padding: 0.25rem 0.5rem;
    border-radius: var(--border-radius-sm);
    font-size: 0.75rem;
    font-weight: 500;
}

.product-card__price {
    display: flex;
    align-items: baseline;
    gap: var(--spacing-sm);
    margin-bottom: var(--spacing-lg);
}

.price {
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--primary-color);
}

.price-unit {
    font-size: 0.875rem;
    color: var(--text-secondary);
}

.product-card__actions {
    display: flex;
    gap: var(--spacing-sm);
    flex-wrap: wrap;
}

.product-card__actions .btn {
    flex: 1;
    min-width: 120px;
    font-size: 0.875rem;
    padding: 0.625rem 1rem;
}

/* Load More */
.products-load-more {
    text-align: center;
}

/* Product Features */
.product-features {
    padding: var(--spacing-3xl) 0;
    background-color: var(--background);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--spacing-2xl);
}

.feature-item {
    text-align: center;
    padding: var(--spacing-xl);
}

.feature-item__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 64px;
    height: 64px;
    background-color: var(--primary-color);
    color: white;
    border-radius: var(--border-radius-xl);
    margin-bottom: var(--spacing-lg);
}

.feature-item__title {
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: var(--spacing-md);
}

.feature-item__description {
    color: var(--text-secondary);
    line-height: 1.6;
}

/* Mobile Styles */
/* CTA Section - Blue Theme Override */
.products-page .cta {
    background: linear-gradient(135deg, #004BB8 0%, #003a91 100%);
    color: white;
}

.products-page .cta__content h2 {
    color: white;
}

.products-page .cta__content p {
    color: rgba(255, 255, 255, 0.9);
}

.products-page .cta .btn--primary {
    background: white;
    color: #004BB8;
    border-color: white;
}

.products-page .cta .btn--primary:hover {
    background: rgba(255, 255, 255, 0.9);
    transform: translateY(-2px);
}

.products-page .cta .btn--outline {
    border-color: white;
    color: white;
}

.products-page .cta .btn--outline:hover {
    background: white;
    color: #004BB8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .products-hero {
        padding: 80px 0;
        min-height: 50vh;
    }
    
    .products-hero__title {
        font-size: 2.5rem;
    }
    
    .products-hero__description {
        font-size: 1.1rem;
    }
    
    .products-hero__meta {
        flex-direction: column;
        gap: var(--spacing-md);
    }
    
    .categories-grid {
        grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
        gap: var(--spacing-lg);
    }
    
    .category-card {
        padding: var(--spacing-xl);
    }
    
    .products-filters {
        flex-direction: column;
        align-items: stretch;
        gap: var(--spacing-md);
    }
    
    .filters-wrapper {
        justify-content: center;
    }
    
    .products-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .product-card__actions {
        flex-direction: column;
    }
    
    .product-card__actions .btn {
        flex: none;
        width: 100%;
    }
    
    .product-card__image {
        height: 220px;
    }
    
    .product-image {
        border-radius: var(--border-radius-md) var(--border-radius-md) 0 0;
    }
    
    .features-grid {
        grid-template-columns: 1fr;
        gap: var(--spacing-xl);
    }
    
    .feature-item {
        padding: var(--spacing-lg);
    }
}

@media (max-width: 480px) {
    .products-hero {
        padding: 60px 0;
        min-height: auto;
    }
    
    .products-hero__title {
        font-size: 2rem;
    }
    
    .products-hero__description {
        font-size: 1rem;
    }
    
    .products-hero__badge {
        font-size: 0.8rem;
        padding: var(--spacing-xs) var(--spacing-md);
    }
    
    .categories-grid {
        grid-template-columns: 1fr;
    }
    
    .filter-btn {
        flex: 1;
        text-align: center;
    }
    
    .product-card__image {
        height: 200px;
    }
    
    .product-image {
        border-radius: var(--border-radius-sm) var(--border-radius-sm) 0 0;
    }
    
    .product-card__specs {
        justify-content: center;
    }
    
    .product-card__price {
        justify-content: center;
    }
}

/* Animation for filtering */
.products-grid {
    transition: all var(--transition-slow);
}

.product-card {
    transition: all var(--transition-base);
}

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid var(--primary-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}
