/* ============================================================
   Nimba header — layout, color, and breakpoints
   Desktop ≥1400 | Laptop 1200–1399 | Tablet/Mobile ≤1199
   ============================================================ */

:root {
    --nmc-header-ink: #16141c;
    --nmc-header-ink-soft: rgba(18, 16, 22, 0.94);
    --nmc-header-glass: rgba(22, 20, 28, 0.62);
    --nmc-header-line: rgba(255, 255, 255, 0.12);
    --nmc-header-link: rgba(255, 255, 255, 0.9);
    --nmc-header-link-strong: #fff;
    --nmc-header-accent: var(--base-skin, #ffa623);
}

#masthead {
    position: relative;
    z-index: 1000;
}

#masthead.header--with-hero {
    isolation: isolate;
    overflow: visible;
    color: #fff;
}

.header-hero__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.header-hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: 58% center;
}

.header-hero__overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(90deg, rgba(0, 0, 0, 0.78) 0%, rgba(0, 0, 0, 0.46) 42%, rgba(0, 0, 0, 0.18) 100%),
        linear-gradient(180deg, rgba(0, 0, 0, 0.38) 0%, rgba(0, 0, 0, 0.08) 28%, transparent 48%, rgba(0, 0, 0, 0.32) 100%);
}

.header-sticky-shell {
    position: fixed;
    top: var(--header-sticky-top, 0px);
    left: 0;
    right: 0;
    width: 100%;
    z-index: 1000;
    background: transparent;
    transition: background-color 0.28s ease, box-shadow 0.28s ease;
}

#masthead.header--with-hero .header-sticky-shell {
    position: fixed;
    z-index: 1000;
}

.header-sticky-spacer {
    display: block;
    width: 100%;
    height: var(--header-sticky-height, 88px);
    pointer-events: none;
}

.header-sticky-shell.is-scrolled {
    background: var(--nmc-header-ink-soft);
    box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
    backdrop-filter: saturate(1.12) blur(14px);
    -webkit-backdrop-filter: saturate(1.12) blur(14px);
}

.prt-stickable-header.fixed-header,
.fixed-header {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    width: auto !important;
    z-index: auto !important;
    animation: none !important;
    transform: none !important;
    background: transparent !important;
    box-shadow: none !important;
}

/* Logo sizing */
#masthead .top-bar-logo,
#masthead .site-navigation__logo,
#logo-imgs.site-navigation__logo {
    display: block;
    width: auto !important;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    object-position: left center;
}

#masthead .site-navigation__brand .home-link,
#masthead .top_bar__brand .home-link {
    display: flex;
    align-items: center;
    line-height: 0;
}

/* Language switcher */
#masthead .lang-switcher {
    position: relative;
    display: inline-grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    isolation: isolate;
    margin: 0;
    padding: 3px;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid var(--nmc-header-line);
    border-radius: 999px;
    line-height: 1;
}

#masthead .lang-switcher--header {
    display: none;
}

/* MMG button */
#masthead .header_btn a.prt-btn.header-mines-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    min-width: 0;
    padding: 3px;
    overflow: hidden;
    isolation: isolate;
    background: #fff;
    border: 1px solid rgba(255, 255, 255, 0.92);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
    color: #111;
}

#masthead .header-mines-btn__brand {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 3px 10px;
    border-radius: 999px;
    background: #fff;
}

#masthead .header-mines-btn__logo {
    display: block;
    width: auto;
    height: 30px;
    min-width: 0;
    max-width: 11.5rem;
    object-fit: contain;
    object-position: center;
}

#masthead .header_extra,
#masthead .header_extra > div,
#masthead .header_btn {
    margin: 0 !important;
}

#masthead .btn-show-menu-mobile {
    display: none;
}

/* ------------------------------------------------------------
   Desktop / laptop (≥1200)
   ------------------------------------------------------------ */
@media (min-width: 1200px) {
    .header-sticky-shell .site-header-menu,
    .prt-header-style-01 .site-header-menu {
        position: relative !important;
        left: auto;
        right: auto;
        margin-top: -18px;
    }

    .header-sticky-shell.is-scrolled .site-header-menu,
    .header-sticky-shell.is-scrolled .prt-header-style-01 .site-header-menu {
        margin-top: 0 !important;
    }

    .header-sticky-shell.is-scrolled .top_bar {
        display: none !important;
    }

    .header-sticky-shell.is-scrolled #site-header-menu .container,
    .header-sticky-shell.is-scrolled #site-header-menu .row,
    .header-sticky-shell.is-scrolled #site-header-menu .col-lg-12 {
        max-width: none;
        width: 100%;
        margin: 0;
        padding-top: 0;
        padding-bottom: 0;
    }

    .header-sticky-shell.is-scrolled #site-header-menu .col-lg-12 {
        padding-left: 15px;
        padding-right: 15px;
        height: auto;
        min-height: 0;
    }

    #masthead .top_bar {
        height: auto;
        line-height: normal;
        padding: 8px 0 28px;
        background: #111;
    }

    #masthead .top_bar--hero {
        background: transparent !important;
        padding: 10px 0 24px;
    }

    #masthead .top_bar_inner {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 16px;
        width: 100%;
        padding: 4px 0;
    }

    #masthead .top-bar-logo {
        height: clamp(48px, 6vw, 62px);
        max-width: min(220px, 28vw);
        margin-top: 0;
    }

    #masthead #site-header-menu .site-navigation {
        display: grid;
        grid-template-columns: minmax(0, 1fr) auto;
        align-items: center;
        gap: 16px;
        min-width: 0;
        min-height: 58px;
        padding: 0 10px 0 8px;
        border-radius: 14px;
        border: 1px solid var(--nmc-header-line);
        background: var(--nmc-header-glass);
        box-shadow:
            0 1px 0 rgba(255, 255, 255, 0.06) inset,
            0 14px 32px rgba(0, 0, 0, 0.22);
        backdrop-filter: blur(16px);
        -webkit-backdrop-filter: blur(16px);
    }

    #masthead .header-sticky-shell.is-scrolled #site-header-menu .site-navigation {
        display: grid;
        grid-template-columns: auto minmax(0, 1fr) auto;
        align-items: center;
        gap: 12px;
        width: 100%;
        min-height: 64px;
        height: 64px;
        padding: 0 4px;
        border-radius: 0;
        border: 0;
        background: transparent;
        box-shadow: none;
        backdrop-filter: none;
        -webkit-backdrop-filter: none;
    }

    #masthead .header-sticky-shell.is-scrolled .site-navigation__brand,
    #masthead .header-sticky-shell.is-scrolled .prt-header-style-01 .site-branding-02 {
        display: flex !important;
        align-items: center;
        align-self: stretch;
        height: 100%;
        padding: 0 !important;
        margin: 0 !important;
    }

    #masthead .header-sticky-shell.is-scrolled .site-navigation__brand .home-link {
        display: flex;
        align-items: center;
        height: 100%;
        max-width: min(160px, 15vw);
    }

    #masthead .header-sticky-shell.is-scrolled .site-navigation__logo,
    #masthead .header-sticky-shell.is-scrolled .site-navigation__brand a.home-link img {
        height: 36px;
        max-height: 36px;
        max-width: min(140px, 13vw);
        margin: 0 !important;
    }

    #masthead .header-sticky-shell.is-scrolled .site-navigation__menu,
    #masthead .header-sticky-shell.is-scrolled .site-header-nav {
        min-width: 0;
        display: flex;
        align-items: center;
        justify-content: center;
        height: 100%;
    }

    #masthead .header-sticky-shell.is-scrolled .site-navigation__actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        height: 100%;
        gap: 10px;
    }

    #masthead .header-sticky-shell.is-scrolled .lang-switcher--header {
        display: none !important;
    }

    #masthead .header-sticky-shell.is-scrolled .prt-header-style-01 #site-header-menu .site-navigation ul.menu {
        justify-content: center;
        margin: 0;
        height: 100%;
    }

    #masthead .header-sticky-shell.is-scrolled .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a,
    #masthead .header-sticky-shell.is-scrolled .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a.simple-menu-link,
    #masthead .header-sticky-shell.is-scrolled .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a.mega-menu-link {
        padding: 10px 9px;
        color: var(--nmc-header-link) !important;
    }

    #masthead .site-navigation__brand {
        display: none;
        align-items: center;
        min-width: 0;
    }

    .header-sticky-shell.is-scrolled .site-navigation__brand {
        display: flex !important;
    }

    #masthead .site-navigation__logo {
        height: 38px;
        max-height: 38px;
        max-width: min(148px, 14vw);
    }

    #masthead .site-navigation__menu,
    #masthead .site-header-nav,
    #masthead .site-header-nav .main-menu {
        min-width: 0;
        display: flex;
        align-items: center;
        width: 100%;
    }

    .header-sticky-shell.is-scrolled .site-navigation__menu,
    .header-sticky-shell.is-scrolled .site-header-nav {
        justify-content: center;
    }

    #masthead .site-navigation__actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        flex: 0 0 auto;
    }

    #masthead .lang-switcher--header,
    .header-sticky-shell.is-scrolled .lang-switcher--header {
        display: none !important;
    }

    .prt-header-style-01 #site-header-menu .site-navigation ul.menu {
        display: flex;
        align-items: center;
        flex-wrap: nowrap;
        margin: 0;
        min-width: 0;
        gap: 1px;
    }

    .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li {
        flex: 0 1 auto;
        min-width: 0;
    }

    .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a,
    .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a.simple-menu-link,
    .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a.mega-menu-link {
        position: relative;
        display: inline-flex;
        align-items: center;
        gap: 4px;
        padding: 15px 15px;
        border-radius: 10px;
        font-size: 12px;
        font-weight: 600;
        letter-spacing: 0.05em;
        line-height: 1.2;
        white-space: nowrap;
        color: var(--nmc-header-link) !important;
        text-decoration: none;
        transition: color 0.2s ease, background-color 0.2s ease;
    }

    #site-header-menu .site-navigation ul.menu > li > a:after,
    #site-header-menu .site-navigation ul.menu > li > a.simple-menu-link:after,
    #site-header-menu .site-navigation ul.menu > li.mega-menu-item > a.mega-menu-link:after {
        content: none !important;
    }

    .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a:hover,
    .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li:hover > a,
    .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li.active > a {
        color: var(--nmc-header-link-strong) !important;
        background: rgba(255, 166, 35, 0.16);
    }

    #site-header-menu .menu-chevron {
        width: 12px;
        height: 12px;
        opacity: 0.78;
        color: currentColor;
        flex-shrink: 0;
    }

    #site-header-menu .site-navigation ul.menu li ul.mega-submenu {
        z-index: 1001;
        padding: 8px;
        min-width: 232px;
        border: 1px solid rgba(0, 0, 0, 0.06);
        border-radius: 12px;
        box-shadow: 0 16px 40px rgba(17, 17, 17, 0.14);
        background: #fff;
    }

    #site-header-menu .site-navigation ul.menu li ul.mega-submenu li a {
        padding: 10px 12px;
        border: 0;
        border-radius: 8px;
        font-size: 13px;
        font-weight: 500;
        color: #2b2b2b;
    }

    #site-header-menu .site-navigation ul.menu li ul.mega-submenu li:hover,
    #site-header-menu .site-navigation ul.menu li ul.mega-submenu li a:hover {
        background: rgba(255, 166, 35, 0.1);
        color: var(--nmc-header-accent);
        margin-left: 0;
    }
}

@media (min-width: 1200px) and (max-width: 1399px) {
    #masthead .header-sticky-shell.is-scrolled #site-header-menu .site-navigation {
        min-height: 60px;
        height: 60px;
        gap: 8px;
    }

    #masthead .header-sticky-shell.is-scrolled .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a,
    #masthead .header-sticky-shell.is-scrolled .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a.simple-menu-link,
    #masthead .header-sticky-shell.is-scrolled .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a.mega-menu-link {
        padding: 8px 6px;
        font-size: 11px;
    }

    #masthead .header-sticky-shell.is-scrolled .site-navigation__logo,
    #masthead .header-sticky-shell.is-scrolled .site-navigation__brand a.home-link img {
        height: 32px;
        max-height: 32px;
        max-width: min(120px, 12vw);
    }
    .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a,
    .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a.simple-menu-link,
    .prt-header-style-01 #site-header-menu .site-navigation ul.menu > li > a.mega-menu-link {
        padding: 13px 7px;
        font-size: 11px;
        letter-spacing: 0.03em;
    }

    #masthead .site-navigation__logo {
        height: 34px;
        max-height: 34px;
        max-width: min(128px, 12vw);
    }

    #masthead .header-mines-btn__logo {
        height: 26px;
        max-width: 9.5rem;
    }

    #masthead .header_btn a.prt-btn.header-mines-btn {
        min-height: 38px;
    }

    #masthead #site-header-menu .site-navigation {
        gap: 10px;
    }
}

/* ------------------------------------------------------------
   Tablet / mobile (≤1199)
   ------------------------------------------------------------ */
@media (max-width: 1199px) {
    .header-sticky-shell {
        background: var(--nmc-header-ink-soft);
        box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
    }

    .header-sticky-shell .top_bar,
    .prt-header-style-01 .top_bar {
        display: none !important;
    }

    .prt-header-style-01 #site-header-menu {
        background: transparent !important;
        margin-top: 0 !important;
        position: relative !important;
    }

    .prt-header-style-01 .site-header-menu .site-navigation,
    #site-header-menu .site-navigation {
        height: 64px !important;
        min-height: 64px;
        background: transparent !important;
        border: 0 !important;
        border-radius: 0 !important;
        box-shadow: none !important;
    }

    #masthead .site-navigation {
        display: flex;
        align-items: center;
        gap: 10px;
        min-height: 64px;
        height: 64px;
        padding: 0;
        position: relative;
    }

    #masthead .site-navigation__brand,
    .prt-header-style-01 .site-branding-02 {
        display: flex !important;
        align-items: center;
        align-self: stretch;
        flex: 0 1 auto;
        max-width: min(168px, 46vw);
        height: 100%;
        padding: 0 !important;
        margin: 0 !important;
    }

    #masthead .site-navigation__brand .home-link {
        display: flex;
        align-items: center;
        height: 100%;
        max-width: 100%;
        line-height: 0;
    }

    .prt-header-style-01 .site-branding,
    #masthead .site-branding {
        padding: 0 !important;
    }

    #masthead .site-navigation__logo,
    #masthead .site-navigation__brand a.home-link img,
    #logo-imgs.site-navigation__logo {
        height: 36px;
        max-height: 36px;
        max-width: min(160px, 44vw);
        margin: 0 !important;
        vertical-align: middle;
    }

    #masthead .site-navigation__menu {
        flex: 1 1 auto;
        min-width: 0;
        position: static;
    }

    #masthead nav.main-menu.menu-mobile {
        left: 0;
        right: 0;
        width: auto;
        max-height: min(78vh, 640px);
        overflow: auto;
    }

    #masthead .site-header-nav {
        width: 100%;
    }

    #masthead .site-navigation__actions {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 8px;
        margin-left: auto;
        flex: 0 0 auto;
    }

    /* Keep the compact bar clean: no MMG on small screens */
    #masthead .header_extra,
    #masthead .header_btn {
        display: none !important;
    }

    #masthead .lang-switcher--header,
    #masthead .header-sticky-shell .lang-switcher--header,
    #masthead .header-sticky-shell.is-scrolled .lang-switcher--header {
        display: inline-grid !important;
        position: relative !important;
        top: auto !important;
        right: auto !important;
        transform: none !important;
        z-index: 2;
        flex-shrink: 0;
        margin: 0;
        align-self: center;
        overflow: hidden;
        isolation: isolate;
        grid-template-columns: 1fr 1fr;
        padding: 3px;
    }

    #masthead .lang-switcher--header .lang-switcher__slider {
        position: absolute;
        top: 3px;
        bottom: 3px;
        left: 3px;
        width: calc((100% - 6px) / 2);
        height: auto;
        border-radius: 999px;
        transform: translateX(0);
        z-index: 0;
        pointer-events: none;
    }

    #masthead .lang-switcher--header[data-active="fr"] .lang-switcher__slider {
        transform: translateX(100%);
    }

    #masthead .lang-switcher--header .lang-switcher__btn {
        position: relative;
        z-index: 1;
        min-width: 0;
        padding: 6px 8px;
    }

    #masthead .btn-show-menu-mobile.menubar {
        display: flex;
        position: relative;
        right: auto;
        top: auto;
        bottom: auto;
        z-index: 9;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        flex-shrink: 0;
    }

    #masthead .menubar-box {
        width: 30px;
        height: 14px;
        position: relative;
    }

    #site-header-menu .menu-chevron {
        display: none;
    }

    nav.main-menu ul.menu > li.mega-menu-item > ul.mega-submenu:not(.active) {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none;
        height: 0;
        overflow: hidden;
        padding-top: 0 !important;
        padding-bottom: 0 !important;
        margin: 0;
    }

    nav.main-menu ul.menu > li.mega-menu-item > ul.mega-submenu.active {
        display: block !important;
        visibility: visible !important;
        opacity: 1 !important;
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100%;
        height: auto;
        background: transparent;
        box-shadow: none;
    }
}

@media (max-width: 767px) {
    #masthead .site-navigation {
        min-height: 58px;
        height: 58px;
        padding: 0;
    }

    #masthead .site-navigation__brand {
        max-width: min(140px, 44vw);
    }

    #masthead .site-navigation__logo,
    #logo-imgs.site-navigation__logo {
        height: 32px;
        max-height: 32px;
    }

    #masthead .lang-switcher__btn {
        padding: 6px 8px;
        gap: 0;
    }

    #masthead .lang-switcher__code {
        position: absolute;
        width: 1px;
        height: 1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
    }
}

@media (max-width: 575px) {
    #masthead .site-navigation__brand {
        max-width: min(122px, 48vw);
    }

    #masthead .site-navigation__logo,
    #logo-imgs.site-navigation__logo {
        height: 28px;
        max-height: 28px;
    }

    #masthead .btn-show-menu-mobile.menubar {
        width: 38px;
        height: 38px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .header-sticky-shell,
    #masthead .site-navigation ul.menu > li > a {
        transition: none;
    }
}
