/* ============================================================
   Mega Menu Elementor Widget — v5.7
   Figma-accurate layout:
   Col1: Navy sidebar | Col2: L2 list | Col3: L3 2-col grid | Col4: Banner (optional)
   ============================================================ */

/* ── Reset ─────────────────────────────────────────────────── */
.mm-wrapper *,.mm-wrapper *::before,.mm-wrapper *::after{
    box-sizing:border-box;margin:0;padding:0;
}
.mm-wrapper{
    position:relative;
    width:100%;
    font-family:inherit;
    z-index:9999;
}
.elementor-widget-mega_menu,
.elementor-widget-mega_menu .elementor-widget-container{
    width:100%;
}

/* ══ NAVBAR ════════════════════════════════════════════════ */
.mm-navbar{
    background:#fff;
    border-bottom:1px solid #e8e8e8;
    width:100%;
    display:flex;
    align-items:center;
    justify-content:space-between;
}
.mm-nav-list{
    display:flex;align-items:center;
    list-style:none;flex-wrap:wrap;
    padding:0;margin:0;
}
.mm-nav-item{position:static;}
.mm-nav-item>a{
    display:flex;align-items:center;gap:4px;
    padding:14px 10px;font-size:14px;font-weight:500;
    color:#222;text-decoration:none;white-space:nowrap;
    border-bottom:2px solid transparent;
    transition:color .2s,border-color .2s;line-height:1;
}
@media(min-width:1280px){.mm-nav-item>a{padding:14px 16px;}}
.mm-nav-item>a:hover,.mm-nav-item.active>a{
    color:#e53e3e;border-bottom-color:#e53e3e;
}
.mm-arrow{
    display:inline-flex;align-items:center;justify-content:center;
    width:20px;height:20px;font-size:13px;border-radius:4px;
    margin-left:2px;flex-shrink:0;cursor:pointer;
    transition:transform .25s,background .15s;
}
.mm-arrow:hover{background:rgba(0,0,0,.08);}
.mm-nav-item.active .mm-arrow,.mm-nav-item:hover .mm-arrow{transform:rotate(180deg);}

/* ── Hamburger ──────────────────────────────────────────── */
.mm-hamburger{
    display:none;
    flex-direction:column;justify-content:center;align-items:center;
    gap:5px;
    width:44px;height:44px;
    padding:10px;
    background:transparent;
    border:none;
    border-radius:6px;
    cursor:pointer;flex-shrink:0;
    touch-action:manipulation;-webkit-tap-highlight-color:transparent;
    position:relative;z-index:100;
    color:#222;              /* bar color via currentColor */
    transition:background .2s,color .2s;
}
.mm-hamburger:hover{
    background:rgba(0,0,0,.06);
}
.mm-hamburger span{
    display:block;height:2px;border-radius:2px;
    background:currentColor;
    transform-origin:center;
    transition:transform .35s cubic-bezier(.77,0,.175,1),opacity .25s,width .3s;
}
.mm-hamburger span:nth-child(1){width:22px;}
.mm-hamburger span:nth-child(2){width:16px;}
.mm-hamburger span:nth-child(3){width:22px;}
.mm-hamburger.is-open span:nth-child(1){transform:translateY(7px) rotate(45deg);width:22px;}
.mm-hamburger.is-open span:nth-child(2){opacity:0;transform:scaleX(0);}
.mm-hamburger.is-open span:nth-child(3){transform:translateY(-7px) rotate(-45deg);width:22px;}

/* ── Standard dropdown (Resources, etc.) ─────────────────── */
.mm-nav-item.mm-has-dropdown{position:relative;z-index:10001;}
.mm-dropdown{
    position:absolute;top:100%;left:0;
    min-width:220px;background:#fff;
    border:1px solid #e0e0e0;border-top:3px solid #e53e3e;
    box-shadow:0 8px 28px rgba(0,0,0,.14);
    list-style:none;padding:6px 0;margin:0;
    z-index:10005;
    opacity:0;visibility:hidden;transform:translateY(-4px);
    transition:opacity .2s,visibility .2s,transform .2s;
    pointer-events:none;
}
.mm-nav-item.mm-has-dropdown:hover .mm-dropdown,
.mm-nav-item.mm-has-dropdown:focus-within .mm-dropdown{
    opacity:1;visibility:visible;transform:translateY(0);pointer-events:auto;
}
.mm-dropdown-item a{
    display:block;padding:10px 18px;font-size:13.5px;color:#333;
    text-decoration:none;white-space:nowrap;
    transition:background .14s,color .14s;
    border-bottom:1px solid #f5f5f5;
}
.mm-dropdown-item:last-child a{border-bottom:none;}
.mm-dropdown-item a:hover{background:#fdf5f5;color:#e53e3e;}

/* ══════════════════════════════════════════════════════════
   MEGA PANEL
══════════════════════════════════════════════════════════ */
.mm-panel{
    position:absolute;
    top:135%;
    left:0;
    width:100%;
    background:#fff;
    border:1px solid #e0e0e0;
    box-shadow:0 8px 32px rgba(0,0,0,.15);
    z-index:10000;
    opacity:0;visibility:hidden;
    transform:translateY(-4px);
    transition:opacity .22s ease,visibility .22s ease,transform .22s ease;
    pointer-events:none;
}
.mm-panel.mm-open{
    opacity:1;visibility:visible;
    transform:translateY(0);pointer-events:auto;
}


/* Panel inner — flex row, all cols stretch to full height */
.mm-panel-inner{
    display:flex;
    flex-direction:row;
    width:100%;
    height:540px;
    overflow:hidden;
    position:relative;
}

/* Close button */
.mm-close{
    position:absolute;top:12px;right:16px;
    background:none;border:none;
    font-size:22px;color:#555;cursor:pointer;
    z-index:20;width:32px;height:32px;
    display:flex;align-items:center;justify-content:center;
    border-radius:50%;transition:background .15s,color .15s;
    line-height:1;
}
.mm-close:hover{background:#f0f0f0;color:#111;}

/* ══════════════════════════════════════════════════════════
   COL 1 — L1 Sidebar (Figma: navy background)
══════════════════════════════════════════════════════════ */
.mm-sidebar{
    width:280px;
    min-width:240px;
    max-width:280px;
    flex-shrink:0;flex-grow:0;
    background:#0f2d6b;    /* navy — matches Figma */
    border-right:none;
    overflow-y:auto;
    height:100%;
}
.mm-sidebar::-webkit-scrollbar{width:4px;}
.mm-sidebar::-webkit-scrollbar-track{background:rgba(255,255,255,.05);}
.mm-sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.2);border-radius:2px;}

/* Sidebar header "Products" */
.mm-sidebar-header{
    padding:18px 20px 14px;
    font-size:16px;font-weight:800;
    color:#fff;
    letter-spacing:.01em;
    border-bottom:1px solid rgba(255,255,255,.1);
    position:sticky;top:0;
    background:#0f2d6b;
    z-index:2;
}

.mm-sidebar-list{list-style:none;padding:4px 0;margin:0;}

.mm-sidebar-item{
    display:flex;align-items:center;
    gap:12px;
    padding:14px 20px;
    font-size:14px;font-weight:500;
    color:rgba(255,255,255,.88);
    cursor:pointer;
    border-left:4px solid transparent;
    transition:background .14s,color .14s,border-color .14s;
    user-select:none;line-height:1.3;
    -webkit-tap-highlight-color:transparent;
}
.mm-sidebar-item:hover{
    background:rgba(255,255,255,.09);
    color:#fff;
}
.mm-sidebar-item.active{
    background:rgba(255,255,255,.13);
    border-left-color:#f0c22b;   /* yellow accent like Figma */
    color:#fff;
    font-weight:700;
}
.mm-sidebar-icon{
    width:20px;flex-shrink:0;
    display:flex;align-items:center;justify-content:center;
    opacity:.8;
}
.mm-sidebar-icon img,.mm-sidebar-icon svg{
    width:18px;height:18px;object-fit:contain;
}
.mm-sidebar-label{flex:1;text-decoration:none;color:inherit;}
a.mm-sidebar-label:hover{text-decoration:none;}
.mm-sidebar-arrow{
    margin-left:auto;
    font-size:14px;
    color:rgba(255,255,255,.5);
    flex-shrink:0;
    transition:color .14s;
}
.mm-sidebar-item:hover .mm-sidebar-arrow,
.mm-sidebar-item.active .mm-sidebar-arrow{
    color:rgba(255,255,255,.9);
}

/* ══════════════════════════════════════════════════════════
   COL 2 — L2 Middle Panel (white bg, single column list)
══════════════════════════════════════════════════════════ */
.mm-l2-panels{
    width:260px;
    min-width:220px;
    max-width:260px;
    flex-shrink:0;flex-grow:0;
    background:#fff;
    border-right:1px solid #eee;
    overflow-y:auto;
    height:100%;
}
.mm-l2-panels::-webkit-scrollbar{width:4px;}
.mm-l2-panels::-webkit-scrollbar-thumb{background:#e0e0e0;border-radius:2px;}

.mm-l2-panel{display:none;}
.mm-l2-panel.active{display:block;}

.mm-l2-list{list-style:none;padding:8px 0;margin:0;}
.mm-l2-item{position:relative;}

.mm-l2-link{
    display:flex;align-items:center;gap:12px;
    padding:12px 16px;
    text-decoration:none;color:#222;
    border-left:4px solid transparent;
    transition:background .14s,border-color .14s;
    cursor:pointer;
}
.mm-l2-link:hover,
.mm-l2-item:hover>.mm-l2-link{
    background:#f5f7ff;
    border-left-color:#0f2d6b;
}
.mm-l2-item.active>.mm-l2-link{
    background:#f0f4ff;
    border-left-color:#0f2d6b;
}
.mm-l2-item:hover>.mm-l2-link .mm-l2-name,
.mm-l2-item.active>.mm-l2-link .mm-l2-name{
    color:#0f2d6b;font-weight:600;
}
.mm-l2-thumb{
    width:38px;height:38px;
    border-radius:6px;overflow:hidden;flex-shrink:0;
    background:#f5f5f5;border:1px solid #eee;
    display:flex;align-items:center;justify-content:center;
}
.mm-l2-thumb img{width:100%;height:100%;object-fit:contain;}
.mm-l2-thumb--empty{background:#f0f0f0;}
.mm-l2-thumb--empty::after{
    content:'';width:18px;height:18px;
    background:#ddd;border-radius:3px;display:block;
}
.mm-l2-name{
    flex:1;
    font-size:13.5px;font-weight:500;
    color:#222;line-height:1.35;
    transition:color .14s;
}
.mm-l2-arrow{
    font-size:14px;color:#bbb;
    margin-left:auto;flex-shrink:0;
    transition:color .14s,transform .14s;
}
.mm-l2-item:hover .mm-l2-arrow,
.mm-l2-item.active .mm-l2-arrow{
    color:#0f2d6b;transform:translateX(2px);
}
.mm-empty-state{
    display:flex;align-items:center;justify-content:center;
    height:100%;min-height:200px;color:#aaa;font-size:13.5px;
}

/* ══════════════════════════════════════════════════════════
   COL 3 — L3 Items (flex:1, full remaining width)
══════════════════════════════════════════════════════════ */
.mm-l3-panels{
    flex:1;
    min-width:0;
    background:#fff;
    border-right:none;
    overflow-y:auto;
    height:100%;
    position:relative;
}
.mm-l3-panels::-webkit-scrollbar{width:4px;}
.mm-l3-panels::-webkit-scrollbar-thumb{background:#e0e0e0;border-radius:2px;}

.mm-l3-panel{display:none;}
.mm-l3-panel.active{
    display:block;
    animation:mmFadeIn .18s ease forwards;
}
@keyframes mmFadeIn{
    from{opacity:0;transform:translateX(6px)}
    to  {opacity:1;transform:translateX(0)}
}

/* 2-column grid matching Figma */
.mm-l3-grid{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:0;
    padding:6px 0;
}
.mm-l3-item{
    display:flex;align-items:center;gap:12px;
    padding:12px 20px;
    text-decoration:none;color:#222;
    border-bottom:1px solid #f0f0f0;
    transition:background .14s;
}
.mm-l3-item:last-child,.mm-l3-item:nth-last-child(2):nth-child(odd){
    border-bottom:none;
}
.mm-l3-item:hover{background:#f0f4ff;}
.mm-l3-item:hover .mm-l3-name{color:#0f2d6b;font-weight:600;}
.mm-l3-thumb{
    width:40px;height:40px;
    border-radius:6px;overflow:hidden;flex-shrink:0;
    background:#f5f5f5;border:1px solid #eee;
    display:flex;align-items:center;justify-content:center;
}
.mm-l3-thumb img{
    width:100%;height:100%;
    object-fit:contain;
    display:block;
}
.mm-l3-thumb--empty{
    background:#f5f5f5;
    border:1px dashed #ddd;
}
.mm-l3-thumb--empty::after{
    content:'';
    width:14px;height:14px;
    background:#e0e0e0;
    border-radius:2px;
    display:block;
    opacity:.5;
}
.mm-l3-name{
    flex:1;
    font-size:13px;font-weight:500;
    color:#222;line-height:1.3;
    transition:color .14s;
    /* Prevent long names from wrapping badly */
    word-break:break-word;
    hyphens:auto;
}

/* Placeholder when nothing hovered */
.mm-l3-placeholder{
    display:flex;align-items:center;justify-content:center;
    height:100%;color:#ccc;font-size:13px;
    padding:20px;text-align:center;
}
.mm-l3-panel.active ~ .mm-l3-placeholder{display:none;}

/* ══════════════════════════════════════════════════════════
   L3 BANNER IMAGES — shown inside L3 col, below the grid
   2-column layout matching Figma bottom row
══════════════════════════════════════════════════════════ */
.mm-l3-banners{
    display:grid;
    grid-template-columns:repeat(2,1fr);
    gap:8px;
    padding:8px 12px 12px;
    border-top:1px solid #f0f0f0;
}
.mm-l3-banner-item{
    border-radius:8px;
    overflow:hidden;
    background:#f5f5f5;
    border:1px solid #eee;
    aspect-ratio:16/9;
    position:relative;
}
.mm-l3-banner-item img{
    width:100%;height:100%;
    object-fit:cover;object-position:center;
    display:block;
    transition:transform .3s ease;
}
.mm-l3-banner-item:hover img{transform:scale(1.03);}
.mm-l3-banner-item a{
    display:block;width:100%;height:100%;
}
/* Empty placeholder matching Figma grey boxes */
.mm-l3-banner-item--empty{
    display:flex;align-items:center;justify-content:center;
    min-height:100px;
}
.mm-l3-banner-item--empty::after{
    content:'';
    width:32px;height:32px;
    background:#ddd;border-radius:6px;
    display:block;opacity:.4;
}
/* Hide banners section when no banners set */
.mm-l3-banners:empty{display:none;}
.mm-l3-panel .mm-l3-banners{display:none;}
.mm-l3-panel.active .mm-l3-banners{display:grid;}

/* ══ OVERLAY ═══════════════════════════════════════════════ */
.mm-overlay{
    position:fixed;inset:0;background:rgba(0,0,0,.25);
    z-index:9998;opacity:0;visibility:hidden;
    transition:opacity .25s,visibility .25s;pointer-events:none;
}
.mm-overlay.mm-open{opacity:1;visibility:visible;pointer-events:auto;}

/* ══════════════════════════════════════════════════════════
   MOBILE DRAWER
══════════════════════════════════════════════════════════ */
.mm-mob-overlay{
    position:fixed;inset:0;background:rgba(4,12,30,.65);
    z-index:10998;opacity:0;visibility:hidden;
    transition:opacity .3s,visibility .3s;backdrop-filter:blur(2px);
}
.mm-mob-overlay.is-open{opacity:1;visibility:visible;}

.mm-mob-drawer{
    position:fixed;top:0;left:0;
    width:min(88vw,340px);height:100%;
    background:#0f2d6b;
    z-index:10999;
    display:flex;flex-direction:column;overflow:hidden;
    transform:translateX(-100%);visibility:hidden;
    transition:transform .38s cubic-bezier(.77,0,.175,1),visibility .38s;
    box-shadow:4px 0 40px rgba(0,0,0,.5);
}
.mm-mob-drawer.is-open{transform:translateX(0);visibility:visible;}

.mm-mob-header{
    display:flex;align-items:center;
    padding:0 14px;height:56px;min-height:56px;
    background:rgba(0,0,0,.2);
    border-bottom:1px solid rgba(255,255,255,.12);
    flex-shrink:0;
    gap:8px;
    position:relative;
}

/* Back button — fixed width, icon only on deep levels */
.mm-mob-back{
    background:none;border:none;cursor:pointer;
    display:flex;align-items:center;gap:4px;
    color:#fff;font-size:13px;font-weight:600;
    padding:6px 8px;border-radius:6px;
    transition:background .15s;
    flex-shrink:0;
    min-width:36px;
    white-space:nowrap;
    max-width:120px;          /* cap so it never eats brand space */
}
.mm-mob-back svg{width:16px;height:16px;stroke:#fff;flex-shrink:0;}
.mm-mob-back:hover{background:rgba(255,255,255,.1);}

/* Back label — truncate if too long */
.mm-mob-back-label{
    overflow:hidden;
    text-overflow:ellipsis;
    white-space:nowrap;
    max-width:80px;
    display:inline-block;
    vertical-align:middle;
}

/* Brand name — centered absolutely so it never shifts */
.mm-mob-brand{
    position:absolute;
    left:50%;
    transform:translateX(-50%);
    font-size:16px;font-weight:800;color:#f0c22b;
    letter-spacing:.04em;
    text-align:center;
    white-space:nowrap;
    pointer-events:none;
    /* Wide enough to always show full brand name */
    max-width:calc(100% - 140px);
}
.mm-mob-close{
    background:none;border:none;cursor:pointer;
    width:36px;height:36px;display:flex;align-items:center;
    justify-content:center;border-radius:50%;flex-shrink:0;
    transition:background .15s;-webkit-tap-highlight-color:transparent;
}
.mm-mob-close svg{width:22px;height:22px;stroke:#fff;stroke-width:2.5;}
.mm-mob-close:hover{background:rgba(255,255,255,.12);}

.mm-mob-slides{flex:1;overflow:hidden;position:relative;}
.mm-mob-slide{
    position:absolute;top:0;left:0;width:100%;height:100%;
    overflow-y:auto;background:#0f2d6b;
    transform:translateX(110%);
    transition:transform .32s cubic-bezier(.77,0,.175,1);
}
.mm-mob-slide::-webkit-scrollbar{width:3px;}
.mm-mob-slide::-webkit-scrollbar-thumb{background:rgba(255,255,255,.2);border-radius:2px;}
.mm-mob-slide.is-current{transform:translateX(0);}
.mm-mob-slide.is-prev{transform:translateX(-28%);}

.mm-mob-slide-title{
    display:flex;align-items:center;gap:6px;
    padding:14px 18px 12px;
    font-size:15px;font-weight:800;color:#f0c22b;
    border-bottom:1px solid rgba(255,255,255,.1);
}
.mm-mob-slide-title svg{width:16px;height:16px;stroke:#f0c22b;flex-shrink:0;}
.mm-mob-list{list-style:none;padding:4px 0;margin:0;}
.mm-mob-item{
    display:flex;align-items:center;gap:12px;
    width:100%;padding:14px 18px;
    background:none;border:none;
    border-bottom:1px solid rgba(255,255,255,.07);
    color:#fff;font-family:inherit;font-size:14.5px;font-weight:500;
    text-decoration:none;cursor:pointer;text-align:left;line-height:1.3;
    transition:background .14s;-webkit-tap-highlight-color:transparent;
}
.mm-mob-item:hover,.mm-mob-item:active{background:rgba(255,255,255,.07);}
.mm-mob-item--has-child{display:flex;align-items:center;justify-content:space-between;}
.mm-mob-item--has-child .mm-mob-item-label{display:flex;align-items:center;gap:12px;flex:1;}
.mm-mob-chev{width:16px;height:16px;stroke:currentColor;flex-shrink:0;}
.mm-mob-thumb{
    width:32px;height:32px;border-radius:4px;overflow:hidden;
    flex-shrink:0;background:rgba(255,255,255,.1);
    display:flex;align-items:center;justify-content:center;
}
.mm-mob-thumb img{width:100%;height:100%;object-fit:contain;}
.mm-mob-banner{margin:12px 16px 16px;border-radius:8px;overflow:hidden;}
.mm-mob-banner img{width:100%;height:auto;display:block;}

/* ══ BREAKPOINTS ═══════════════════════════════════════════ */

/* Tablet */
@media(max-width:991px){
    .mm-panel-inner{height:440px;}
    .mm-sidebar{width:220px;min-width:200px;max-width:220px;}
    .mm-l2-panels{width:220px;min-width:200px;max-width:220px;}
    .mm-l3-grid{grid-template-columns:1fr;}
}

/* Mobile */
@media(max-width:767px){
    .mm-nav-list{display:none !important;}
    .mm-hamburger{display:flex !important;}
    .mm-panel{display:none !important;}
    .mm-overlay{display:none !important;}
}

/* Laptop: 1200px–1440px */
@media(min-width:1200px) and (max-width:1440px){
    .mm-sidebar{width:220px;min-width:220px;max-width:220px;}
    .mm-l2-panels{width:240px;min-width:240px;max-width:240px;}
    .mm-panel{
        position:absolute;
        top:135%;
        left:0;
        width:115%;
    }
}
/* Large: 1441px–1600px */
@media(min-width:1441px) and (max-width:1600px){
    .mm-sidebar{width:250px;min-width:250px;max-width:250px;}
    .mm-l2-panels{width:260px;min-width:260px;max-width:260px;}
    .mm-panel{
        position:absolute;
        top:135%;
        left:0;
        width:126%;
    }    
}

/* Wide: 1601px+ */
@media(min-width:1601px){
    .mm-sidebar{width:280px;min-width:280px;max-width:280px;}
    .mm-l2-panels{width:280px;min-width:280px;max-width:280px;}
    .mm-panel{
        position:absolute;
        top:135%;
        left:0;
        width:119%;
    }     
}

/* ══ ELEMENTOR EDITOR ══════════════════════════════════════ */
.elementor-editor-active .mm-panel{
    position:relative;opacity:1;visibility:visible;
    transform:none;pointer-events:auto;
    top:auto;box-shadow:none;border:1px dashed #ccc;
}
.elementor-editor-active .mm-overlay{display:none;}
