/* =============================================
   NS Mega Menu — bykenneth.nl
   Vervangt Max Mega Menu plugin
   ============================================= */

/* ── Basis nav ── */
#ns-mega-nav {
    display: flex;
    align-items: center;
}

.ns-nav__list {
    display: flex;
    align-items: center;
    gap: 0;
    list-style: none;
    margin: 0;
    padding: 0;
}

.ns-nav__item {
    position: static; /* mega is full-width, dus relative op header */
}

.ns-nav__link {
    display: flex;
    align-items: center;
    gap: 5px;
    padding: 8px 14px;
    font-size: 15px;
    font-weight: 600;
    color: #111;
    text-decoration: none;
    white-space: nowrap;
    letter-spacing: 0.01em;
    transition: color 0.15s;
    position: relative;
}

.ns-nav__link::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: #111;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 0.2s ease;
}

.ns-nav__item--current .ns-nav__link::after,
.ns-nav__item:hover .ns-nav__link::after {
    transform: scaleX(1);
}

.ns-nav__chevron {
    width: 9px;
    height: 6px;
    transition: transform 0.2s ease;
    color: #aaa;
    flex-shrink: 0;
}

.ns-nav__item--has-drop:hover .ns-nav__chevron,
.ns-nav__item--has-drop.ns-open .ns-nav__chevron {
    transform: rotate(180deg);
}

/* Hamburger — verborgen op desktop */
.ns-hamburger { display: none; }

/* ── Dropdowns: basis ── */
.ns-mega,
.ns-dropdown {
    position: fixed;
    top: var(--header-height, 64px);
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    box-shadow: 0 12px 40px rgba(0,0,0,0.08);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s;
    z-index: 99998;
    pointer-events: none;
}

.ns-nav__item--has-drop:hover .ns-mega,
.ns-nav__item--has-drop:hover .ns-dropdown,
.ns-nav__item--has-drop.ns-open .ns-mega,
.ns-nav__item--has-drop.ns-open .ns-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: all;
}

/* ── Mega dropdown inner ── */
.ns-mega__inner {
    display: grid;
    grid-template-columns: 180px auto auto;
    justify-content: start;
    width: 75%;
    margin: 0 auto;
    padding: 0;
}

@media screen and (max-width: 1450px) {
    .ns-mega__inner {
        width: 90%;
    }
}

/* Als er geen featured foto is: cats neemt auto, brands de rest */
.ns-mega__inner--no-featured {
    grid-template-columns: auto 1fr;
}

/* Featured foto links */
.ns-mega__featured {
    position: relative;
    overflow: hidden;
    background: #f5f5f5;
}

.ns-mega__featured-link {
    display: block;
    width: 100%;
    height: 100%;
}

.ns-mega__featured img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.4s ease;
}

.ns-mega__featured:hover img { transform: scale(1.03); }

.ns-mega__featured-label {
    position: absolute;
    bottom: 20px;
    left: 20px;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #fff;
    background: rgba(0,0,0,0.5);
    padding: 6px 12px;
    backdrop-filter: blur(4px);
}

/* Categoriekolommen */
.ns-mega__cats {
    display: flex;
    gap: 0;
    padding: 24px 32px;
    border-left: 1px solid #f5f5f5;
    border-right: 1px solid #f5f5f5;
}

ul.ns-mega__col {
    display: block !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    min-width: 200px;
}

.ns-mega__col + .ns-mega__col {
    padding-left: 32px;
}

ul.ns-mega__col > li {
    display: block !important;
    width: 100% !important;
    margin-bottom: 4px;
    float: none !important;
}

.ns-mega__col > li > a.ns-mega__cat-link {
    display: block !important;
    width: 100% !important;
    padding: 5px 0;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: #333;
    text-decoration: none;
    transition: color 0.15s, padding-left 0.15s;
    border-bottom: 1px solid transparent;
    white-space: nowrap;
}

.ns-mega__cat-link:hover {
    color: #111;
    padding-left: 6px;
    border-bottom-color: #111;
}

.ns-mega__cat-icon {
    width: 18px;
    height: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0.5;
    transition: opacity 0.15s;
}
.ns-mega__cat-link:hover .ns-mega__cat-icon { opacity: 1; }

.ns-mega__cat-icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    filter: grayscale(100%);
    transition: filter 0.15s;
}
.ns-mega__cat-link:hover .ns-mega__cat-icon img { filter: none; }

/* Merkspotlights rechts */
.ns-mega__brands {
    display: flex;
    gap: 1px;
    background: #f0f0f0;
}

.ns-mega__brand {
    display: flex;
    flex-direction: column;
    text-decoration: none;
    position: relative;
    overflow: hidden;
    width: 180px;
    background: #fff;
    transition: background 0.15s;
}

.ns-mega__brand:hover { background: #fafafa; }

.ns-mega__brand-img {
    flex: 1;
    overflow: hidden;
    background: #f8f8f8;
}

.ns-mega__brand-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: top center;
    display: block;
    transition: transform 0.4s ease;
}

.ns-mega__brand:hover .ns-mega__brand-img img { transform: scale(1.04); }

.ns-mega__brand-name {
    padding: 8px 12px;
    font-size: 9px;
    font-weight: 900;
    letter-spacing: 0.3em;
    text-transform: uppercase;
    color: #111;
    text-align: center;
    border-top: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.ns-mega__brand:hover .ns-mega__brand-name {
    background: #111;
    color: #fff;
}

/* ── Simpele dropdown ── */
.ns-dropdown {
    left: auto;
    right: auto;
    width: auto;
    min-width: 200px;
}

/* Positioneer simpele dropdown onder het item zelf */
.ns-nav__item--has-drop[data-type="simple"] {
    position: relative;
}

.ns-nav__item--has-drop[data-type="simple"] .ns-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: auto;
    margin-top: 1px;
}

.ns-dropdown__list {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.ns-dropdown__link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 24px;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.08em;
    color: #333;
    text-decoration: none;
    text-transform: uppercase;
    transition: background 0.12s, color 0.12s, padding-left 0.12s;
    white-space: nowrap;
}

.ns-dropdown__link:hover {
    background: #f8f8f8;
    color: #111;
    padding-left: 30px;
}

.ns-dropdown__icon {
    width: 20px;
    height: 16px;
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.ns-dropdown__icon img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    opacity: 0.4;
    transition: opacity 0.12s;
}
.ns-dropdown__link:hover .ns-dropdown__icon img { opacity: 0.9; }

/* ── Mobiel ── */
.ns-mobile-drawer {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    background: #fff;
    z-index: 999999;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4,0,0.2,1);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.ns-mobile-drawer.ns-mob--open {
    transform: translateX(0);
}

.ns-mobile-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    z-index: 999998;
}

.ns-mobile-overlay.ns-mob--open { display: block; }

.ns-mobile-drawer__inner {
    padding: 20px 0;
}

.ns-mob__row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #f5f5f5;
}

.ns-mob__link {
    display: block;
    padding: 16px 20px;
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #111;
    text-decoration: none;
    flex: 1;
}

.ns-mob__toggle {
    background: none;
    border: none;
    padding: 16px 20px;
    cursor: pointer;
    color: #aaa;
    transition: transform 0.2s, color 0.2s;
}

.ns-mob__toggle.ns-mob--active {
    transform: rotate(180deg);
    color: #111;
}

.ns-mob__sub {
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
}

.ns-mob__sub-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 20px 12px 30px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #f0f0f0;
    transition: color 0.12s, background 0.12s;
}

.ns-mob__sub-link:hover { color: #111; background: #f0f0f0; }

.ns-mob__sub-link img {
    width: 16px;
    height: 14px;
    object-fit: contain;
    opacity: 0.35;
}

.ns-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    width: 34px;
    height: 34px;
}

.ns-hamburger span {
    display: block;
    width: 22px;
    height: 2px;
    background: #111;
    transition: transform 0.25s, opacity 0.25s;
    transform-origin: center;
}

.ns-hamburger.ns-ham--open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.ns-hamburger.ns-ham--open span:nth-child(2) { opacity: 0; }
.ns-hamburger.ns-ham--open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ── Responsive ── */
@media (max-width: 1000px) {
    .ns-nav__list { display: none; }
    .ns-hamburger { display: flex; }
}

@media (min-width: 1001px) {
    .ns-mobile-drawer,
    .ns-mobile-overlay { display: none !important; }
}

/* Header hoogte instellen zodat fixed dropdown correct valt */
header #mainbar {
    --header-height: 64px;
}
