/* =========================================================
   میخرم | SIDEBAR — لاکچری
   ========================================================= */

.categories-sidebar {
    grid-column: 2;
    grid-row: 1;
    direction: rtl;
    width: 230px;
    padding: 20px 16px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-sizing: border-box;
    position: sticky;
    top: 20px;
    align-self: start;
    height: calc(100vh - 40px);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: var(--border-light) transparent;
    transition: background .3s, border-color .3s;
}

.categories-sidebar::-webkit-scrollbar { width: 5px; }
.categories-sidebar::-webkit-scrollbar-track { background: transparent; }
.categories-sidebar::-webkit-scrollbar-thumb {
    background: var(--border-light);
    border-radius: 99px;
}
.categories-sidebar::-webkit-scrollbar-thumb:hover {
    background: var(--gold-dark);
}

/* ============ عنوان ============ */
.sidebar-title {
    padding-bottom: 14px;
    margin-bottom: 12px;
    border-bottom: 1px solid var(--border);
    color: var(--gold);
    font-size: 18px;
    font-weight: 800;
    letter-spacing: -.3px;
}

/* ============ آیتم‌های دسته ============ */
.sidebar-group { margin: 0; }

.sidebar-group summary { list-style: none; }
.sidebar-group summary::-webkit-details-marker { display: none; }

.sidebar-parent {
    cursor: pointer;
    position: relative;
}

.sidebar-item {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    padding: 8px 10px;
    border-radius: 8px;
    color: var(--text-soft);
    font-size: 15px;
    font-weight: 500;
    text-decoration: none;
    box-sizing: border-box;
    transition: all .2s ease;
}

.sidebar-item:hover {
    color: var(--gold);
    background: var(--gold-soft);
}

.sidebar-icon {
    width: 22px;
    min-width: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--gold);
}

.sidebar-icon img {
    width: 20px;
    height: 20px;
    filter: brightness(1);
}

.sidebar-name { flex: 1; }

.sidebar-chevron {
    margin-right: auto;
    color: var(--text-faint);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform .25s ease, color .25s;
}

.sidebar-chevron svg {
    width: 18px;
    height: 18px;
    display: block;
    stroke-width: 2.5;
}

.sidebar-group[open] > .sidebar-parent .sidebar-chevron {
    transform: rotate(180deg);
    color: var(--gold);
}

.sidebar-children {
    margin-right: 10px;
    padding-right: 8px;
    border-right: 1px solid var(--border);
}

.sidebar-level-1 { font-size: 14px; }
.sidebar-level-2 { font-size: 13px; }

/* ============ جداکننده ============ */
.sidebar-divider {
    height: 1px;
    margin: 18px 0;
    background: var(--border);
}

/* ============ فیلترها ============ */
.sidebar-filter { width: 100%; }

.sidebar-filter-title {
    margin-bottom: 12px;
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 700;
}

.filter-item { margin-bottom: 14px; }

.filter-item label {
    display: block;
    margin-bottom: 7px;
    color: var(--text-muted);
    font-size: 13px;
}

.filter-item select {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border: 1px solid var(--border);
    border-radius: 9px;
    outline: none;
    background: var(--bg-elevated);
    color: var(--text);
    font-family: inherit;
    font-size: 13px;
    cursor: pointer;
    transition: all .2s ease;
}

.filter-item select:focus {
    border-color: var(--gold);
    box-shadow: 0 0 0 3px var(--gold-soft);
}

/* ============ سوییچ‌ها ============ */
.filter-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.filter-switch {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    color: var(--text-soft);
    font-size: 14px;
    cursor: pointer;
    transition: color .2s;
}

.filter-switch:hover { color: var(--gold); }

.filter-switch input { display: none; }

.switch-slider {
    position: relative;
    width: 40px;
    height: 22px;
    flex-shrink: 0;
    border-radius: 22px;
    background: var(--bg-elevated);
    border: 1px solid var(--border-light);
    transition: all .25s ease;
}

.switch-slider::before {
    content: "";
    position: absolute;
    top: 3px;
    right: 3px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--text-faint);
    transition: all .25s ease;
}

.filter-switch input:checked + .switch-slider {
    background: var(--gold-soft);
    border-color: var(--gold);
}

.filter-switch input:checked + .switch-slider::before {
    right: 21px;
    background: var(--gold);
}

/* ============ لینک‌های پایین ============ */
.sidebar-links {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.sidebar-links a {
    display: block;
    padding: 6px 4px;
    color: var(--text-muted);
    font-size: 13px;
    text-decoration: none;
    transition: all .2s;
}

.sidebar-links a:hover {
    color: var(--gold);
    padding-right: 8px;
}

.sidebar-copyright {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid var(--border);
    color: var(--text-faint);
    font-size: 11px;
}

/* ============ ریسپانسیو ============ */
@media (max-width: 950px) {
    .categories-sidebar {
        position: relative;
        top: auto;
        width: 100%;
        height: auto;
        max-height: 500px;
        overflow-y: auto;
    }
}
/* اینماد تو سایدبار */
.sidebar-enamad {
    margin-top: 18px;
    padding-top: 14px;
    border-top: 1px solid var(--border);
    display: flex;
    justify-content: center;
}

.sidebar-enamad img {
    width: 90px;
    height: auto;
    transition: all .2s;
}

.sidebar-enamad img:hover {
    transform: scale(1.05);
}
/* ============ دکمه بازگشت به دسته‌بندی‌ها ============ */
.sidebar-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 0;
    margin-bottom: 16px;
    background: transparent;
    border: none;
    color: var(--text-muted);
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s ease;
    width: auto;
}

.sidebar-back-btn:hover {
    color: var(--gold);
}

.sidebar-back-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}