@media (min-width: 992px) {
    #cat-menu {
        transition: $transition;
        background: #FFF;
        box-shadow: 0 7px 8px 0 rgba(0, 0, 0, .04);
        z-index: 99;
        margin-bottom: 20px;
        position: relative;

        a {
            color: $font-color;
        }

        ul {
            position: relative;
            list-style: none;
            padding: 0;
            margin: 0;

            span[data-icon] {
                display: none !important;
            }
        }

        .menu-item {
            display: inline-block;

            a {
                padding: 7px 12px;

                .cat-icon {
                    font-size: 20px;
                    position: relative;
                    right: 5px;
                    line-height: 0;
                }

                .cat-icon:not(img) {
                    top: 3px;
                }
            }
        }

        #magic-line {
            position: absolute;
            bottom: 0;
            left: 0;
            height: 2px;
            background: $danger;
            transition: $transition;
            z-index: -1;
        }

        .menu-item-has-children {
            position: relative;

            &:hover {
                > .sub-menu {
                    display: block;
                }
            }

            .menu-item-has-children > a {
                position: relative;

                &:after {
                    content: '\203A';
                    position: absolute;
                    right: 12px;
                    font-size: 18px;
                    color: #B1B1B1;
                }
            }
        }

        .menu-item.mega-menu-main-item {
            > a {
                position: relative;
                padding-left: 24px;

                &:before {
                    font-family: IRANKala;
                    content: "\E12E\00FE0E";
                    font-size: 18px;
                    margin-right: 4px;
                    color: #424750;
                    position: absolute;
                    top: 9px;
                    left: 0;
                }

                &:after {
                    content: "";
                    height: 20px;
                    bottom: 13px;
                    position: absolute;
                    width: 1px;
                    background: #F0F0F1;
                    right: -1px;
                }
            }

            > .sub-menu {
                //background: #F4F4F4 !important;
                width: 220px;
                border-bottom-left-radius: $border-radius;
                box-shadow: none;
                border-right: 1px solid #F4F4F4;
                border-bottom: 1px solid #ffffff;

                &.active {
                    > .menu-item:first-child {
                        > a {
                            color: $danger;
                            background: #f9f9f9 !important;
                            border-top: 1px solid #f0f0f1;
                            border-bottom: 1px solid #f0f0f1;
                            border-left: 1px solid #f0f0f1;
                        }

                        .sub-menu {
                            //display: block;
                            display: flex;
                            -webkit-box-orient: vertical;
                            -webkit-box-direction: normal;
                            -ms-flex-direction: column;
                            flex-direction: column;
                            -ms-flex-wrap: wrap;
                            flex-wrap: wrap;
                        }
                    }
                }

                > .menu-item {
                    padding-top: 5px;

                    > a {
                        //background: #F4F4F4;
                        border-top: 1px solid transparent;
                        border-bottom: 1px solid transparent;
                        padding-top: 6px;
                        padding-bottom: 6px;
                    }

                    &:hover > a {
                        background: #f9f9f9;
                        border-top: 1px solid #f0f0f1;
                        border-bottom: 1px solid #f0f0f1;
                    }
                }

                .menu-item-has-children {
                    .sub-menu {
                        background: #FFF;
                        box-shadow: none;
                        border-bottom-right-radius: $border-radius;
                        border-top: 1px solid #F4F4F4;

                        .menu-item-has-children {
                            > a {
                                font-weight: bold;

                                &:after {
                                    right: auto;
                                    margin-left: 7px;
                                    bottom: 6px;
                                }
                            }

                            .menu-item a {
                                color: #4A5F73;
                                line-height: 22px;
                                padding: 3px 12px;
                                font-size: 90%;

                                &:hover {
                                    color: $danger;
                                }
                            }
                        }
                    }

                    &.mega-menu {
                        position: static;

                        > .sub-menu {
                            > .menu-item {
                                //display: inline-block;
                                //float: left;
                            }
                        }

                        .sub-menu {
                            .sub-menu {
                                position: static;
                                display: block;
                                border-top: none;
                            }
                        }
                    }

                    &.mega-menu-col-2 > .sub-menu > .menu-item {
                        width: 49%;
                    }

                    &.mega-menu-col-3 > .sub-menu > .menu-item {
                        width: 32.33%;
                    }

                    &.mega-menu-col-4 > .sub-menu > .menu-item {
                        width: 24%;
                    }

                    &.mega-menu-col-5 > .sub-menu > .menu-item {
                        width: 19%;
                    }

                    &.mega-menu-col-6 > .sub-menu > .menu-item {
                        width: 15.67%;
                    }
                }
            }
        }

        .menu-item:not(.mega-menu-main-item) {
            &.mega-menu {
                position: static;

                > .sub-menu {
                    width: 100%;

                    > .menu-item {
                        display: inline-block;
                        float: left;
                    }
                }

                .sub-menu {
                    a {
                        font-weight: bold;
                        position: relative;

                        &:before {
                            content: '';
                            display: inline-block;
                            width: 2px;
                            background: $danger;
                            height: 14px;
                            left: 4px;
                            top: 13px;
                            position: absolute;
                        }

                        &:after {
                            margin-left: 5px;
                            right: auto;
                        }
                    }

                    .sub-menu {
                        position: static;
                        display: block;
                        border-top: none;
                        box-shadow: none;

                        a {
                            line-height: 24px;
                            font-weight: normal;

                            &:before {
                                display: none;
                            }
                        }
                    }
                }
            }

            &.mega-menu-col-2 > .sub-menu > .menu-item {
                width: 49%;
            }

            &.mega-menu-col-3 > .sub-menu > .menu-item {
                width: 32.33%;
            }

            &.mega-menu-col-4 > .sub-menu > .menu-item {
                width: 24%;
            }

            &.mega-menu-col-5 > .sub-menu > .menu-item {
                width: 19%;
            }

            &.mega-menu-col-6 > .sub-menu > .menu-item {
                width: 15.67%;
            }
        }

        .sub-menu {
            display: none;
            position: absolute;
            left: 0;
            top: 100%;
            background: #FFF;
            width: 200px;
            z-index: 99;
            box-shadow: 0 2px 9px 0 rgba(112, 112, 112, .32);

            .menu-item {
                display: block;
                padding: 0;

                a {
                    padding: 4px 16px;
                }

                &:hover > a {
                    color: $danger;
                }
            }

            > .menu-item a {
                display: block;

                &:hover {
                    color: $danger;
                }
            }

            .menu-item-has-children {
                .sub-menu {
                    left: calc(100% + 1px);
                    top: 0;
                }
            }
        }
    }
    #cat-menu .side-logo {
        display: none;
    }
}

@media (max-width: 992px) {
    #cat-menu {
        width: 285px;
        background-color: #FFF;
        box-shadow: -2px 0 4px 0 rgba(0, 0, 0, 0.13);
        height: 100vh;
        overflow-y: auto;
        overflow-x: hidden;
        z-index: 9999999;
        position: fixed;
        top: 0 !important;
        left: -285px;
        bottom: 0;
        transition: $transition;

        .container {
            padding: 0;
        }

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

        a {
            display: block;
            padding: 7px 15px;
        }

        .cat-menu {
            > li.menu-item {
                > a {
                    > span.cat-icon {
                        font-size: 20px;
                        margin-right: 5px;
                        color: #9A9A9A;
                    }
                }
            }

            .menu-item-has-children {
                span[data-icon] {
                    font-size: 14px;
                    //margin-right: 5px;
                    float: right;
                    //border: 1px solid #9A9A9A;
                    //border-radius: 50%;
                    //padding: 4px 3px 1px 3px;
                    padding: 5px 10px 0 10px;
                    position: relative;
                    top: 6px;

                    &:before {
                        color: #9A9A9A;
                    }
                }

                .cat-icon {
                    //display: none;
                }

                .sub-menu {
                    display: none;
                    height: auto !important;
                    width: auto !important;
                    background-color: #F5F5F5;
                    padding-left: 20px;

                    .sub-menu {
                        a {
                            color: #8C8C8C;
                        }
                    }
                }
            }

            > .menu-item-has-children > .sub-menu {
                -webkit-box-shadow: inset 0 5px 4px -4px rgba(0, 0, 0, .06), inset 0 -5px 4px -4px rgba(0, 0, 0, .06);
                box-shadow: inset 0 5px 4px -4px rgba(0, 0, 0, .06), inset 0 -5px 4px -4px rgba(0, 0, 0, .06);
            }
        }
    }
    body.show-cat-menu {
        #cat-menu {
            left: 0;
        }

        .overlay {
            opacity: 1;
            z-index: 104;
            pointer-events: auto;
        }
    }
    #cat-menu .side-logo {
        display: block;
        text-align: center;
        border-bottom: 1px solid #E5E5EA;
        margin: 0 15px 15px 15px;
        padding: 15px 0;
    }
}

.overlay {
    position: fixed;
    right: 0;
    height: 100%;
    width: 100%;
    top: 0;
    bottom: 0;
    content: "";
    background: rgba(74, 74, 74, .43);
    opacity: 0;
    z-index: 98;
    -webkit-transition: opacity .2s cubic-bezier(.215, .61, .355, 1) .1s;
    transition: opacity .2s cubic-bezier(.215, .61, .355, 1) .1s;
    pointer-events: none;
}

@media (min-width: 992px) {
    #cat-menu {
        .mega-menu-main-item.flex-menu {
            .menu-item-has-children {
                &:hover {
                    > .sub-menu {
                        display: flex;
                        -webkit-box-orient: vertical;
                        -webkit-box-direction: normal;
                        -ms-flex-direction: column;
                        flex-direction: column;
                        -ms-flex-wrap: wrap;
                        flex-wrap: wrap;
                    }
                }
            }
        }

        .menu-item.mega-menu-main-item {
            > .sub-menu {
                &.active {
                    > .menu-item:first-child {
                        .sub-menu {
                            display: flex;
                            -webkit-box-orient: vertical;
                            -webkit-box-direction: normal;
                            -ms-flex-direction: column;
                            flex-direction: column;
                            -ms-flex-wrap: wrap;
                            flex-wrap: wrap;
                        }
                    }
                }

                .menu-item-has-children {
                    &.mega-menu {
                        > .sub-menu {
                            > .menu-item {
                                display: unset;
                                float: none;
                            }
                        }
                    }
                }
            }
        }
    }
}