.main-category-card {
    border: none;
    border-radius: 20px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    position: relative;
    overflow: hidden;
}

.main-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 5px;
    background: linear-gradient(90deg, var(--category-color, #6c757d), transparent);
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.3s ease;
}

.main-category-card:hover::before {
    transform: scaleX(1);
}

.main-category-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
}

.category-icon {
    transition: transform 0.3s ease;
}

.main-category-card:hover .category-icon {
    transform: scale(1.1) rotate(5deg);
}

/* Button loading states */
.btn-loading {
    position: relative;
    color: transparent !important;
}

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

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

#products-container > div:nth-child(2) > div > div > a:hover {
background: linear-gradient(45deg, #CC0000, #990000)!important;
transform: translateY(-3px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#products-container > div:nth-child(3) > div > div > a:hover {
background: linear-gradient(45deg, #0dcaf0, #0aa3c4);
transform: translateY(-3px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#products-container > div:nth-child(4) > div > div > a:hover {
background: linear-gradient(45deg, #198754, #146c43);
transform: translateY(-3px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#products-container > div:nth-child(5) > div > div > a:hover {
background: linear-gradient(45deg, #ffc107, #e0a800); /* warning gradient */
transform: translateY(-3px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

#products-container > div:nth-child(6) > div > div > a:hover {
background: linear-gradient(45deg, #6c757d, #5a6268); /* secondary gradient */
transform: translateY(-3px);
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Category-specific colors */
.product-item[data-category="paints"] .main-category-card::before {
    --category-color: #CC0000;
}

.product-item[data-category="waterproofings"] .main-category-card::before {
    --category-color: #CC0000;
}

.product-item[data-category="decorative"] .main-category-card::before {
    --category-color: #17a2b8;
}

.product-item[data-category="base paints colorants"] .main-category-card::before {
    --category-color: #e0a800;
}

.product-item[data-category="primers"] .main-category-card::before {
    --category-color: #28a745;
}

.product-item[data-category="all"] .main-category-card::before {
    --category-color: #6c757d;
}

/* Responsive design */
@media (max-width: 768px) {
    .main-category-card .card-body {
        padding: 2rem !important;
    }

    .category-icon .fa-4x {
        font-size: 3rem;
    }

    .main-category-card h3 {
        font-size: 1.5rem !important;
    }

    /* Prevent explore buttons from overflowing on narrow screens */
    .main-category-card .btn-lg {
        font-size: 0.82rem !important;
        padding: 0.5rem 0.75rem !important;
        white-space: normal !important;
        word-break: break-word;
        max-width: 100%;
    }
}
