/* =======================================================
   FLATSOME MEGA MENU v3 — Frontend Styles (Refined)
   All colours/sizes driven by CSS variables injected by PHP
======================================================= */

:root {
    --fmm-blue:        #109CDE;
    --fmm-blue-dk:     #0b7db8;
    --fmm-blue-lt:     #e6f5fc;
    --fmm-text:        #1a1a1a;
    --fmm-muted:       #555555;
    --fmm-border:      #e4e4e4;
    --fmm-col1-bg:     #f4f6f9;
    --fmm-col2-bg:     #ffffff;
    --fmm-col3-bg:     #ffffff;
    --fmm-col1-w:      200px;
    --fmm-col2-w:      220px;
    --fmm-panel-max:   1140px;
    --fmm-radius:      6px;
    --fmm-fs-col1:     13px;
    --fmm-fs-col2:     13px;
    --fmm-fs-col3-h:   12.5px;
    --fmm-fs-col3-li:  12.5px;
    --fmm-mobile-bp:   900px;
    --fmm-ease:        0.15s ease;
    --fmm-shadow:      0 8px 32px rgba(0,0,0,.13), 0 2px 8px rgba(0,0,0,.06);
}

/* ─── Trigger ─── */
.fmm-nav {
    position: relative;
    display: inline-flex;
    align-items: center;
    font-family: inherit;
    z-index: 9000;
}

.fmm-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    background: var(--fmm-blue);
    color: #fff;
    border: none;
    padding: 0 16px;
    height: 44px;
    font-size: var(--fmm-fs-col1);
    font-weight: 700;
    letter-spacing: .3px;
    text-transform: uppercase;
    cursor: pointer;
    border-radius: var(--fmm-radius);
    transition: background var(--fmm-ease);
    white-space: nowrap;
    user-select: none;
    -webkit-font-smoothing: antialiased;
    line-height: 1;
}
.fmm-trigger:hover,
.fmm-trigger[aria-expanded="true"] { background: var(--fmm-blue-dk); }

/* Burger */
.fmm-burger {
    display: flex;
    flex-direction: column;
    gap: 4px;
    width: 15px;
    flex-shrink: 0;
}
.fmm-burger span {
    display: block;
    height: 2px;
    background: #fff;
    border-radius: 2px;
    transform-origin: center;
    transition: transform var(--fmm-ease), opacity var(--fmm-ease), width var(--fmm-ease);
}
.fmm-trigger[aria-expanded="true"] .fmm-burger span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.fmm-trigger[aria-expanded="true"] .fmm-burger span:nth-child(2) { opacity: 0; width: 0; }
.fmm-trigger[aria-expanded="true"] .fmm-burger span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

.fmm-trigger-arrow {
    flex-shrink: 0;
    display: block;
    transition: transform var(--fmm-ease);
}
.fmm-trigger[aria-expanded="true"] .fmm-trigger-arrow { transform: rotate(180deg); }

/* ─── Panel ─── */
.fmm-panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    display: flex;
    width: min(var(--fmm-panel-max), 94vw);
    background: var(--fmm-col2-bg);
    border: 1px solid #dde3ea;
    border-radius: 0 var(--fmm-radius) var(--fmm-radius) var(--fmm-radius);
    box-shadow: var(--fmm-shadow);
    max-height: 80vh;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
    z-index: 8999;
    will-change: opacity, transform;
}
.fmm-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}
/* Top accent stripe */
.fmm-panel::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--fmm-blue) 0%, var(--fmm-blue-dk) 100%);
    z-index: 1;
    pointer-events: none;
}

/* ─── Column 1: Groups ─── */
.fmm-col1 {
    width: var(--fmm-col1-w);
    min-width: var(--fmm-col1-w);
    max-width: var(--fmm-col1-w);
    background: var(--fmm-col1-bg);
    border-right: 1px solid var(--fmm-border);
    list-style: none;
    margin: 0;
    padding: 11px 0 8px;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #c5cdd8 transparent;
    overscroll-behavior: contain;
}
.fmm-col1::-webkit-scrollbar { width: 3px; }
.fmm-col1::-webkit-scrollbar-thumb { background: #c5cdd8; border-radius: 3px; }

.fmm-c1-item { margin: 0; padding: 0; list-style: none; }

.fmm-c1-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    width: 100%;
    background: none;
    border: none;
    border-left: 3px solid transparent;
    padding: 8px 10px 8px 14px;
    font-size: var(--fmm-fs-col1);
    font-weight: 500;
    color: #374151;
    text-align: left;
    cursor: pointer;
    line-height: 1.4;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
    -webkit-font-smoothing: antialiased;
}
.fmm-c1-btn:hover {
    background: rgba(16,156,222,.07);
    color: var(--fmm-blue);
    border-left-color: rgba(16,156,222,.35);
}
.fmm-c1-item.is-active .fmm-c1-btn {
    background: var(--fmm-col2-bg);
    color: var(--fmm-blue);
    font-weight: 700;
    border-left-color: var(--fmm-blue);
}
.fmm-c1-icon  { font-size: 15px; flex-shrink: 0; line-height: 1; display: block; }
.fmm-c1-label { flex: 1; min-width: 0; }
/* FIX: display:block prevents SVG baseline misalignment */
.fmm-c1-item .fmm-chevron {
    display: block;
    margin-left: auto;
    flex-shrink: 0;
    opacity: .25;
    transition: opacity .12s ease;
}
.fmm-c1-item.is-active .fmm-chevron,
.fmm-c1-btn:hover .fmm-chevron { opacity: .7; }

/* ─── Column 2: Categories ─── */
.fmm-col2-wrap {
    width: var(--fmm-col2-w);
    min-width: var(--fmm-col2-w);
    max-width: var(--fmm-col2-w);
    background: var(--fmm-col2-bg);
    border-right: 1px solid var(--fmm-border);
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
    scrollbar-color: #c5cdd8 transparent;
    overscroll-behavior: contain;
}
.fmm-col2-wrap::-webkit-scrollbar { width: 3px; }
.fmm-col2-wrap::-webkit-scrollbar-thumb { background: #c5cdd8; border-radius: 3px; }

.fmm-col2 {
    display: none;
    list-style: none;
    margin: 0;
    padding: 11px 0 8px;
}
.fmm-col2.is-active {
    display: block;
    animation: fmmSlide .12s ease;
}
.fmm-c2-none { padding: 16px; font-size: 13px; color: var(--fmm-muted); }
.fmm-c2-item { margin: 0; padding: 0; list-style: none; }

.fmm-c2-link {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 7px 10px 7px 16px;
    font-size: var(--fmm-fs-col2);
    color: #374151;
    text-decoration: none;
    border-left: 3px solid transparent;
    transition: background .12s ease, color .12s ease, border-color .12s ease;
    line-height: 1.4;
    -webkit-font-smoothing: antialiased;
}
.fmm-c2-link:hover {
    background: rgba(16,156,222,.05);
    color: var(--fmm-blue);
    text-decoration: none;
}
.fmm-c2-item.is-active .fmm-c2-link {
    background: rgba(16,156,222,.07);
    color: var(--fmm-blue);
    font-weight: 600;
    border-left-color: var(--fmm-blue);
}
.fmm-c2-icon { font-size: 14px; flex-shrink: 0; line-height: 1; display: block; }
/* FIX: display:block prevents SVG baseline misalignment */
.fmm-c2-item .fmm-chevron {
    display: block;
    margin-left: auto;
    flex-shrink: 0;
    opacity: .2;
    transition: opacity .12s ease;
}
.fmm-c2-item.is-active .fmm-chevron,
.fmm-c2-link:hover .fmm-chevron { opacity: .65; }

/* ─── Column 3: Subcategories ─── */
.fmm-col3-wrap {
    flex: 1;
    background: var(--fmm-col3-bg);
    overflow-y: auto;
    scrollbar-width: thin;
    scrollbar-color: #c5cdd8 transparent;
    overscroll-behavior: contain;
}
.fmm-col3-wrap::-webkit-scrollbar { width: 4px; }
.fmm-col3-wrap::-webkit-scrollbar-thumb { background: #c5cdd8; border-radius: 3px; }

.fmm-col3 {
    display: none;
    padding: 18px 24px 22px;
}
.fmm-col3.is-active {
    display: block;
    animation: fmmFade .13s ease;
}

@keyframes fmmFade  { from { opacity:0; transform:translateX(4px); } to { opacity:1; transform:none; } }
@keyframes fmmSlide { from { opacity:0; transform:translateY(3px); } to { opacity:1; transform:none; } }

/* View All header link */
.fmm-view-all {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 700;
    color: var(--fmm-blue);
    text-decoration: none;
    margin-bottom: 16px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--fmm-blue);
    transition: color .12s ease, border-color .12s ease;
    -webkit-font-smoothing: antialiased;
}
.fmm-view-all:hover {
    color: var(--fmm-blue-dk);
    border-bottom-color: var(--fmm-blue-dk);
    text-decoration: none;
}
.fmm-va-icon { font-size: 16px; }

/* Sub-grid */
.fmm-sub-grid {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 0 24px;
    width: 100%;
}
.fmm-sub-col-wrap {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}
.fmm-sub-col {
    margin-bottom: 16px;
}
.fmm-sub-col + .fmm-sub-col {
    padding-top: 14px;
    border-top: 1px solid #eff1f4;
}

/* Sub heading — bold, dark, underlined */
.fmm-sub-h {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: calc(var(--fmm-fs-col3-h) + 1.5px);
    font-weight: 700;
    color: #1e2a38;
    text-decoration: none;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid #d1d5db;
    line-height: 1.3;
    transition: color .12s ease;
    -webkit-font-smoothing: antialiased;
}
.fmm-sub-h:hover { color: var(--fmm-blue); text-decoration: none; }
.fmm-sub-icon { font-size: 13px; flex-shrink: 0; display: block; }

/* Sub list */
.fmm-sub-list {
    list-style: none;
    margin: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    gap: 1px;
}
.fmm-sub-list li {
    margin: 0;
    padding: 0;
    border: none;
    list-style: none;
}
.fmm-sub-list a {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: var(--fmm-fs-col3-li);
    font-weight: 400;
    color: #6b7280;
    text-decoration: none;
    line-height: 1.7;
    border: none;
    transition: color .1s ease, padding-left .1s ease;
    -webkit-font-smoothing: antialiased;
    padding-left: 0;
}
.fmm-sub-list a:hover {
    color: var(--fmm-blue);
    text-decoration: none;
    padding-left: 3px;
}

/* Icon types */
.fmm-icon-emoji { font-style: normal; }
.fmm-icon.dashicons { font-size: inherit; width: auto; height: auto; line-height: 1; display: inline-block; }

/* Empty state */
.fmm-empty-state { padding: 32px; font-size: 14px; color: var(--fmm-muted); text-align: center; }
.fmm-empty-state a { color: var(--fmm-blue); font-weight: 600; }

/* ─── Mobile: hide label ─── */
@media (max-width: 900px) {
    .fmm-trigger.fmm-hide-label-mobile .fmm-trigger-label,
    .fmm-trigger.fmm-hide-label-mobile .fmm-trigger-arrow { display: none; }
    .fmm-trigger.fmm-hide-label-mobile {
        padding: 0 12px;
        min-width: 44px;
        justify-content: center;
    }
}

.fmm-mobile-close { display: none; }

/* ─── Overlay ─── */
.fmm-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,.18);
    z-index: 8998;
    cursor: default;
}
.fmm-overlay.is-visible {
    display: block;
    animation: fmmFadeOverlay .2s ease;
}
@keyframes fmmFadeOverlay { from{opacity:0} to{opacity:1} }

/* ─── Mobile — full-screen drill-down ─── */
@media (max-width: 900px) {
    .fmm-panel {
        position: fixed;
        top: 0; left: 0;
        width: 100vw;
        height: 100dvh;
        max-height: 100dvh;
        max-width: 100vw;
        border-radius: 0;
        border: none;
        flex-direction: column;
        transform: translateX(-100%);
        transition: transform .22s ease;
        z-index: 99999;
        overflow: hidden;
    }
    .fmm-panel::before { display: none; }
    .fmm-panel.is-open { opacity: 1; transform: translateX(0); }

    .fmm-mobile-close {
        display: flex;
        align-items: center;
        justify-content: space-between;
        padding: 12px 16px;
        background: var(--fmm-blue);
        color: #fff;
        font-size: 14px;
        font-weight: 700;
        flex-shrink: 0;
        cursor: pointer;
    }
    .fmm-mobile-close-btn {
        background: none;
        border: none;
        color: #fff;
        font-size: 22px;
        cursor: pointer;
        line-height: 1;
        padding: 0 4px;
    }

    .fmm-col1 {
        width: 100%; min-width: 0; max-width: 100%;
        display: flex; flex-direction: column;
        overflow-y: auto; overflow-x: hidden;
        border-right: none; border-bottom: 1px solid var(--fmm-border);
        padding: 4px 0; gap: 0; flex-shrink: 0; max-height: 35vh;
    }
    .fmm-c1-item { flex-shrink: 0; width: 100%; }
    .fmm-c1-btn {
        border-left: 3px solid transparent; border-bottom: none;
        padding: 11px 14px; font-size: 14px; white-space: normal;
        border-radius: 0; width: 100%; justify-content: space-between;
    }
    .fmm-c1-item.is-active .fmm-c1-btn {
        border-left-color: var(--fmm-blue); border-bottom: none; background: var(--fmm-blue-lt);
    }
    .fmm-c1-item .fmm-chevron { display: block; }

    .fmm-col2-wrap {
        width: 100%; min-width: 0; max-width: 100%;
        border-right: none; border-bottom: 1px solid var(--fmm-border);
        overflow-x: hidden; overflow-y: auto; flex-shrink: 0; max-height: 30vh;
    }
    .fmm-col2 { display: none; flex-direction: column; flex-wrap: nowrap; padding: 4px 0; gap: 0; }
    .fmm-col2.is-active { display: flex; }
    .fmm-c2-item { flex-shrink: 0; width: 100%; }
    .fmm-c2-link {
        border-left: 3px solid transparent; border-bottom: none;
        padding: 10px 14px; font-size: 13.5px; white-space: normal;
        border-radius: 0; width: 100%;
    }
    .fmm-c2-item.is-active .fmm-c2-link {
        border-left-color: var(--fmm-blue); border-bottom: none; background: var(--fmm-blue-lt);
    }
    .fmm-c2-item .fmm-chevron { display: block; }

    .fmm-col3-wrap { flex: 1; overflow-y: auto; overflow-x: hidden; }
    .fmm-col3 { padding: 14px 16px; }

    .fmm-sub-grid { flex-direction: column; gap: 0; }
    .fmm-sub-col-wrap { width: 100%; flex: none; }
    .fmm-sub-col { margin-bottom: 16px; }
    .fmm-sub-col + .fmm-sub-col { padding-top: 16px; border-top: 1px solid var(--fmm-border); }

    .fmm-sub-list a:hover { padding-left: 0; }
}

/* ─── Flatsome overflow fix ─── */
.header-inner, .header-main, .header-bottom,
.header .row, .header .col,
.is-sticky .header-inner { overflow: visible !important; }