/* Modern Filters Sidebar */

.filters-sidebar-modern {
    background: white;
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.06);
    height: fit-content;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    display: block;
}

.filters-title-modern {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e5e5;
}

.filter-section-modern {
    margin-bottom: 30px;
    padding-bottom: 25px;
    border-bottom: 1px solid #e5e5e5;
}

.filter-section-modern:last-child {
    border-bottom: none;
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Mobilde son section için ekstra margin */
@media (max-width: 968px) {
    .filter-section-modern:last-of-type {
        margin-bottom: 20px;
        padding-bottom: 20px;
    }
    
    .btn-clear-filters-modern {
        margin-top: 30px;
        margin-bottom: 20px;
    }
}

.filter-label-modern {
    font-size: 14px;
    font-weight: 600;
    color: #333;
    margin-bottom: 15px;
    display: block;
}

.price-range-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.price-input-modern {
    flex: 1;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    width: 100%;
    box-sizing: border-box;
}

.price-input-modern:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0,123,255,0.1);
}

.price-display-modern {
    font-size: 12px;
    color: #999;
    margin-top: 5px;
}

.filter-list-modern {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

/* Mobilde filter list max-height kaldır */
@media (max-width: 968px) {
    .filter-list-modern {
        max-height: none;
        overflow-y: visible;
    }
}

.filter-checkbox-modern {
    display: flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
    padding: 8px;
    border-radius: 6px;
    transition: background 0.3s ease;
}

.filter-checkbox-modern:hover {
    background: #f8f9fa;
}

.filter-checkbox-modern input[type="checkbox"],
.filter-checkbox-modern input[type="radio"] {
    width: 18px;
    height: 18px;
    cursor: pointer;
    accent-color: #007bff;
}

.filter-checkbox-modern span {
    font-size: 14px;
    color: #666;
    user-select: none;
}

.btn-clear-filters-modern {
    width: 100%;
    padding: 12px;
    background: #f8f9fa;
    color: #333;
    border: 1px solid #e5e5e5;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    margin-top: 20px;
}

.btn-clear-filters-modern:hover {
    background: #e9ecef;
    border-color: #ddd;
}

/* Scrollbar styling */
.filter-list-modern::-webkit-scrollbar {
    width: 6px;
}

.filter-list-modern::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 10px;
}

.filter-list-modern::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 10px;
}

.filter-list-modern::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* Mobile Responsive */
@media (max-width: 968px) {
    .filters-sidebar-modern {
        position: fixed;
        top: 0;
        left: -100%;
        width: 85%;
        max-width: 320px;
        height: 100vh;
        height: 100dvh; /* Dynamic viewport height for mobile */
        max-height: 100vh;
        max-height: 100dvh;
        z-index: 10001;
        background: white;
        box-shadow: 2px 0 20px rgba(0,0,0,0.2);
        overflow: hidden; /* Ana container overflow hidden */
        transition: left 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        margin-bottom: 0;
        padding: 0;
        border-radius: 0;
        box-sizing: border-box;
        display: flex;
        flex-direction: column;
    }
    
    .filters-sidebar-modern.mobile-open {
        left: 0;
        display: flex !important;
    }
    
    .filters-header-mobile {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 20px;
        padding-bottom: 15px;
        border-bottom: 2px solid #e5e5e5;
        flex-shrink: 0;
        background: white;
        position: relative;
        z-index: 1;
    }
    
    .filters-sidebar-modern form {
        flex: 1 1 auto;
        overflow-y: auto;
        overflow-x: hidden;
        padding: 20px;
        padding-bottom: 0;
        min-height: 0;
        max-height: 100%;
        -webkit-overflow-scrolling: touch;
        display: flex;
        flex-direction: column;
        position: relative;
        width: 100%;
    }
    
    .filters-sidebar-modern form .filter-section-modern:last-of-type {
        margin-bottom: 30px;
    }
    
    .filters-sidebar-modern form .btn-clear-filters-modern {
        margin-top: 30px;
        margin-bottom: 0;
        position: relative;
        z-index: 1;
    }
    
    /* Form'un sonuna boşluk ekle */
    .filters-sidebar-modern form::after {
        content: '';
        display: block;
        height: 80px;
        flex-shrink: 0;
    }
    
    /* Form scrollbar styling */
    .filters-sidebar-modern form::-webkit-scrollbar {
        width: 6px;
    }
    
    .filters-sidebar-modern form::-webkit-scrollbar-track {
        background: #f1f1f1;
    }
    
    .filters-sidebar-modern form::-webkit-scrollbar-thumb {
        background: #888;
        border-radius: 10px;
    }
    
    .filters-sidebar-modern form::-webkit-scrollbar-thumb:hover {
        background: #555;
    }
    
    .filters-title-modern {
        margin: 0;
        font-size: 18px;
        font-weight: 700;
        color: #333;
    }
    
    .filters-close-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 36px;
        height: 36px;
        background: #f5f5f5;
        border: none;
        border-radius: 50%;
        cursor: pointer;
        color: #666;
        font-size: 18px;
        transition: all 0.2s ease;
        flex-shrink: 0;
    }
    
    .filters-close-mobile:hover {
        background: #e5e5e5;
        color: #333;
    }
    
    .filters-close-mobile i {
        font-size: 16px;
    }
    
    .filters-toggle-mobile {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        padding: 14px 16px;
        background: white;
        border: 2px solid #e5e5e5;
        border-radius: 10px;
        margin-bottom: 20px;
        font-weight: 600;
        font-size: 14px;
        color: #333;
        cursor: pointer;
        transition: all 0.3s ease;
        position: relative;
        z-index: 1;
    }
    
    .filters-toggle-mobile:hover {
        background: #f8f9fa;
        border-color: var(--primary-color);
        color: var(--primary-color);
    }
    
    .filters-toggle-mobile i {
        font-size: 14px;
    }
    
    .filters-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        backdrop-filter: blur(2px);
        z-index: 10000;
        animation: fadeIn 0.3s ease;
        cursor: pointer;
    }
    
    .filters-overlay.active {
        display: block;
    }
    
    @keyframes fadeIn {
        from { opacity: 0; }
        to { opacity: 1; }
    }
}

@media (min-width: 969px) {
    .filters-toggle-mobile {
        display: none;
    }
    
    .filters-overlay {
        display: none !important;
    }
    
    .filters-header-mobile {
        display: none;
    }
    
    .filters-title-modern {
        margin-bottom: 25px;
        padding-bottom: 15px;
        border-bottom: 2px solid #e5e5e5;
    }
}
