/* ==========================================================================
   HM Royal Mega Menu  v1.4.0
   ========================================================================== */

:root {
    --hmr-navy:      #003369;
    --hmr-navy-dark: #152448;
    --hmr-red:       #cc2229;
    --hmr-white:     #ffffff;
    --hmr-text:      #222222;
    --hmr-link:      #1a2e5a;
    --hmr-link-hover:#cc2229;
    --hmr-border:    #d8dde6;
    --hmr-experts-bg:#F4F4F4;
    --hmr-z:         9999;
    --hmr-speed:     150ms;
}

/* -- Make the nav bar the positioning context for the dropdown ------------- */
.navbar,
.site-header nav,
nav.navbar,
#masthead nav,
header nav {
    position: relative;
}

/* -- The Products <li> ------------------------------------------------------ */
.hmr-mega-menu-item {
    position: static !important;
}

/* ==========================================================================
   DESKTOP — mega menu hidden via visibility/opacity, shown by JS .is-open
   ========================================================================== */

.hmr-mega-menu {
    display:         flex;
    visibility:      hidden;
    opacity:         0;
    pointer-events:  none;
    position:        absolute;
    top:             100%;
    left:            50%;
    transform:       translateX(-50%);
    width:           95%;
    z-index:         var(--hmr-z);
    flex-direction:  row;
    align-items:     stretch;
    background:      var(--hmr-white);
    box-shadow:      0 6px 20px rgba(0,0,0,.15);
    border-top:      3px solid var(--hmr-red);
    margin-left:     0;
    margin-right:    0;
    transition:      opacity var(--hmr-speed) ease,
                     visibility var(--hmr-speed) ease;
    transition-delay: 0ms;
}

.hmr-mega-menu-item.is-open > .hmr-mega-menu {
    visibility:       visible;
    opacity:          1;
    pointer-events:   auto;
    transition-delay: 0ms;
}

/* -- Left tab rail --------------------------------------------------------- */
.hmr-mega__tabs {
    display:        flex;
    flex-direction: column;
    background:     var(--hmr-navy);
    min-width:      210px;
    flex-shrink:    0;
    padding-top:    3.25rem;
}

.hmr-mega__tab {
    appearance:  none;
    border:      none;
    background:  transparent;
    color:       rgba(255,255,255,.7);
    font-size:   .875rem;
    font-weight: 600;
    line-height: 1.3;
    text-align:  left;
    padding:     1.1rem 1.25rem;
    cursor:      pointer;
    transition:  background var(--hmr-speed), color var(--hmr-speed);
    border-left: 3px solid transparent;
}

.hmr-mega__tab:hover {
    background: var(--hmr-navy-dark);
    color:      var(--hmr-white);
}

.hmr-mega__tab--active {
    background: var(--hmr-white);
    color:      var(--hmr-text);
}

/* -- Centre panels --------------------------------------------------------- */
.hmr-mega__panels {
    flex:      1;
    padding:   1.5rem 2rem;
    min-width: 0;
}

.hmr-mega__panel[hidden] {
    display: none;
}

.hmr-mega__panel-title {
    font-size:     1rem;
    font-weight:   700;
    color:         var(--hmr-navy);
    margin:        0 0 1rem;
    padding-bottom:.5rem;
    border-bottom: 3px solid var(--hmr-border);
}

#hmr-panel-manufacturer .hmr-mega__panel-title {
    border-bottom:  none;
    padding-bottom: 0;
}

/* -- Lists ----------------------------------------------------------------- */
.hmr-mega__list {
    list-style:    none;
    margin:        0;
    padding:       0;
    display:       grid;
    gap:           .5rem 2.5rem;
    margin-bottom: 30px;
}

.hmr-mega__list--two-col   { grid-template-columns: repeat(2, 1fr); }
.hmr-mega__list--three-col { grid-template-columns: repeat(3, 1fr); }

.hmr-mega__list li {
    display:     flex;
    align-items: baseline;
    gap:         .45rem;
}

/* Red square bullet */
.hmr-mega__list li::before {
    content:    '';
    display:    inline-block;
    width:      7px;
    height:     7px;
    min-width:  7px;
    background: var(--hmr-red);
    position:   relative;
    top:        1px;
}

.hmr-mega__list a {
    color:           var(--hmr-link);
    text-decoration: none;
    font-size:       .875rem;
    line-height:     1.55;
    font-weight:     200 !important;
    transition:      color var(--hmr-speed);
}

.hmr-mega__list a:hover {
    color:           var(--hmr-link-hover);
    text-decoration: underline;
}

.hmr-mega__divider {
    border:     none;
    border-top: 3px solid #757d8d;
    margin:     1.25rem 0;
}

.hmr-mega__list--most-viewed a {
    font-weight: 600;
}

/* -- Right expert panel ---------------------------------------------------- */
.hmr-mega__experts {
    background:  var(--hmr-experts-bg);
    min-width:   318px;
    max-width:   360px;
    flex-shrink: 0;
    display:     flex;
    align-items: flex-start;
}

.hmr-mega__experts-inner {
    padding:     1.5rem 1.25rem;
    width:       100%;
    display:     flex;
    flex-wrap:   wrap;
    align-items: center;
    gap:         0 0.55rem;
}

.hmr-mega__experts-icon {
    display:         inline-flex;
    align-items:     center;
    justify-content: center;
    width:           2rem;
    height:          2rem;
    border-radius:   50%;
    background:      var(--hmr-navy);
    color:           var(--hmr-white);
    font-weight:     700;
    font-size:       1.55rem;
    font-family:     sans-serif;
    flex-shrink:     0;
    align-self:      center;
    margin-bottom:   0;
    border:          2px solid #c9def5;
}

.hmr-mega__experts-title {
    flex:        1;
    font-size:   1.05rem;
    font-weight: 700;
    color:       var(--hmr-text);
    margin:      0;
}

.hmr-mega__experts-sub {
    font-size:    .8rem;
    color:        #555;
    margin:       0 0 .9rem;
    line-height:  1.4;
    width:        100%;
    padding-left: calc(2rem + 0.55rem);
}

/* Grouped CTA links */
.hmr-mega__experts-links {
    list-style:     none;
    margin:         0;
    padding:        7px;
    padding-left:   calc(2rem + 0.55rem);
    width:          100%;
    display:        flex;
    flex-direction: column;
    border:         1px solid var(--hmr-border);
    border-radius:  6px;
    overflow:       hidden;
    background:     var(--hmr-white);
}

.hmr-mega__experts-links li::before {
    display: none;
}

.hmr-mega__experts-links li {
    border-bottom: 1px solid var(--hmr-border);
}

.hmr-mega__experts-links li:last-child {
    border-bottom: none;
}

.hmr-mega__experts-links a {
    display:         flex;
    align-items:     center;
    justify-content: space-between;
    background:      var(--hmr-white);
    color:           var(--hmr-text);
    font-size:       .85rem;
    font-weight:     400;
    text-decoration: none;
    transition:      background var(--hmr-speed), color var(--hmr-speed);
    white-space:     nowrap;
    border:          none;
    border-radius:   0;
}

.hmr-mega__experts-links a:hover {
    background: #f0f3f8;
    color:      var(--hmr-navy);
}

.hmr-mega__experts-arrow {
    font-size:   1.55rem;
    line-height: 1;
    margin-left: .5rem;
    color:       var(--hmr-navy);
    font-family: system-ui;
}

/* ==========================================================================
   MOBILE — Bootstrap navbar-expand-xl collapses below 1200px
   ========================================================================== */
@media ( max-width: 1199px ) {

    /* Switch from visibility/opacity to display so menu sits in document flow
       inside the collapsed Bootstrap navbar — visibility trick doesn't work
       for in-flow content */
    .hmr-mega-menu {
        display:        none !important;   /* hidden by default in mobile flow */
        visibility:     visible !important;
        opacity:        1 !important;
        pointer-events: auto !important;
        /* Reset absolute positioning */
        position:       static;
        transform:      none;
        width:          100%;
        flex-direction: column;
        box-shadow:     none;
        border-top:     none;
        border-left:    3px solid var(--hmr-red);
        margin:         .5rem 0;
    }

    /* JS adds .is-open — switch to flex so content is visible */
    .hmr-mega-menu-item.is-open > .hmr-mega-menu {
        display: flex !important;
    }

    /* Tabs run horizontally */
    .hmr-mega__tabs {
        flex-direction: row;
        padding-top:    0;
        min-width:      0;
    }

    .hmr-mega__tab {
        flex:          1;
        text-align:    center;
        padding:       .75rem .5rem;
        font-size:     .8rem;
        border-left:   none;
        border-bottom: 3px solid transparent;
    }

    .hmr-mega__tab--active {
        background:    var(--hmr-navy-dark);
        color:         var(--hmr-white);
        border-left:   none;
        border-bottom: 3px solid var(--hmr-red);
    }

    /* Single column lists */
    .hmr-mega__list--two-col,
    .hmr-mega__list--three-col {
        grid-template-columns: 1fr;
    }

    /* Expert panel full width, no side border */
    .hmr-mega__experts {
        border-left: none;
        border-top:  1px solid var(--hmr-border);
        max-width:   none;
        width:       100%;
    }

    /* Remove icon indent — too tight on small screens */
    .hmr-mega__experts-sub,
    .hmr-mega__experts-links {
        padding-left: 0;
    }
}
