.aw-dropdown-button {
    display: block;
    width: 100%;

    & > span {
        display: flex;
        gap: 1rem;
        align-items: flex-start;
        padding: 1.125rem 1rem;

        font-size: 1rem;
        line-height: 1.25rem;
    }

    & + & {
        margin-top: -1px;
        border-top: 1px solid var(--c-mono-900);
    }

    &:focus, & > span:focus {
        outline: none;
    }

    /* Same active state for all modifiers */
    &.is-active {
        background-color: rgba(var(--c-info-rgb, 69, 164, 220), 0.2);
    }

    .aw-icon {
        flex-shrink: 0;
        margin-top: calc((1.25rem - var(--icon-size, 1.25rem)) / 2);
    }

    /* Default color */
    &_default {
        color: inherit;

        &:hover {
            @apply bg-mono-900;
        }

        &.is-active {
             @apply bg-mono-900;
        }

        .aw-icon {
            @apply text-mono-400;
        }
    }

    &[disabled] > span {
        opacity: 0.5;
        cursor: not-allowed;
    }
}

@screen md {
    .aw-dropdown-button {
        white-space: nowrap;

        padding: 2px;
        border-radius: theme('borderRadius.default');

        position: relative;

        & > span {
            align-items: center;

            font-size: 0.875rem;
            line-height: 1rem;

            padding: calc(theme('spacing.3') - 2px) calc(theme('spacing.4') - 2px);
        }

        .aw-icon {
            margin-top: 0;
        }

        &:focus > span {
            outline: theme('focusOutline', 'none');
        }

        & + & {
            border-top: none;
            margin-top: 1px;
        }
    }
}

/* Color modifiers */
@each $color in (error) {
    .aw-dropdown-button_$(color) {
        color: var(--c-$(color));

        &:hover {
            background-color: rgba(var(--c-$(color)-rgb), 0.1);
        }
    }
}
