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

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

.main-menu{
    & > nav > ul{
        & > li{
            position: relative;
            list-style: none;
            display: inline-block;
            margin-right: 27px;

            @media #{$xxl}{
                margin-right: 19px;
            }

            &.has-mega-menu{
                position: static;
            }
            & > a{
                display: inline-block;
                font-size: 16px;
                color: var(--tp-common-white);
                padding: 23px 0;
                position: relative;

                &::before{
                    position: absolute;
                    content: '';
                    left: calc(50% - 2px);
                    bottom: 16px;
                    width: 4px;
                    height: 4px;
                    border-radius: 50%;
                    visibility: hidden;
                    opacity: 0;
                    background-color: var(--tp-common-white);
                    @extend %tp-transition-common;
                }
            }
			&.has-dropdown{
				& > a{
                    position: relative;
                    &::before{
                        left: calc(50% - 7px);

                        [dir=rtl] & {
                            left: unset;
                            right: calc(50% - 7px);
                        }
                    }
                    &::after{
                        content: '\f107';
                        @include transform(translateY(1px));
                        font-size: 14px;
                        color: var(--tp-common-white);
                        font-family: var(--tp-ff-fontawesome);
                        font-weight: 400;
                        margin-left: 5px;
                        display: inline-block;
                        @extend %tp-transition;

                        [dir=rtl] & {
                            margin-left: unset;
                            margin-right: 5px;
                        }
                    }
                }
			}
			& > .tp-submenu{
                position: absolute;
                top: 100%;
                left: 0;
                min-width: 200px;
                background: var(--tp-common-white);
                z-index: 99;
                visibility: hidden;
                opacity: 0;
                box-shadow: 0px 30px 70px 0px rgba(11, 6, 70, 0.08);
                @extend %tp-transition-common;
                padding: 12px 25px 20px;
                transform-origin: top;
                transition-duration: .1s;
                @include transform(perspective(300px) rotateX(-18deg));

                [dir=rtl] & {
                    left: unset;
                    right: 0;
                }
                & li{
                    display: block;
                    width: 100%;
					margin: 0;
                    &:not(:last-child){
                        margin-right: 0;

                        [dir=rtl] & {
                            margin-right: unset;
                            margin-left: 0;
                        }
                    }
                    &.has-dropdown{
                        & > a{
                            &::after{
                                position: absolute;
                                right: 0;
                                content: '\f107';
                                font-size: 14px;
                                color: var(--tp-common-black);
                                font-family: var(--tp-ff-fontawesome);
                                font-weight: 400;
                                margin-left: 5px;
                                display: inline-block;
                                @extend %tp-transition;
                                @include transform(translateY(0%) rotate(-90deg));

                                [dir=rtl] & {
                                    right: unset;
                                    left: 0;
                                    margin-left: unset;
                                    margin-right: 5px;
                                }
                            }
                        }
                    }
                    & a{
                        padding: 3px 0;
                        font-size: 14px;
                        position: relative;
                        z-index: 1;
						color: var(--tp-text-body);
						width: 100%;    
                        display: block;                    
                    }
                    & > .tp-submenu{
                        left: 120%;
                        top:0;
                        visibility: hidden;
                        opacity: 0;

                        [dir=rtl] & {
                            left: unset;
                            right: 120%;
                        }
                    }
                    &:hover{
                        & > a{
                            color: var(--tp-theme-primary);
                            &::after{
                                color: var(--tp-theme-primary);
                            }
                        }
                    }
                }
            }


            & .tp-mega-menu{
                position: absolute;
                top: 100%;
                left: 0;
                right: 0;
                width: 100%;
                background-color: var(--tp-common-white);
                box-shadow: 0px 20px 30px rgba(1, 15, 28, 0.1);
                z-index: 9;
                padding: 20px 20px 0;
                visibility: hidden;
                opacity: 0;
                @extend %tp-transition;
                transition-duration: .1s;
                transform-origin: top;
                @include transform(perspective(300px) rotateX(-18deg));


                &.mega-menu-style-2{
                    padding: 25px 40px 0;
                }

                & li{
                    margin-bottom: 35px;
                    float: left;
                    width: 25%;
                    overflow: hidden;

                    [dir=rtl] & {
                        float: right;
                    }

                    &.has-dropdown{
                        & > a{
                            &::after{
                                display: none;
                            }
                        }
                    }
                    & .mega-menu-title{
                        font-size: 16px;
                        color: var(--tp-common-black);
                        display: block;
                        margin-bottom: 7px;
                    }

                }

                & ul{
                    & li{
                        float: none;
                        width: 100%;
                        line-height: 1;
                        margin-bottom: 0;

                        &:not(:last-child){
                            margin-bottom: 9px;
                        }
                    }
                    
                }

                & .tp-submenu{
                   @include tp-transition(all, .3s);
                }
                
            }
            &:hover{
				& > a{
					color: var(--tp-common-white);
                    &::before{
                        visibility: hidden;
                        opacity: 1;
                    }
					&::after{
						color: var(--tp-common-white);
					}
				}
				& > .tp-submenu{
					visibility: visible;
					opacity: 1;
                    transition-duration: .2s;
                    @include transform(perspective(300px) rotateX(0deg));
				}
                & > .tp-mega-menu{
                    visibility: visible;
                    opacity: 1;
                    transition-duration: .2s;
                    @include transform(perspective(300px) rotateX(0deg));

                    & .tp-submenu{
                        visibility: visible;
                        opacity: 1;
                        transition-delay: 0s;
                    }
                }
			}
        }
    }
    &.menu-style-1{
        padding-left: 7px;

        [dir=rtl] & {
            padding-left: unset;
            padding-right: 7px;
        }
        @media #{$lg, $md, $sm, $xs}{
            padding-left: 0;
            margin-right: -40px;

            [dir=rtl] & {
                padding-left: unset;
                padding-right: 0;
                margin-right: unset;
                margin-left: -40px;
            }
        }
        & > nav > ul{
            & > li{
                display: inline-block;

                &:not(:last-child){
                    margin-right: 25px;

                    [dir=rtl] & {
                        margin-right: unset;
                        margin-left: 25px;
                    }

                    @media #{$lg}{
                        margin-right: 20px;

                        [dir=rtl] & {
                            margin-right: unset;
                            margin-left: 20px;
                        }
                    }
                }
                & > a{
                    @extend %tp-ff-roboto;
                    font-weight: 500;
                    font-size: 14px;
                    color: var(--tp-common-black);
                    padding: 11px 0;
                }

                &:hover{
                    & > a{
                        color: var(--tp-theme-primary);
                    }
                }

            }
        }
    }

    &.menu-style-2{
        margin-left: -30px;

        [dir=rtl] & {
            margin-left: unset;
            margin-right: -30px;
        }
        & > nav > ul{
            &  > li{
                margin-right: 20px;

                [dir=rtl] & {
                    margin-right: unset;
                    margin-left: 20px;
                }
                @media #{$xl}{
                    
                    margin-right: 15px;

                    [dir=rtl] & {
                        margin-right: unset;
                        margin-left: 15px;
                    }
                }
                & > a{
                    padding: 22px 0;
                }

                &:hover{
                    & > a{
                        color: var(--tp-theme-secondary);
                        &::after{
                            color: var(--tp-theme-secondary);
                        }
                    }
                }

                & .tp-submenu{
                    & li{
                        &:hover{
                            & > a{
                                color: var(--tp-theme-secondary);
                                &::after{
                                    color: var(--tp-theme-secondary);
                                }
                            }
                        }
                    }
                }

                & .home-menu-title{
                    & a{
                        &:hover{
                            color: var(--tp-theme-secondary);
                        }
                    }
                }
                & .home-menu-item:hover .home-menu-title {
                    color: var(--tp-theme-secondary);
                }
            }
        }

        .tp-menu-showcase-btn-2 {
            border-radius: 0;
            background-color: var(--tp-theme-secondary);
            
        }
    }

    &.menu-style-3{
        & > nav > ul{
            &  > li{
                text-align: left;

                [dir=rtl] & {
                    text-align: right;
                }

                @media #{$xl}{
                    margin-right: 20px;

                    [dir=rtl] & {
                        margin-right: unset;
                        margin-left: 20px;
                    }
                }
                & > a{
                    padding: 17px 0;
                    color: var(--tp-common-white);
                }
                &.has-dropdown{
                    & > a{
                        &::after{
                            color: var(--tp-common-white);
                        }
                    }
                }

                &.tp-menu-line{
                    position: absolute !important;
                    margin: 0;
                    text-align: initial;
                    display: block;
                }

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

                
                & .home-menu-title{
                    & a{
                        &:hover{
                            color: var(--tp-theme-brown);
                        }
                    }
                }
                & .home-menu-item:hover .home-menu-title {
                    color: var(--tp-theme-brown);
                }
                
                & .tp-submenu{
                    text-align: left;

                    [dir=rtl] & {
                        text-align: right;
                    }
                    & li{
                        &:hover{
                            & > a{
                                color: var(--tp-theme-brown);
                                &::after{
                                    color: var(--tp-theme-brown);
                                }
                            }
                        }
                    }
                }
            }
        }
        & .tp-menu-showcase-btn-2 {
            border-radius: 0;
            background-color: var(--tp-theme-brown);
        }
    }

    &.menu-style-3.menu-style-4{
        & > nav > ul{
            &  > li{
                text-align: left;

                [dir=rtl] & {
                    text-align: right;
                }
                @media #{$xl}{
                    margin-right: 20px;

                    [dir=rtl] & {
                        margin-right: unset;
                        margin-left: 20px;
                    }
                }
                & > a{
                    color: rgba($color: $white, $alpha: .8);
                    font-weight: 500;

                }
                &.has-dropdown{
                    & > a{
                        &::after{
                            color: rgba($color: $white, $alpha: .8);
                        }
                    }
                }

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

                & .tp-submenu{
                    text-align: left;

                    [dir=rtl] & {
                        text-align: right;
                    }
                    & li{
                        & a{
                            color: var(--tp-common-black);
                        }
                        &.has-dropdown{
                            & > a{
                                &::after{
                                    color: var(--tp-common-black);
                                }
                            }
                        }
                        &:hover{
                            & > a{
                                color: var(--tp-theme-brown);
                                &::after{
                                    color: var(--tp-theme-brown);
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}


.home-menu{
    $menu : &;
    &-item{
        text-align: center;
        margin-bottom: 22px;
        & a{
            border: 0 !important;
            padding: 0 !important;
        }
        &:hover{
            #{$menu}{
                &-thumb{
                    box-shadow: none;
                    &::after{
                        opacity: 1;
                        visibility: visible;
                    }
                }
                &-title{
                    color: var(--tp-theme-primary);
                }
            }
        }

        & .menu-text{
            display: none !important;
        }
    }
    &-thumb{
        position: relative;
        margin-bottom: 10px;
        box-shadow: 0px 2px 6px rgba(1, 15, 28, 0.2);
        @extend %tp-transition;
        & img{
            @include tp-transition(transform, .2s);
            max-width: 100%;
        }
        &::after{
            position: absolute;
            content: '';
            left: 0;
            top: 0;
            width: 100%;
            height: 100%;
            background-color: rgba($color: $black, $alpha: .3);
            visibility: hidden;
            opacity: 0;
            @extend %tp-transition;

            [dir=rtl] & {
                left: unset;
                right: 0;
            }
        }
    }
    &-title{
        font-size: 20px;
        font-weight: 400;
        margin-bottom: 0;

        & a{
            &:hover{
                color: var(--tp-theme-primary);
            }
        }
    }
}

.shop-mega-menu{
    padding: 30px 40px 0 !important;
    padding-bottom: 30px !important;
    &-title{
        font-size: 16px;
        font-weight: 400;
        border-bottom: 1px solid #eee;
        padding-bottom: 7px;
        margin-bottom: 15px;
        display: block;
        color: var(--tp-common-black);
    }
    &-img{
        position: relative;
        overflow: hidden;
        height: calc(100% - 30px);
        &:hover{
            & img{
                @include transform(scale(1.1));
            }
        }
        & img{
            width: 100%;
            height: 100%;
            object-fit: cover;
            @extend %tp-transition;
        }
    }
    &-btn{
        position: absolute;
        bottom: 30px;
        left: 0;
        right: 0;
        text-align: center;

        [dir=rtl] & {
            left: unset;
            right: 0;
        }
    }
    &-list{
        & a{

        }
    }
    &-arrow{
        & button{

        }
    }
}


