/* =========================================
   WINSKOOP TOERE - HEADER
========================================= */

.site-header {
    position: relative;
    /*z-index: 100;*/
}

/* =========================================
   CONTACT BAR
========================================= */

.header-top {
    width: 100%;
    height: 62px;
    background-color: var(--wit);
    display: flex;
    align-items: center;
    justify-content: center;
}

.header-container {
    width: min(90%, calc(100% - 40px));
    margin: 0 auto;
}

.header-container br {
    display: none;
}

.header-top .header-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 45px;
    color: var(--lig-grys);
    font-size: var(--font-body);
}

/* =========================================
   MAIN NAVIGATION
========================================= */

.header-menu {
    position: sticky;
    top: 0;
    z-index: 20;
    width: 100%;
    height: 62px;
    background-color: var(--donkerblou);
    border-bottom: 8px solid var(--goud);
    overflow: visible;
}

.header-menu > .header-container {
    height: 100%;
    display: flex;
    align-items: center;
}

.main-navigation {
    height: 100%;
    display: flex;
    align-items: center;
}

.primary-menu {
    display: flex;
    align-items: center;
    gap: 20px;
    height: 100%;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-menu > li {
    position: relative;
    display: flex;
    align-items: center;
    margin: 0;
    padding: 0;
    list-style: none;
}

.primary-menu > li.menu-item-has-children > a {
    position: relative;
}

.primary-menu a {
    display: flex;
    align-items: center;
    height: 100%;
    padding: 0;
    color: var(--wit);
    font-size: var(--font-body);
    font-weight: 500;
    text-transform: uppercase;
    text-decoration: none;
    letter-spacing: 1px;
    white-space: nowrap;
    transition: color 0.2s ease;
}

.primary-menu a:hover {
    color: var(--goud);
}

/* =========================================
   DROPDOWN MENU
========================================= */

.primary-menu .sub-menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 100;
    min-width: 300px;
    margin: 0;
    padding: 15px 0;
    background: var(--cream);
    list-style: none;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);

    /* Hidden initially */
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;
}

.primary-menu > li:hover > .sub-menu {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.primary-menu .sub-menu li {
    display: block;
    width: 100%;
    margin: 0;
    padding: 0;
}

.primary-menu .sub-menu a {
    display: block;
    height: auto;
    padding: 12px 42px;
    color: var(--donkerblou);
    font-size: var(--font-body);
    font-weight: 600;
    text-transform: inherit;
    white-space: nowrap;
}

.primary-menu .sub-menu a:hover {
    color: var(--rooi);
}

/* =========================================
   LOGO
========================================= */

.site-logo {
    position: absolute;
    top: -32px;
    right: 0;
    z-index: 100;
    width: 400px;
    transition: top 0.25s ease;
}

.site-logo a {
    display: block;
}

.site-logo img {
    display: block;
    width: 100%;
    height: auto;
}

/* Logo position when navigation is sticky */
.header-menu.is-stuck .site-logo {
    top: 0px;
}

/* =========================================
   MOBILE MENU TOGGLE BUTTON
========================================= */

.mobile-menu-toggle {
    display: none;
    padding: 8px;
    background: transparent;
    border: 0;
    color: var(--wit);
    font-size: 24px;
    cursor: pointer;
}

/* =========================================
   MEDIA QUERIES
========================================= */

@media (max-width: 900px) {
    .header-top {
        height: auto;
        padding: 12px 0;
    }

    .header-top .header-container {
        flex-direction: column;
        gap: 5px;
        text-align: center;
    }

    .header-menu {
        height: auto;
        min-height: 60px;
    }

    .header-menu > .header-container {
        overflow-x: auto;
    }

    .primary-menu {
        height: 60px;
        gap: 18px;
    }

    .site-logo {
        top: 100px;
        right: 0px;
        width: 130px;
    }
}

@media (max-width: 768px) {
    .header-menu {
        height: 60px;
        overflow: visible !important;
    }

    .header-menu > .header-container {
        width: 100%;
        height: 100%;
        overflow: visible !important;
    }

    /* Hide navigation until hamburger is clicked */
    .main-navigation {
        display: none;
        height: auto !important;
    }

    .header-container br {
        display: block;
    }

    /* Hamburger Toggle */
    .mobile-menu-toggle {
        display: block;
        position: absolute;
        top: 50%;
        left: 20px;
        z-index: 100;
        transform: translateY(-50%);
    }

    /* Open Mobile Navigation */
    .main-navigation.mobile-open {
        display: block !important;
        position: absolute;
        top: 60px;
        left: 0;
        z-index: 200;
        width: 100%;
        height: auto !important;
        background: var(--donkerblou);
        box-shadow: 0 8px 15px rgba(0, 0, 0, 0.15);
    }

    .main-navigation.mobile-open .primary-menu {
        display: block !important;
        width: 100%;
        height: auto !important;
        margin: 0;
        padding: 10px 0;
        list-style: none;
    }

    .primary-menu > li {
        display: block !important;
        width: 100%;
        height: auto !important;
        margin: 0;
        padding: 0;
    }

    .primary-menu > li > a {
        display: flex;
        width: 100%;
        height: auto !important;
        padding: 15px 25px;
        box-sizing: border-box;
        color: var(--wit);
    }

    /* Mobile Submenus */
    .primary-menu .sub-menu {
        position: static;
        display: none;
        width: 100%;
        min-width: 0;
        height: auto;
        margin: 0;
        padding: 0;
        background: rgba(0, 0, 0, 0.15);
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .primary-menu .sub-menu a {
        height: auto !important;
        padding: 12px 45px;
        color: var(--wit);
        font-size: var(--font-body);
    }

    .site-logo {
        top: 0px;
        right: 0px;
        width: 180px;
    }

    /* Accordion Toggle Support */
    .primary-menu > li.menu-item-has-children > a {
        position: relative;
        padding-right: 50px;
    }

    .primary-menu > li.menu-item-has-children > a::after {
        content: "\f0d7";
        position: absolute;
        right: 25px;
        margin-left: 0;
        font-family: "Font Awesome 6 Free" !important;
        font-size: var(--font-body);
        font-weight: 900 !important;
        font-style: normal;
        transition: transform 0.2s ease;
    }

    .primary-menu > li.menu-item-has-children.submenu-open > a::after {
        transform: rotate(180deg);
    }

    .primary-menu > li.menu-item-has-children > .sub-menu {
        display: none;
    }

    .primary-menu > li.menu-item-has-children.submenu-open > .sub-menu {
        display: block;
    }
}

/* =========================================
   WINSKOOP TOERE - ONS TOERE MEGA MENU
========================================= */

@media (min-width: 769px) {
    /* Main mega-menu panel */
    #menu-item-22231 {
        position: relative;
    }

    #menu-item-22231 > .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        z-index: 9999;

        display: block;
        width: 844px;
        height: 310px;
        min-width: 0;
        margin: 0;
        padding: 35px 0 0;
        box-sizing: border-box;

        background: #fbf5dc;
        border-radius: 0 0 28px 28px;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.22);
        overflow: visible;

        opacity: 0;
        visibility: hidden;
        transform: translateY(6px);
        transition:
            opacity 0.2s ease,
            transform 0.2s ease,
            visibility 0.2s ease;
    }

    /* Open on hover or keyboard focus */
    #menu-item-22231:hover > .sub-menu,
    #menu-item-22231:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Featured image - expanded by default */
    #menu-item-22231 > .sub-menu::after {
        content: "";
        position: absolute;
        top: 0;
        right: 0;
        width: 678px;
        height: 100%;
        background-image: var(
            --mega-menu-image,
            url("https://winskoop.edgedev.co.za/wp-content/uploads/2026/10/hongary.webp")
        );
        background-size: cover;
        background-position: center;
        border-radius: 0 0 28px 0;
        pointer-events: none;
        z-index: 0;
        transition: width 0.25s ease;
    }

    /* Reduce image width when a category is active */
    #menu-item-22231 > .sub-menu.has-active-submenu::after {
        width: 352px;
    }

    /* Left column heading */
    #menu-item-22231 > .sub-menu::before {
        /*content: "Toer volgens";*/
        position: absolute;
        top: 0;
        left: 0;
        width: 166px;
        height: 35px;
        padding: 0 10px;
        box-sizing: border-box;

        display: flex;
        align-items: center;

        background: #a71920;
        color: #fff;

        font-weight: 800;
        z-index: 3;
    }

    /* Left column categories */
    #menu-item-22231 > .sub-menu > li {
        position: static;
        width: 166px;
        margin: 0;
        padding: 0;
    }

    #menu-item-22231 > .sub-menu > li > a {
        display: flex;
        align-items: center;
        justify-content: space-between;

        width: 166px;
        height: 53px;
        padding: 0 24px;
        box-sizing: border-box;

        background: #fbf5dc;
        color: var(--donkerblou);

        font-weight: 700;
        white-space: nowrap;
    }

    #menu-item-22231 > .sub-menu > li:hover > a {
        color: #a71920;
        background: #f5edcf;
    }

    /* Arrow for categories with children */
    #menu-item-22231 > .sub-menu > li.menu-item-has-children > a::after {
        content: "";
        width: 0;
        height: 0;
        border-top: 5px solid transparent;
        border-bottom: 5px solid transparent;
        border-left: 5px solid var(--donkerblou);
        flex-shrink: 0;
        margin-left: 10px;
    }

    /* Middle column */
    #menu-item-22231 > .sub-menu > li > .sub-menu {
        position: absolute;
        top: 0;
        left: 166px;

        display: block;
        width: 326px;
        height: 100%;
        min-width: 0;
        margin: 0;
        padding: 35px 0 12px;
        box-sizing: border-box;

        background: #fbf5dc;
        box-shadow: none;
        border-radius: 0;
        overflow-y: auto;

        opacity: 0;
        visibility: hidden;
        transform: none;
        z-index: 1;
    }

    /* Show the first category's submenu by default */
    #menu-item-22231:hover > .sub-menu > li:first-child > .sub-menu,
    #menu-item-22231 > .sub-menu > li:hover > .sub-menu,
    #menu-item-22231 > .sub-menu > li:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
    }

    /* Middle column heading */
    #menu-item-22231 > .sub-menu > li:first-child > .sub-menu::before {
        content: "Al ons toere";
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 35px;

        display: flex;
        align-items: center;
        justify-content: center;

        background: #bd8b43;
        color: #fff;

        font-weight: 800;
        z-index: 2;
    }

    /* Middle column links */
    #menu-item-22231 > .sub-menu > li > .sub-menu > li > a {
        display: block;
        width: 100%;
        min-height: 39px;
        padding: 8px 22px;
        box-sizing: border-box;

        color: #a71920;

        font-weight: 700;
        white-space: normal;
    }

    #menu-item-22231 > .sub-menu > li > .sub-menu > li > a:hover {
        color: var(--donkerblou);
        text-decoration: underline;
        text-underline-offset: 5px;
    }

    /* Third-level menu items */
    #menu-item-22231 > .sub-menu > li > .sub-menu > li > .sub-menu {
        position: static;
        display: block;
        width: 100%;
        min-width: 0;
        height: auto;
        padding: 0 0 8px 12px;
        margin: 0;

        background: transparent;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    #menu-item-22231 > .sub-menu > li > .sub-menu > li > .sub-menu a {
        min-height: 32px;
        padding: 6px 14px;
        color: var(--donkerblou);

        font-weight: 600;
    }

    /* Keep menu text above the image */
    #menu-item-22231 > .sub-menu > li > a,
    #menu-item-22231 > .sub-menu > li > .sub-menu {
        z-index: 1;
    }

    /* Rounded bottom-left corner */
    #menu-item-22231 > .sub-menu > li:last-child > a {
        border-radius: 0 0 0 28px;
    }
}

/* =========================================
   MEER OOR ONS - SIMPLE DROPDOWN
========================================= */

@media (min-width: 769px) {
    /* Dropdown panel */
    #menu-item-78 > .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;

        display: block;
        width: 300px;
        min-width: 300px;
        margin: 0;
        padding: 12px 0;

        background: #fbf5dc;
        border-radius: 0 0 24px 0;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.18);

        opacity: 0;
        visibility: hidden;
        transform: translateY(6px);

        transition:
            opacity 0.2s ease,
            transform 0.2s ease,
            visibility 0.2s ease;

        z-index: 9999;
    }

    /* Show dropdown */
    #menu-item-78:hover > .sub-menu,
    #menu-item-78:focus-within > .sub-menu {
        opacity: 1;
        visibility: visible;
        transform: translateY(0);
    }

    /* Individual links */
    #menu-item-78 > .sub-menu > li > a {
        display: block;
        width: 100%;
        height: auto;
        padding: 12px 40px;
        box-sizing: border-box;

        background: transparent;
        color: var(--donkerblou);

        font-weight: 600;
        text-transform: none;
        letter-spacing: 0;
        white-space: nowrap;

        transition:
            color 0.2s ease,
            background 0.2s ease;
    }

    /* Hover effect */
    #menu-item-78 > .sub-menu > li > a:hover {
        color: #a71920;
        background: #f5edcf;
    }
}
