/* ===================================================================
   Filter Sidebar Component
   Single HTML block. CSS switches between:
     Mobile  (<768px): fixed drawer with transform + backdrop
     Desktop (>=768px): static flex column
   No Bootstrap offcanvas. No !important. No duplicate IDs.
   =================================================================== */

/* ── Mobile FAB Toggle ── */
.mobile-filter-toggle {
    display: none;
    position: fixed;
    bottom: 20px;
    right: 20px;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: var(--bs-success);
    color: white;
    border: none;
    border-radius: 50px;
    font-size: 1rem;
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(var(--bs-success-rgb), 0.4);
    z-index: 1040;
    transition: background 0.2s ease;
    cursor: pointer;
}

.mobile-filter-toggle:hover {
    background: var(--bs-primary);
}

/* ── Filter Count Badge ── */
.filter-count-badge {
    display: none;
    background: #e74c3c;
    color: white;
    border-radius: 12px;
    padding: 2px 8px;
    font-size: 12px;
    font-weight: bold;
    min-width: 20px;
    text-align: center;
}

.filter-count-badge.visible {
    display: inline-block;
}

/* ── Sidebar Container ── */
.filter-sidebar {
    display: flex;
    flex-direction: column;
    background: white;
}

/* ── Sidebar Body ── */
.filter-sidebar-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
}

/* ── Header (hidden on desktop, shown on mobile) ── */
.filter-sidebar-header {
    display: none;
    background: linear-gradient(135deg, #2c3e50 0%, #34495e 100%);
    color: white;
    padding: 0 20px;
    height: var(--navbar-h, 76px);
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.filter-sidebar-header h5 {
    margin: 0;
    font-weight: 600;
    font-size: 1.1rem;
}

.filter-sidebar-close {
    background: none;
    border: none;
    color: white;
    opacity: 0.8;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    line-height: 1;
}

.filter-sidebar-close:hover {
    opacity: 1;
}

/* ── Footer (hidden on desktop, shown on mobile) ── */
.filter-sidebar-footer {
    display: none;
    gap: 10px;
    padding: 15px 20px;
    background: white;
    border-top: 1px solid var(--bs-border-color);
    box-shadow: 0 -4px 10px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
}

/* ── Backdrop (hidden on desktop) ── */
.filter-sidebar-backdrop {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1044;
}

.filter-sidebar-backdrop.is-open {
    display: block;
}

/* ── Mobile: drawer behavior ── */
@media (max-width: 768px) {
    .mobile-filter-toggle {
        display: flex;
    }

    .filter-sidebar {
        position: fixed;
        top: 0;
        left: 0;
        width: 320px;
        max-width: 85vw;
        height: 100%;
        z-index: 1045;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        box-shadow: 4px 0 12px rgba(0, 0, 0, 0.15);
    }

    .filter-sidebar.is-open {
        transform: translateX(0);
    }

    .filter-sidebar-header {
        display: flex;
    }

    .filter-sidebar-footer {
        display: flex;
    }
}
