﻿/* فول‌عرض شدن مگامنو و هم‌تراز با container صفحه */
.mega-dropdown > .dropdown-menu.mega-menu {
    display: none;
    left: 0;
    right: 0;
    top: 100%;
    border: 0;
    border-radius: 1rem;
    padding: 1.25rem 0;
    box-shadow: 0 10px 30px rgba(0,0,0,.08);
}

.mega-inner {
    padding-inline: 1rem;
}

/* عنوان و لیست‌ها */
.mega-title {
    font-weight: 700;
    font-size: .95rem;
}

.mega-list {
    list-style: none;
    padding: 0;
    margin: .5rem 0 0;
}

    .mega-list li a {
        display: block;
        padding: .35rem 0;
        color: var(--bs-body-color);
        text-decoration: none;
    }

        .mega-list li a:hover {
            color: var(--bs-primary);
        }

/* باکس کناری شبیه اسکرین‌شات */
.mega-aside .card-action {
    display: flex;
    align-items: center;
    gap: .5rem;
    padding: .75rem 1rem;
    margin-bottom: .75rem;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    background: #fff;
    transition: box-shadow .15s ease, transform .15s ease;
}

    .mega-aside .card-action:hover {
        box-shadow: 0 6px 18px rgba(0,0,0,.06);
        transform: translateY(-1px);
    }

/* کارت‌های پلن */
.plan-card {
    height: 100%;
    border: 1px solid var(--bs-border-color);
    border-radius: .75rem;
    padding: 1rem;
    background: #fff;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

/* نمایش با Hover در دسکتاپ */
@media (min-width: 992px) {
    .mega-dropdown:hover > .dropdown-menu.mega-menu {
        display: block;
    }

    .mega-dropdown .dropdown-toggle:after {
        transition: .2s;
    }

    .mega-dropdown:hover .dropdown-toggle:after {
        transform: rotate(180deg);
    }
}

/* بهبود فاصله‌ی ناوبری */
.navbar-nav > li {
    margin-inline: .25rem;
}

/* ساختار کلی مگامنو */
.dropdown-mega {
    position: static !important;
}

    .dropdown-mega .dropdown-menu {
        width: 100%;
        right: 0;
        left: 0;
        margin-top: 0;
        border-radius: 0 0 0.5rem 0.5rem;
    }

/* دسته‌بندی‌ها - دسکتاپ */
.categories {
    width: 280px;
    overflow-y: auto;
}

    .categories .category-item {
        padding: 12px 15px;
        margin-bottom: 8px;
        cursor: pointer;
        border-radius: 8px;
        display: flex;
        align-items: center;
        transition: background 0.3s, color 0.3s;
        white-space: nowrap;
    }

        .categories .category-item:hover,
        .categories .category-item.active {
            background-color: rgba(13,110,253,0.05);
            color: #0d6efd;
        }

/* زیر‌دسته‌ها */
.subcategory-list {
    display: none;
}

    .subcategory-list.show {
        display: block;
        animation: fadeIn 0.3s ease;
    }

    .subcategory-list a {
        color: #333;
        text-decoration: none;
        transition: all 0.3s;
    }

        .subcategory-list a:hover {
            color: #0d6efd;
        }

/* ===== موبایل ===== */
@media (max-width: 767px) {
    .mega-inner {
        flex-direction: column !important;
        height: auto !important;
    }

    .categories {
        width: 100%;
        border: none !important;
        overflow-x: auto;
        overflow-y: hidden;
        white-space: nowrap;
        padding: 0.5rem 0.25rem;
        display: flex;
        scroll-behavior: smooth;
    }

        .categories::-webkit-scrollbar {
            height: 4px;
        }

        .categories .category-item {
            display: inline-flex;
            margin: 0 4px;
            padding: 10px 14px;
            font-size: 0.9rem;
            flex-shrink: 0;
        }

    .subcategories {
        max-height: none;
        padding-top: 1rem;
    }
}

/* انیمیشن */
@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}
