/* =========================================================
   MOBİL FİLTRE – position: fixed (Özel Tasarım Geliştirmeleri)
   ========================================================= */

.mobile-filter-container {
    display: none;
}

@media (max-width: 768px) {
    .navbar {
        border-bottom: none !important;
        box-shadow: none !important;
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        will-change: transform;
    }

    .mobile-filter-container {
        display: flex !important;
        flex-direction: column;
        gap: 8px;
        background: #ffffff;
        border-bottom: 1px solid #e2e8f0;
        border-top: 1px solid #f1f5f9;
        padding: 5px 16px;
        box-sizing: border-box;
        position: fixed;
        top: 59px;
        left: 0;
        width: 100%;
        z-index: 999;
        box-shadow: 0 4px 6px rgba(0, 0, 0, 0.03);
        transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
        will-change: transform;
    }

    body {
        padding-top: 136px !important;
    }

    body.scroll-locked {
        overflow: hidden !important;
        position: fixed !important;
        width: 100% !important;
    }

    body.scroll-locked .detail-actions {
        display: none !important;
    }

    .filter-badges-container {
        display: none !important;
    }
}

.mf-search-bar form {
    display: flex;
    align-items: center;
    border: 1px solid #cbd5e1;
    border-radius: 8px;
    background: #f8fafc;
    overflow: hidden;
    padding-right: 14px;
}

.mf-search-bar input {
    flex: 1;
    border: none;
    background: transparent;
    padding: 9px 14px;
    font-size: 14px;
    outline: none;
    color: #0f172a;
    cursor: pointer;
}

.mf-search-bar button {
    border: none;
    background: transparent;
    color: #475569;
    font-size: 15px;
    padding: 0;
}

.mf-pills-scroll {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin !important;
    scrollbar-color: #cbd5e1 #f1f5f9 !important;
    padding-bottom: 8px;
    margin: -10px -16px 0 -16px;
    padding: 15px 16px;
}

.mf-pills-scroll::-webkit-scrollbar {
    display: block !important;
    height: 3px !important;
}

.mf-pills-scroll::-webkit-scrollbar-track {
    background: #f1f5f9 !important;
    border-radius: 2px !important;
}

.mf-pills-scroll::-webkit-scrollbar-thumb {
    background: #cbd5e1 !important;
    border-radius: 2px !important;
}

.mf-sliders-btn {
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    font-size: 16px;
    color: #334155;
    padding: 6px 12px;
    display: inline-flex;
    align-items: center;
    border-radius: 8px;
    position: relative;
}

.mf-sliders-btn.has-active-filters {
    background: #eff6ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.sliders-dot {
    position: absolute;
    top: 3px;
    right: 3px;
    width: 8px;
    height: 8px;
    background: #ef4444;
    border-radius: 50%;
    border: 1.5px solid #fff;
}

.mf-pill-btn {
    display: inline-flex;
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 20px;
    padding: 6px 13px;
    font-size: 13px;
    font-weight: 600;
    color: #475569;
    text-decoration: none;
    white-space: nowrap;
}

.mf-pill-btn.active-filter {
    background: #eff6ff !important;
    color: #1d4ed8 !important;
    border-color: #bfdbfe !important;
}

.mf-drawer-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(15, 23, 42, .45);
    z-index: 1100;
    backdrop-filter: blur(2px);
    opacity: 0;
    transition: opacity .3s;
}

.mf-drawer-overlay.visible {
    opacity: 1;
}

/* Ekran Tasarımı - Full Screen Çekmece */
.mf-drawer-sheet {
    display: flex !important;
    flex-direction: column;
    position: fixed;
    bottom: -100%;
    left: 0;
    width: 100%;
    height: 100%;
    max-height: 100vh;
    background: #fff;
    z-index: 1101;
    transition: bottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.mf-drawer-sheet.open {
    bottom: 0;
}

/* Custom Header */
.mf-custom-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #f1f5f9;
    background: #fff;
}

.mf-btn-cancel {
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 500;
    color: #4545a1;
    cursor: pointer;
    padding: 0;
}

.mf-btn-apply-custom {
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    color: #4545a1;
    cursor: pointer;
    padding: 0;
}

/* Custom Inputs Box */
.mf-custom-inputs-box {
    padding: 16px 20px;
    background: #f8fafc;
    border-bottom: 1px solid #e2e8f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.mf-custom-input-wrapper {
    position: relative;
    width: 100%;
}

.mf-custom-input {
    width: 100%;
    height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 40px 10px 14px;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    background: #fff;
    color: #0f172a;
    box-sizing: border-box;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mf-custom-input:focus {
    border-color: #4545a1;
    box-shadow: 0 0 0 3px rgba(69, 69, 161, .1);
}

.mf-custom-select {
    width: 100%;
    height: 44px;
    border: 1px solid #cbd5e1;
    border-radius: 6px;
    padding: 10px 40px 10px 14px;
    font-size: 15px;
    font-weight: 500;
    outline: none;
    background: #fff;
    color: #0f172a;
    box-sizing: border-box;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.mf-custom-select:focus {
    border-color: #4545a1;
    box-shadow: 0 0 0 3px rgba(69, 69, 161, .1);
}

.mf-custom-input-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #64748b;
    font-size: 16px;
    pointer-events: none;
}

.mf-custom-clear-btn {
    position: absolute;
    right: 36px;
    top: 50%;
    transform: translateY(-50%);
    border: none;
    background: transparent;
    color: #64748b;
    font-size: 16px;
    cursor: pointer;
    padding: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Custom Results List */
.mf-custom-results {
    flex: 1;
    overflow-y: auto;
    background: #fff;
    -webkit-overflow-scrolling: touch;
}

.mf-results-header {
    background: #f8fafc;
    padding: 10px 20px;
    font-size: 13px;
    font-weight: 600;
    color: #64748b;
    border-bottom: 1px solid #f1f5f9;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.mf-result-row {
    padding: 14px 20px;
    border-bottom: 1px solid #f1f5f9;
    cursor: pointer;
}

.mf-result-row:active {
    background: #f8fafc;
}

.mf-result-title {
    font-size: 15px;
    font-weight: 500;
    color: #1e293b;
    margin-bottom: 2px;
}

.mf-result-title strong {
    font-weight: 700;
    color: #0f172a;
}

.mf-result-subtitle {
    font-size: 12px;
    color: #64748b;
}

#mobileSidebarContent {
    display: none;
}

@media (max-width: 768px) {

    /* Masaüstü arama kenar çubuğunu mobilde tam ekran kurumsal çekmeceye dönüştür */
    .search-sidebar-left,
    #mobileSidebarContent {
        display: block !important;
        position: fixed !important;
        top: 100% !important;
        /* Slide out of view initially */
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        width: 100% !important;
        height: 100% !important;
        max-height: 100vh !important;
        z-index: 1200 !important;
        background: #ffffff !important;
        border-radius: 0 !important;
        overflow-y: auto !important;
        -webkit-overflow-scrolling: touch !important;
        transition: top 0.3s cubic-bezier(0.16, 1, 0.3, 1) !important;
        box-shadow: none !important;
        padding: 0 0 80px 0 !important;
        /* Alt buton alanı için ekstra padding */
        box-sizing: border-box !important;
    }

    .search-sidebar-left.open,
    #mobileSidebarContent.open {
        top: 0 !important;
    }

    /* iOS/Modern mobil tarzı temiz başlık alanı */
    .sidebar-mobile-header {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        padding: 12px 16px !important;
        background: #f8fafc !important;
        border-bottom: 1px solid #e2e8f0 !important;
        position: sticky !important;
        top: 0 !important;
        z-index: 10 !important;
        margin-bottom: 0px !important;
    }

    .sidebar-mobile-header h4 {
        margin: 0 !important;
        font-size: 15px !important;
        font-weight: 600 !important;
        color: #0f172a !important;
        font-family: var(--font-sans) !important;
    }

    .sidebar-mobile-header button {
        background: transparent !important;
        border: none !important;
        color: #64748b !important;
        cursor: pointer !important;
        padding: 4px !important;
        font-size: 18px !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
    }

    /* Kutu içinde kutu görünümünü engelle: widget iç kaplamalarını sıfırla */
    .search-sidebar-left .widget,
    #mobileSidebarContent .widget {
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;

        margin: 0 !important;
        border-radius: 0 !important;
        border-bottom: 1px solid #f1f5f9 !important;
    }

    /* Masaüstü orijinal widget başlığını mobilde gizle (mobil başlığımız zaten var) */
    .search-sidebar-left .widget-title,
    #mobileSidebarContent .widget-title {
        display: none !important;
    }

    /* Form başlıklarını belirginleştir ve aralara ferahlık kat */
    .search-sidebar-left .comb-field,
    #mobileSidebarContent .comb-field {
        margin-bottom: 12px !important;
    }

    .search-sidebar-left .comb-field>label,
    #mobileSidebarContent .comb-field>label {
        font-size: 16px !important;
        font-weight: 700 !important;
        color: #334155 !important;
        display: flex !important;
        align-items: center !important;
        gap: 6px !important;
        margin-bottom: 8px !important;
    }

    .search-sidebar-left .comb-field>label i,
    #mobileSidebarContent .comb-field>label i {
        color: #4545a1 !important;
        font-size: 14px !important;
    }

    /* Checkbox'ları dokunma dostu, kurumsal ve sade satırlara dönüştür (Kartlar kaldırıldı) */
    .search-sidebar-left .checkbox-group label,
    #mobileSidebarContent .checkbox-group label {
        font-size: 13.5px !important;
        padding: 6px 0 !important;
        background: transparent !important;
        border: none !important;
        border-bottom: 1px solid #f8fafc !important;
        border-radius: 0 !important;
        margin: 0 !important;
        transition: color 0.2s ease !important;
        color: #475569 !important;
        font-weight: 400 !important;
        display: flex !important;
        align-items: center !important;
        gap: 8px !important;
    }

    .search-sidebar-left .checkbox-group label:last-child,
    #mobileSidebarContent .checkbox-group label:last-child {
        border-bottom: none !important;
    }

    .search-sidebar-left .checkbox-group label:has(input:checked),
    #mobileSidebarContent .checkbox-group label:has(input:checked) {
        background: transparent !important;
        color: #1d4ed8 !important;
        font-weight: 500 !important;
    }

    .search-sidebar-left .checkbox-group label span,
    #mobileSidebarContent .checkbox-group label span {
        font-weight: inherit !important;
    }

    .search-sidebar-left .checkbox-group input[type="checkbox"],
    #mobileSidebarContent .checkbox-group input[type="checkbox"] {
        width: 16px !important;
        height: 16px !important;
        border-radius: 4px !important;
        border: 1px solid #cbd5e1 !important;
        margin: 0 !important;
    }

    /* Arama kutularını modernleştir */
    .search-sidebar-left .brans-search-box,
    #mobileSidebarContent .brans-search-box {
        padding: 8px 12px !important;
        border-radius: 6px !important;
        border: 1px solid #cbd5e1 !important;
        background: #fff !important;
        margin-bottom: 12px !important;
        display: flex !important;
        align-items: center !important;
    }

    .search-sidebar-left .brans-search-box input,
    #mobileSidebarContent .brans-search-box input {
        font-size: 13px !important;
        color: #1e293b !important;
        border: none !important;
        background: transparent !important;
        width: 100% !important;
        outline: none !important;
        padding: 0 !important;
    }

    .search-sidebar-left .brans-search-box i,
    #mobileSidebarContent .brans-search-box i {
        font-size: 14px !important;
        color: #94a3b8 !important;
        margin-right: 6px !important;
    }

    /* Filtreleri Uygula Butonunu Varsayılan Olarak Gizle (Sadece Çekmece Açıkken Göster) */
    .search-sidebar-left .comb-submit,
    #mobileSidebarContent .comb-submit {
        display: none !important;
    }

    /* Çekmece Açıkken Butonu Ekranın Altına Sabitle (Sticky/Fixed) ve Kurumsal Hale Getir */
    .search-sidebar-left.open .comb-submit,
    #mobileSidebarContent.open .comb-submit {
        display: block !important;
        position: fixed !important;
        bottom: 0 !important;
        left: 0 !important;
        right: 0 !important;
        background: #ffffff !important;
        padding: 12px 16px 16px 16px !important;
        border-top: 1px solid #e2e8f0 !important;
        z-index: 1210 !important;
    }

    .search-sidebar-left.open .comb-submit button,
    #mobileSidebarContent.open .comb-submit button {
        height: 44px !important;
        border-radius: 6px !important;
        font-size: 14px !important;
        font-weight: 600 !important;
        background: #4545a1 !important;
        border: none !important;
        color: #ffffff !important;
        width: 100% !important;
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        gap: 6px !important;
    }
}

/* Sayfa geçişlerinde (js-ready sınıfı html etiketinden kaldırıldığında) filtrenin/drawer'ın anlık parlamasını engelle */
html:not(.js-ready) .search-sidebar-left,
html:not(.js-ready) #mobileSidebarContent,
html:not(.js-ready) .mf-drawer-sheet,
html:not(.js-ready) .mf-drawer-overlay,
html:not(.js-ready) .mobile-filter-container {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    transition: none !important;
}