
nav {
    font-family: var(--font-geogrotesque), sans-serif;
    width: 100%;
}

nav a {
    color: var(--white);
    font-family: var(--font-geogrotesque), sans-serif;
    text-decoration: none;
}

nav.white-bg a {
    color: var(--rmk-green);
}

nav.top {
    height: 40px;
    display: flex;
    flex-direction: row;
}

.primary-menu {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    max-width: var(--max-width);
    margin: 0 auto;
    color: var(--white);
    min-height: 64px;
    align-items: center;
    padding-left: 16px;
    padding-right: 16px;
}


.rmk-logo-white > a > img {
    width: 108px;
    height: 48px;
    padding: .5rem 0;
}

.rmk-logo-green > a > img {
    width: 108px;
    height: 48px;
    padding: .5rem 0;
}

.social-icons, .search-icon, .search-icon-mobile {
    display: flex;
    flex-direction: row;
    gap: .5rem;
}

.search-icon-mobile {
    display: none;
}

.social-icons img, .search-icon img {
    width: 24px;
    height: 24px;
}

.green-bg .menu-icon {
    display: none;
    cursor: pointer;
    font-size: 2.2rem;
    color: white;
}

.white-bg .menu-icon {
    display: none;
    cursor: pointer;
    font-size: 2.2rem;
    color: var(--rmk-green);
}

#menu-icon {
    padding-right: 0;
    padding-bottom: 5px;
}

.top-menu-items-mobile {
    display: none;
}

/* -- top menu -- */
.top {
    a {
        color: var(--white);
        text-decoration: none;
    }

    .top-menu-navigation {
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        max-width: var(--max-width);
        margin: 0 auto;
        padding: .5rem 1rem;
    }

    .view-menu-items {
        display: flex;
        justify-content: space-between;
        gap: 3rem;
    }

    .menu-types {
        display: flex;
        flex-direction: row;
        align-self: center;

        > a {
            display: block;
            font-size: .875rem;
            text-decoration: none;
            text-transform: uppercase;
            height: .875rem;
            line-height: .875rem;
            font-family: var(--font-geogrotesque), sans-serif;
            font-weight: 400;
        }

        > a:first-of-type {
            padding-right: .5rem;
            border-right: 1px solid var(--white);
        }

        > a:last-of-type {
            padding-left: .5rem;
        }

        .active span {
            position: relative;
            font-weight: 500;
            text-decoration-line: none;
        }

        .active span::after {
            content: '';
            position: absolute;
            left: 0;
            right: 0;
            bottom: -2px;
            height: 2px;
            background-color: var(--white);
            pointer-events: none;
        }
    }

    .menu-accessibility {
        background: url('../../assets/svg/accessibility.svg') no-repeat center left;
        background-size: 1.25rem 1.25rem;
        text-transform: uppercase;
        padding-left: 1.625rem;
        align-content: center;
        color: var(--white);
        cursor: pointer;
    }

    ul.top-menu {
        display: flex;
        flex-direction: row;
        list-style: none;
        margin: 0;
        padding: 0;
        justify-content: end;
    }

    .top-menu > li a {
        text-decoration: none;
        font-size: 1rem;
        font-style: normal;
        font-weight: 500;
        color: var(--white);
        font-family: var(--font-geogrotesque), sans-serif;
    }

    .top-menu-items {
        padding-right: 1.5rem;
        border-right: 1px solid var(--white);
    }

    .langs-list {
        position: relative;
        display: inline-block;
        width: 3.5rem;
        font-family: var(--font-geogrotesque), sans-serif;
        font-size: 1rem;
    }

    #languageDisplay {
        color: var(--white);
        padding-left: 1.5rem;
        cursor: pointer;
        background: url('../../assets/svg/caret-down-l-green.svg') no-repeat right;
        padding-right: 1rem;
    }

    .dropdown-content {
        display: none;
        position: absolute;
        background-color: var(--rmk-green-keskmine);
        min-width: 3.75rem;
        z-index: 10;
        margin-left: .4rem;
        padding: 6px;
        box-shadow: none;
        flex-direction: column;
    }

    .dropdown-content div {
        padding-left: .4rem;
        cursor: pointer;
        text-decoration: none;
        display: block;
        font-family: inherit;
        font-size: inherit;
        color: var(--white);
        border-bottom: 1px solid var(--white);
    }

    .dropdown-content div:last-of-type {
        border-bottom: none;
    }

    .dropdown-content div:hover {
        background-color: var(--rmk-green-hele);
        color: var(--rmk-green);
    }
}

/* -- end of top menu-- */

.menu {
    list-style: none;
    margin: 0;
    padding: 0;
}

.menu ul {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    margin: 0;
    padding: 0;
    list-style: none;
    background: #555;
    z-index: 10;
}

.menu > li {
    display: inline-block;
    position: relative;
}

.menu > li a {
    text-decoration: none;
}

.main-menu > li > a {
    display: block;
    padding: 10px 20px;
}

.top-menu > li > a {
    padding: .125rem .625rem;
}

.menu ul ul {
    top: 0;
    position: absolute;
}

ul.sub-menu li a {
    border-top: 2px solid var(--rmk-green-keskmine);
    border-bottom: 2px solid var(--rmk-green-keskmine);
}

ul.sub-menu li a:hover {
    background-color: var(--rmk-green-hele) !important;
    color: var(--rmk-green) !important;
    border-top: 2px solid var(--rmk-green-keskmine);
    border-bottom: 2px solid var(--rmk-green-keskmine);
}

ul.sub-menu li.menu-item-has-children > a:hover {
    background: var(--rmk-green-hele) url('../../assets/svg/open-menu-arrow-hover.svg') no-repeat 97% 50%;
    color: var(--rmk-green);
}

ul.main-menu ul.menu {
    border-bottom: 2px solid var(--white);
    white-space: nowrap;
}

.white-bg ul.menu {
    border-bottom: 2px solid var(--rmk-green);
}

ul.menu > li:hover {
    background-color: var(--white);

    > a {
        color: var(--rmk-green);
    }
}

.white-bg ul.menu > li:hover {
    background-color: var(--rmk-green);

    > a {
        color: var(--white);
    }
}

/** only main menu style */

ul.main-menu > li > a {
    text-transform: uppercase;
    padding: 8px 12px;
    font-size: 1.125rem;
    font-weight: 500;
}

/** ------ */

ul.sub-menu {
    background-color: var(--rmk-green-keskmine);
    padding: 24px 16px 16px 16px;
    min-width: 250px;
    white-space: nowrap;
    margin-top: 2px;
}

ul.sub-menu li {
    border-bottom: 1px solid var(--white);

    a {

        display: block;
        padding: 6px 8px 6px 8px;
        text-align: left;
    }
}

.white-bg ul.sub-menu li {
    a {
        color: var(--white);
    }
}

ul.sub-menu li.menu-item-has-children {
    background: url('../../assets/svg/open-menu-arrow.svg') no-repeat 97% 50%;
}

#close-menu {
    display: none;
    margin-right: -4px;
}

.top-menu ul {
    display: none;
}

[class*="menu-primary-menu"] {
    display: flex;
}

li.sub-menu-back-link > a {
    text-transform: uppercase;
    padding-left: 1.875rem !important;
    background: url('../../assets/svg/arrow-back-cornered.svg') no-repeat center left;
}

li.sub-menu-parent-title > a {
    background-color: var(--rmk-green);
    border-top: 4px solid var(--rmk-green-keskmine);
    border-bottom: 4px solid var(--rmk-green-keskmine);
}

li.sub-menu-parent-title > a:hover {
    background-color: var(--rmk-green);
    color: var(--white);
}

@media (min-width: 360px) {
    .top {
        .menu-types {

            > a:first-of-type {
                padding-right: 1rem;
            }
    
            > a:last-of-type {
                padding-left: 1rem;
            }
        }
        .langs-list {
            width: 4.1rem;
        }
    }
}

@media (max-width: 550px) {
    .top .view-menu-items {
        justify-content: start;
        gap: .5rem;
    }

    .menu-accessibility {
        > span {
            display: none;
        }
    }
}

@media (max-width: 1320px) {

    .primary-menu-type {
        width: 100%;
    }
    .top {
        .top-menu-navigation {
            padding-left: 1.25rem !important;
            padding-right: 1.25rem !important;
        }
    }

    .top-menu-items {
        display: none;
    }


    .top-menu-items-mobile {
        display: none;
        width: 100%;

        ul.top-menu {
            padding-top: 0.688rem;
            list-style: none;
            padding-left: 0;
            margin: 0;
            display: flex;
            flex-direction: column;
            gap: 0.688rem;
        }

        ul.top-menu > li > a {
            display: block;
            box-sizing: border-box;
            text-decoration: none;
            font-size: 1rem;
            font-style: normal;
            font-weight: 500;
            font-family: var(--font-geogrotesque), sans-serif;
            text-transform: uppercase;
            width: 100%;
        }
    }

    .color-green ul li a {
        color: var(--rmk-green);
    }

    .color-white ul li a {
        color: var(--white);
    }

    .primary-menu {
        flex-direction: column;
        align-items: start;
    }

    ul.menu {
        padding-bottom: 11px;
        border-bottom: 2px solid var(--rmk-light-green);
        min-width: 300px;
        width: 100%;
    }

    ul.menu > li > a {
        font-size: 1rem;
        padding-left: 0;
    }

    .green-bg ul.menu > li > a {
        border-bottom: 1px solid var(--white);
    }

    .white-bg ul.menu > li > a {
        color: var(--rmk-green);
        border-bottom: 1px solid var(--rmk-green);
    }


    ul.menu > li:last-child > a {
        border-bottom: none;
    }

    .green-bg ul.sub-menu {
        background-color: var(--rmk-green-keskmine);
        padding: 16px 8px;
    }

    .white-bg ul.sub-menu {
        background-color: var(--rmk-green-shade-4);
        padding: 16px 8px;
    }

    ul.sub-menu li {
        border-bottom: none;

        a {
            display: block;
            padding: 6px 8px 6px 8px;
            text-align: left;
            text-decoration: none;
        }
    }

    .white-bg ul.sub-menu li a {
        color: var(--rmk-green);
        border: none;
    }

    .green-bg li.menu-item-has-children {
        background: url('../../assets/svg/open-menu-arrow.svg') no-repeat top 15px right;
    }

    .white-bg li.menu-item-has-children {
        background: url('../../assets/svg/open-menu-arrow-green.svg') no-repeat top 15px right;
    }

    .white-bg ul.sub-menu li.menu-item-has-children {
        background: url('../../assets/svg/open-menu-arrow-green.svg') no-repeat top 15px right;
    }

    .green-bg ul.top-menu li.menu-item-has-children {
        background: url('../../assets/svg/open-menu-arrow.svg') no-repeat top .5rem right;
    }


    .green-bg ul.menu > li:hover {
        background-color: var(--rmk-green);

        > a {
            color: var(--white);
        }
    }

    .white-bg ul.menu > li:hover {
        background-color: var(--white);

        > a {
            color: var(--rmk-green);
        }
    }

    .rmk-logo-white {
        width: 100%;
        display: flex;
        flex-direction: row;
        justify-content: space-between;
        align-items: center;

        a {
            display: block;
        }
    }

    .header-icons {
        display: none;
    }

    .social-icons {
        align-self: center;
        gap: 1rem;
        margin-top: 2.5rem;
        margin-bottom: 1.5rem;
    }

    .search-icon {
        display: none;
    }

    .search-icon-mobile {
        cursor: pointer;
        background-color: transparent;
        border: none;
        margin-left: .75rem;
        display: block;
        width: 1.5rem;
        height: 1.5rem;
    }

    .green-bg .menu-icon {
        display: block;
        color: var(--white);
    }

    .white-bg .menu-icon {
        display: block;
        color: var(--rmk-green);
    }

    .menu {
        display: none;
        width: 100%;
    }

    .menu > li {
        display: block;
    }

    .menu ul {
        position: static;
    }

    .menu ul ul {
        top: 0;
        left: 100%;
        position: inherit;
        box-shadow: none;
    }

    ul.sub-menu li a:hover {
        background: none;
    }

    ul.sub-menu li.menu-item-has-children > a:hover {
        background-color: var(--rmk-green-hele);
        color: var(--rmk-green);
    }


    li.sub-menu-parent-title > a,
    li.sub-menu-parent-title > a:hover {
        background-color: var(--white);
        color: var(--rmk-green);
    }

    ul.sub-menu li a:hover {
        background-color: var(--white) !important;
    }

    li.sub-menu-back-link > a:hover {
        background: url('../../assets/svg/arrow-back-cornered.svg') no-repeat center left !important;
    }
}
