header {
    height: 100px;
    position: fixed;
    z-index: 1000;
    background: var(--color-bg);
    width: 100%;
    top: 0;
    left: 0;
    transition: .2s ease-in-out;

    @media screen and (min-width: 1000px) {
        overflow: visible !important;
    }

    &.active {
        transition: .2s ease-in-out;
    }

    &.header.active {
        box-shadow: 0 0 2px 2px rgba(0, 0, 0, .1);

        @media screen and (min-width: 1000px) {
            overflow: visible !important;
        }
    }

    .inner {
        display: flex;
        justify-content: flex-end;
        align-items: center;
        height: 100%;
        padding: 0 20px;
        width: calc(100% - 40px);
        max-width: 1250px;
        margin: 0 auto;

        @media screen and (min-width: 1000px) {
            overflow: visible;
        }

        .trigger-menu {
            cursor: pointer;
            position: relative;
            z-index: 25;

            @media screen and (min-width: 1000px) {
                display: none;
            }

            img {
                width: 35px;
                height: 35px;

                @media screen and (min-width: 600px) {
                    width: 45px;
                    height: 45px;
                }
            }

        }

        .logo {
            width: max-content;
            position: absolute;
            left: 50%;
            transform: translateX(-50%);
            z-index: 1;

            @media screen and (min-width: 1000px) {
                z-index: 20;
            }

            a {
                display: block;
                width: 100%;
                max-width: 110px;
                height: auto;
                line-height: 0;
                position: relative;
                z-index: 1;

                @media screen and (min-width: 1000px) {
                    max-width: 140px;
                }

                img {
                    display: block;
                    width: 100%;
                    height: auto;
                    pointer-events: none;
                }
            }
        }

        .nav-wrapper {
            display: flex;
            justify-content: center;
            position: fixed;
            opacity: 0;
            z-index: -1;
            transition: .2s ease-in-out;
            color: #fff;
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background: rgba(24, 24, 24, 1);
            text-align: center;
            max-height: 0;
            overflow: hidden;

            @media screen and (min-width: 1000px) {
                padding-top: unset;
                position: relative;
                left: unset;
                top: unset;
                background: unset;
                opacity: 1;
                z-index: 10;
                color: var(--color-font);
                max-height: none;
                height: auto;
                overflow: visible;
                pointer-events: none;
            }

            &.active {
                padding-top: 20vh;
                transition: .2s ease-in-out;
                opacity: 1;
                z-index: 30;
                max-height: 5000px;
                pointer-events: auto;
            }

            .close {
                position: absolute;
                top: 20px;
                right: 20px;
                cursor: pointer;

                @media screen and (min-width: 1000px) {
                    display: none;
                }

                img {
                    width: 35px;
                    height: 35px;

                    @media screen and (min-width: 600px) {
                        width: 45px;
                        height: 45px;
                    }
                }
            }

            nav {
                width: 100%;

                @media screen and (min-width: 1000px) {
                    display: flex;
                    justify-content: space-between;
                    overflow: visible;
                    pointer-events: none;
                }

                .menu {
                    padding-left: 0;
                    margin: 0;
                    list-style-type: none;
                    font-size: 1.7rem;
                    line-height: 2rem;

                    @media screen and (min-width: 1000px) {
                        line-height: unset;
                        display: flex;
                        align-items: center;
                        gap: 20px;
                        font-size: 20px;
                        overflow: visible;
                        pointer-events: none;
                    }

                    .menu-item {
                        padding: .5rem;

                        @media screen and (min-width: 1000px) {
                            pointer-events: auto;
                        }
                        &#green-it {
                            position: relative;
                            width: max-content;
                            margin: 0 auto;
                            padding-right: 20px;

                            &:after {
                                content: "";
                                width: 17px;
                                height: 17px;
                                position: absolute;
                                right: 0;
                                top: 48%;
                                transform: translateY(-50%);
                                background: url("/assets/img/icons/tree-white.svg") no-repeat;

                                @media screen and (min-width: 1000px) {
                                    background: url("/assets/img/icons/tree.svg") no-repeat;
                                }
                            }

                            &.active {

                                a {
                                    color: #1B5E20;
                                }

                                &:after {
                                    background: url("/assets/img/icons/tree-green.svg") no-repeat;
                                }
                            }

                            &:hover {
                                a {
                                    color: #1B5E20;
                                }

                                &:after {
                                    background: url("/assets/img/icons/tree-green.svg") no-repeat;
                                }
                            }
                        }

                        &.active {
                            > a {
                                opacity: .8;

                                @media screen and (min-width: 1000px) {
                                    opacity: 1;
                                    color: var(--color-bg-surface);
                                }

                            }
                        }

                        a {
                            color: inherit;
                            text-decoration: none;

                            &:hover {
                                opacity: .8;

                                @media screen and (min-width: 1000px) {
                                    opacity: 1;
                                    color: var(--color-bg-surface);
                                }
                            }
                        }

                        &.has-children {
                            @media screen and (min-width: 1000px) {
                                position: relative;

                                &:hover > .submenu,
                                &:focus-within > .submenu {
                                    display: block;
                                }
                            }
                        }

                        .submenu {
                            list-style: none;
                            margin: 0.35rem 0 0.75rem;
                            padding: 0 0 0 1rem;
                            font-size: 1.25rem;
                            line-height: 1.6;

                            @media screen and (min-width: 1000px) {
                                display: none;
                                position: absolute;
                                top: 100%;
                                left: 0;
                                transform: none;
                                min-width: 200px;
                                margin: 0;
                                padding: 8px 0;
                                background: #fff;
                                border: 1px solid rgba(0, 0, 0, 0.1);
                                border-radius: 10px;
                                box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
                                font-size: 17px;
                                line-height: 1.4;
                                z-index: 400;
                                text-align: left;
                            }

                            .submenu-item {
                                padding: 0.25rem 0;
                                list-style: none;

                                @media screen and (min-width: 1000px) {
                                    padding: 0;
                                }

                                a {
                                    display: block;
                                    opacity: 0.85;
                                    color: inherit;

                                    @media screen and (min-width: 1000px) {
                                        padding: 10px 18px;
                                        opacity: 1;
                                        color: #555;
                                        white-space: nowrap;
                                    }

                                    &:hover {
                                        opacity: 1;

                                        @media screen and (min-width: 1000px) {
                                            color: #3abff0;
                                            background: rgba(58, 191, 240, 0.12);
                                        }
                                    }
                                }

                                &.active a {
                                    opacity: 1;
                                    color: var(--color-bg-surface);

                                    @media screen and (min-width: 1000px) {
                                        color: #3abff0;
                                        background: rgba(58, 191, 240, 0.12);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }

}

@media screen and (min-width: 1000px) {
    header.header,
    header.header.active,
    .home header.active {
        overflow: visible !important;
    }

    header .nav-wrapper,
    header .inner,
    header nav,
    header .menu,
    header .menu-item.has-children {
        overflow: visible !important;
    }

    header .menu-item.has-children {
        position: relative;
    }

    header .menu-item.has-children > .submenu {
        display: none;
        position: absolute;
        top: 100%;
        left: 0;
        transform: none;
        min-width: 200px;
        margin: 0 !important; /* beat nested mobile margin (hover gap) */
        padding: 8px 0;
        list-style: none;
        background: #fff;
        border: 1px solid rgba(0, 0, 0, 0.1);
        border-radius: 10px;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.16);
        font-size: 17px;
        line-height: 1.4;
        z-index: 400;
        text-align: left;
    }

    header .menu-item.has-children:hover > .submenu,
    header .menu-item.has-children:focus-within > .submenu {
        display: block;
    }

    header .menu-item.has-children > .submenu .submenu-item a {
        display: block;
        padding: 10px 18px;
        color: #555;
        text-decoration: none;
        white-space: nowrap;
    }

    header .menu-item.has-children > .submenu .submenu-item a:hover,
    header .menu-item.has-children > .submenu .submenu-item.active a {
        color: #3abff0;
        background: rgba(58, 191, 240, 0.12);
    }
}
