﻿/* ==================================================
   CART OFFCANVAS STYLES
   ================================================== */

.custom-education-theme-cart-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;
    overscroll-behavior: contain;
    pointer-events: auto;
}

    .custom-education-theme-cart-overlay.custom-education-theme-open {
        opacity: 1;
        visibility: visible;
    }

.custom-education-theme-cart-offcanvas {
    position: fixed;
    top: 0;
    left: 0;
    height: 100vh;
    height: 100dvh; /* 👈 استفاده از Dynamic Viewport Height برای جلوگیری از خالی شدن در موبایل */
    width: 420px;
    max-width: 92vw;
    background: var(--mobile-menu-bg);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-right: 1px solid var(--glass-border);
    box-shadow: 20px 0 60px rgba(0, 0, 0, 0.25);
    z-index: 2001;
    display: flex;
    flex-direction: column;
    transform: translateX(-100%);
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

[dir="rtl"] .custom-education-theme-cart-offcanvas {
    left: 0;
    right: auto;
    border-right: 1px solid var(--glass-border);
    border-left: none;
    transform: translateX(-100%);
}

.custom-education-theme-cart-offcanvas.custom-education-theme-open {
    transform: translateX(0) !important;
}

.custom-education-theme-cart-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--glass-border);
}

    .custom-education-theme-cart-header h3 {
        font-size: 1.1rem;
        font-weight: 700;
        color: var(--text-primary);
        display: flex;
        align-items: center;
        gap: 8px;
    }

        .custom-education-theme-cart-header h3 i {
            color: var(--accent);
        }

.custom-education-theme-cart-close {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid var(--glass-border);
    background: var(--glass-bg);
    color: var(--text-primary);
    font-size: 0.95rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

    .custom-education-theme-cart-close:hover {
        background: linear-gradient(135deg, #ff6b6b, #ee5a24);
        color: #fff;
        border-color: transparent;
        transform: rotate(90deg);
    }

.custom-education-theme-cart-items {
    flex: 1; /* 👈 باعث میشه فضای باقی‌مانده بین هدر و فوتر پر بشه */
    overflow-y: auto; /* 👈 اسکرول فقط روی آیتم‌ها اعمال میشه */
    padding: 16px 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    overscroll-behavior: contain;
}

.custom-education-theme-cart-item {
    display: flex;
    gap: 12px;
    padding: 12px;
    border-radius: var(--radius-md);
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    transition: var(--transition);
    position: relative;
    align-items: center;
}

    .custom-education-theme-cart-item:hover {
        border-color: var(--accent-glow-30);
        box-shadow: 0 6px 20px var(--accent-glow-10);
    }

.custom-education-theme-cart-item-img {
    width: 70px;
    height: 70px;
    border-radius: var(--radius-sm);
    overflow: hidden;
    flex-shrink: 0;
}

    .custom-education-theme-cart-item-img img {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

.custom-education-theme-cart-item-info {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 0;
}

    .custom-education-theme-cart-item-info h5 {
        font-size: 0.88rem;
        font-weight: 700;
        color: var(--text-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    .custom-education-theme-cart-item-info .custom-education-theme-cart-item-instructor {
        font-size: 0.75rem;
        color: var(--text-secondary);
    }

    .custom-education-theme-cart-item-info .custom-education-theme-cart-item-price {
        font-size: 0.88rem;
        font-weight: 700;
        color: var(--accent);
        margin-top: 4px;
    }

.custom-education-theme-cart-item-remove {
    flex-shrink: 0;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 107, 107, 0.15);
    color: #ff6b6b;
    font-size: 0.75rem;
    cursor: pointer;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
    align-self: center;
}

    .custom-education-theme-cart-item-remove:hover {
        background: #ff6b6b;
        color: #fff;
        transform: scale(1.15);
    }

.custom-education-theme-cart-footer {
    padding: 20px 24px;
    border-top: 1px solid var(--glass-border);
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.custom-education-theme-cart-total {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 0.95rem;
    color: var(--text-secondary);
}

    .custom-education-theme-cart-total strong {
        font-size: 1.2rem;
        font-weight: 800;
        color: var(--accent);
    }

.custom-education-theme-btn-checkout {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 14px 20px;
    border-radius: var(--radius-md);
    border: 1px solid transparent;
    background: var(--accent-gradient);
    color: #fff;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: 0 8px 25px var(--accent-glow-35);
}

    .custom-education-theme-btn-checkout:hover {
        transform: translateY(-3px);
        box-shadow: 0 14px 35px var(--accent-glow-50);
    }

/* ==================================================
   قفل کردن اسکرول صفحه وقتی سبد باز است
   ================================================== */
body.cart-is-open {
    overflow: hidden !important;
    /* جلوگیری از پرش صفحه در دستگاه‌های مختلف */
    height: 100vh;
}