/*
 * Header-navigatie en mega-menu "Productcategorieën" (nieuw ontwerp).
 * Overgenomen van de shop (shop.buma.com) zodat menu en topbar op beide sites gelijk zijn.
 * Het categorieënmenu wordt gevuld door inc/shop-categories.php (bron: de shop).
 */
:root {
    --fs15: 0.9375rem;
    --fs16: 1rem;
    --fs18: 1.125rem;
    --fs24: 1.5rem;
}

@media screen and (min-width: 992px) {
    /* Zelfde als de shop: de dropdown positioneert zich t.o.v. de volle containerbreedte,
       niet t.o.v. het (smalle) menu zelf */
    header .navigatie #primary-menu,
    header .navigatie #primary-menu-ul {
        position: static;
    }

    header .navigatie .mobile-menu {
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    header .navigatie #primary-menu .menu {
        justify-content: flex-start;
        gap: 40px;
        padding-left: 12px;
    }

    /* Hoofdmenu: geen afbreekstreepjes / woorden over twee regels */
    header .navigatie #primary-menu .menu > li > a {
        white-space: nowrap;
        hyphens: none;
    }
}

/* Alleen Productcategorieën heeft een dropdown; de overige items zijn directe links */
#primary-menu-ul > li:not(.li-cats-list) > .sub-menu {
    display: none !important;
}

body > header {
    z-index: 999;
}

header .navigatie #primary-menu .menu > li.li-cats-list {
    padding: 0 30px 0 0;
    border-right: 1px solid #cecece;
    margin-right: -10px; 
}

header .navigatie #primary-menu .menu > li.li-cats-list > a {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 16px 0;
}

header .navigatie #primary-menu .menu > li.li-cats-list > a::before {
    content: '';
    width: 18px;
    height: 12px;
    flex: none;
    background: url("../img/nav-categories-icon.svg") center / contain no-repeat;
}

header .navigatie #primary-menu .menu > li:not(.li-cats-list) > a {
    padding: 5px 10px;
}

header .navigatie .nav-phone {
    display: flex;
    align-items: center;
    align-self: center;
    line-height: 0; 
}

header .navigatie .nav-phone a {
    display: inline-flex;
    align-items: center;
    gap: 12px;
    font-family: var(--mainFont);
    font-weight: 700;
    font-size: 16px;
    line-height: 21px;
    color: #01478C;
    white-space: nowrap;
}

header .navigatie .nav-phone a::before {
    content: '';
    width: 19px;
    height: 20px;
    background: url("../img/nav-phone-icon.svg") center / contain no-repeat;
}

@media screen and (max-width: 991px) {
header .navigatie .nav-phone {
        display: none;
    }
}

#primary-menu-ul .li-cats-list {
    position: static;
}

#primary-menu-ul .li-cats-list > .sub-menu {
    background-color: var(--white);
    top: 100%;
    padding-block: 15px 33px;
    width: 100%;
}

#primary-menu-ul .li-cats-list > .sub-menu::before, #primary-menu-ul .li-cats-list > .sub-menu::after {
    --w-space: calc(50vw - 50%);
    content: '';
    position: absolute;
    top: 0;
    left: calc(var(--w-space) * -1);
    height: 100%;
    width: var(--w-space);
    background: inherit;
}

#primary-menu-ul .li-cats-list > .sub-menu::after {
    width: calc(50vw + 75%);
    left: 25%;
    background-color: #F5F5F5;
    height: 100%;
    top: 0;
    border-top: 15px solid var(--white);
}

#primary-menu-ul .li-cats-list > .sub-menu > li:first-child {
    padding-top: 15px;
}

#primary-menu-ul .li-cats-list > .sub-menu > li:last-child {
    position: static;
}

#primary-menu-ul .li-cats-list > .sub-menu > li:last-child:after {
    content: '';
    width: 100vw;
    position: absolute;
    height: 53px;
    background-color: rgba(0, 0, 0, 0.5);
    top: 100%;
    left: calc((50vw - 50%) * -1);
}

#primary-menu-ul .li-cats-list > .sub-menu > .menu-item {
    width: 25%;
    display: block;
    padding-right: 15px;
}

#primary-menu-ul .li-cats-list > .sub-menu > .menu-item-has-children {
    position: static;
}

#primary-menu-ul .li-cats-list > .sub-menu > .menu-item-has-children > .sub-menu {
    width: 75%;
    right: 75%;
    left: unset;
    background: #F5F5F5;
    padding: 100px 0px 0px 50px;
    row-gap: 15px;
    height: calc(100% - 15px);
    min-height: calc(100% - 15px);
    overflow: hidden;
    top: 15px;
}

#primary-menu-ul .li-cats-list > .sub-menu > .menu-item-has-children:hover > .sub-menu {
    display: grid;
    grid-template-columns: 1fr 1fr;
    grid-auto-rows: min-content;
    gap: 20px;
    height: calc(100% - 15px);
    padding: 50px;
    padding-right: 25%;
    padding-top: 100px;
    overflow: auto;
}

#primary-menu-ul .li-cats-list > .sub-menu > .menu-item-has-children > .sub-menu .sub-menu {
    display: flex;
    position: static;
    transform: translateX(0px);
    flex-wrap: wrap;
}

#primary-menu-ul .li-cats-list > .sub-menu > .menu-item-has-children > .sub-menu .sub-menu li {
    width: 50%;
}

#primary-menu-ul .li-cats-list > .sub-menu a {
    font-size: var(--fs16) !important;
    font-weight: 500 !important;
    font-style: italic !important;
    padding-block: 7.5px;
    color: var(--black) !important;
    transition: all 150ms ease;
}

#primary-menu-ul .li-cats-list > .sub-menu > li > a {
    font-size: var(--fs15) !important;
    padding-block: 5px;
    color: rgba(0, 0, 0, 0.5) !important;
}

#primary-menu-ul .li-cats-list > .sub-menu > li > a:hover {
    color: #01478C !important;
    text-decoration: underline;
    text-underline-position: under;
    text-decoration-thickness: 2px;
}

#primary-menu-ul .li-cats-list > .sub-menu .menu-title.menu-item-has-children > a, #primary-menu-ul .li-cats-list > .sub-menu .menu-item-type-conv_html span.title {
    display: block !important;
    font-size: var(--fs24) !important;
    font-weight: 600 !important;
    padding-bottom: 10px;
    margin-bottom: 10px;
}

#primary-menu-ul .li-cats-list > .sub-menu .menu-item-type-conv_html span.title {
    opacity: 0;
    visibility: hidden;
    font-style: italic;
    line-height: inherit;
    margin-bottom: 20px;
}

#primary-menu-ul .li-cats-list > .sub-menu .menu-title.menu-item-has-children > a:after {
    content: '';
    position: absolute;
    bottom: 0;
    width: 150%;
    height: 1px;
    background-color: #E1E5EE;
    z-index: 99;
    left: 0;
}

#mobile-menu .mm-panels .menu-item-type-conv_html .mega-html-contact > *:not(img), #primary-menu-ul .li-cats-list > .sub-menu .menu-item-type-conv_html .mega-html-contact > *:not(img) {
    margin-left: 20px;
}

#mobile-menu .mm-panels .menu-item-type-conv_html .mega-html-contact > h3, #primary-menu-ul .li-cats-list > .sub-menu .menu-item-type-conv_html .mega-html-contact > h3 {
    margin-block: 25px 5px;
    font-size: var(--fs18);
    font-weight: 700;
    color: var(--blue);
}

#mobile-menu .mm-panels .menu-item-type-conv_html .mega-html-contact > p, #primary-menu-ul .li-cats-list > .sub-menu .menu-item-type-conv_html .mega-html-contact > p {
    margin-bottom: 15px;
}

#mobile-menu .mm-panels .menu-item-type-conv_html .mega-html-contact > .main-btn, #primary-menu-ul .li-cats-list > .sub-menu .menu-item-type-conv_html .mega-html-contact > .main-btn {
    font-weight: 600 !important;
    color: var(--white) !important;
    font-style: normal !important;
    max-width: 180px;
    width: 100%;
    padding-block: 15px;
    min-width: max-content;
    display: flex;
    align-items: center;
    justify-content: center;
}

#mobile-menu .mm-panels .menu-item-type-conv_html .mega-html-contact > .main-btn::before, #primary-menu-ul .li-cats-list > .sub-menu .menu-item-type-conv_html .mega-html-contact > .main-btn::before {
    content: '';
    width: 19px;
    height: 19px;
    display: inline-block;
    background: url('../img/white-phone-icon.svg') center/contain no-repeat;
    margin-right: 15px;
}

#primary-menu-ul > li.li-cats-list > a::after {
    content: none;
    display: none;
}

#primary-menu-ul .li-cats-list > .sub-menu > .menu-item-has-children:hover > a {
    text-decoration: underline;
    text-underline-position: under;
    text-decoration-thickness: 2px;
}

#primary-menu-ul .li-cats-list:hover > .sub-menu > li > a {
    color: var(--black) !important;
}

#primary-menu-ul .li-cats-list > .sub-menu:hover > li > a {
    color: rgba(0, 0, 0, 0.5) !important;
}

#primary-menu-ul .li-cats-list > .sub-menu:hover > .menu-item-has-children:hover > a, #primary-menu-ul .li-cats-list > .sub-menu:hover > li > a:hover {
    color: #01478C !important;
}

#primary-menu-ul .li-cats-list > .sub-menu > li:last-child:after {
    min-height: 53px;
    height: calc((100vh - 100%) - 153.8px) !important;
}

@media screen and (max-width: 991px) {
.mm-panels .mega-html-contact .mm-navbar, .mm-listview .menu-item-type-conv_html .mm-next {
        display: none !important;
    }
}

#primary-menu-ul .li-cats-list > .sub-menu::before {
    left: calc((var(--w-space) + -1px) * -1);
}

#primary-menu-ul .li-cats-list > .sub-menu > li:last-child:after {
    pointer-events: none;
    background-color: rgba(0, 0, 0, 0.7);
}

@media (min-width: 992px) {
#primary-menu-ul .li-cats-list > .sub-menu {
        max-height: calc(100vh - var(--cats-menu-top, 175px));
        overflow-y: auto;
        overscroll-behavior: contain;
        background: linear-gradient(90deg, #fff 25%, #F5F5F5 25%);
        
        box-shadow:
        500px 0 0 0 #f5f5f5, -500px 0 0 0 #fff,
        1000px 0 0 0 #f5f5f5, -1000px 0 0 0 #fff,
        1500px 0 0 0 #f5f5f5, -1500px 0 0 0 #fff,
        2000px 0 0 0 #f5f5f5, -2000px 0 0 0 #fff,
        2500px 0 0 0 #f5f5f5, -2500px 0 0 0 #fff;
    }
#primary-menu-ul .li-cats-list > .sub-menu::before,
    #primary-menu-ul .li-cats-list > .sub-menu::after,
    #primary-menu-ul .li-cats-list > .sub-menu > li:last-child::after {
        display: none;
    }
#primary-menu-ul > li.li-cats-list.sub-menu-open::after {
        content: "";
        display: block;
        position: fixed;
        top: var(--cats-menu-top, 175px);
        right: 0;
        bottom: 0;
        left: 0;
        width: auto;
        height: auto;
        border: 0;
        transform: none;
        background: rgba(0, 0, 0, 0.7);
        pointer-events: none;
        z-index: 99;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
header .navigatie #primary-menu .menu > li.li-cats-list {
        padding-right: 20px;
        margin-right: 0;
    }
header .navigatie #primary-menu .menu > li:not(.li-cats-list) > a {
        padding: 5px 6px;
    }
}

#primary-menu-ul .li-cats-list > .sub-menu > .menu-item-has-children:hover > .sub-menu {
    padding-top: 30px;
}

#primary-menu-ul .li-cats-list > .sub-menu > .menu-item-has-children > .sub-menu > h2.block-title {
    position: static !important;
    grid-column: 1 / -1;
    width: auto !important;
    margin-left: 0 !important;
    padding-top: 0 !important;
    margin-bottom: 10px !important;
}

#primary-menu-ul .question-box .btn-primary.call-icon {
    display: block !important;
    width: 100%;
    text-align: center;
    white-space: nowrap;
    padding: 14px 20px 14px 56px !important;
    font-size: 18px !important;
}

#primary-menu-ul .question-box .btn-primary.call-icon::after {
    left: 22px;
}

/* Topbar rechts: Inloggen + winkelwagen-icoon (links naar de shop) */
.topbar .topbar-actions-right ul {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    padding: 0;
    margin: 0;
    column-gap: 30px;
    list-style: none;
}

.topbar .topbar-actions-right ul li {
    margin: 0;
}

.topbar .topbar-actions-right ul li a {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    column-gap: 15px;
    padding: 0;
}

.topbar .topbar-actions-right ul li .menu-title {
    color: #FFF;
    font-size: 14px;
    font-style: normal;
    font-weight: 500;
    line-height: normal;
}

.topbar .topbar-actions-right ul li a:hover .menu-title {
    color: var(--yellow);
}

.topbar .topbar-actions-right ul li a:hover svg path {
    fill: var(--yellow);
}

.topbar .topbar-actions-right ul li svg {
    max-width: 19px;
    height: auto;
    object-fit: contain;
}

/* Winkelwagen: alleen icoon (label blijft beschikbaar voor screenreaders) */
header .topbar-actions-right #menu-cart .menu-title {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

@media screen and (max-width: 991px) {
    /* Mobiel (zoals de shop): Inloggen- en winkelwagen-icoon rechts op de logo-regel,
       de zoekbalk eronder. De kop is hier omgedraaid (navigatie boven, topbar eronder),
       dus de iconen worden t.o.v. de topbar naar boven gezet. */
    header .topbar .row,
    header .topbar .row > div,
    header .topbar .topbar-cont {
        position: static;
    }

    header .topbar {
        overflow: visible; /* anders knipt de topbar de omhoog geplaatste iconen af */
    }

    header .topbar .topbar-actions-right {
        position: absolute;
        top: -51.3px;
        right: 12px;
        z-index: 101;
    }

    .topbar .topbar-actions-right ul {
        column-gap: 20px;
        padding-right: 10px;
    }

    /* Maten gelijk aan de shop: logo-regel 74 px, zoekbalk 38 px */
    header .navigatie nav {
        padding-top: 14.8px;
        padding-bottom: 25.2px;
    }

    header .topbar {
        padding-bottom: 10px;
    }

    header .topbar .row > div,
    header.nax-scroll-resize .topbar .row > div.col-md-5.col-md-5 {
        padding-left: 12px;
        padding-right: 12px;
    }

    /* Tablet (768-991 px): zoekbalk over de volle breedte, niet 5/12 van de kolom */
    header.nax-scroll-resize .topbar .row > div.col-md-5.col-md-5 {
        flex: 0 0 100%;
        max-width: 100%;
        width: 100%;
    }

    /* Logo: 34 px hoog, gecentreerd tussen hamburger en iconen */
    header .navigatie #logo {
        box-sizing: border-box;
        padding-left: 20px;
        padding-right: 55px;
    }

    div#logo a {
        height: 34px;
    }

    #logo img {
        height: 34px;
        width: auto;
        max-height: none;
    }

    /* Hamburger: dezelfde streepjes (21 x 3,6 px, afgerond) en plek als op de shop */
    .mobile-menu-toggle-position {
        left: 6.4px;
        top: 12.6px;
        height: 21.4px;
    }

    button.menu-toggle {
        width: 22px;
        height: 21.4px;
        background-image: url("../img/ham-menu-closed-v2.svg");
    }

    /* Zoekbalk: compacter, zoals op de shop */
    #buma-wcas-search-input {
        padding: 7px 20px;
        font-size: 15px;
        width: calc(100% - 120px);
    }

    .topbar .dgwt-wcas-sf-wrapp button.dgwt-wcas-search-submit {
        column-gap: 11px;
        min-height: 38px;
        padding: 8.5px 20px;
        font-size: 14px;
        font-weight: 700;
    }

    .topbar .topbar-actions-right ul li .menu-title {
        display: none;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .topbar .topbar-actions-right ul {
        gap: 10px;
    }

    .topbar .topbar-actions-right ul li a {
        gap: 5px;
    }
}
