/* ═══════════════════════════════════════════════════════════════
   IrLuxory Mega Menu · e20a5ed7 · v5.1.0
   Brand:#061032 · RTL · All top-level product_cat (parent=0)
   Suffix e20a5ed7 — matches main.php & script.js exactly
   ═══════════════════════════════════════════════════════════════ */

/* ── Suppress Elementor native submenu/dropdown on mega trigger only ───── */
.elementor-nav-menu li.ilm-has-mega-e20a5ed7 > ul.sub-menu,
.elementor-nav-menu--main li.ilm-has-mega-e20a5ed7 > ul.sub-menu,
.elementor-nav-menu li.ilm-has-mega-e20a5ed7 > .elementor-nav-menu--dropdown,
.elementor-nav-menu--main li.ilm-has-mega-e20a5ed7 > .elementor-nav-menu--dropdown,
li.ilm-has-mega-e20a5ed7 > ul.sub-menu {
    display: none !important;
    visibility: hidden !important;
    pointer-events: none !important;
}

/* ── position context for trigger li ──────────────────────────────────── */
.elementor-nav-menu li.ilm-has-sub-e20a5ed7,
.elementor-nav-menu--main li.ilm-has-sub-e20a5ed7 {
    position: static !important;
}

/* ── caret on trigger link ─────────────────────────────────────────────── */
.ilm-has-sub-e20a5ed7 > a::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    margin-right: 6px;
    vertical-align: middle;
    opacity: 0.45;
    transition: transform 0.22s ease, opacity 0.22s ease;
    flex-shrink: 0;
}
.ilm-has-sub-e20a5ed7.ilm-open-e20a5ed7 > a::after {
    transform: rotate(-135deg) translateY(2px);
    opacity: 0.9;
}

/* ── panel base: flex column — grid scrolls, footer stays fixed ────────── */
.ilm-sub-e20a5ed7 {
    display: flex !important;
    flex-direction: column !important;
    position: absolute !important;
    top: calc(100% + 8px) !important;
    z-index: 99999 !important;
    background: #ffffff;
    border: 1px solid rgba(6,16,50,0.08);
    border-radius: 16px;
    box-shadow:
        0 2px 4px -1px rgba(6,16,50,0.04),
        0 8px 24px -4px rgba(6,16,50,0.10),
        0 24px 64px -8px rgba(6,16,50,0.13);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translateY(10px);
    transition:
        opacity 0.22s ease,
        transform 0.22s ease,
        visibility 0s linear 0.22s;
    font-family: 'Vazirmatn', Vazir, Tahoma, sans-serif;
    direction: rtl;
    text-align: right;
    max-height: 480px;
    overflow: hidden;
}
.ilm-has-sub-e20a5ed7.ilm-open-e20a5ed7 > .ilm-sub-e20a5ed7 {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
    transition:
        opacity 0.18s ease,
        transform 0.18s ease,
        visibility 0s linear 0s;
}

/* ── mega panel sizing ─────────────────────────────────────────────────── */
.ilm-mega-e20a5ed7 {
    right: auto !important;
    left: 0 !important;
    min-width: 720px;
    max-width: min(1380px, 96vw);
    width: max-content;
}

/* ── inner wrapper: flex column, fills panel ───────────────────────────── */
.ilm-mega-inner-e20a5ed7 {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
}

/* ── grid: scrollable area ─────────────────────────────────────────────── */
.ilm-mega-grid-e20a5ed7 {
    display: grid !important;
    grid-template-columns: repeat(var(--ilm-cols, 4), 1fr);
    gap: 0;
    padding: 28px 36px 20px;
    align-items: start;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: rgba(6,16,50,0.15) transparent;
}
.ilm-mega-grid-e20a5ed7::-webkit-scrollbar { width: 4px; }
.ilm-mega-grid-e20a5ed7::-webkit-scrollbar-track { background: transparent; }
.ilm-mega-grid-e20a5ed7::-webkit-scrollbar-thumb {
    background: rgba(6,16,50,0.18);
    border-radius: 4px;
}

/* ── column ────────────────────────────────────────────────────────────── */
.ilm-col-e20a5ed7 {
    padding: 0 20px 18px;
    border-left: 1px solid rgba(6,16,50,0.07);
    min-width: 0;
}
.ilm-col-e20a5ed7:last-child  { border-left: none; }
.ilm-col-e20a5ed7:first-child { padding-right: 0; }

/* column heading */
.ilm-col-title-e20a5ed7 {
    display: flex !important;
    align-items: center;
    gap: 8px;
    font-size: 13.5px;
    font-weight: 700;
    color: #061032;
    text-decoration: none;
    margin-bottom: 12px;
    padding-bottom: 10px;
    border-bottom: 1.5px solid rgba(6,16,50,0.10);
    white-space: normal;
    word-break: break-word;
    line-height: 1.45;
    transition: color 0.15s ease;
}
.ilm-col-title-e20a5ed7:hover { color: rgba(6,16,50,0.60); }
.ilm-col-title-text-e20a5ed7  { flex: 1; min-width: 0; }
.ilm-col-thumb-e20a5ed7 {
    width: 28px; height: 28px;
    border-radius: 6px;
    object-fit: cover;
    flex-shrink: 0;
}
.ilm-col-toggle-e20a5ed7 { display: none; }

/* ── grandchildren: override Elementor .elementor-nav-menu ul{display:none} */
.ilm-col-e20a5ed7 ul.ilm-grandchildren-e20a5ed7,
.ilm-mega-grid-e20a5ed7 .ilm-col-e20a5ed7 ul.ilm-grandchildren-e20a5ed7,
.elementor-nav-menu .ilm-col-e20a5ed7 ul.ilm-grandchildren-e20a5ed7,
.elementor-nav-menu--main .ilm-col-e20a5ed7 ul.ilm-grandchildren-e20a5ed7,
ul.ilm-grandchildren-e20a5ed7 {
    display: block !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    visibility: visible !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
}
.ilm-grandchildren-e20a5ed7 > li {
    display: block !important;
    margin-bottom: 1px;
    visibility: visible !important;
}
.ilm-grandchildren-e20a5ed7 > li > a {
    display: block;
    font-size: 12.5px;
    font-weight: 400;
    color: #4a4a6a;
    text-decoration: none;
    line-height: 1.65;
    padding: 3px 0;
    white-space: normal;
    word-break: break-word;
    transition: color 0.13s ease, padding-right 0.13s ease;
}
.ilm-grandchildren-e20a5ed7 > li > a:hover {
    color: #061032;
    font-weight: 600;
    padding-right: 5px;
}

/* ── level 3 ───────────────────────────────────────────────────────────── */
.ilm-col-e20a5ed7 ul.ilm-level4-e20a5ed7,
.elementor-nav-menu .ilm-col-e20a5ed7 ul.ilm-level4-e20a5ed7,
ul.ilm-level4-e20a5ed7 {
    display: block !important;
    list-style: none !important;
    margin: 3px 0 5px !important;
    padding: 0 10px !important;
    border-right: 2px solid rgba(6,16,50,0.10);
    visibility: visible !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
}
.ilm-level4-e20a5ed7 li { display: block !important; visibility: visible !important; }
.ilm-level4-e20a5ed7 li a {
    display: block;
    font-size: 12px;
    font-weight: 400;
    color: #6b6b88;
    text-decoration: none;
    padding: 2px 0;
    transition: color 0.12s ease;
}
.ilm-level4-e20a5ed7 li a:hover { color: #061032; }

/* ── footer: stays outside scroll, flex-shrink:0 ──────────────────────── */
.ilm-mega-footer-e20a5ed7 {
    border-top: 1px solid rgba(6,16,50,0.07);
    padding: 14px 36px 16px;
    background: rgba(6,16,50,0.018);
    border-radius: 0 0 16px 16px;
    text-align: left;
    direction: rtl;
    flex-shrink: 0;
}
.ilm-view-all-e20a5ed7 {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    font-weight: 600;
    color: #061032;
    text-decoration: none;
    border: 1.5px solid rgba(6,16,50,0.22);
    border-radius: 10px;
    padding: 7px 20px;
    transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease;
}
.ilm-view-all-e20a5ed7:hover {
    background: #061032;
    color: #ffffff;
    border-color: #061032;
}
.ilm-arrow-e20a5ed7 { font-size: 14px; opacity: 0.7; }

/* ── large screens ─────────────────────────────────────────────────────── */
@media (min-width: 1440px) {
    .ilm-mega-grid-e20a5ed7    { padding: 32px 44px 24px; }
    .ilm-mega-footer-e20a5ed7  { padding: 15px 44px 16px; }
}
@media (max-width: 1280px) {
    .ilm-mega-grid-e20a5ed7   { padding: 22px 24px 16px; }
    .ilm-col-e20a5ed7          { padding: 0 14px 14px; }
    .ilm-mega-footer-e20a5ed7  { padding: 12px 24px 14px; }
}

/* ── mobile ────────────────────────────────────────────────────────────── */
@media (max-width: 1023px) {
    .ilm-sub-e20a5ed7 {
        display: block !important;
        position: static !important;
        opacity: 1 !important;
        visibility: visible !important;
        pointer-events: auto !important;
        transform: none !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        background: transparent !important;
        border: none !important;
        max-height: 0;
        overflow: hidden !important;
        transition: max-height 0.35s ease !important;
    }
    .ilm-has-sub-e20a5ed7.ilm-mob-open-e20a5ed7 > .ilm-sub-e20a5ed7 {
        max-height: 3000px;
        overflow-y: auto !important;
    }
    .ilm-mega-inner-e20a5ed7 { flex: unset; min-height: unset; }
    .ilm-mega-grid-e20a5ed7 {
        display: block !important;
        padding: 0 !important;
        overflow: visible !important;
        flex: unset;
        min-height: unset;
    }
    .ilm-col-e20a5ed7 {
        border-left: none !important;
        border-bottom: 1px solid rgba(6,16,50,0.07);
        padding: 0 !important;
    }
    .ilm-col-title-e20a5ed7 {
        padding: 11px 16px !important;
        margin-bottom: 0 !important;
        border-bottom: none !important;
        background: rgba(6,16,50,0.025);
        cursor: pointer;
        justify-content: space-between;
    }
    .ilm-col-toggle-e20a5ed7 {
        display: block !important;
        width: 9px; height: 9px;
        border-right: 2px solid #061032;
        border-bottom: 2px solid #061032;
        transform: rotate(45deg);
        flex-shrink: 0;
        opacity: 0.5;
        transition: transform 0.2s ease;
    }
    .ilm-col-e20a5ed7.ilm-col-open-e20a5ed7 .ilm-col-toggle-e20a5ed7 {
        transform: rotate(-135deg);
        opacity: 0.9;
    }
    /* mobile accordion: collapse grandchildren by default */
    .ilm-grandchildren-e20a5ed7,
    .ilm-col-e20a5ed7 ul.ilm-grandchildren-e20a5ed7,
    ul.ilm-grandchildren-e20a5ed7 {
        max-height: 0 !important;
        overflow: hidden !important;
        height: auto !important;
        padding: 0 16px !important;
        background: #fff;
        transition: max-height 0.3s ease;
        display: block !important;
    }
    .ilm-col-e20a5ed7.ilm-col-open-e20a5ed7 > ul.ilm-grandchildren-e20a5ed7 {
        max-height: 1500px !important;
        padding-bottom: 8px !important;
    }
    .ilm-mega-footer-e20a5ed7 {
        position: static !important;
        padding: 14px 16px !important;
        text-align: center !important;
        flex-shrink: unset;
    }
    .ilm-view-all-e20a5ed7 { width: 100%; justify-content: center; }
    .ilm-mega-e20a5ed7 {
        min-width: 0 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}