/* ============================================= */
/* فقط اینو کپی کن و جایگزین کل CSS قبلی کن */
/* ============================================= */

.ets_mm_megamenu.ets-dir-rtl {
    direction: rtl;
}

.noscroll {
    margin: 0;
    height: 100%;
    overflow: hidden;
}

/* منوی موبایل (دست نخورده و عالیه) */
.mobile-menu-modal {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 99999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s, visibility 0.4s;
    direction: rtl;
}

.mobile-menu-modal.open {
    opacity: 1;
    visibility: visible;
}

.mobile-menu-modal .modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(5px);
}

.mobile-menu-modal .menu-sidebar {
    position: absolute;
    top: 0;
    right: 0;
    width: 90%;
    max-width: 380px;
    height: 100%;
    background: #fff;
    box-shadow: -5px 0 25px rgba(0, 0, 0, 0.4);
    transform: translateX(100%);
    transition: transform 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.mobile-menu-modal.open .menu-sidebar {
    transform: translateX(0);
}

.menu-header {
    background: #222;
    color: #fff;
    padding: 15px;
    display: flex;
    align-items: center;
}

.back-btn,
.close-btn {
    background: none;
    border: none;
    color: #fff;
    font-size: 24px;
    cursor: pointer;
}

.back-btn {
    opacity: 0;
    pointer-events: none;
}

.back-btn.visible {
    opacity: 1;
    pointer-events: all;
}

.menu-title {
    flex: 1;
    text-align: center;
    margin: 0;
    font-size: 17px;
}

.menu-scroll {
    height: calc(100% - 60px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.menu-level {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    padding: 12px 0;
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.25, 0.8, 0.25, 1);
}

.menu-level.active {
    transform: translateX(0);
}

.menu-level ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.menu-level li {
    border-bottom: 1px solid #eee;
}

.menu-level a {
    display: block;
    padding: 16px 20px;
    color: #333;
    text-decoration: none;
    font-size: 15px;
    position: relative;
}

.has-submenu>a {
    padding-right: 55px;
}

.has-submenu>a i {
    position: absolute;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #999;
    font-size: 18px;
}

.real-back-link {
    display: block;
    padding: 16px 20px !important;
    background: #f8f8f8;
    font-weight: 600;
    color: #333;
    border-bottom: 1px solid #ddd;
}

.real-back-link i {
    margin-left: 8px;
    color: #888;
}

/* منوی دسکتاپ اصلی - تمیز و نهایی */
.desktop-main-menu {
    background: #fff;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.1);
    position: sticky;
    top: 0;
    z-index: 1;
    background: var(--color-1);

}

.desktop-main-menu .container-fluid {
    position: static;
    /* مهم برای full-width */
}

.main-menu-ul {
    display: flex;
    justify-content: right;
    align-items: center;
    gap: 15px;
    margin: 0;
    padding: 0 20px;
    list-style: none;
    height: 68px;
}

.main-menu-ul .menu-item>a {
    display: block;
    padding: 0.7rem;
    border-radius: 5px;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
    color: #fff;
    transition: background 0.4s ease-in-out;

}

.main-menu-ul .menu-item.has-categories {
    display: block;
    padding: 12px 0px;
    font-weight: 500;
    font-size: 15px;
    transition: color 0.3s;
    color: #fff;
    cursor: pointer;

}


.main-menu-ul .menu-item:hover>a{
    transition: background 0.2s ease-in-out;
    background: var(--color-3);
}

.main-menu-ul .menu-item.has-categories:hover>a {
    transition: background 0.2s ease-in-out;
    background: var(--color-3);
}

.main-menu-ul .menu-item.has-categories>a {
    transition: background 0.4s ease-in-out;
}


.main-menu-ul .menu-item.has-categories>a i {
    font-size: 11px;
    margin-right: 6px;
    transition: transform 0.3s;
}

.main-menu-ul .menu-item.has-categories:hover>a i {
    transform: rotate(180deg);
}

/* مگامنو تمام عرض و دقیقاً هم‌عرض منوی بالایی */
.categories-full-megamenu {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 3px solid var(--pry-color);
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.22);
    opacity: 0;
    visibility: hidden;
    transform: translateY(15px);
    transition: all 0.4s cubic-bezier(0.25, 0.8, 0.25, 1);
    pointer-events: none;
    z-index: 998;
}

.menu-item.has-categories:hover .categories-full-megamenu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    margin-left: 3rem;
    margin-right: 3rem;
    pointer-events: all;
}

.categories-content {
    display: flex;
    max-width: 1480px;
    margin: 0 auto;
    min-height: 520px;
}

/* سمت چپ - لیست عمودی */
.categories-left-panel {
    width: 300px;
    background: #f9f9f9;
    border-left: 1px solid #eee;
    padding: 18px 0;
    flex-shrink: 0;
}

.main-cats-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.main-cat-item {
    position: relative;
}

.main-cat-item a {
    display: block;
    padding: 14px 28px;
    color: #333;
    font-size: 15px;
    text-decoration: none;
    transition: all 0.25s;
}

.main-cat-item:hover,
.main-cat-item.active {
    background: #fff;
}

.main-cat-item:hover>a,
.main-cat-item.active>a {
    color: var(--color-3);
    font-weight: 600;
}

.main-cat-item .arrow {
    position: absolute;
    left: 18px;
    top: 50%;
    transform: translateY(-50%);
    font-size: 15px;
    color: #999;
}

/* سمت راست - زیرشاخه‌ها */
.categories-right-panel {
    flex: 1;
    padding: 20px 45px;
    background: #fff;
    min-height: 520px;
}

.subcat-level,
.subcat-block {
    display: none;
    animation: fadeInRight 0.35s ease;
}

.subcat-level.active,
.subcat-block.active {
    display: block;
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(25px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

.subcat-header h3{
    margin-bottom: 0;
}

.subcat-group-title {
    font-size: 17px;
    font-weight: 600;
}

.subcat-header a{
    color: var(--color-3);
    font-size: 18px;
}
.subcat-group-title a {
    color: #222;
    text-decoration: none;

}


.subcat-group-title a:hover {
    color: var(--color-3);
}

.subcat-columns {
    display: flex;
    flex-wrap: wrap;
    gap: 45px;
    margin-top: 15px;
}

.subcat-group {
}

.subcat-group-title {
    font-size: 17px;
    border-bottom: none;
    padding-bottom: 5px;
}

.subcat-column {
    flex: 1;
    min-width: 200px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.subcat-column li {
    margin-bottom: 10px;
}

.subcat-column a {
    color: #444;
    font-size: 14.5px;
    text-decoration: none;
    transition: all 0.2s;
    display: block;
    font-weight: normal;
    padding: 2px 0;
}

.subcat-column a:hover {
    color: var(--color-3);
    padding-right: 8px;
}

/* ریسپانسیو */
@media (max-width: 1400px) {
    .categories-content {
        max-width: 1240px;
    }
}

@media (max-width: 1200px) {
    .categories-content {
        max-width: 1000px;
    }

    .categories-left-panel {
        width: 260px;
    }
}