/* Categories Hamburger Menu for Mobile - Enhanced Design */
.mobile-categories-menu {
    display: none;
}

.categories-hamburger-btn {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 8px;
    padding: 0.6rem 0.8rem;
    margin-right: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
}

.categories-hamburger-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s;
}

.categories-hamburger-btn:hover::before {
    left: 100%;
}

.categories-hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.25);
    border-color: rgba(255, 255, 255, 0.3);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.categories-hamburger-btn i {
    font-size: 1.1rem;
    position: relative;
    z-index: 1;
}

.categories-sidebar {
    position: fixed;
    top: 0;
    left: -320px;
    width: 320px;
    height: 100vh;
    background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
    z-index: 1030;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 0 50px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    border-right: 1px solid rgba(0, 0, 0, 0.05);
}

.categories-sidebar.show {
    left: 0;
}

.categories-sidebar-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 1.5rem 1.25rem;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    position: relative;
}

.categories-sidebar-header::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
}

.categories-sidebar-header h5 {
    color: white;
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
    letter-spacing: 0.025em;
}

.categories-sidebar-close {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    font-size: 1.2rem;
    color: white;
    padding: 0.4rem 0.6rem;
    border-radius: 6px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(10px);
}

.categories-sidebar-close:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: rotate(90deg) scale(1.1);
    border-color: rgba(255, 255, 255, 0.3);
}

.categories-sidebar-body {
    padding: 1.5rem 0 2rem 0;
}

.categories-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.categories-list li {
    margin: 0 1rem 0.5rem 1rem;
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.categories-list li:hover {
    transform: translateX(4px);
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.15);
}

.categories-list li a {
    display: block;
    padding: 1rem 1.25rem;
    color: #374151;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    font-weight: 500;
    font-size: 0.95rem;
    letter-spacing: 0.025em;
    background: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
    border: 1px solid rgba(102, 126, 234, 0.1);
    position: relative;
    overflow: hidden;
}

.categories-list li a::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(102, 126, 234, 0.1), transparent);
    transition: left 0.6s;
}

.categories-list li a:hover::before {
    left: 100%;
}

.categories-list li a:hover {
    background: linear-gradient(135deg, #f0f4ff 0%, #e0e7ff 100%);
    color: #667eea;
    border-color: #667eea;
    transform: translateX(0);
}

/* Special styling for "All Categories" item */
.categories-list li:last-child {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
}

.categories-list li:last-child a {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    border: 1px solid transparent;
    box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}

.categories-list li:last-child a::before {
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
}

.categories-list li:last-child a:hover {
    background: linear-gradient(135deg, #5a67d8 0%, #6b46c1 100%);
    color: white;
    transform: translateX(0) translateY(-2px);
    box-shadow: 0 8px 25px rgba(102, 126, 234, 0.4);
}

.categories-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(45deg, rgba(0, 0, 0, 0.6) 0%, rgba(0, 0, 0, 0.4) 100%);
    z-index: 1025;
    display: none;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    backdrop-filter: blur(8px);
}

.categories-overlay.show {
    display: block;
    opacity: 1;
}

/* Enhanced Responsive Design */
@media (max-width: 991.98px) {
    .categories-hamburger-btn {
        display: inline-flex !important;
        align-items: center;
        justify-content: center;
    }
}

@media (max-width: 576px) {
    .categories-sidebar {
        width: 100%;
        left: -100%;
    }
    
    .categories-sidebar.show {
        left: 0;
    }
    
    .categories-sidebar-header {
        padding: 1.25rem 1rem;
    }
    
    .categories-list li {
        margin: 0 0.75rem 0.4rem 0.75rem;
    }
    
    .categories-list li a {
        padding: 0.9rem 1rem;
        font-size: 0.9rem;
    }
}

/* Smooth scrollbar for sidebar */
.categories-sidebar::-webkit-scrollbar {
    width: 6px;
}

.categories-sidebar::-webkit-scrollbar-track {
    background: #f1f5f9;
}

.categories-sidebar::-webkit-scrollbar-thumb {
    background: linear-gradient(180deg, #667eea 0%, #764ba2 100%);
    border-radius: 3px;
}

.categories-sidebar::-webkit-scrollbar-thumb:hover {
    background: linear-gradient(180deg, #5a67d8 0%, #6b46c1 100%);
}

/* Loading animation for smooth transitions */
@keyframes slideInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.categories-sidebar.show .categories-list li {
    animation: slideInLeft 0.3s ease forwards;
}

.categories-sidebar.show .categories-list li:nth-child(1) { animation-delay: 0.1s; }
.categories-sidebar.show .categories-list li:nth-child(2) { animation-delay: 0.15s; }
.categories-sidebar.show .categories-list li:nth-child(3) { animation-delay: 0.2s; }
.categories-sidebar.show .categories-list li:nth-child(4) { animation-delay: 0.25s; }
.categories-sidebar.show .categories-list li:nth-child(5) { animation-delay: 0.3s; }
.categories-sidebar.show .categories-list li:nth-child(n+6) { animation-delay: 0.35s; }

/* Category count badge (if needed) */
.category-count {
    background: rgba(13, 110, 253, 0.1);
    color: var(--primary-color, #0d6efd);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
    font-size: 0.7rem;
    margin-left: auto;
}

@media (max-width: 991.98px) {
    .categories-hamburger-btn {
        display: flex;
        align-items: center;
    }
    
    .mobile-categories-menu {
        display: block;
    }
}

/* Extra responsive adjustments */
@media (max-width: 575.98px) {
    .categories-sidebar {
        width: 260px;
        left: -260px;
    }
    
    .categories-sidebar-header {
        padding: 0.8rem;
    }
    
    .categories-sidebar-header h5 {
        font-size: 1rem;
    }
    
    .categories-list li a {
        padding: 0.7rem 0.8rem;
        font-size: 0.9rem;
    }
}
