@use '../../utils' as *;

/*----------------------------------------*/
/*  4.1 Main menu css
/*----------------------------------------*/

.#{$theme-prifix}-main {
    &-menu {
        &>nav {
            &>ul {
                &>li {
                    position: relative;
                    display: inline-block;
                    margin-right: 60px;

                    @media #{$xl,$lg} {
                        margin-right: 60px;
                    }

                    &:hover {
                        &>a {
                            color: var(--tp-common-black);
                        }
                    }

                    & .sub-menu {
                        position: absolute;
                        top: 100%;
                        left: 0;
                        padding: 10px 0;
                        display: block;
                        min-width: 220px;
                        visibility: hidden;
                        transform: scaleY(0);
                        transform-origin: top center;
                        background: var(--tp-common-white);
                        border-top: 5px solid var(--tp-theme-1);
                        box-shadow: 0px 10px 30px 0px rgba(25, 25, 26, 0.1);
                        z-index: 6;
                        transition: all 0.3s ease-out;

                        & li {
                            position: relative;
                            display: block;

                            &>a {
                                font-weight: 600;
                                padding: 3px 20px;
                                display: block;
                                transition: all 0.5s ease;
                                text-transform: capitalize;
                                text-align: left;
                                position: relative;
                                font-size: 15px;
                                @include tp-transition();

                                &::before {
                                    position: absolute;
                                    width: 0px;
                                    height: 2px;
                                    top: 50%;
                                    left: 20px;
                                    content: "";
                                    opacity: 0;
                                    visibility: hidden;
                                    transform: translateY(-50%);
                                    background: var(--tp-theme-1);
                                    @include tp-transition();
                                }
                            }

                            & .sub-menu {
                                left: 100%;
                                top: 0;
                            }

                            &:hover {
                                &>a {
                                    padding-left: 40px;
                                    color: var(--tp-common-black);

                                    &::before {
                                        width: 15px;
                                        opacity: 1;
                                        visibility: visible;
                                    }
                                }

                                &>.sub-menu {
                                    transform: scaleY(1);
                                    visibility: visible;
                                }
                            }

                        }
                    }

                    & .tp-mega-menu {
                        position: absolute;
                        width: 1170px;
                        padding: 30px 30px 10px 30px;
                        background-color: var(--tp-common-white);
                        box-shadow: rgba(149, 157, 165, 0.4) 0px 8px 24px;
                        margin: auto;

                        @media #{$xl} {
                            width: 1000px;
                        }

                        @media #{$lg} {
                            width: 940px;
                        }

                        &.home {
                            &-2 {
                                @media #{$xxl} {
                                    left: -110px;
                                }

                                @media #{$xl} {
                                    left: -250px;
                                }
                            }

                            &-3 {
                                @media #{$x3l} {
                                    left: -250px;
                                }

                                @media #{$xxl,$xl} {
                                    left: -300px;
                                }
                            }

                            &-4 {
                                @media #{$xl} {
                                    left: -295px;
                                }
                            }
                        }
                    }

                    &>a {
                        position: relative;
                        font-size: 18px;
                        font-weight: 600;
                        padding: 16px 0;
                        display: block;
                        color: var(--tp-text-body);
                        @include tp-transition();

                        &.active {
                            color: var(--tp-common-black);
                        }
                    }

                    &:hover {

                        &>.sub-menu,
                        .tp-mega-menu {
                            transform: scaleY(1);
                            visibility: visible;
                        }
                    }
                }
            }
        }

        &-home {
            & nav {
                & ul {
                    & li {
                        &:hover {
                            &>a {
                                color: var(--tp-theme-1);
                            }
                        }

                        & .sub-menu.tp-mega-menu .homemenu-title a:hover {
                            color: var(--tp-theme-1);
                        }
                    }
                }
            }
        }

        &-bars {
            margin-left: 15px;

            & button {
                font-size: 18px;
                padding: 10px 15px;
                border-radius: 5px;
                color: var(--tp-common-white);
                background-color: var(--tp-common-black);
                transition: .3s;

                &:hover {
                    background-color: var(--tp-theme-1);
                }
            }
        }
    }
}

.homemenu {
    position: relative;
    padding: 0px 10px;
    margin-bottom: 20px;

    &-thumb {
        position: relative;
        margin-bottom: 3px;

        & img {
            width: 100%;
        }

        &::before {
            position: absolute;
            content: '';
            top: 0;
            left: 0;
            height: 100%;
            width: 100%;
            background: rgba(38, 34, 33, 0.1);
            transition: all 0.3s 0s ease-out;
        }

        &:hover {
            & .homemenu-btn {
                transform: translateY(-50%);
                opacity: 1;
                visibility: visible;

                & .menu-btn {
                    &::before {
                        display: none;
                    }

                    &.show {
                        &-1 {
                            transform: translateY(0);
                        }

                        &-2 {
                            transform: translateY(0);
                        }
                    }
                }
            }

            &::before {
                opacity: 1;
            }
        }
    }

    &-title {
        & a {
            padding: 0;
            font-size: 16px;
            font-weight: 600;
            color: var(--tp-common-black);

            &::before {
                width: 0;
            }

            &:hover {
                color: var(--tp-theme-1);

                &::before {
                    width: 0;
                }
            }
        }
    }

    &-btn {
        position: absolute;
        top: 50%;
        left: 0;
        right: 0;
        text-align: center;
        transform: translateY(-40%);
        transition: all 0.3s 0s ease-out;
        opacity: 0;

        & .tp-menu-btn {
            position: relative;
            font-size: 14px;
            text-transform: uppercase;
            padding: 15px 20px;
            width: 150px;
            overflow: hidden;
            display: inline-block;
            text-align: center;
            border-radius: 50px;
            color: var(--tp-common-white);
        }
    }
}