/* Mobile Filter Header & Footer Styles */
.mobile-filter-header {
    display: none;
    /* Hidden on desktop */
}

.mobile-filter-footer {
    display: none;
    /* Hidden on desktop */
}

@media (max-width: 900px) {
    .filters-sidebar {
        padding: 0 !important;
        /* Reset padding to allow full layout control */
        display: flex;
        flex-direction: column;
        position: fixed;
        top: 0;
        left: -100%;
        width: 100%;
        height: 100dvh;
        /* Use dynamic viewport height */
        background: #0f172a;
        z-index: 9999;
        transition: left 0.3s ease;
        overflow: hidden;
        /* Prevent body scroll bleed */
    }

    .filters-sidebar.active {
        left: 0;
    }

    .mobile-filter-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 15px 20px;
        background: #111;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
    }

    .mobile-filter-header h3 {
        margin: 0;
        font-size: 1.2rem;
        color: white;
    }

    .close-filter-btn {
        background: transparent;
        border: none;
        color: var(--text-muted);
        font-size: 1.5rem;
        cursor: pointer;
        padding: 5px;
    }

    /* Container for scrollable filters */
    .filters-sidebar>div.glass-card {
        flex: 1;
        overflow-y: auto;
        padding: 20px;
        background: transparent;
        /* Remove card bg in overlay mode */
        box-shadow: none;
    }

    /* Hide desktop 'Filtrele' button inside mobile view, keep 'Clear' button */
    .filters-sidebar .glass-card .btn-primary {
        display: none !important;
    }

    /* Exception for Apply button in footer */
    .mobile-filter-footer .btn {
        display: block !important;
    }

    .mobile-filter-footer {
        display: flex;
        padding: 15px 20px;
        padding-bottom: env(safe-area-inset-bottom, 20px);
        /* iPhone Home Bar Safe Area */
        background: #111;
        border-top: 1px solid rgba(255, 255, 255, 0.1);
        flex-shrink: 0;
    }

    .apply-filter-btn {
        width: 100%;
        padding: 15px;
        font-size: 1rem;
        text-transform: uppercase;
        letter-spacing: 1px;
        background: var(--accent-color);
        color: white;
        border: none;
        border-radius: 8px;
        box-shadow: 0 4px 15px rgba(255, 140, 0, 0.3);
    }
}