﻿/* =========================
   TOPBAR
========================= */
.topbar {
    background: #f0f0f0;
    color: #000;
    width: 100%;
    font-size: 0.9rem;
    position: relative;
    z-index: 999; /* boven andere elementen */
}

.topbar-inner {
    max-width: 1300px;
    margin: 0 0 0 64%;
    display: flex;
    align-items: center;
    justify-content: flex-end; /* items helemaal rechts */
    padding: 5px 60px;
    gap: 20px;
}

.login-link {
    display: flex;
    align-items: center;
    gap: 6px; /* ruimte tussen icoon en tekst */
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

    .login-link .icon {
        width: 20px;
        height: 20px;
        fill: currentColor; /* gebruikt dezelfde kleur als de link */
    }
.header-action,
.login-link {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
}

    .header-action .icon,
    .login-link .icon {
        width: 20px;
        height: 20px;
    }

.header-icon-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-badge {
    position: absolute;
    top: -9px;
    right: -10px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 10px;
    background: #fff;
    color: #333;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
}

.cart-link {
    display: flex;
    align-items: center;
    gap: 7px;
    color: #fff;
    text-decoration: none;
    font-weight: 500;
    white-space: nowrap;
}

    .cart-link .icon {
        width: 22px;
        height: 22px;
    }

#wishlist-total {
    font-weight: 600;
}

.topbar a {
    color: #000;
    text-decoration: none;
    transition: color 0.3s;
}

    .topbar a:hover {
        color: #e5e5e5;
    }

/* =========================
   TOPBAR - MOBILE
========================= */
.topbar-mobile .topbar-inner {
    display: flex;
    justify-content: center;
    gap: 10px;
    white-space: nowrap; /* voorkomt afbreken */
}

.topbar-mobile a {
    font-size: 0.8rem;
    color: #555;
}

.topbar-mobile {
    display: none;
    align-items: center;
    background: #fff;
    color: #000;
    font-size: 0.9rem;
    
}

    .topbar-mobile .topbar-left {
        display: flex;
        align-items: center;
    }

    .topbar-mobile .topbar-right {
        display: flex;
        align-items: center;
        gap: 12px;
    }

/* =========================
   HEADER
========================= */
.header {
    background: #fff;
    color: #555;
    position: absolute;
    top: 0;
    z-index: 2000;
    width: 100%;
    margin: 0;
    left: 50%;
    transform: translateX(-50%);
}

    .header.is-sticky {
        position: fixed; /* wordt fixed zodra gescrolled */
        box-shadow: 0 6px 18px rgba(0,0,0,0.12);
        background: #fff;
        z-index: 3000;
    }

.header-main {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 35px;
    height: 70px;
    max-width: 1300px;
    margin: 0 auto;
    position: relative;
}

.header-content {
    display: flex;
    align-items: center;
    width: 100%;
    max-width: 1300px;
    padding: 0 20px;
    position: relative;
    z-index: 1000;
    box-sizing: border-box;
}

/* LOGO */
.logo {
    flex: 0 0 auto;
    margin-right: 40px; /* afstand tussen logo en menu */
}

    .logo img {
        height: 40px;
        width: auto;
        border-radius: 5px;
    }

.main-nav {
    align-items: center;
    max-width: 1300px;
    margin: 0 auto;
    justify-content: flex-end; /* menu aan de linkerkant */
    gap: 40px; /* ruimte tussen menu en zoekbalk */
    display: flex;
    flex: 1;
}

    .main-nav ul.menu {
        display: flex;
        gap: 30px;
        list-style: none;
        justify-content: flex-end; /* menu aan de linkerkant */
        padding: 0;
        margin: 0;
    }

    .main-nav li {
        position: relative;
    }

    .main-nav a {
        color: #000;
        font-size: 1rem;
        font-weight: 500;
        padding: 20px 0;
        transition: color 0.3s;
    }

.has-submenu .submenu {
    display: none;
    position: fixed; /* 🔑 key change */
    top: 50px; /* header hoogte + 30px */
    left: 50%;
    transform: translateX(-50%);
    background: #ffffff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.2);
    color: #000;
    width: 900px;
    gap: 20px;
    z-index: 2000;
    flex-wrap: wrap;
}

.has-submenu > a {
    position: relative; /* voor ::after positioning */
    padding-right: 20px; /* ruimte voor pijltje */
}

    .has-submenu > a::after {
        content: '';
        position: absolute;
        right: 0;
        top: 50%;
        width: 8px;
        height: 8px;
        border-right: 2px solid #000;
        border-bottom: 2px solid #000;
        transform: translateY(-50%) rotate(45deg); /* kleine pijltje */
        transition: transform 0.25s ease;
    }

.has-submenu.open > a {
    color: #d71319;
}

    .has-submenu.open > a::after {
        transform: translateY(-50%) rotate(-135deg); /* pijltje omhoog */
        border-color: #d71319;
    }

    .has-submenu.open > a:hover {
        color: #d71319; /* houdt dezelfde kleur */
    }

.submenu {
    max-height: calc(100vh - 140px); /* ruimte voor header */
    overflow-y: auto; /* 🔑 scrollbar */
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

.submenu-close {
    position: absolute;
    top: 14px;
    right: 14px;
    background: none;
    border: none;
    font-size: 2em;
    cursor: pointer;
    color: #555;
    z-index: 5000;
}

.submenu-column {
    display: block;
    font-size: 1rem;
    font-weight: 500;
    padding: 5px 0;
    color: #000;
    position: relative;
    text-decoration: none;
    cursor: pointer;
    margin-top: 0px;
}

    .submenu-column h4 {
        margin: 0;
        padding: 12px 0;
        font-size: 1em;
    }

    .submenu-column ul li a,
    .submenu-column .submenu-link {
        color: #555;
        padding: 8px 0;
        display: block;
        font-size: 1rem;
        font-weight: 500;
        position: relative;
        text-decoration: none;
        cursor: pointer;
        margin-top: 0px;
    }

.submenu-footer {
    flex: 0 0 100%;
    width: 100%;
    order: 999;
    margin-top: 20px;
    padding-top: 15px;
    border-top: 1px solid #f0f0f0;
    font-size: 1em;
    color: #d71319;
    text-align: left;
}

.search-container {
    margin-left: auto;
    display: flex;
    align-items: center;
    position: relative;
}

.search-input {
    padding: 13px 10px;
    border-radius: 4px;
    border: 1px solid #ccc;
    width: 180px;
    font-size: 0.9rem;
    transition: width 0.3s ease;
}

    .search-input:focus {
        outline: none;
        width: 220px;
        border-color: #004080;
    }

.search-btn {
    background: none;
    border: none;
    margin-left: -30px;
    cursor: pointer;
    color: #004080;
}

    .search-btn svg {
        width: 18px;
        height: 18px;
    }

/* =========================
   SEARCH FIELD
========================= */
.search-container {
    position: absolute;
    top: 0;
    right: 35px;
    display: flex;
    align-items: center;
    z-index: 3000;
}

.search-overlay {
    position: fixed;
    top: 40px;
    right: 0;
    width: calc(100vw - 40%);
    height: 50%;
    max-width: 1000px;
    background: linear-gradient(to right, #fff 100%, #fff 0%);
    opacity: 0;
    visibility: hidden;
    transition: transform 0.5s ease, opacity 0.5s ease;
    z-index: 1000;
}

/* toggle knop */
.search-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: #000;
    padding: 13px 0;
    display: flex;
    align-items: center;
    transition: transform 0.35s ease, opacity 0.35s ease;
}

/* wrapper */
.search-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    z-index: 1010;
}

/* input */
.search-input {
    width: 0;
    opacity: 0;
    padding: 0;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 0.9rem;
    transition: width 0.35s ease, opacity 0.35s ease, padding 0.35s ease;
    pointer-events: none;
}

.search-btn {
    position: absolute;
    right: 5px;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    cursor: pointer;
    color: #555;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease;
}

.clear-btn {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);
    width: 18px;
    height: 18px;
    background: #fff;
    border: 0.5px solid #555;
    border-radius: 50%;
    color: #555;
    font-weight: bold;
    font-size: 0.8rem;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
}

    .clear-btn:hover {
        background: #555;
        color: #fff;
    }

.search-close {
    display: none;
    background: none;
    border: none;
    color: #000;
    font-size: 22px;
    cursor: pointer;
    margin-left: 10px;
    z-index: 1010;
}

/* =========================
   OPEN STATE
========================= */
.desktop-search.open .search-input {
    width: 400px;
    height: 40px;
    padding: 6px 35px 6px 10px;
    opacity: 1;
    pointer-events: auto;
    margin-left: 10px;
}

.desktop-search.open .search-btn {
    opacity: 1;
    pointer-events: auto;
}

.desktop-search.open .search-toggle {
    transform: translateX(-30px);
    opacity: 0;
}

.desktop-search.open .search-close {
    display: block;
}

.desktop-search.open .search-overlay {
    opacity: 0.6;
    visibility: visible;
}

.search-input::placeholder {
    color: #888;
}

/* =========================
   HAMBURGER
========================= */
.hamburger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 40px;
    height: 40px;
    background: #d71319;
    border: 0.5px solid #d71319;
    border-radius: 8px;
    cursor: pointer;
}

    .hamburger span {
        display: block;
        height: 3px;
        background: #fff;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .hamburger.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .hamburger.open span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.open span:nth-child(3) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

/* Mobile search toggle/input */
.search-mobile-form {
    display: none;
    position: absolute;
    top: 100%;
    left: 15px;
    right: 15px;
    width: auto;
    max-width: none;
    margin: 0;
    padding: 8px 10px;
    background: #fff;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
    flex-direction: row;
    align-items: center;
    box-sizing: border-box;
    z-index: 5000;
}

    .search-mobile-form input {
        width: 100%;
        min-width: 0;
        padding: 10px 40px;
        font-size: 0.9rem;
        border: 0.5px solid #ccc;
        border-radius: 4px;
        box-sizing: border-box;
        outline: none;
    }

.search-mobile-btn {
    background: none;
    border: none;
    position: absolute;
    left: 15px;
    top: 57%;
    transform: translateY(-50%);
    color: #555;
    cursor: pointer;
}

.ssearch-mobile-btn input:focus {
    border: 0.5px solid #ccc;
    outline: none;
}

.search-mobile-clear {
    position: absolute;
    right: 18px;
    top: 52%;
    transform: translateY(-50%);
    width: 25px;
    height: 25px;
    border-radius: 50%;
    background: #fff;
    color: #555;
    border: 0.5px solid #555;
    font-size: 16px;
    line-height: 1;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
}

    .search-mobile-clear:hover,
    .search-mobile-clear:active {
        background: #555;
        color: #fff;
    }

.search-toggle-mobile {
    background: none;
    border: none;
    color: #000;
    cursor: pointer;
    display: flex;
    align-items: center;
    margin-left: 0px;
}

    .search-toggle-mobile .icon-close {
        display: none;
    }

    .search-toggle-mobile.open .icon-search {
        display: none;
    }

    .search-toggle-mobile.open .icon-close {
        display: inline;
    }

    .search-toggle-mobile.open svg {
        display: none;
    }

    .search-toggle-mobile.open::after {
        content: "✕";
        font-size: 20px;
        color: #004080;
        display: inline-block;
    }

.topbar-mobile .search-mobile-form.open {
    display: flex;
}

/* =========================
   RESPONSIVE MOBILE
========================= */
@media (max-width: 1100px) {

    html,
    body {
        width: 100%;
        max-width: 100%;
        overflow-x: hidden;
    }

    .header {
        left: 0;
        right: 0;
        width: 100%;
        max-width: 100%;
        transform: none;
        box-sizing: border-box;
    }

    .header-content {
        position: relative;
        display: flex;
        align-items: center;
        width: 100%;
        max-width: 100%;
        padding: 0 15px;
        margin: 0;
        box-sizing: border-box;
    }



    .desktop-search,
    .search-overlay {
        display: none !important;
    }
    .topbar-mobile,
    .topbar-mobile .topbar-inner,
    .topbar-mobile .topbar-right {
        position: static;
    }

    .main-nav,
    .main-nav *,
    .main-nav *::before,
    .main-nav *::after {
        box-sizing: border-box;
    }
    .container {
        margin: 0 auto;
        padding: 40px 0;
    }

    .topbar {
        display: none;
    }

    .topbar-mobile {
        display: flex;
        flex: 1 1 0;
        min-width: 0;
        width: auto;
        margin: 0;
    }


    .topbar-desktop {
        display: none;
    }

    .topbar-mobile .topbar-inner {
        display: flex;
        flex: 1;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        min-width: 0;
        margin: 0;
        padding: 0;
    }

    .topbar-mobile .topbar-right {
        display: flex;
        align-items: center;
        justify-content: flex-end;
        gap: 10px;
        min-width: 0;
    }





    .search-toggle-mobile {
        display: flex;
        flex: 0 0 30px;
        width: 30px;
        height: 40px;
        align-items: center;
        justify-content: center;
        padding: 0;
        margin: 0;
    }

    .search-mobile-form {
        display: none;
        position: fixed !important;
        top: 70px !important;
        left: 10px !important;
        right: 10px !important;
        width: auto !important;
        max-width: none !important;
        min-width: 0 !important;
        margin: 0 !important;
        padding: 8px 10px !important;
        box-sizing: border-box !important;
        background: #fff;
        border-radius: 0 0 8px 8px;
        box-shadow: 0 8px 15px rgba(0,0,0,.12);
        z-index: 6000;
    }
    
    .topbar-mobile .search-mobile-form.open {
        display: flex;
    }

        .search-mobile-form input {
            display: block;
            flex: 1 1 0;
            width: 0 !important;
            min-width: 0 !important;
            max-width: 100% !important;
            padding: 10px 40px !important;
            margin: 0 !important;
            font-size: 16px;
            box-sizing: border-box !important;
        }
   

    .desktop-search {
        display: none;
    }

    .header-main {
        width: 100%;
        max-width: 100%;
        padding: 0;
        margin: 0;
        box-sizing: border-box;
    }

    /* Logo */
    .logo {
        flex: 0 0 auto;
        margin-right: 10px;
    }

        .logo img {
            display: block;
            height: 30px;
            width: auto;
        }

    .main-nav {
        display: none;
        position: absolute;
        top: 100%;
         width: calc(100% - 20px);
        left: 10px;
        right: 10px;
        max-width: none;
        margin: 0;
        padding: 0;
        background: #fff;
        flex-direction: column;
        align-items: stretch;
        box-sizing: border-box;
        max-height: calc(100dvh - 70px);
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 4000;
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.12);
        -webkit-overflow-scrolling: touch;
    }

        .main-nav.open {
            display: flex;
        }

        .main-nav ul.menu {
            width: 100%;
            flex-direction: column;
            gap: 0;
            padding: 0;
            margin: 0;
        }

        .main-nav li {
            width: 100%;
            position: relative;
            box-sizing: border-box;
        }

        .main-nav a {
            width: 100%;
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 15px 20px;
            box-sizing: border-box;
        }

            .main-nav a:hover {
                background-color: #ccc;
                border-radius: 5px;
            }

    .has-submenu .submenu {
        display: none;
        position: static; /* ❗ KEY FIX */
        transform: none;
        width: 100%;
        box-shadow: none;
        padding: 5px 20px;
        background: #fff;
        border-radius: 0;
        margin-top: 5px;
        overflow-y: hidden;
        box-sizing: border-box;
    }

    .has-submenu.open .submenu {
        display: block;
    }

    .has-submenu > a::after {
        right: 35px;
    }

    .has-submenu.open > a {
        border-bottom: 0.5px solid #d71319;
        border-top: 0.5px solid #d71319;
        padding: 20px 20px;
    }

    .submenu-column {
        width: 100%;
        margin-bottom: 5px;
    }

        .submenu-column ul li a {
            color: #004080;
            padding: 5px 0;
        }

    .submenu-close {
        display: none; /* mobiel geen kruisje nodig */
    }

    .submenu-column > h4 {
        position: relative;
        padding: 14px 0px 14px 14px;
        color: #000;
        font-size: 1rem;
        font-weight: 500;
        cursor: pointer;
    }

        .submenu-column > h4::after {
            content: '';
            position: absolute;
            right: 15px;
            top: 50%;
            width: 8px;
            height: 8px;
            border-right: 2px solid #000;
            border-bottom: 2px solid #000;
            transform: translateY(-50%) rotate(45deg);
            transition: transform 0.25s ease;
            z-index: 1;
        }

    .submenu-column.open > h4::after {
        transform: translateY(-50%) rotate(-135deg);
    }

    .submenu-column > h4:hover::before,
    .submenu-column.open > h4::before {
        content: '';
        position: absolute;
        width: 40px;
        height: 40px;
        background-color: #ccc;
        border-radius: 50%;
        top: 50%;
        right: 0px;
        transform: translateY(-50%);
        z-index: 0;
        transition: all 0.2s ease;
    }

    .has-submenu .submenu li a {
        padding: 12px 30px;
        font-size: 0.95rem;
        color: #000;
        text-transform: none;
        font-weight: normal;
    }

    .has-submenu .submenu-link {
        padding: 20px 14px;
        font-size: 1rem;
        color: #000;
        text-transform: none;
        font-weight: normal;
    }


    .hamburger {
        display: flex;
        flex: 0 0 40px;
        width: 40px;
        height: 40px;
        margin: 0 0 0 10px;
        position: static;
        transform: none;
    }
}

/* =========================
   RESPONSIVE DESKTOP
========================= */
@media (min-width: 1101px) {
    .topbar {
        display: flex;
        order: 0;
        width: 100%;
    }

    .header-main {
        order: 1;
        display: flex;
        align-items: center;
        justify-content: space-between;
    }

    .main-nav {
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        display: flex;
        z-index: 1000;
    }

        .main-nav a:hover {
            color: #000;
            border-bottom: 3px solid #d71319;
        }

        .main-nav ul.menu {
            display: flex;
            gap: 30px;
            max-width: 1300px;
            flex-shrink: 0;
        }

    .has-submenu .submenu {
        flex-wrap: wrap;
        justify-content: flex-start;
        gap: 30px;
        max-height: calc(100vh - 140px);
        overflow-y: auto;
        padding: 10px;
    }

    .has-submenu.open .submenu {
        display: flex;
    }

    .has-submenu.open > .submenu {
        display: flex;
    }

    .submenu {
        display: flex;
        flex-direction: row;
        gap: 40px;
        overflow: visible;
        height: auto;
    }

    .submenu-column {
        flex: 1 1 200px;
        display: flex;
        flex-direction: column;
    }

        .submenu-column ul {
            display: block !important;
            height: auto !important;
            overflow: visible !important;
        }

            .submenu-column ul li a {
                display: inline-block;
            }

        .submenu-column .submenu-link {
            display: inline-block !important;
            width: auto !important;
            align-self: flex-start;
        }

            .submenu-column ul li a:hover,
            .submenu-column .submenu-link:hover {
                border-bottom: 2px solid #d71319;
            }

    .hamburger {
        display: none;
    }
}
