// Default variables
$font_size: 14px !default;
$font_size_small: 12px !default;

$input_border_radius: 5px !default;

:root {
    --input-height: 56px;
}

$input_height: 56px !default;
$input_height_small: 36px !default;
$dropdown_padding: 18px !default;

$gray_dark: #444 !default;
$gray: #999 !default;
$gray_light: #e8e8e8 !default;
$gray_lighter: #f6f6f6 !default;
$primary_light: $gray !default;
$arrow_color: $gray !default;

// Style the dropdown
.nice-select {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
    background-image: none;
    box-sizing: border-box;
    clear: both;
    cursor: pointer;
    position: relative;
    line-height: calc(var(--input-height) - 2px);
    user-select: none;
    white-space: nowrap;


    // Arrow
    &:after {
        content: '';
        font-family: var(--icon-font);
        font-weight: 700;
        font-size: 16px;
        pointer-events: none;
        border-bottom: 1px solid $body-color;
        border-right: 1px solid $body-color;
        position: absolute;
        right: 20px;
        line-height: calc(var(--input-height) - 2px);
        top: 21px;
        height: 8px;
        width: 8px;
        transition: all 0.2s ease-in-out;
        transform: rotate(45deg);
    }

    &.open {
        @extend :active;


        &:after {
            transform: rotate(-135deg);
        }

        .list {
            opacity: 1;
            border-radius: 0;
            pointer-events: auto;
            display: block;
            transform: scale(1) translateY(0);  
            border-bottom: 1px solid $theme-color;
        }
    }

    &.disabled {
        border-color: lighten($gray_light, 2%);
        color: $gray;
        pointer-events: none;

        &:after {
            border-color: lighten($arrow_color, 20%);
        }
    }

    // Modifiers
    &.wide {
        width: 100%;

        .list {
            left: 0 !important;
            right: 0 !important;
        }
    }

    &.right {
        float: right;

        .list {
            left: auto;
            right: 0;
        }
    }

    &.small {
        font-size: $font_size_small;
        height: $input_height_small;
        line-height: $input_height_small - 2;

        &:after {
            height: 4px;
            width: 4px;
        }

        .option {
            line-height: $input_height_small - 2;
            min-height: $input_height_small - 2;
        }
    }

    // List and options
    .list {
        width: 100%;
        background-color: #fff;
        border-radius: $input_border_radius;
        box-shadow: 0 0 0 1px rgba($gray_dark, 0.11);
        box-sizing: border-box;
        margin-top: 4px;
        opacity: 0;
        overflow: hidden;
        padding: 0;
        pointer-events: none;
        position: absolute;
        top: 100%;
        left: 0;
        max-height: 250px;
        transform: scaleY(0);
        transform-origin: top;
        transform: scale(0.75) translateY(-$input_height / 2);
        transition: all 0.2s cubic-bezier(0.5, 0, 0, 1.25),
            opacity 0.15s ease-out;
        z-index: 9;

        &:hover .option:not(:hover) {
            background-color: transparent !important;
        }
    }

    .option {
        cursor: pointer;
        font-weight: 400;
        line-height: $input_height - 16px;
        list-style: none;
        min-height: $input_height - 16px;
        outline: none;
        padding-left: $dropdown_padding;
        padding-right: $dropdown_padding + 11;
        text-align: left;
        transition: all 0.2s;

        &:hover,
        &.focus,
        &.selected.focus {
            background-color: $smoke-color;
        }

        &.selected {
            font-weight: bold;
        }

        &.disabled {
            background-color: transparent;
            color: $gray;
            cursor: default;
        }
    }
}

// Use display instead of opacity for IE <= 10
.no-csspointerevents .nice-select {
    .list {
        display: none;
    }

    &.open {
        .list {
            display: block;
        }
    }
}

.currency-menu {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 8px;

    img {
        min-width: 16px;
        min-height: 16px;
        position: relative;
    }

    .nice-select {
        font-family: $body-font;
        background: none;
        border: none;
        width: 100%;
        color: $black-color2;
        font-weight: 400;
        font-size: 14px;
        padding-left: 15px;
        line-height: 16px;
        padding: 0;
        padding-right: 15px;
        border-radius: 0;
        border-right: 1px solid $body-color;
        height: 16px;

        .list {
            width: auto;
            left: -35px;
        }

        &:after {
            content: "\f107";
            right: 0;
            top: -19px;
            font-size: 14px;
            transform: rotate(0deg);
            border-bottom: none;
            border-right: none;
        }

        &.open {
            @extend :active;

            &:after {
                transform: rotate(0deg);
            }

            .list {
                left: -35px;
                opacity: 1;
                pointer-events: auto;
                transform: scale(1) translateY(0);
            }
        }

        .option {
            color: $title-color;
            min-height: 30px;

            &.selected {
                color: $theme-color !important;
                background: $theme-color !important;

                &.focus {
                    color: #fff !important;
                    background: $theme-color !important;
                }
            }

            &:hover,
            &.focus {
                background: $theme-color !important;
                color: #fff !important;
            }
        }
    }
}