.site-header {
    position: relative;
    border-bottom-width: 1px;
    border-bottom-color: var(--digi-silver);
    border-bottom-style: solid;
    z-index: 99;

    ul {
        list-style: none;
        padding: 0;
        margin: 0;
    }
}

.site-header-inner {
    display: flex;
    justify-content: space-between;
    align-items: stretch;
    gap: 1.25rem;
    min-height: 80px;
}

.site-branding {
    position: relative;
    z-index: 10;
    transition: all 300ms ease-in-out;

    &,
    a {
        display: flex;
        align-items: center;
    }
}

.digi-site-logo {
    position: relative;
    z-index: 20;
    margin-right: auto;
}

.digi-logo-img {
    width: 200px;
    transition: all 300ms ease-in-out;
}

.digi-header-nav {
    display: flex;

    li {
        display: flex;
        align-items: stretch;
        position: relative;
    }

    a {
        display: flex;
        align-items: center;
        position: relative;
        color: var(--digi-dark-blue);
        font-size: 1rem;
        font-weight: 500;
        padding: 0 0.5rem;
        text-decoration: none;
        transition: all 300ms ease-in-out;

        &:hover {
            color: var(--digi-crimson);
        }
    }

    .current-menu-item a {
        color: var(--digi-crimson);
    }

    li.menu-item-has-children > a {
        gap: 0.25rem;
    }

    .sub-menu {
        position: absolute;
        top: 100%;
        left: 0;
        background-color: #fff;
        width: 200px;
        visibility: hidden;
        opacity: 0;
        padding: 0.5rem;
        border-bottom-left-radius: 0.375rem;
        border-bottom-right-radius: 0.375rem;
        box-shadow: 0 5px 5px 0 rgba(9, 5, 58, 0.1);
        transition: all 300ms ease-in-out;

        li {
            width: 100%;
        }

        a {
            font-size: 0.9rem;
            font-weight: normal;
            color: rgba(0, 0, 0, 0.8);
            padding: 0.5rem;
            width: 100%;
            gap: 0.6rem;
            border-radius: 0.2rem;

            &:hover {
                background-color: rgba(237, 240, 255, 0.3);
                color: var(--digi-charcoal);
                opacity: 1;
            }
        }

        .current-menu-item a {
            background-color: rgba(237, 240, 255, 0.3);
            color: var(--digi-charcoal);
        }
    }

    li:is(:hover, :active, :focus-within) > .sub-menu {
        visibility: visible;
        opacity: 1;
    }
}

.digi-nav-menu {
    display: flex;
    gap: 0.5rem;
}

/* Mobile Menu */
.digi-menu-toggle {
    display: none;
    justify-content: center;
    height: 3rem;
    width: 3rem;
    cursor: pointer;
    padding: 0;
}

.digi-menu-bars {
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
    width: 1.5rem;
    height: 1.2rem;
    cursor: pointer;
    z-index: 10;

    span {
        position: absolute;
        display: flex;
        height: 0.13rem;
        width: 100%;
        background-color: #fff;
        border-radius: 0.75rem;
        transition: all 300ms ease-in-out;

        &:nth-child(1),
        &:nth-child(2),
        &:nth-child(3) {
            left: 0;
        }

        &:nth-child(1) {
            top: 0;
        }

        &:nth-child(2) {
            top: 50%;
            transform: translateY(-50%);
        }

        &:nth-child(3) {
            bottom: 0;
            left: 0;
        }
    }
}

.digi-menu-toggle:hover span {
    background-color: var(--digi-charcoal);
}

.digi-mobile-menu {
    transform: translate3d(100%, 0, 0);
    transition: all 0.5s;
    z-index: 1000000;
    display: none;

    &.open {
        display: flex;
        transform: translate3d(0, 0, 0);
    }

    nav a {
        display: flex;
        width: 100%;
        padding: 0.5rem 2rem;
        color: var(--digi-charcoal);
        font-size: 1.3rem;
        font-weight: bold;

        &:hover {
            color: rgba(0, 0, 0, 0.6);
            background-color: #fff1e5;
        }
    }

    .menu-item-has-children {
        a {
            align-items: stretch;
            justify-content: space-between;

            .submenu-toggle {
                display: flex;
                align-items: center;
                justify-content: center;
                width: 3rem;
                background-color: #fff1e5;
                color: var(--digi-charcoal);
                border-radius: 0.2rem;
                padding: 0;
                cursor: pointer;
                z-index: 50;
                transition: all 300ms ease-in-out;

                svg {
                    transition: all 300ms ease-in-out;
                }
            }

            &:hover svg {
                fill: var(--digi-crimson);
            }

            &:hover .submenu-toggle {
                background-color: var(--digi-crimson);
                color: #fff;

                svg {
                    fill: currentColor;
                }
            }
        }

        .sub-menu {
            display: flex;
            flex-direction: column;
            width: 100%;
            max-height: 0;
            overflow: hidden;
            transition: max-height 0.2s ease-in-out;

            a {
                display: flex;
                justify-content: flex-start;
                gap: 0.5rem;
                background-color: var(--digi-charcoal);
                padding: 0.5rem;
                font-size: 1rem;
                font-weight: 500;
                color: #fff;

                &:hover {
                    background-color: rgba(0, 0, 0, 0.8);
                }
            }
        }

        &.submenu-open {
            a .submenu-toggle svg {
                transform: rotate(-180deg);
            }

            .sub-menu {
                overflow: auto;
                max-height: 300px;
            }
        }
    }

    .digi-button {
        width: 100%;
        justify-content: center;
        border-radius: 0;
    }
}

#page {
    transition: transform 0.5s;
}

body.mopen {
    overflow: hidden;
}

body.mopen #page {
    transform: translate3d(-100%, 0, 0);
}

body.mopen .digi-mobile-menu {
    display: flex;
    transform: translate3d(0, 0, 0);
}

.digi-menu-toggle-close {
    .digi-button {
        width: 3rem;
        height: 3rem;
        border-radius: 9999px;
        cursor: pointer;
        padding: 0;

        &:hover span {
            background-color: var(--digi-charcoal);
        }
    }

    .digi-menu-bars {
        align-items: center;
        justify-content: center;
        position: relative;
        width: 1.5rem;
        height: 1.2rem;
        cursor: pointer;
        z-index: 10;

        span {
            position: absolute;
            display: flex;
            height: 0.13rem;
            width: 100%;
            background-color: #fff;
            border-radius: 0.75rem;
            transition: all 300ms ease-in-out;

            &:nth-child(1),
            &:nth-child(2) {
                left: 0;
            }

            &:nth-child(1) {
                top: 50%;
                transform: translateY(-50%) rotate(-45deg);
            }

            &:nth-child(2) {
                top: 50%;
                transform: translateY(-50%) rotate(45deg);
            }
        }
    }
}
