@use '../../colors';
@use '../../icons';
@use '../../breakpoints';
@use '../../animations';

.bz-header {
    flex-shrink: 0;
    @media (max-width: breakpoints.$mobile) {
        height: 5rem;
    }
    @media (min-width: #{breakpoints.$mobile + 1}) and (max-width: breakpoints.$tablet) {
        height: 5.5rem;
    }
    @media (min-width: #{breakpoints.$tablet + 1}) and (max-width: breakpoints.$desktop) {
        height: 6rem;
    }
    @media (min-width: #{breakpoints.$desktop + 1}) {
        height: 8rem;
    }
}

.bz-navbar {
    position: fixed;
    z-index: 100;
    width: 100%;
    top: 0;
    background-color: colors.$white;
    box-shadow: 0px 2px 4px 0px rgba(0, 0, 0, 0.10);
    line-height: 27px;
    > .bz-content {
        display: flex;
        justify-content: space-between;
        align-items: center;
    }
    &__top {
        display: flex;
        justify-content: space-between;
        align-items: center;
        width: 100%;
    }
    &__logo {
        height: 4.5rem;
    }
    &__menu {
        margin: 0;
        padding: 0;
        list-style: none;
        display: flex;
    }
    &__menu-btn {
        display: none;
    }
    &__item {
        position: relative;
        display: flex;
        &--active {
            .bz-navbar__link {
                font-size: 1.25rem;
                font-weight: 700;
                color: colors.$pink-darker;
                &::after {
                    opacity: 1;
                }
            }
            &.bz-navbar__item--shape-d {
                .bz-navbar__link {
                    color: colors.$white;
                }
            }
        }
        &--shape-a {
            .bz-navbar__link {
                &::after {
                    clip-path: polygon(
                        7.5% 9.5%,  /* Top-left point */
                        0.8% 100%,  /* Bottom-left point */
                        92.7% 82.6%,  /* Bottom-right point */
                        100% 0%  /* Top-right point */
                    );
                }
            }
        }
        &--shape-b {
            .bz-navbar__link {
                &::after {
                    clip-path: polygon(
                        0% 0%,        /* Top-left */
                        99.6% 5%,     /* Top-right */
                        98.1% 100%,   /* Bottom-right */
                        1.9% 89.2%    /* Bottom-left */
                    );
                }
            }
        }
        &--shape-c {
            .bz-navbar__link {
                &::after {
                    clip-path: polygon(
                        3.2% 6.6%,    /* Top-left */
                        99.7% 2.3%,   /* Top-right */
                        94.7% 100%,   /* Bottom-right */
                        0% 99.6%      /* Bottom-left */
                    );
                }
            }
        }
        &--shape-d {
            .bz-navbar__link {
                &::after {
                    background-color: colors.$blue-100;
                    clip-path: polygon(
                        8.7% 8.4%,    /* Top-left */
                        99.7% 0%,     /* Top-right */
                        91% 99.1%,    /* Bottom-right */
                        0.3% 86.5%,   /* Bottom-left */
                        6.9% 20.8%    /* Additional point for left curve */
                    );
                }
                &:hover {
                    color: colors.$white;
                    &::before {
                        color: colors.$white;
                    }
                }
            }
        }
        &--has-dropdown {
            position: relative;
            .bz-navbar__link {
                padding-right: 40px;
                @extend .bz-icon-arrow-down;
                &::before {
                    position: absolute;
                    top: 50%;
                    right: 15px;
                    transform: translatey(-50%);
                    font-size: 0.7rem;
                }
                &::after {
                    right: -10px;
                }
                &[aria-expanded=true] {
                    @extend .bz-icon-arrow-up;
                }
            }
            &.bz-navbar__item--active {
                .bz-navbar__link {
                    &::before {
                        color: colors.$white;
                    }
                }
            }
        }
    }
    &__link {
        position: relative;
        color: colors.$pink-100;
        padding: 0.5rem 1.5rem;
        margin-top: 0.5rem;
        margin-left: 0.5rem;
        font-size: 1.125rem;
        font-weight: 500;
        text-decoration: none;
        transition: 0.3s ease;
        @extend .bz-anim-grow-hover;
        text-align: center;
        text-wrap: nowrap;
        z-index: 1;
        &:hover {
            color: colors.$pink-darker;
            &::after {
                opacity: 1;
            }
        }
        &::after {
            content: '';
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            transition: 0.3s ease;
            opacity: 0;
            background-color: colors.$yellow-dark;
            z-index: -1;
        }
    }
    &__dropdown {
        $space-between-link-dropdown: 2.9rem;
        //---
        display: none;
        margin: -8px 0 0;
        padding: 1.5rem 2.5rem 1.5rem 1.5rem;
        list-style: none;
        position: absolute;
        top: calc(100% + $space-between-link-dropdown);
        left: 0;
        background-color: #fff;
        box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        min-width: 200px;
        z-index: inherit;
        &::before {
            content: '';
            height: $space-between-link-dropdown;
            width: 100%;
            position: absolute;
            top: -$space-between-link-dropdown;
            left: 0;
            background-color: transparent;
        }
    }
    &__dropdown-item {
        & + .bz-navbar__dropdown-item {
            margin-top: 2rem;
        }
    }
    &__dropdown-link {
        color: colors.$pink-100;
        font-size: 1.125rem;
        font-weight: 600;
        text-decoration: none;
        text-wrap: nowrap;
        text-decoration: underline;
        @extend .bz-anim-grow-hover;
        &:hover {
            font-weight: 500;
            color: colors.$pink-darker;
        }
    }
}

@media (max-width: breakpoints.$desktop) {
    .bz-navbar {
        > .bz-content {
            flex-direction: column;
            align-items: start;
        }
        &__logo {
            width: 4.90731rem;
            height: 2.75rem;
        }
        &__menu {
            flex-direction: column;
            display: none;
            margin-top: 2.5rem;
        }
        &__menu-btn {
            display: block;
        }
        &__link {
            margin-top: 2rem; 
            display: inline-block;
        }
        &--visible-mobile {
            .bz-navbar__menu-btn {
                display: none;
            }
            .bz-icon-close {
                text-decoration: none;
                display: block !important;
            }
            .bz-navbar__menu {
                display: flex;
                width: 100%;
                max-height: 90vh;
                max-height: calc(100vh - 107px);
                overflow-y: auto;
            }
        }
        &__item {
            flex-direction: column;
            display: block;
            &--shape-b {
                .bz-navbar__link {
                    //margin-left: -5px;
                }
            }
            &--shape-c {
                .bz-navbar__link {
                    //margin-left: -7px;
                }
            }
            &--shape-d {
                .bz-navbar__link {
                   // margin-left: -7px;
                }
            }
        }
        &__dropdown {
            position: static;
            top: 100%;
            left: 0;
            padding: 1.5rem 2.5rem;
            background-color: #fff;
            box-shadow: none;
            min-width: auto;
            z-index: 1;
        }
    }
}