/* FE Mega Menu – frontend styles
   Compatible with classic themes AND block/FSE themes (Bagberry etc.) */

/* ─────────────── Trigger item ─────────────── */
.has-mega-menu {
    position: relative;
}

/* Arrow added by JS */
.fmm-nav-arrow {
    font-size: 9px;
    display: inline-block;
    margin-left: 4px;
    transition: transform .25s ease;
    vertical-align: middle;
    line-height: 1;
    pointer-events: none;
}
.has-mega-menu.fmm-open .fmm-nav-arrow {
    transform: rotate(180deg);
}

/* ─────────────── Panel ─────────────── */
.fmm-panel {
    display: none;
    position: fixed;    /* spans full viewport width */
    left: 0;
    right: 0;
    /* top is set by JS */
    background: #fff;
    box-shadow: 0 10px 40px rgba(0, 0, 0, .14);
    z-index: 999999;    /* above block-theme nav overlays */
    animation: fmmFadeIn .2s ease both;
    overflow: visible;
}
@keyframes fmmFadeIn {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Show when parent has fmm-open class */
.has-mega-menu.fmm-open > .fmm-panel {
    display: block;
}

/* ─────────────── Inner layout ─────────────── */
.fmm-inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 36px 32px 44px;
    display: flex;
    gap: 48px;
    align-items: flex-start;
}

/* Bridge the gap so mouse can travel from nav item to panel without closing */
.has-mega-menu::after {
    content: '';
    position: fixed;
    left: 0;
    right: 0;
    height: 20px; /* match your margin-top value */
    top: auto;
    z-index: 999998;
    display: none;
}

.has-mega-menu.fmm-open::after {
    display: block;
}


/* Remove margin-top from .fmm-panel, use this instead */
.fmm-inner {
    padding-top: 50px; /* ← controls the visual space from nav to content */
}
/* ─────────────── Link columns ─────────────── */
.fmm-links {
    display: flex;
    gap: 48px;
    flex: 1 1 auto;
}

.fmm-col {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
    min-width: 150px;
    margin: 0;
    padding: 0;
}

.fmm-col a {
    color: #222 !important;         /* override block-theme link colours */
    text-decoration: none !important;
    font-size: 15px !important;
    line-height: 24px !important;
    display: block;
    transition: color .15s, padding-left .15s;
    background: none !important;    /* block themes sometimes add bg */
    padding: 0 !important;
}
.fmm-col a:hover {
/*     color: #cc1b1b !important; */
    padding-left: 0px !important;
	padding: 0px !important;
}

/* ─────────────── Divider ─────────────── */
.fmm-divider {
    width: 1px;
    background: #e8e8e8;
    align-self: stretch;
    flex-shrink: 0;
}

/* ─────────────── Image cards ─────────────── */
.fmm-cards {
    display: flex;
    gap: 16px;
    flex-shrink: 0;
}

.fmm-card {
    display: block;
    text-decoration: none !important;
    width: 210px;
}

.fmm-card-img {
    width: 210px;
    height: 148px;
    overflow: hidden;
    background: #e8e8e8;
}
.fmm-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .35s ease;
    display: block;
}
.fmm-card:hover .fmm-card-img img {
    transform: scale(1.05);
}

.fmm-card-label {
    display: block;
    margin-top: 9px;
    font-size: 13px !important;
    font-weight: 500;
    color: #222 !important;
    text-align: center;
}

/* ─────────────── Responsive (mobile) ─────────────── */
@media (max-width: 900px) {

    .fmm-panel {
        position: static !important;
        top: auto !important;
        box-shadow: none;
        border-top: none;
        border-left: 3px solid #cc1b1b;
        margin-left: 12px;
        animation: none;
        z-index: 1;
    }

    .fmm-inner {
        flex-direction: column;
        padding: 12px 16px 20px;
        gap: 20px;
    }

    .fmm-links { flex-direction: column; gap: 0; }
    .fmm-col   { gap: 0; }
    .fmm-col a {
        padding: 9px 0 !important;
        border-bottom: 1px solid #eee;
    }

    .fmm-divider { display: none; }

    .fmm-cards { flex-wrap: wrap; gap: 12px; }
    .fmm-card  { width: calc(50% - 6px); }
    .fmm-card-img { width: 100%; height: 110px; }
}
