/* ========== سایدبار ========== */
.filters-sidebar { background: transparent; width: 100%; }

.filter-card {
    background: white;
    border-radius: 1rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
    margin-bottom: 1.5rem;
}

.filter-header {
    display: flex;
    align-items: center;
    gap: .75rem;
    padding: 1.25rem 1.5rem;
    border-bottom: 1px solid #eef2f6;
}

.filter-header svg { width: 1.5rem; height: 1.5rem; color: #6c757d; }
.filter-header span { font-size: 1rem; font-weight: 500; color: #2c3e50; }
.filter-content { padding: 1.25rem 1.5rem; }

/* جستجو */
.search-box {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: .75rem;
    padding: .75rem 1.25rem;
    background: white;
    border-radius: .75rem;
    margin-bottom: 1.5rem;
    box-shadow: 0 1px 3px rgba(0,0,0,.05);
}
.search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: .875rem;
    color: #2c3e50;
    padding: 0px;
}
.search-input::placeholder { color: #adb5bd; }
.search-icon { width: 1.25rem; height: 1.25rem; color: #adb5bd; }

/* چک‌باکس */
.checkbox {
    display: flex;
    align-items: center;
    gap: .625rem;
    cursor: pointer;
    margin-bottom: .75rem;
}
.checkbox__input { position: absolute; opacity: 0; width: 0; height: 0; }
.checkbox__marker {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #dee2e6;
    border-radius: .25rem;
    display: inline-block;
    position: relative;
    transition: all .2s ease;
    flex-shrink: 0;
}
.checkbox__input:checked + .checkbox__marker {
    background-color: #0d6efd;
    border-color: #0d6efd;
}
.checkbox__input:checked + .checkbox__marker::after {
    content: '';
    position: absolute;
    right: .3125rem;
    top: .125rem;
    width: .25rem;
    height: .5rem;
    border: solid white;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}
.checkbox span:last-child { font-size: .875rem; color: #4a5568; }

/* رادیو */
.radio {
    display: flex;
    align-items: center;
    gap: .625rem;
    cursor: pointer;
    margin-bottom: .75rem;
}
.radio__input { position: absolute; opacity: 0; width: 0; height: 0; }
.radio__marker {
    width: 1.125rem;
    height: 1.125rem;
    border: 2px solid #dee2e6;
    border-radius: 50%;
    display: inline-block;
    position: relative;
    transition: all .2s ease;
    flex-shrink: 0;
}
.radio__input:checked + .radio__marker { border-color: #0d6efd; }
.radio__input:checked + .radio__marker::after {
    content: '';
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: .5rem; height: .5rem;
    background-color: #0d6efd;
    border-radius: 50%;
}
.radio span:last-child { font-size: .875rem; color: #4a5568; }

/* اسکرول دسته‌بندی */
.categories-scroll { max-height: 18rem; overflow-y: auto; padding-left: .5rem; }
.categories-scroll::-webkit-scrollbar { width: 4px; }
.categories-scroll::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 10px; }
.categories-scroll::-webkit-scrollbar-thumb { background: #cbd5e1; border-radius: 10px; }

/* ---- فیلدهای جدید: تاریخ و مرتب‌سازی ---- */
.filter-input {
    width: 100%;
    padding: .5rem .75rem;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    font-size: .875rem;
    color: #2c3e50;
    background: #f8f9fa;
    outline: none;
    transition: border-color .2s;
    box-sizing: border-box;
}
.filter-input:focus { border-color: #0d6efd; background: white; }

.filter-label {
    display: block;
    font-size: .75rem;
    color: #6c757d;
    margin-bottom: .3rem;
}

.date-row {
    display: flex;
    flex-direction: column;
    gap: .75rem;
}

/* Bottom Sheet */
.drawer-overlay {
    position: fixed;
    inset: 0;
    background-color: rgba(0,0,0,.5);
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: all .3s ease;
}
.drawer-overlay.active { opacity: 1; visibility: visible; }

.bottom-sheet {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    background-color: white;
    border-radius: 1.5rem 1.5rem 0 0;
    z-index: 1000;
    transform: translateY(100%);
    transition: transform .3s cubic-bezier(.2,.9,.4,1.1);
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 -4px 20px rgba(0,0,0,.1);
}
.bottom-sheet.active { transform: translateY(0); }

.sheet-handle { display: flex; justify-content: center; padding: .75rem 0 .5rem; }
.sheet-handle .handle-bar {
    width: 3rem; height: .25rem;
    background-color: #dee2e6;
    border-radius: .25rem;
}
.sheet-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: .5rem 1.25rem 1rem;
    border-bottom: 1px solid #eef2f6;
}
.sheet-header h3 { font-size: 1rem; font-weight: 600; color: #0d6efd; margin: 0; }
.sheet-close {
    background: none; border: none;
    font-size: 1.5rem; cursor: pointer;
    color: #0d6efd; padding: 0;
    width: 2rem; height: 2rem;
    display: flex; align-items: center; justify-content: center;
    border-radius: .5rem;
}
.sheet-body { flex: 1; overflow-y: auto; padding: 0 1rem; }
.sheet-footer {
    padding: 1rem;
    border-top: 1px solid #eef2f6;
    display: flex;
    gap: 1rem;
    background: white;
}

.btn-sheet {
    padding: .625rem 1rem;
    border-radius: .5rem;
    font-size: .875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all .2s;
    border: none;
}
.btn-filled-brand { background-color: #0d6efd; color: white; flex: 1; }
.btn-filled-brand:hover { background-color: #0b5ed7; }
.btn-text-primary { background-color: transparent; color: #0d6efd; width: 7rem; }
.btn-text-primary:hover { background-color: #e7f1ff; }

/* دکمه‌های موبایل */
.mobile-filter-buttons {
    display: none;
    gap: .75rem;
    margin-bottom: 1.5rem;
}
.mobile-filter-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: .625rem;
    width: 100%;
    height: 2.75rem;
    border: 1px solid #dee2e6;
    border-radius: .5rem;
    background: white;
    cursor: pointer;
    transition: all .2s;
    position: relative;
}
.mobile-filter-btn svg { width: 1.25rem; height: 1.25rem; }
.mobile-filter-btn span { font-size: .875rem; color: #4a5568; }
.mobile-filter-btn:hover { background: #f8f9fa; border-color: #adb5bd; }

.active-filters-badge {
    position: absolute;
    top: -.25rem; right: -.25rem;
    width: .75rem; height: .75rem;
    background-color: #0d6efd;
    border: 2px solid white;
    border-radius: 50%;
    display: none;
}
.active-filters-badge.show { display: block; }

@media (max-width: 768px) {
    .desktop-sidebar { display: none; }
    .mobile-filter-buttons { display: flex; }
}
@media (min-width: 769px) {
    .mobile-filter-buttons { display: none; }
}