/* Mega - Menu
----------------------------------------*/

.mega-menu {
    display: none;
}

.dropdown {
    .dropdown-menu.mega-menu-custom {
        padding: 0;

        @include media-breakpoint-down(xl) {
            padding: 10px 0px;
        }
    }

    .dropdown-toggle:after {
        content: unset;
    }

    @include media-breakpoint-up(xl) {
        &:hover {
            .dropdown-menu {
                &.mega-menu-custom {
                    transform: translateX(-50%) scaleY(1);
                }
            }
        }
    }

    &.has-mega-menu {
        position: static !important;

        @include media-breakpoint-up(xl) {
            .mega-menu-custom {
                width: 100%;
                left: 50%;
                transform: translateX(-50%) scaleY(0);
                top: 100%;
            }
        }

        @include media-breakpoint-down(xl) {
            .mega-menu-custom {
                border: none;

                .sub-menu-list {
                    h3 {
                        display: none;
                    }

                    ul {
                        padding: 0;

                        li {
                            margin-bottom: 15px;
                            max-width: 250px;
                            word-break: break-all;
                            text-overflow: ellipsis;
                            overflow: hidden;

                            a {
                                height: auto;
                                font-weight: 500;
                                font-size: 16px;
                                color: #000000;
                                line-height: 22px;
                                text-transform: none;
                                background: none;
                                border-radius: 0;
                                overflow: inherit;
                                position: relative;
                                z-index: 1;
                                padding: 3px 22px;
                                margin: -3px 0;
                                font-family: "Raleway", sans-serif;
                                font-weight: 700;
                                font-size: 1rem;
                                letter-spacing: 0.9px;

                                &:hover {
                                    color: #ffffff;
                                    text-decoration: none;

                                    &:before {
                                        width: 100%;
                                        height: 100%;
                                    }
                                }

                                &:before {
                                    display: none;
                                    content: "";
                                    width: 12px;
                                    height: 12px;
                                    background: $quaternary-color;
                                    border-radius: 360px;
                                    -webkit-transition: all 0.25s ease-out;
                                    -moz-transition: all 0.25s ease-out;
                                    -o-transition: all 0.25s ease-out;
                                    transition: all 0.25s ease-out;
                                    position: absolute;
                                    top: 50%;
                                    left: 0;
                                    transform: translate(0, -50%);
                                    z-index: -1;
                                }
                            }
                        }
                    }
                }

                .sub-menu-boxes {
                    width: 100%;
                    background: none;
                    padding: 20px;

                    .article-out {
                        display: -ms-flexbox;
                        display: flex;
                        -ms-flex-wrap: wrap;
                        flex-wrap: wrap;
                        padding: 0;
                        .article {
                            @include media-breakpoint-down(xl) {
                                margin-left: -20px;
                                margin-right: -20px;
                                flex-grow: 1 !important;
                            }
                        }
                    }

                    .article {
                        flex-grow: 1;

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

                        .box {
                            margin-bottom: 10px;
                            width: 100%;
                            height: auto;
                            min-height: 100px;
                            display: flex;
                            flex-wrap: wrap;
                            align-items: flex-end;
                            font-family: $font-family-primary;
                            font-weight: 400;
                            font-size: 12px;
                            color: $primary-color;
                            line-height: 16px;
                            text-decoration: none;
                            border-radius: 8px;
                            position: relative;
                            overflow: hidden;
                            padding: 0;
                            margin: 0;

                            .figure {
                                width: 100%;
                                height: 100%;
                                position: absolute;
                                top: 0;
                                left: 0;
                                overflow: hidden;

                                &:before {
                                    content: "";
                                    width: 200%;
                                    height: 200%;
                                    float: left;
                                    box-shadow: inset 0 0 40px rgba(0, 0, 0, 1), inset 0 0 40px rgba(0, 0, 0, 1);
                                    position: absolute;
                                    bottom: 0;
                                    left: -50%;
                                    z-index: 1;
                                }

                                img {
                                    width: auto;
                                    height: auto;
                                    min-width: 100%;
                                    min-height: 100%;
                                    position: absolute;
                                    top: 50%;
                                    left: 50%;
                                    transform: translate(-50%, -50%);
                                    -webkit-transition: all 0.25s ease-out;
                                    -moz-transition: all 0.25s ease-out;
                                    -o-transition: all 0.25s ease-out;
                                    transition: all 0.25s ease-out;
                                }
                            }

                            .aside {
                                z-index: 2;
                                padding: 20px 15px 10px 15px;

                                h3 {
                                    font-weight: 700;
                                    font-size: 16px;
                                    color: inherit;
                                    line-height: 22px;
                                    padding-bottom: 0;
                                }
                            }

                            &:hover,
                            &:focus,
                            &:active {
                                .figure {
                                    img {
                                        transform: translate(-50%, -50%) scale(1.1);
                                    }
                                }
                            }
                        }
                    }
                }
            }
        }
    }
}

#header-type-4 .dropdown-menu.mega-menu-custom {
    flex-wrap: nowrap;

    .sub-menu-list {
        width: 60%;
    }

    .sub-menu-boxes {
        width: 40%;
    }
}

@include media-breakpoint-up(xl) {

    .mega-menu-custom {
        background: #ffffff;

        .sub-menu-list {
            padding: 40px;

            h3 {
                font-weight: 700;
                font-size: 16px;
                line-height: 22px;
                text-transform: uppercase;
                border-bottom: 1px solid #dddddd;
                padding-bottom: 10px;
                margin-bottom: 25px;
                color: $secondary-color;
            }

            ul {

                display: grid;
                grid-template-columns: auto auto auto;
                padding: 0;
                margin: 0 -15px -17px -15px;

                li {
                    width: auto;
                    height: auto;
                    padding: 0 15px 17px 15px;
                    margin: 0;
                    flex: 1;

                    a {
                        height: auto;
                        font-weight: 500;
                        font-size: 16px;
                        color: $tertiary-color;
                        line-height: 22px;
                        text-transform: none;
                        background: none;
                        border-radius: 0;
                        overflow: inherit;
                        position: relative;
                        z-index: 1;
                        padding: 3px 22px;
                        margin: -3px 0;
                        font-family: $font-family-primary;
                        font-weight: $font-weight-bold;
                        font-size: $font-size-16;
                        letter-spacing: 0.9px;

                        &:before {
                            content: "";
                            width: 12px;
                            height: 12px;
                            background: $quaternary-color;
                            border-radius: 360px;
                            -webkit-transition: all 0.25s ease-out;
                            -moz-transition: all 0.25s ease-out;
                            -o-transition: all 0.25s ease-out;
                            transition: all 0.25s ease-out;
                            position: absolute;
                            top: 50%;
                            left: 0;
                            transform: translate(0, -50%);
                            z-index: -1;
                        }
                    }

                    >a:hover,
                    >a:focus,
                    &.current-menu-item>a,
                    &.current-menu-parent>a,
                    &.current-menu-ancestor>a {
                        color: $primary-color;
                        text-decoration: none;

                        &:before {
                            width: 100%;
                            height: 100%;
                        }
                    }
                }
            }
        }

        .sub-menu-boxes {
            width: 100%;
            background: #dddddd;
            padding: 22px 40px;

            .article-out {
                display: -ms-flexbox;
                display: flex;
                -ms-flex-wrap: wrap;
                flex-wrap: wrap;
                padding: 0;
                margin: 0 -15px -20px -15px;
                justify-content: center;
            }

            .article {
                width: auto;
                height: auto;
                padding: 0 15px 20px 15px;
                margin: 0;
                flex: 1;
                max-width: 50%;

                .box {
                    width: 100%;
                    height: auto;
                    min-height: 100px;
                    display: flex;
                    flex-wrap: wrap;
                    align-items: flex-end;
                    font-family: $font-family-primary;
                    font-weight: 400;
                    font-size: 12px;
                    color: $primary-color;
                    line-height: 16px;
                    text-decoration: none;
                    border-radius: 8px;
                    position: relative;
                    overflow: hidden;
                    padding: 0;
                    margin: 0;

                    .figure {
                        width: 100%;
                        height: 100%;
                        position: absolute;
                        top: 0;
                        left: 0;
                        overflow: hidden;

                        &:before {
                            content: "";
                            width: 200%;
                            height: 200%;
                            float: left;
                            box-shadow: inset 0 0 40px rgba(0, 0, 0, 1), inset 0 0 40px rgba(0, 0, 0, 1);
                            position: absolute;
                            bottom: 0;
                            left: -50%;
                            z-index: 1;
                        }

                        img {
                            width: auto;
                            height: auto;
                            min-width: 100%;
                            min-height: 100%;
                            position: absolute;
                            top: 50%;
                            left: 50%;
                            transform: translate(-50%, -50%);
                            -webkit-transition: all 0.25s ease-out;
                            -moz-transition: all 0.25s ease-out;
                            -o-transition: all 0.25s ease-out;
                            transition: all 0.25s ease-out;
                        }
                    }

                    .aside {
                        width: 100%;
                        float: left;
                        position: relative;
                        z-index: 2;
                        padding: 20px 15px 10px 15px;

                        h3 {
                            font-weight: 700;
                            font-size: 16px;
                            color: inherit;
                            line-height: 22px;
                            padding-bottom: 0;
                        }
                    }

                    &:hover,
                    &:focus,
                    &:active {
                        .figure {
                            img {
                                transform: translate(-50%, -50%) scale(1.1);
                            }
                        }
                    }
                }
            }
        }
    }


}

@include media-breakpoint-down(xl) {
    #header-type-1,#header-type-2 {
        .navbar .container .nav-link {
            max-width: 100% !important;
            position: relative;

            &.dropdown-toggle {
                &.show {
                    &::after {
                        transform: rotate(180deg);
                    }
                }

                &::after {
                    content: "";
                    font-family: "Font Awesome 5 Pro";
                    font-weight: 900;
                    font-size: 1.25rem;
                    line-height: 0.8rem;
                    border: none;
                    position: absolute;
                    right: 0px;
                    top: 22px;
                    color: #000000;
                    margin-left: 0;
                    vertical-align: 0;
                }
            }
        }
    }
}