/* ===== MOBILE FILTER NAVBAR Z-INDEX FIX ===== */
/* Fix untuk memastikan filter tidak tertutup navbar */

@media (max-width: 767px) {
    /* Ketika filter terbuka, pastikan z-index lebih tinggi dari navbar */
    .collection-filter.filter-opened {
        z-index: 99999 !important;
        position: fixed !important;
    }
    
    /* Back button sebagai bagian terintegrasi dari filter - HANYA ketika filter terbuka */
    .collection-filter.filter-opened .collection-mobile-back {
        z-index: auto !important; /* Reset z-index */
        position: relative !important; /* Bagian dari flow normal */
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        background-color: #f8f9fa !important;
        border-bottom: 1px solid #ddd !important;
        box-shadow: 0 2px 4px rgba(0,0,0,0.1) !important;
        display: block !important; /* Tampilkan hanya ketika filter terbuka */
    }
    
    /* SEMBUNYIKAN back button ketika filter tertutup */
    .collection-filter:not(.filter-opened) .collection-mobile-back {
        display: none !important;
    }
    
    /* Turunkan z-index navbar ketika filter terbuka */
    body:has(.collection-filter.filter-opened) .navbar,
    body:has(.collection-filter.filter-opened) header,
    body:has(.collection-filter.filter-opened) .header,
    body:has(.collection-filter.filter-opened) .main-menu,
    body:has(.collection-filter.filter-opened) .layout-header1,
    body:has(.collection-filter.filter-opened) .layout-header2,
    body:has(.collection-filter.filter-opened) .layout-header3,
    body:has(.collection-filter.filter-opened) .layout-header4 {
        z-index: 9998 !important;
    }
    
    /* Fallback untuk browser yang tidak support :has() */
    .navbar-lowered,
    .header-lowered {
        z-index: 9998 !important;
    }
    
    /* Filter content tidak perlu padding extra karena back button sudah terintegrasi */
    .collection-filter.filter-opened .creative-card.creative-inner {
        padding: 15px 20px !important; /* Padding normal */
        margin-top: 0 !important;
    }
    
    /* Filter container dimulai dari bawah navbar */
    .collection-filter.filter-opened {
        top: 60px !important; /* Mulai dari bawah navbar */
        height: calc(100vh - 60px) !important; /* Tinggi dikurangi navbar */
        padding-top: 0 !important; /* Reset padding */
        box-sizing: border-box !important;
    }
    
    /* Style untuk back button text dan icon */
    .collection-filter .collection-mobile-back span {
        display: flex !important;
        align-items: center !important;
        font-size: 16px !important;
        font-weight: 600 !important;
        color: #333 !important;
        text-transform: uppercase !important;
        cursor: pointer !important;
    }
    
    .collection-filter .collection-mobile-back span i {
        margin-right: 8px !important;
        font-size: 18px !important;
    }
    
    /* Hover effect untuk back button */
    .collection-filter .collection-mobile-back:hover {
        background-color: #e9ecef !important;
    }
    
    /* Active state untuk back button */
    .collection-filter .collection-mobile-back:active {
        background-color: #dee2e6 !important;
    }
}