﻿/* ==================================================
   SLIDER SIDEBAR (کنار اسلایدر - offcanvas در موبایل)
   ================================================== */

/* ---------- Layout Wrapper: سایدبار + اسلاید ---------- */
.custom-education-theme-slider-with-sidebar {
    display: flex;
    gap: 24px;
    padding: 0 24px 20px;
    max-width: 1400px;
    margin: 0 auto;
    align-items: stretch;
    /* هر دو باید هم‌قد بشن */
}

/* ---------- Sidebar (منو) ---------- */
.custom-education-theme-sidebar {
    flex: 0 0 20%;
    max-width: 260px;
    min-width: 220px;
    background: var(--card-bg);
    backdrop-filter: blur(20px) saturate(180%);
    -webkit-backdrop-filter: blur(20px) saturate(180%);
    border: 1px solid var(--glass-border);
    border-radius: var(--radius-xl);
    box-shadow: var(--glass-shadow);
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    overflow-y: auto;
    transition: var(--transition);
}

    /* ---------- Sidebar Item ---------- */
    .custom-education-theme-sidebar a {
        display: flex;
        align-items: center;
        gap: 12px;
        padding: 8px 5px;
        margin: 5px;
        border-radius: var(--radius-md);
        color: var(--text-secondary);
        text-decoration: none;
        font-size: 0.9rem;
        font-weight: 500;
        transition: var(--transition);
        position: relative;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

        .custom-education-theme-sidebar a i {
            font-size: 1.05rem;
            color: var(--accent);
            width: 22px;
            text-align: center;
            flex-shrink: 0;
            transition: var(--transition);
        }

        .custom-education-theme-sidebar a:hover {
            background: var(--accent-glow-08);
            color: var(--text-primary);
            transform: translateX(-4px);
        }

[dir="rtl"] .custom-education-theme-sidebar a:hover {
    transform: translateX(4px);
}

.custom-education-theme-sidebar a:hover i {
    transform: scale(1.15);
    color: var(--accent);
}

/* Active Item */
.custom-education-theme-sidebar a.custom-education-theme-active {
    background: var(--accent-gradient);
    color: #fff;
    box-shadow: 0 8px 20px var(--accent-glow-35);
}

    .custom-education-theme-sidebar a.custom-education-theme-active i {
        color: #fff;
    }

/* Divider */
.custom-education-theme-sidebar-divider {
    height: 1px;
    background: var(--glass-border);
    margin: 8px 4px;
    flex-shrink: 0;
}

/* ---------- Slider Area ---------- */
.custom-education-theme-slider-with-sidebar .custom-education-theme-slider-area {
    flex: 1 1 80%;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

/* ---------- Offcanvas Header (mobile only) ---------- */
.custom-education-theme-sidebar-header {
    display: none;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid var(--glass-border);
    flex-shrink: 0;
}

    .custom-education-theme-sidebar-header h3 {
        font-size: 1rem;
        font-weight: 800;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .custom-education-theme-sidebar-header h3 i {
            color: var(--accent);
        }

/* ---------- Offcanvas Close Button ---------- */
.custom-education-theme-sidebar-close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 0.9rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .custom-education-theme-sidebar-close:hover {
        background: linear-gradient(135deg, #ff6b6b, #ee5a24);
        color: #fff;
        border-color: transparent;
        transform: rotate(90deg);
    }

/* ---------- Offcanvas Toggle Button (mobile only) ---------- */
.custom-education-theme-sidebar-toggle {
    display: none;
    align-items: center;
    gap: 8px;
    padding: 10px 18px;
    border-radius: var(--radius-xl);
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text-primary);
    font-family: var(--font-family);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--glass-shadow);
}

    .custom-education-theme-sidebar-toggle i {
        color: var(--accent);
        font-size: 1rem;
    }

    .custom-education-theme-sidebar-toggle:hover {
        background: var(--accent-gradient);
        color: #fff;
        border-color: transparent;
        transform: translateY(-2px);
        box-shadow: 0 8px 25px var(--accent-glow-35);
    }

        .custom-education-theme-sidebar-toggle:hover i {
            color: #fff;
        }

/* ---------- Overlay ---------- */
.custom-education-theme-sidebar-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 2000;
    opacity: 0;
    visibility: hidden;
    transition: all 0.4s ease;
}

    .custom-education-theme-sidebar-overlay.custom-education-theme-open {
        opacity: 1;
        visibility: visible;
    }

/* ==================================================
   RESPONSIVE: در موبایل سایدبار به offcanvas تبدیل می‌شود
   از سمت راست باز می‌شود (برعکس سبد خرید که از چپ)
   ================================================== */
@media (max-width: 900px) {
    .custom-education-theme-slider-with-sidebar {
        flex-direction: column;
        padding: 20px 16px;
        gap: 0;
    }

    /* نمایش دکمه‌ی بازکننده منو */
    .custom-education-theme-sidebar-toggle {
        display: inline-flex;
    }

    /* سایدبار به offcanvas تبدیل می‌شود */
    .custom-education-theme-sidebar {
        position: fixed;
        top: 0;
        right: 0;
        bottom: 0;
        width: 300px;
        max-width: 85vw;
        min-width: 0;
        max-height: 100vh;
        border-radius: 0;
        border-right: none;
        border-left: 1px solid var(--glass-border);
        box-shadow: -20px 0 60px rgba(0, 0, 0, 0.3);
        z-index: 2001;
        padding: 0;
        gap: 0;
        transform: translateX(100%);
        transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
        background: var(--mobile-menu-bg);
        backdrop-filter: blur(30px) saturate(180%);
        -webkit-backdrop-filter: blur(30px) saturate(180%);
        flex: 0 0 auto;
        align-items: stretch;
    }

    /* در RTL هم از راست باز می‌شود (برعکس سبد خرید) */
    [dir="rtl"] .custom-education-theme-sidebar {
        right: 0;
        left: auto;
        border-left: 1px solid var(--glass-border);
        border-right: none;
        transform: translateX(100%);
    }

    .custom-education-theme-sidebar.custom-education-theme-open {
        transform: translateX(0);
    }

    /* در offcanvas، هدر دیده می‌شود */
    .custom-education-theme-sidebar-header {
        display: flex;
    }

    /* آیتم‌ها به‌صورت لیست عمودی با فاصله‌ی راحت */
    .custom-education-theme-sidebar .custom-education-theme-sidebar-list {
        flex: 1;
        overflow-y: auto;
        padding: 12px 12px 24px;
        display: flex;
        flex-direction: column;
        gap: 4px;
    }

    /* در موبایل، فاصله‌ی داخلی سایدبار حذف می‌شود چون خود List دارد */
    .custom-education-theme-sidebar > *:not(.custom-education-theme-sidebar-header):not(.custom-education-theme-sidebar-list) {
        margin: 0 12px;
    }
}

.custom-education-theme-slider-with-sidebar .custom-education-theme-slider-area {
    flex: 1 1 80%;
    min-width: 0;
    display: flex;
    flex-direction: column;
    min-height: 480px; /* ✅ این خط رو اضافه کن */
}

.custom-education-theme-sidebar-toggle-wrapper {
    display: none; /* در دسکتاپ مخفی */
}

/* در سایز کوچکتر از 640px، عرض offcanvas کمتر */
@media (max-width: 640px) {
    .custom-education-theme-sidebar {
        width: 270px;
    }
}

@media (max-width: 900px) {
    .custom-education-theme-slider-with-sidebar .custom-education-theme-slider-area {
        min-height: 380px;
    }
}
/* در موبایل wrapper نمایش داده بشه و وسط‌چین */
.custom-education-theme-sidebar-toggle-wrapper {
    display: flex;
    justify-content: center;
    padding: 0 16px;
    margin-top: 20px;
}

@media (max-width: 640px) {
    .custom-education-theme-slider-with-sidebar .custom-education-theme-slider-area {
        min-height: 320px;
    }
}

@media (max-width: 400px) {
    .custom-education-theme-slider-with-sidebar .custom-education-theme-slider-area {
        min-height: 280px;
    }
}
