/* =========================================
   MODERN PRODUCT STYLE - EXACT REFERENCE DESIGN
   ========================================= */

.products-modern-section {
    padding: 3.5rem 0;
    background: #f5f5f5;
}

.products-modern-section.secondary-section {
    background: #d8dce8;
}

/* Section Header */
.section-header-modern {
    text-align: center;
    max-width: 820px;
    margin: 0 auto 2.5rem;
}

.section-title-modern {
    font-size: 1.9rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.85rem;
    letter-spacing: -0.01em;
}

.section-subtitle-modern {
    font-size: 0.95rem;
    line-height: 1.65;
    color: #6b7280;
}

/* Category Tabs */
.category-tabs {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    margin-bottom: 2.75rem;
    flex-wrap: wrap;
    padding: 0 1rem;
}

.tab-btn {
    padding: 0.65rem 1.6rem;
    background: white;
    border: 1px solid #d1d5db;
    border-radius: 6px;
    color: #4b5563;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.25s ease;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.tab-btn:hover {
    border-color: #3b82f6;
    color: #3b82f6;
    box-shadow: 0 1px 3px rgba(59, 130, 246, 0.1);
}

.tab-btn.active {
    background: #3b82f6;
    border-color: #3b82f6;
    color: white;
    box-shadow: 0 2px 4px rgba(59, 130, 246, 0.2);
}

/* Products Grid - 4 Columns */
.products-modern-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1.4rem;
    max-width: 1400px;
    margin: 0 auto;
}

/* Product Card - Wide Horizontal Proportion */
.product-card-modern {
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
    height: fit-content;
    max-height: 360px; /* Limit height to keep horizontal proportion */
}

.product-card-modern:hover {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
    transform: translateY(-3px);
    border-color: #d1d5db;
}

/* Product Image */
.product-image-link {
    display: block;
    text-decoration: none;
}

.product-image-modern {
    position: relative;
    width: 100%;
    padding-top: 58%; /* Wide landscape ratio - full image visible */
    background: #f8f9fa;
    overflow: hidden;
}

.product-image-modern img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: contain; /* Show full image, no crop */
    transition: transform 0.3s ease;
}

.product-card-modern:hover .product-image-modern img {
    transform: scale(1.03);
}

/* Badge Rating */
.badge-rating {
    position: absolute;
    top: 0.7rem;
    right: 0.7rem;
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    color: white;
    padding: 0.3rem 0.7rem;
    border-radius: 16px;
    font-size: 0.8rem;
    font-weight: 700;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
    display: flex;
    align-items: center;
    gap: 0.2rem;
}

.badge-rating::before {
    content: '⭐';
    font-size: 0.68rem;
}

/* Product Info */
.product-info-modern {
    padding: 0.95rem 1rem 0.95rem;
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    flex-grow: 1;
}

.product-title-modern {
    margin: 0;
    font-size: 0.9rem;
    font-weight: 600;
    line-height: 1.35;
}

.product-title-modern a {
    color: #1f2937;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.4rem;
}

.product-title-modern a:hover {
    color: #2563eb;
}

.product-price-modern {
    font-size: 1.1rem;
    font-weight: 700;
    color: #111827;
    margin: 0;
}

.price-free {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* Product Meta */
.product-meta-modern {
    display: flex;
    align-items: center;
    gap: 0.25rem;
    flex-wrap: wrap;
    font-size: 0.78rem;
    color: #6b7280;
    line-height: 1.2;
}

.product-meta-modern .author {
    color: #6b7280;
    font-weight: 400;
}

.product-meta-modern .rating-stars {
    color: #fbbf24;
    font-size: 0.68rem;
    display: flex;
    gap: 0.08rem;
}

.product-meta-modern .sales {
    color: #6b7280;
    font-weight: 400;
}

/* Preview Button */
.btn-preview-modern {
    display: block;
    width: 100%;
    padding: 0.65rem;
    background: #374151;
    color: white;
    text-align: center;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.825rem;
    transition: all 0.25s ease;
    margin-top: auto;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.btn-preview-modern:hover {
    background: #1f2937;
    color: white;
    transform: translateY(-1px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

/* View More Button */
.btn-view-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.9rem 2.25rem;
    background: white;
    border: 2px solid #3b82f6;
    color: #3b82f6;
    text-decoration: none;
    border-radius: 7px;
    font-weight: 600;
    font-size: 0.9375rem;
    transition: all 0.25s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.btn-view-more:hover {
    background: #3b82f6;
    color: white;
    box-shadow: 0 2px 6px rgba(59, 130, 246, 0.3);
}

/* Empty State */
.empty-state {
    grid-column: 1 / -1;
    text-align: center;
    padding: 3rem;
    color: #94a3b8;
    font-size: 0.95rem;
}

.empty-state i.fa-spinner {
    font-size: 1.5rem;
    color: #3b82f6;
    margin-bottom: 0.5rem;
}

/* Category Tab Loading & Transition */
.category-tabs .tab-btn {
    position: relative;
    transition: all 0.3s ease;
}

.category-tabs .tab-btn.loading::after {
    content: '';
    position: absolute;
    right: 0.5rem;
    top: 50%;
    transform: translateY(-50%);
    width: 12px;
    height: 12px;
    border: 2px solid currentColor;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
}

@keyframes spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Products Grid Fade In */
.products-modern-grid {
    animation: fadeIn 0.4s ease-in-out;
}

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

/* Responsive */
@media (max-width: 1200px) {
    .products-modern-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.25rem;
    }
}

@media (max-width: 992px) {
    .products-modern-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
    
    .category-tabs {
        gap: 0.35rem;
    }
    
    .tab-btn {
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }
}

@media (max-width: 768px) {
    .products-modern-section {
        padding: 3rem 0;
    }
    
    .section-title-modern {
        font-size: 1.5rem;
    }
    
    .section-subtitle-modern {
        font-size: 0.9rem;
    }
    
    .category-tabs {
        margin-bottom: 2rem;
    }
    
    .products-modern-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.85rem;
    }
    
    .product-info-modern {
        padding: 1rem;
        gap: 0.6rem;
    }
    
    .product-title-modern {
        font-size: 0.9rem;
    }
    
    .product-price-modern {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .products-modern-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }
    
    .product-image-modern {
        padding-top: 80%;
    }
    
    .product-info-modern {
        padding: 0.85rem;
    }
    
    .btn-preview-modern {
        padding: 0.65rem;
        font-size: 0.85rem;
    }
}

