/* Enhanced Mobile Categories Section css*/
.mobile-categories-section {
    position: relative;
    padding: 0.5rem 0;
}

.mobile-categories-container {
    position: relative;
    overflow: hidden;
    margin: 0 -0.5rem;
}

.mobile-categories-wrapper {
    display: flex;
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    gap: 0.75rem;
    padding: 0 0.5rem;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}

.mobile-category-item {
    flex: 0 0 auto;
    width: calc(50vw - 1.5rem);
    max-width: 180px;
    min-width: 140px;
    scroll-snap-align: start;
}

.mobile-category-card {
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border-radius: 1rem;
    padding: 1rem 0.75rem;
    text-align: center;
    border: 1px solid rgba(13, 110, 253, 0.1);
    box-shadow: 0 2px 12px rgba(13, 110, 253, 0.08);
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    overflow: hidden;
    height: 120px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.mobile-category-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.05) 0%, rgba(13, 110, 253, 0.02) 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

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

.mobile-category-card:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 8px 25px rgba(13, 110, 253, 0.15);
    border-color: rgba(13, 110, 253, 0.2);
}

.mobile-category-image {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 0.5rem;
    border: 2px solid rgba(13, 110, 253, 0.1);
    transition: all 0.3s ease;
}

.mobile-category-card:hover .mobile-category-image {
    border-color: rgba(13, 110, 253, 0.3);
    transform: scale(1.1);
}

.mobile-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(13, 110, 253, 0.1) 0%, rgba(13, 110, 253, 0.05) 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.5rem;
    color: #0d6efd;
    font-size: 1.1rem;
    transition: all 0.3s ease;
}

.mobile-category-card:hover .mobile-category-icon {
    background: linear-gradient(135deg, #0d6efd 0%, #0b5ed7 100%);
    color: white;
    transform: scale(1.1);
}

.mobile-category-name {
    font-size: 0.75rem;
    font-weight: 600;
    color: #333;
    line-height: 1.2;
    margin: 0;
    transition: color 0.3s ease;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
}

.mobile-category-card:hover .mobile-category-name {
    color: #0d6efd;
}

/* Navigation Buttons */
.mobile-category-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.95);
    border: 1px solid rgba(13, 110, 253, 0.2);
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    color: #0d6efd;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 10;
    opacity: 0.8;
}

.mobile-category-nav:hover {
    background: #0d6efd;
    color: white;
    opacity: 1;
    transform: translateY(-50%) scale(1.1);
}

.mobile-category-nav.prev {
    left: 8px;
}

.mobile-category-nav.next {
    right: 8px;
}

.mobile-category-nav i {
    font-size: 0.8rem;
}

/* Indicators */
.mobile-category-indicators {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
}

.mobile-category-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.3);
    cursor: pointer;
    transition: all 0.3s ease;
}

.mobile-category-indicator.active {
    background: #0d6efd;
    transform: scale(1.2);
}

/* Swipe gesture indicators */
.mobile-swipe-hint {
    text-align: center;
    margin-top: 0.5rem;
    color: #6c757d;
    font-size: 0.7rem;
    opacity: 0.7;
}

.mobile-swipe-hint i {
    margin: 0 0.25rem;
    animation: swipeHint 2s ease-in-out infinite;
}

@keyframes swipeHint {
    0%, 100% { transform: translateX(0); }
    50% { transform: translateX(4px); }
}

/* Responsive adjustments */
@media (max-width: 575.98px) {
    .mobile-category-item {
        width: calc(50vw - 1rem);
        min-width: 120px;
    }
    
    .mobile-category-card {
        height: 100px;
        padding: 0.75rem 0.5rem;
    }
    
    .mobile-category-image,
    .mobile-category-icon {
        width: 35px;
        height: 35px;
    }
    
    .mobile-category-icon {
        font-size: 1rem;
    }
    
    .mobile-category-name {
        font-size: 0.7rem;
    }
    
    .mobile-category-nav {
        width: 28px;
        height: 28px;
    }
    
    .mobile-category-nav i {
        font-size: 0.7rem;
    }
}

@media (max-width: 375px) {
    .mobile-category-item {
        width: calc(50vw - 0.75rem);
        min-width: 110px;
    }
    
    .mobile-category-card {
        height: 90px;
        padding: 0.5rem;
    }
    
    .mobile-category-image,
    .mobile-category-icon {
        width: 30px;
        height: 30px;
    }
    
    .mobile-category-name {
        font-size: 0.65rem;
    }
}

/* Touch interaction improvements */
.mobile-categories-wrapper {
    cursor: grab;
}

.mobile-categories-wrapper:active {
    cursor: grabbing;
}

.mobile-categories-wrapper.dragging {
    cursor: grabbing;
}

.mobile-categories-wrapper.dragging .mobile-category-card {
    pointer-events: none;
}

/* Performance optimizations */
.mobile-category-card {
    will-change: transform, box-shadow;
}

.mobile-categories-wrapper {
    will-change: transform;
}

/* Accessibility improvements */
.mobile-category-nav:focus {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

.mobile-category-card:focus-within {
    outline: 2px solid #0d6efd;
    outline-offset: 2px;
}

/* Loading skeleton */
.mobile-category-skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
    border-radius: 1rem;
    height: 120px;
}

@keyframes loading {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* Hide desktop carousel on mobile */
@media (max-width: 991.98px) {
    #categoriesCarousel {
        display: none !important;
    }
    
    .mobile-categories-section {
        display: block !important;
    }
}

/* Show desktop carousel on larger screens */
@media (min-width: 992px) {
    .mobile-categories-section {
        display: none !important;
    }
}
