// DROPDOWN
// ––––––––––––––––––––––––––––––––––––––––––––––––––

.dropdown {
    position: relative;

    &:hover>.dropdown-menu,
    &.menu-showing>.dropdown-menu {
        display: flex !important;
    }

    li {
        list-style: none;
        margin: 0;
    }

    &.btn>.dropdown-menu {
        top: 100% !important;
    }



    // REGULAR DROPDOWN MENU
    &>.dropdown-menu {
        display: none;
        flex-direction: column;
        min-width: 200px;
        width: 100%;
        background: white;
        box-shadow: 0 2px 4px 0 rgba(17, 16, 15, .1), 0 2px 10px rgba(17, 16, 15, .1);
        padding: 5px 0;
        position: absolute;
        right: 0;
        top: 100%;
        white-space: nowrap;
        animation: dropdown 0.220s forwards ease-in-out;
        z-index: 1000;

        .dropdown-group {
            border-bottom: 1px solid #e9ecef;

            .dropdown-title {
                display: block;
                color: $secondary;
                font-weight: bold;
                border-bottom: 1px solid #e9ecef;
                text-align: left;
                white-space: nowrap;
                padding: 10px 15px;
            }

            .inner-dropdown>a,
            &>li>a,
            &>a {
                padding-left: 25px !important;
            }
        }

        .dropdown-divider {
            height: 0;
            overflow: hidden;
            border-top: 1px solid #e9ecef;
        }


        @if $radius {
            border-radius: $border-radius;
        }


        a {
            display: block;
            color: #333;
            text-align: left;
            // white-space: nowrap;
            padding: 10px 15px;

            &.active,
            &.is-active,
            &:hover {
                color: $white;
                background: $primary;
            }
        }

        .menu-hiding {
            animation: dropdownHiding 0.220s forwards ease-in-out;
        }


        .inner-dropdown {
            .dropdown-menu {
                top: 0;
                animation: dropdownInner 0.220s forwards ease-in-out;
                margin-top: 0 !important;
            }

            &.dropdown-right {
                &>.dropdown-menu {
                    left: 100%;
                }
            }

            &.dropdown-left {
                &>.dropdown-menu {
                    left: -100%;
                }
            }

            @media(max-width: 768px) {
                .dropdown-menu {
                    top: 100% !important;
                }

                &.dropdown-right {
                    &>.dropdown-menu {
                        left: 0 !important;
                    }
                }

                &.dropdown-left {
                    &>.dropdown-menu {
                        left: 0 !important;
                    }
                }
            }
        }
    }

    // BIG DROPDOWN MENU
    &.dropdown-bigger {
        position: static;

        &>.dropdown-menu {
            left: 0 !important;
            width: 100%;
            min-width: auto !important;
            max-width: 100% !important;
        }
    }

    &.dropdown-right {
        &>.dropdown-menu {
            right: 0;
        }
    }

    &.dropdown-left {
        &>.dropdown-menu {
            left: 0;
        }
    }


    &.carret:after,
    &>button:after,
    &>div:not(.dropdown-menu):after,
    &>a:after {
        display: inline-block;
        width: 0;
        height: 0;
        margin-left: 10px;
        vertical-align: 4px;
        content: " ";
        border-top: 5px solid;
        border-right: 5px solid transparent;
        border-bottom: 0;
        border-left: 5px solid transparent;
    }

}

// DROPDOWN ANIMATION
@keyframes dropdown {
    0% {
        opacity: 0;
        top: 80%
    }

    100% {
        opacity: 1;
        top: 100%;
    }
}


// DROPDOWN ANIMATION INSIDE DROPDOWN
@keyframes dropdownInner {
    0% {
        opacity: 0;
        top: -10%
    }

    100% {
        opacity: 1;
        top: 0;
    }
}



// DROPDOWN HIDING ANIMATION
@keyframes dropdownHiding {
    0% {
        opacity: 0;
        top: 0
    }

    100% {
        opacity: 1;
        top: -10%;
    }
}