/* ============================================
   BD Menu - Modern Category Sidebar
   ============================================ */

/* Main Sidebar Container - Modern & Sleek */
.category-sidebar-menu {
    position: fixed;
    left: 0;
    top: 0;
    height: 100vh;
    z-index: 1000;
    background: linear-gradient(180deg, #ffffff 0%, #fafbfc 100%);
    box-shadow: 4px 0 24px rgba(0, 0, 0, 0.08), 0 0 0 1px rgba(0, 0, 0, 0.04);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.4s ease;
    width: 70px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    backdrop-filter: blur(10px);
}

.category-sidebar-menu.expanded {
    width: 320px;
    box-shadow: 8px 0 32px rgba(0, 0, 0, 0.12), 0 0 0 1px rgba(0, 0, 0, 0.06);
}

/* Toggle Button (Minimized State - Modern Shiny) */
.category-sidebar-toggle {
    width: 50px;
    height: 50px;
    margin: 15px auto;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    background: linear-gradient(135deg, #1a56db 0%, #2563eb 100%);
    color: #ffffff;
    border-radius: 14px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(26, 86, 219, 0.3), 0 2px 4px rgba(26, 86, 219, 0.2), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
}

.category-sidebar-toggle::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: linear-gradient(45deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transform: rotate(45deg);
    transition: all 0.6s ease;
    opacity: 0;
}

.category-sidebar-toggle:hover {
    background: linear-gradient(135deg, #1e40af 0%, #1d4ed8 100%);
    transform: scale(1.08) translateY(-2px);
    box-shadow: 0 6px 20px rgba(26, 86, 219, 0.4), 0 4px 8px rgba(26, 86, 219, 0.3), inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.category-sidebar-toggle:hover::before {
    opacity: 1;
    animation: shine 0.6s ease;
}

.category-sidebar-toggle:active {
    transform: scale(1.02) translateY(0);
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.3);
}

.category-sidebar-toggle i {
    font-size: 18px;
    position: relative;
    z-index: 1;
    transition: transform 0.3s ease;
}

.category-sidebar-toggle:hover i {
    transform: rotate(90deg);
}

@keyframes shine {
    0% {
        transform: translateX(-100%) translateY(-100%) rotate(45deg);
    }
    100% {
        transform: translateX(100%) translateY(100%) rotate(45deg);
    }
}

/* Content Area */
.category-sidebar-content {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.category-sidebar-menu.expanded .category-sidebar-content {
    align-items: stretch;
}

/* Header Section (Expanded State) - Modern & Sleek */
.category-sidebar-header {
    padding: 12px;
    display: none;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    min-width: 280px;
    opacity: 0;
    transition: opacity 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s, transform 0.4s cubic-bezier(0.4, 0, 0.2, 1) 0.15s;
    pointer-events: none;
    margin-bottom: 12px;
    position: relative;
    transform: translateY(-10px);
}

.category-sidebar-menu.expanded .category-sidebar-header {
    display: flex;
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}

/* Modern Search Input (Replaces All Categories Button) */
.category-sidebar-search-wrapper {
    position: relative;
    width: 100%;
    display: flex;
    align-items: center;
}

.category-sidebar-search {
    width: 100%;
    padding: 14px 45px 14px 45px;
    font-size: 14px;
    font-weight: 500;
    color: #1f2937;
    background: linear-gradient(135deg, #ffffff 0%, #f8fafc 100%);
    border: 2px solid #e5e7eb;
    border-radius: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    outline: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    font-family: inherit;
}

.category-sidebar-search::placeholder {
    color: #9ca3af;
    font-weight: 400;
}

.category-sidebar-search:focus {
    border-color: #1a56db;
    background: #ffffff;
    box-shadow: 0 4px 16px rgba(26, 86, 219, 0.15), 0 0 0 4px rgba(26, 86, 219, 0.1);
    transform: translateY(-1px);
}

.category-sidebar-search-icon {
    position: absolute;
    left: 16px;
    color: #9ca3af;
    font-size: 16px;
    pointer-events: none;
    transition: all 0.3s ease;
    z-index: 1;
}

.category-sidebar-search:focus ~ .category-sidebar-search-icon {
    color: #1a56db;
    transform: scale(1.1);
}

.category-sidebar-search-clear {
    position: absolute;
    right: 12px;
    background: #f3f4f6;
    border: none;
    border-radius: 50%;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-size: 12px;
    transition: all 0.2s ease;
    z-index: 1;
}

.category-sidebar-search-clear:hover {
    background: #e5e7eb;
    color: #1f2937;
    transform: scale(1.1) rotate(90deg);
}

.category-sidebar-search-clear:active {
    transform: scale(0.95) rotate(90deg);
}

.category-sidebar-close {
    position: relative;
    background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
    border: 1px solid #d1d5db;
    font-size: 14px;
    color: #6b7280;
    cursor: pointer;
    padding: 0;
    border-radius: 10px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    z-index: 10;
    flex-shrink: 0;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.category-sidebar-menu.expanded .category-sidebar-close {
    opacity: 1;
    pointer-events: auto;
}

.category-sidebar-close:hover {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
    border-color: #dc2626;
    color: #ffffff;
    transform: scale(1.1) rotate(90deg);
    box-shadow: 0 4px 12px rgba(220, 38, 38, 0.3);
}

.category-sidebar-close:active {
    transform: scale(0.95) rotate(90deg);
}

.category-sidebar-close:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.2);
}

/* Category List */
.category-sidebar-list {
    padding: 10px 0;
    flex: 1;
    min-width: 280px;
    width: 100%;
    display: flex;
    flex-direction: column;
}

.category-sidebar-item {
    position: relative;
    margin-bottom: 2px;
    padding: 0 10px;
}

.category-sidebar-link {
    display: flex;
    align-items: center;
    padding: 14px 15px;
    color: #333333;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    min-width: 280px;
    position: relative;
    background: transparent;
    border: 1px solid transparent;
}

.category-sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: linear-gradient(180deg, #1a56db 0%, #2563eb 100%);
    border-radius: 0 3px 3px 0;
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
}

.category-sidebar-link:hover {
    background: linear-gradient(90deg, rgba(26, 86, 219, 0.08) 0%, rgba(26, 86, 219, 0.04) 100%);
    color: #1a56db;
    transform: translateX(4px);
    border-color: rgba(26, 86, 219, 0.1);
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.08);
}

.category-sidebar-link:hover::before {
    height: 60%;
    opacity: 1;
}

.category-sidebar-item.active .category-sidebar-link,
.category-sidebar-link.active {
    background: linear-gradient(90deg, rgba(26, 86, 219, 0.12) 0%, rgba(26, 86, 219, 0.06) 100%);
    color: #1a56db;
    font-weight: 600;
    border-color: rgba(26, 86, 219, 0.15);
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.1);
}

.category-sidebar-item.active .category-sidebar-link::before,
.category-sidebar-link.active::before {
    height: 70%;
    opacity: 1;
}

/* Icons */
.category-sidebar-link i {
    font-size: 20px;
    width: 24px;
    text-align: center;
    margin-right: 15px;
    flex-shrink: 0;
    color: #4b5563;
    transition: color 0.2s ease;
}

.category-sidebar-link:hover i,
.category-sidebar-item.active .category-sidebar-link i,
.category-sidebar-link.active i {
    color: #1a56db;
}

/* Category Label */
.category-sidebar-label {
    opacity: 0;
    transition: opacity 0.3s ease;
    white-space: nowrap;
    font-size: 14px;
    font-weight: 500;
    pointer-events: none;
    flex: 1;
}

.category-sidebar-menu.expanded .category-sidebar-label {
    opacity: 1;
    pointer-events: auto;
}

/* Chevron Icon for Children - Smooth Animation */
.category-sidebar-toggle-children {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(0deg);
    background: rgba(26, 86, 219, 0.08);
    border: none;
    color: #9ca3af;
    cursor: pointer;
    padding: 6px;
    font-size: 11px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    pointer-events: none;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
}

.category-sidebar-menu.expanded .category-sidebar-toggle-children {
    opacity: 1;
    pointer-events: auto;
}

.category-sidebar-item:hover .category-sidebar-toggle-children,
.category-sidebar-item.active .category-sidebar-toggle-children {
    opacity: 1;
    pointer-events: auto;
    color: #1a56db;
    background: rgba(26, 86, 219, 0.12);
}

.category-sidebar-toggle-children.active {
    transform: translateY(-50%) rotate(90deg);
    background: rgba(26, 86, 219, 0.15);
    color: #1a56db;
}

.category-sidebar-toggle-children:hover {
    color: #1a56db;
    background: rgba(26, 86, 219, 0.2);
    transform: translateY(-50%) scale(1.1);
}

.category-sidebar-toggle-children.active:hover {
    transform: translateY(-50%) rotate(90deg) scale(1.1);
}

/* Children Submenu - Smooth Expand/Collapse Animation */
.category-sidebar-children {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1), 
                opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                padding 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
    opacity: 0;
    pointer-events: none;
    margin-left: 10px;
    margin-right: 10px;
    border-radius: 8px;
    margin-top: 6px;
    transform: translateY(-10px);
    border: 1px solid rgba(26, 86, 219, 0.08);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}

.category-sidebar-menu.expanded .category-sidebar-children {
    opacity: 1;
    pointer-events: auto;
}

.category-sidebar-children.active {
    max-height: 1000px;
    opacity: 1;
    padding: 10px 0;
    transform: translateY(0);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.06);
}

.category-sidebar-children .category-sidebar-item {
    margin-left: 0;
    margin-bottom: 0;
    padding: 0 10px;
}

.category-sidebar-children .category-sidebar-link {
    padding: 10px 15px 10px 20px;
    font-size: 13px;
    min-width: auto;
}

.category-sidebar-children .category-sidebar-link i {
    font-size: 16px;
    width: 18px;
    margin-right: 12px;
}

/* Empty State */
.category-sidebar-empty {
    padding: 40px 20px;
    text-align: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    min-width: 280px;
}

.category-sidebar-menu.expanded .category-sidebar-empty {
    opacity: 1;
    pointer-events: auto;
}

.category-sidebar-empty p {
    color: #9ca3af;
    font-size: 14px;
    margin: 0;
}

/* Buy Button (Bottom) */
.category-sidebar-buy-button {
    padding: 10px;
    margin-top: auto;
    min-width: 280px;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.category-sidebar-menu.expanded .category-sidebar-buy-button {
    opacity: 1;
    pointer-events: auto;
}

.category-sidebar-buy-button a,
.category-sidebar-buy-button button {
    width: 100%;
    padding: 14px 20px;
    background: #000000;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.2s ease;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
    font-family: inherit;
}

.category-sidebar-buy-button a:hover,
.category-sidebar-buy-button button:hover {
    background: #1f2937;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.category-sidebar-buy-button a:focus,
.category-sidebar-buy-button button:focus {
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.2);
}

.category-sidebar-buy-button i {
    font-size: 18px;
    color: #10b981;
}

.category-sidebar-buy-button span {
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.category-sidebar-menu.expanded .category-sidebar-buy-button span {
    opacity: 1;
    pointer-events: auto;
}

/* Minimized State - Icon Only View (Stacked) */
.category-sidebar-menu:not(.expanded) .category-sidebar-list {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 10px 0;
    gap: 10px;
}

.category-sidebar-menu:not(.expanded) .category-sidebar-item {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    margin: 0;
    width: 100%;
}

.category-sidebar-menu:not(.expanded) .category-sidebar-link {
    width: 42px;
    height: 42px;
    min-width: 42px;
    max-width: 42px;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    margin: 0 auto;
    background: #ffffff;
    border: 1.5px solid #e5e7eb;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.category-sidebar-menu:not(.expanded) .category-sidebar-link::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 0;
    background: #1a56db;
    border-radius: 0 3px 3px 0;
    transition: height 0.25s ease;
}

.category-sidebar-menu:not(.expanded) .category-sidebar-link:hover {
    background: #f3f4f6;
    border-color: #1a56db;
    transform: translateX(2px);
    box-shadow: 0 2px 6px rgba(26, 86, 219, 0.15);
}

.category-sidebar-menu:not(.expanded) .category-sidebar-item.active .category-sidebar-link,
.category-sidebar-menu:not(.expanded) .category-sidebar-link.active {
    background: #eff6ff;
    border-color: #1a56db;
    box-shadow: 0 2px 8px rgba(26, 86, 219, 0.2);
}

.category-sidebar-menu:not(.expanded) .category-sidebar-item.active .category-sidebar-link::before,
.category-sidebar-menu:not(.expanded) .category-sidebar-link.active::before {
    height: 60%;
}

.category-sidebar-menu:not(.expanded) .category-sidebar-link i {
    margin-right: 0;
    font-size: 20px;
    color: #4b5563;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.category-sidebar-menu:not(.expanded) .category-sidebar-link:hover i {
    color: #1a56db;
    transform: scale(1.1);
}

.category-sidebar-menu:not(.expanded) .category-sidebar-item.active .category-sidebar-link i,
.category-sidebar-menu:not(.expanded) .category-sidebar-link.active i {
    color: #1a56db;
}

.category-sidebar-menu:not(.expanded) .category-sidebar-label {
    display: none;
}

.category-sidebar-menu:not(.expanded) .category-sidebar-toggle-children {
    display: none;
}

.category-sidebar-menu:not(.expanded) .category-sidebar-children {
    display: none;
}

/* Ensure proper stacking in both states */
.category-sidebar-list {
    display: flex;
    flex-direction: column;
}

.category-sidebar-menu.expanded .category-sidebar-list {
    gap: 2px;
}

/* Scrollbar Styling */
.category-sidebar-content::-webkit-scrollbar {
    width: 6px;
}

.category-sidebar-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.category-sidebar-content::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 3px;
}

.category-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* Responsive Design */
@media (max-width: 768px) {
    .category-sidebar-menu {
        width: 0;
        box-shadow: none;
    }
    
    .category-sidebar-menu.expanded {
        width: 100%;
        max-width: 320px;
        box-shadow: 2px 0 15px rgba(0, 0, 0, 0.15);
    }
    
    .category-sidebar-toggle {
        position: fixed;
        left: 15px;
        top: 15px;
        z-index: 1001;
        margin: 0;
    }
    
    .category-sidebar-menu.expanded .category-sidebar-toggle {
        display: none;
    }
}

/* Enhanced Animations for smooth transitions */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateX(-15px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateY(-8px) scale(0.95);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.category-sidebar-menu.expanded .category-sidebar-item {
    animation: fadeIn 0.4s cubic-bezier(0.4, 0, 0.2, 1) forwards;
    animation-fill-mode: both;
}

.category-sidebar-menu.expanded .category-sidebar-item:nth-child(1) { animation-delay: 0.05s; }
.category-sidebar-menu.expanded .category-sidebar-item:nth-child(2) { animation-delay: 0.1s; }
.category-sidebar-menu.expanded .category-sidebar-item:nth-child(3) { animation-delay: 0.15s; }
.category-sidebar-menu.expanded .category-sidebar-item:nth-child(4) { animation-delay: 0.2s; }
.category-sidebar-menu.expanded .category-sidebar-item:nth-child(5) { animation-delay: 0.25s; }
.category-sidebar-menu.expanded .category-sidebar-item:nth-child(n+6) { animation-delay: 0.3s; }

.category-sidebar-children.active .category-sidebar-item {
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.category-sidebar-no-results {
    padding: 40px 20px;
    text-align: center;
    opacity: 0;
    animation: fadeIn 0.3s ease forwards;
}

.category-sidebar-no-results p {
    color: #9ca3af;
    font-size: 14px;
    margin: 0;
    font-style: italic;
}

/* Active state indicator */
.category-sidebar-item.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 3px;
    height: 60%;
    background: #1a56db;
    border-radius: 0 3px 3px 0;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-sidebar-menu.expanded .category-sidebar-item.active::before {
    opacity: 1;
}

