/* Category-specific badge colors */
.product-badge.badge-paint {
    background: linear-gradient(135deg, #CC0000 0%, #c82333 100%);
    color: white;
}

.product-badge.badge-waterproofing {
    background: linear-gradient(135deg, #CC0000 0%, #990000 100%);
    color: white;
}

.product-badge.badge-base-paints-colorants {
    background: linear-gradient(135deg, #ffc107 0%, #e0a800 100%);
    color: #212529;
}

.product-badge.badge-decorative {
    background: linear-gradient(135deg, #17a2b8 0%, #138496 100%);
    color: white;
}

.product-badge.badge-primer , .product-badge.badge-complementary {
    background: linear-gradient(135deg, #28a745 0%, #1e7e34 100%);
    color: white;
}

/* Premium Badge Styles */
.premium-badge {
    position: absolute;
    top: 12px;
    right: 12px;
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #8B4513;
    padding: 6px 12px;
    border-radius: 20px;
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: flex;
    align-items: center;
    gap: 4px;
    box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    z-index: 2;
    animation: premium-glow 2s ease-in-out infinite alternate;
}

.premium-mini-badge {
    background: linear-gradient(135deg, #FFD700 0%, #FFA500 100%);
    color: #8B4513;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 0.7rem;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 215, 0, 0.3);
}

@keyframes premium-glow {
    from {
        box-shadow: 0 4px 12px rgba(255, 215, 0, 0.3);
    }
    to {
        box-shadow: 0 4px 20px rgba(255, 215, 0, 0.6);
    }
}

/* Badges container */
.badges-container {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    flex-wrap: wrap;
}

/* Category-specific hover effects */
.modern-product-card[data-product-type="paint"]:hover {
    border-color: #CC0000;
}

.modern-product-card[data-product-type="waterproofing"]:hover {
    border-color: #CC0000;
}

.modern-product-card[data-product-type="industrial"]:hover {
    border-color: #ffc107;
}

.modern-product-card[data-product-type="decorative"]:hover {
    border-color: #17a2b8;
}

.modern-product-card[data-product-type="primer"]:hover {
    border-color: #28a745;
}

/* Fixed image container styles */
.modern-products-grid {
    position: relative;
    z-index: 1;
}

.products-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-bottom: 15px;
    border-bottom: 1px solid #eaeaea;
    margin-bottom: 30px;
}

.products-main-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50;
    margin: 0;
}

.products-count-badge {
    background: #f8f9fa;
    color: #6c757d;
    padding: 6px 12px;
    border-radius: 12px;
    font-size: 0.85rem;
    font-weight: 500;
    border: 1px solid #e9ecef;
}

.modern-product-card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f1f3f4;
    height: 100%;
    display: flex;
    flex-direction: column;
    position: relative;
}

.modern-product-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.12);
}

/* FIXED: Better image container for mobile */
.product-image-container {
    position: relative;
    height: 260px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    overflow: hidden;
    border-bottom: 1px solid #f1f1f1;
    flex-shrink: 0;
}

/* FIXED: Better image handling with mobile optimization */
.product-image {
    width: auto !important;
    height: auto !important;
    max-width: 85% !important;
    max-height: 85% !important;
    object-fit: contain;
    transition: transform 0.4s ease;
}

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

.product-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: all 0.3s ease;
    z-index: 1;
}

.modern-product-card:hover .product-overlay {
    opacity: 1;
}

.btn-quick-view {
    background: white;
    border: none;
    padding: 12px 20px;
    border-radius: 25px;
    color: #2c3e50;
    font-weight: 600;
    font-size: 0.9rem;
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    transform: translateY(10px);
}

.modern-product-card:hover .btn-quick-view {
    transform: translateY(0);
}

.btn-quick-view:hover {
    background: #CC0000;
    color: white;
    transform: translateY(-2px);
}

.product-info {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    min-height: 200px;
}

.product-badge {
    padding: 4px 12px;
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #2c3e50;
    margin-bottom: 8px;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.6em;
}

.product-subtitle {
    font-size: 0.85rem;
    color: #6c757d;
    line-height: 1.4;
    margin-bottom: 15px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex-grow: 1;
    min-height: 2.8em;
}

.product-features {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    flex-wrap: wrap;
}

.feature-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: #f8f9fa;
    padding: 6px 12px;
    border-radius: 8px;
    font-size: 0.8rem;
    color: #6c757d;
    border: 1px solid #e9ecef;
    white-space: nowrap;
}

.feature-item i {
    color: #CC0000;
    font-size: 0.8rem;
}

.product-actions {
    margin-top: auto;
}

.btn-product-primary {
    background: #CC0000;
    color: white;
    border: none;
    padding: 12px 20px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.9rem;
    text-decoration: none;
    text-align: center;
    width: 100%;
    transition: all 0.3s ease;
    display: block;
}

.btn-product-primary:hover {
    color: white;
    text-decoration: none;
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(220, 53, 69, 0.3);
}

/* Mobile-specific image optimization */
@media (max-width: 1200px) {
    .product-image-container {
        height: 240px;
    }
}

@media (max-width: 992px) {
    .product-image-container {
        height: 220px;
        padding: 15px;
    }
    
    .product-image {
        max-width: 90% !important;
        max-height: 90% !important;
    }
    
    .product-info {
        padding: 15px;
    }
}

@media (max-width: 768px) {
    .product-image-container {
        height: 200px;
        padding: 12px;
    }
    
    .product-image {
        max-width: 95% !important;
        max-height: 95% !important;
    }
    
    .product-title {
        font-size: 1rem;
    }
    .premium-badge {
        font-size: 0.65rem;
        padding: 4px 8px;
    }
}

@media (max-width: 576px) {
    .product-image-container {
        height: 180px;
        padding: 10px;
    }
    
    .product-image {
        max-width: 100% !important;
        max-height: 100% !important;
    }
    
    .product-features {
        flex-direction: column;
        gap: 6px;
    }
    .feature-item {
        width: 100%;
        justify-content: center;
    }
    .badges-container {
        flex-direction: column;
        align-items: flex-start;
    }
}

/* Ensure consistent card heights */
.row.g-4 {
    align-items: stretch;
}

.modern-product-card {
    height: 100%;
}
