.simple-menu {
    display: none;
    position: absolute;
    min-width: 170px;
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    margin: 0;
    padding: 0;
    transform: scale(0);
    transform-origin: top left;
    border-radius: 2px;
    background-color: white;
    white-space: nowrap;
    opacity: 0;
    overflow-x: hidden;
    overflow-y: auto;
    box-sizing: border-box;
    will-change: transform, opacity;
    z-index: 48;

    @include z-depth(4);

    &--theme-dark,
    .theme--dark & {
        background-color: #424242;
    }

    &:focus {
        outline: none;
    }

    &--open {
        display: inline-block;
        opacity: 1;
        transform: scale(1);
    }

    &--animating {
        display: inline-block;
        transition: opacity $simple-menu-fade-duration cubic-bezier(0, 0, 0.2, 1);
    }

    &__items {
        box-sizing: border-box;
        overflow-x: hidden;
        overflow-y: auto;
        will-change: transform;

        > * {
            opacity: 0;
        }

        > .list-item {
            cursor: pointer;
        }

        .simple-menu--animating & {
            overflow-y: hidden;

            > * {
                transition-duration: $simple-menu-item-fade-duration;
                transition-property: opacity;
                transition-timing-function: cubic-bezier(0, 0, 0.2, 1);
            }
        }

        .simple-menu--open & {
            > * {
                opacity: 1;
                will-change: opacity;
            }
        }
    }

    [dir="rtl"] & {
        transform-origin: top right;
    }

    // Note: it's appropriate to use `!important` for these since:
    // - they override defaults at several levels of specificity;
    // - they're optional classes that are purposely added by the developer to obtain a desired behaviour.
    &--open-from-top-left {
        transform-origin: top left !important;
    }

    &--open-from-top-right {
        transform-origin: top right !important;
    }

    &--open-from-bottom-left {
        transform-origin: bottom left !important;
    }

    &--open-from-bottom-right {
        transform-origin: bottom right !important;
    }

    .list-group,
    .list {
        padding: 8px 0;
    }

    .list-item {
        @include typography-subheading-2();

        align-items: center;
        display: flex;
        height: 48px;
        justify-content: flex-start;
        outline: none;
        padding: 0 28px 0 16px;
        position: relative;
        text-decoration: none;
        user-select: none;

        &::before {
            color: rgba($form-focus-color, 0.75);
        }

        .simple-menu--theme-dark#{&},
        .theme--dark & {
            color: white;
        }
    }

    .list-divider {
        .simple-menu--theme-dark#{&},
        .theme--dark & {
            border-color: rgba(white, .12);
        }
    }

    .list-item__start-detail {
        color: rgba(black, .54);

        .simple-menu--theme-dark#{&},
        .theme--dark & {
            color: rgba(white, .54);
        }
    }

    &--selected.list-item,
    &--selected.list-item .list-item__start-detail {
        color: $fancy-select-primary-color;  // was primary.
    }

    .list-item::before {
        background: currentColor;
        border-radius: inherit;
        content: '';
        height: 100%;
        left: 0;
        opacity: 0;
        position: absolute;
        top: 0;
        transition: opacity 120ms cubic-bezier(0, 0, 0.2, 1);
        width: 100%;
    }

    .list-item:focus::before {
        opacity: 0.12;
    }

    .list-item:active::before {
        opacity: 0.18;
    }

    .list-item[aria-disabled="true"] {
        cursor: default;

        color: $fancy-select-text-disabled-color;  // was text-disabled-on-light.

        .select--theme-dark &,
        .theme--dark & {
            color: $fancy-select-text-disabled-color;  // was text-disabled-on-dark.
        }
    }

    .list-item[aria-disabled="true"] {
        &:focus::before,
        &:active::before {
            opacity: 0;
        }
    }
}
