/* Overlay Backdrop - Only covers the right side, NOT the sidebar */
.bf-overlay {
    position: fixed !important;
    top: 0 !important;
    left: 480px !important;
    right: 0 !important;
    bottom: 0 !important;
    width: auto !important;
    height: 100vh !important;
    background: rgba(0, 0, 0, 0.4) !important;
    z-index: 999998 !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: opacity 0.3s ease, visibility 0.3s ease !important;
    backdrop-filter: none !important;
}

.bf-overlay.active {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Mobile - overlay covers full screen except sidebar */
@media (max-width: 767px) {
    .bf-overlay {
        left: 85vw !important;
    }
}

/* Toggle Button */
.bf-toggle-btn {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 8px !important;
    padding: 14px 24px !important;
    background: #ffffff !important;
    border: 1px solid #e0e0e0 !important;
    border-radius: 6px !important;
    font-size: 16px !important;
    font-weight: 600 !important;
    color: #000000 !important;
    cursor: pointer !important;
    transition: all 0.3s ease !important;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
    margin-bottom: 24px !important;
}

.bf-toggle-btn:hover {
    background: #fafafa !important;
    border-color: #bdbdbd !important;
    transform: translateY(-2px) !important;
}

.bf-toggle-icon {
    width: 20px !important;
    height: 20px !important;
    flex-shrink: 0 !important;
}

/* Sidebar Panel - Slides from LEFT - MUST BE OPAQUE AND ON TOP */
.bf-sidebar {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    right: auto !important;
    width: 480px !important;
    max-width: 90vw !important;
    height: 100vh !important;
    background: #ffffff !important;
    z-index: 999999 !important;
    display: flex !important;
    flex-direction: column !important;
    box-shadow: 2px 0 20px rgba(0, 0, 0, 0.15) !important;
    overflow: hidden !important;
    transform: translateX(-100%) !important;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    will-change: transform !important;
    visibility: hidden !important;
    isolation: isolate !important;
}

.bf-sidebar.active {
    transform: translateX(0) !important;
    visibility: visible !important;
}

/* Ensure sidebar has solid opaque background layers */
.bf-sidebar::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: #ffffff !important;
    z-index: -1 !important;
}

.bf-sidebar::after {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: #ffffff !important;
    z-index: -2 !important;
}

/* Force all sidebar elements to be visible */
.bf-sidebar,
.bf-sidebar *,
.bf-sidebar::before,
.bf-sidebar::after {
    pointer-events: auto !important;
    filter: none !important;
    backdrop-filter: none !important;
}

/* Ensure sidebar itself is a solid clickable surface */
.bf-sidebar {
    background: #ffffff !important;
}

.bf-sidebar > * {
    background: #ffffff !important;
}

/* Hide header when sidebar is open */
body.bf-sidebar-open .glassmorphic-header,
body.bf-sidebar-open .elementor-sticky {
    z-index: 99 !important;
}

/* Sidebar Header - FIXED at top */
.bf-sidebar-header {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 20px 24px !important;
    border-bottom: 1px solid #e8e8e8 !important;
    background: #ffffff !important;
    flex-shrink: 0 !important;
    min-height: 70px !important;
    position: sticky !important;
    top: 0 !important;
    z-index: 10 !important;
}

.bf-sidebar-title {
    margin: 0 !important;
    font-size: 20px !important;
    font-weight: 600 !important;
    color: #000000 !important;
    letter-spacing: 0 !important;
}

.bf-close-btn {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 40px !important;
    height: 40px !important;
    background: none !important;
    border: none !important;
    border-radius: 50% !important;
    cursor: pointer !important;
    color: #666666 !important;
    transition: all 0.2s ease !important;
    padding: 0 !important;
}

.bf-close-btn:hover {
    background: #f5f5f5 !important;
    color: #000000 !important;
}

.bf-close-btn svg {
    width: 20px !important;
    height: 20px !important;
}

/* Sidebar Content - SCROLLABLE */
.bf-sidebar-content {
    flex: 1 !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    padding: 0 24px !important;
    display: flex !important;
    flex-direction: column !important;
    gap: 0 !important;
    background: #ffffff !important;
    position: relative !important;
}

/* Add invisible clickable background to catch all clicks */
.bf-sidebar-content::before {
    content: '' !important;
    position: absolute !important;
    top: 0 !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: transparent !important;
    z-index: -1 !important;
    pointer-events: auto !important;
}

/* Custom Scrollbar */
.bf-sidebar-content::-webkit-scrollbar {
    width: 6px !important;
}

.bf-sidebar-content::-webkit-scrollbar-track {
    background: #f5f5f5 !important;
}

.bf-sidebar-content::-webkit-scrollbar-thumb {
    background: #cccccc !important;
    border-radius: 3px !important;
}

.bf-sidebar-content::-webkit-scrollbar-thumb:hover {
    background: #999999 !important;
}

/* Sidebar Actions - FIXED at bottom */
.bf-sidebar-actions {
    display: flex !important;
    flex-direction: column !important;
    gap: 12px !important;
    padding: 20px 24px !important;
    border-top: 1px solid #e8e8e8 !important;
    background: #ffffff !important;
    flex-shrink: 0 !important;
    position: sticky !important;
    bottom: 0 !important;
    z-index: 10 !important;
}

.bf-apply-btn,
.bf-reset-btn {
    width: 100% !important;
    padding: 16px 24px !important;
    font-size: 15px !important;
    font-weight: 600 !important;
    border: none !important;
    border-radius: 8px !important;
    cursor: pointer !important;
    transition: all 0.2s ease !important;
    letter-spacing: 0.3px !important;
}

.bf-apply-btn {
    background: #E91E63 !important;
    color: #ffffff !important;
}

.bf-apply-btn:hover:not(:disabled) {
    background: #C2185B !important;
    transform: translateY(-1px) !important;
    box-shadow: 0 4px 12px rgba(233, 30, 99, 0.3) !important;
}

.bf-apply-btn:disabled {
    opacity: 0.5 !important;
    cursor: not-allowed !important;
}

.bf-reset-btn {
    background: transparent !important;
    color: #E91E63 !important;
    border: 2px solid #E91E63 !important;
}

.bf-reset-btn:hover {
    background: #FCE4EC !important;
}

/* Prevent body scroll and push content behind */
body.bf-sidebar-open,
html.bf-sidebar-open {
    overflow: hidden !important;
}

/* Push main content behind sidebar when open */
body.bf-sidebar-open .products,
body.bf-sidebar-open .woocommerce,
body.bf-sidebar-open main,
body.bf-sidebar-open .site-content {
    position: relative !important;
    z-index: 1 !important;
    pointer-events: none !important;
}

/* Disable pointer events on main content when sidebar is open */
body.bf-sidebar-open .products *,
body.bf-sidebar-open .woocommerce *,
body.bf-sidebar-open main *,
body.bf-sidebar-open .site-content * {
    pointer-events: none !important;
}

/* Add blocking layer over main content when sidebar open */
body.bf-sidebar-open::before {
    content: '' !important;
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 480px !important;
    height: 100vh !important;
    background: #ffffff !important;
    z-index: 999997 !important;
    pointer-events: none !important;
}

/* Responsive */
@media (max-width: 767px) {
    .bf-sidebar {
        width: 100% !important;
        max-width: 100% !important;
    }
    
    .bf-sidebar-header,
    .bf-sidebar-actions {
        padding: 16px 20px !important;
    }
    
    .bf-sidebar-content {
        padding: 0 20px !important;
    }
}