/* -------------------------------------------
    Dropdowns
        - Dropdown
        - Dropdown-expanded
---------------------------------------------- */

// Dropdown
@if use(dropdown) {
    .dropdown {
        position: relative;
        background: transparent;
        border: none;
        font-size: inherit;
        padding: 0;

        &:hover,
        &.show {
            .dropdown-box {
                visibility: visible;
                opacity: 1;
                top: 100%;
            }

            &::after {
                visibility: visible;
                opacity: 1;
                top: calc(100% - 20px);
                transform: translate3d(-50%, 0, 0);
            }

            .dropdown-box {
                transform: translate3d(0, 0, 0);
            }

            >a {
                color: var(--wolmart-primary-color, $primary-color);
            }
        }

        &::after {
            content: '';
            position: absolute;
            z-index: 1001;
            left: 50%;
            top: -9999px;
            transform: translate3d(-50%, -8px, 0);
            border: 11px solid transparent;
            border-bottom: 11px solid #fff;
            transition: opacity .2s ease-out, transform .2s ease-out;
            visibility: hidden;
            opacity: 0;
            cursor: pointer;
            pointer-events: none;
        }

        a {
            display: flex;
            align-items: center;
        }

        >a {
            line-height: 1.1;
            padding: 9px 0;

            &:after {
                display: inline-block;
                margin-#{$left}: 5px;

                font: {
                    family: 'wolmart';
                    weight: 600;
                    size: 9px;
                }

                line-height: 1;
                content: '\e9a6';
            }
        }

        li {

            &.active,
            &:hover {
                >a {
                    color: var(--wolmart-primary-color, $primary-color);
                }
            }
        }
    }

    .dropdown-box {
        position: absolute;
        #{$right}: 0;
        top: -9999px;
        margin: 0;
        padding: .5rem 0;
        color: var(--wolmart-body-color, $body-color);
        background-color: #fff;
        box-shadow: 0 2px 22px rgba(0, 0, 0, 0.1);
        z-index: 1001;
        visibility: hidden;
        opacity: 0;
        width: 100%;
        transition: transform .2s ease-out;
        transform: translate3d(0, -10px, 0);

        a {
            padding: .6rem 1rem;
        }

        li {
            font-size: inherit;
            line-height: 1.1;
        }

        .dir-up & {
            transform: translate3d(0, 10px, 0);
        }
    }
}