/* Popular Categories Modern CSS */

/* Category Card Modern Styles */
.category-card-modern {
    position: relative;
    border-radius: 15px;
    overflow: hidden;
    background: white;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    height: auto;
    max-height: 280px;
    cursor: pointer;
    display: flex;
    flex-direction: column;
}

.category-card-modern:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 30px rgba(0, 0, 0, 0.12);
}

.category-link {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    color: inherit;
    height: auto;
}

.category-link:hover {
    text-decoration: none;
    color: inherit;
}

/* Image Container */
.category-image-wrapper {
    position: relative;
    height: 140px;
    overflow: hidden;
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
    flex-shrink: 0;
}

.category-card-modern .category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.category-card-modern:hover .category-image {
    transform: scale(1.1);
}

/* Prevent category image effects on banner images */
.banner-card-1 .category-image,
.banner-card-2 .category-image,
.banner-card-3 .category-image,
.box-image_V06 .category-image {
    transition: none !important;
    transform: none !important;
}

.banner-card-1:hover .category-image,
.banner-card-2:hover .category-image,
.banner-card-3:hover .category-image,
.box-image_V06:hover .category-image {
    transform: none !important;
}

/* Icon Fallback */
.category-icon-modern {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    font-size: 4rem;
    color: rgba(255, 255, 255, 0.9);
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
}

/* Overlay Effects - Scoped to prevent conflicts */
.category-card-modern .category-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(237, 82, 51, 0.85) 0%, rgba(237, 82, 51, 0.85) 100%);
    opacity: 0;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 5;
}

.category-card-modern:hover .category-overlay {
    opacity: 1;
    pointer-events: auto;
}

/* Ensure overlay doesn't affect banner cards */
.banner-card-1 .category-overlay,
.banner-card-2 .category-overlay,
.banner-card-3 .category-overlay,
.box-image_V06 .category-overlay {
    display: none !important;
    opacity: 0 !important;
    pointer-events: none !important;
}

.category-overlay-content {
    text-align: center;
    color: white;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.category-card-modern:hover .category-overlay-content {
    transform: translateY(0);
}

.category-arrow {
    font-size: 2rem;
    margin-bottom: 10px;
    display: block;
    animation: bounce 2s infinite;
}

@keyframes bounce {
    0%, 20%, 50%, 80%, 100% {
        transform: translateY(0);
    }
    40% {
        transform: translateY(-10px);
    }
    60% {
        transform: translateY(-5px);
    }
}

.category-text {
    font-size: 1.1rem;
    font-weight: 600;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* Category Info */
.category-info {
    padding: 12px 12px 15px 12px;
    text-align: center;
    position: relative;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.category-name {
    font-size: 1.1rem;
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 5px;
    line-height: 1.3;
    transition: all 0.3s ease;
}

.category-card-modern:hover .category-name {
    color: #ed5233;
}

.category-parent {
    font-size: 0.85rem;
    color: #718096;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    font-weight: 500;
}

/* Underline Animation */
.category-underline {
    height: 3px;
    background: #ed5233;
    width: 0;
    margin: 0 auto;
    border-radius: 2px;
    transition: all 0.4s ease;
}

.category-card-modern:hover .category-underline {
    width: 60px;
}

/* Special Gradient Variants */
.category-card-modern:nth-child(4n+1) .category-image-wrapper {
    background: linear-gradient(135deg, #ed5233 0%, #ed5233 100%);
}

.category-card-modern:nth-child(4n+2) .category-image-wrapper {
    background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
}

.category-card-modern:nth-child(4n+3) .category-image-wrapper {
    background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
}

.category-card-modern:nth-child(4n+4) .category-image-wrapper {
    background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
}

/* Responsive Design */
@media (max-width: 1200px) {
    .category-image-wrapper {
        height: 130px;
    }
    
    .category-name {
        font-size: 1.05rem;
    }
    
    .category-info {
        padding: 10px 10px 12px 10px;
    }
}

@media (max-width: 768px) {
    .category-image-wrapper {
        height: 120px;
    }
    
    .category-info {
        padding: 8px 10px 12px 10px;
    }
    
    .category-name {
        font-size: 1rem;
    }
    
    .category-icon-modern {
        font-size: 3rem;
    }
    
    .category-arrow {
        font-size: 1.5rem;
    }
    
    .category-text {
        font-size: 1rem;
    }
}

@media (max-width: 576px) {
    .category-card-modern:hover {
        transform: translateY(-3px);
    }
    
    .category-image-wrapper {
        height: 100px;
    }
    
    .category-info {
        padding: 6px 8px 10px 8px;
    }
    
    .category-name {
        font-size: 0.95rem;
        margin-bottom: 3px;
    }
    
    .category-parent {
        font-size: 0.8rem;
        margin-bottom: 4px;
    }
}

/* Loading Animation for Lazy Images */
.category-image[data-src] {
    background: linear-gradient(45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(-45deg, #f0f0f0 25%, transparent 25%), 
                linear-gradient(45deg, transparent 75%, #f0f0f0 75%), 
                linear-gradient(-45deg, transparent 75%, #f0f0f0 75%);
    background-size: 20px 20px;
    background-position: 0 0, 0 10px, 10px -10px, -10px 0px;
    animation: loading 1s linear infinite;
}

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

/* Focus States for Accessibility */
.category-card-modern:focus-within {
    outline: 3px solid #ed5233;
    outline-offset: 2px;
}

.category-link:focus {
    outline: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .category-overlay {
        background: rgba(0, 0, 0, 0.8);
    }
    
    .category-name {
        color: #000;
    }
    
    .category-card-modern:hover .category-name {
        color: #000;
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .category-card-modern,
    .category-image,
    .category-overlay,
    .category-overlay-content,
    .category-underline {
        transition: none;
    }
    
    .category-arrow {
        animation: none;
    }
    
    .category-card-modern:hover {
        transform: none;
    }
}
