.chosen-container {
    position: relative;
    min-width: 190px;
    display: inline-block;
    vertical-align: middle;
    zoom: 1;
    *display: inline;
    -webkit-user-select: none;
    -moz-user-select: none;
    user-select: none;
    width: 100%;
    border-radius: @border_radius;

    a {
        cursor: pointer;
    }

    .chosen-drop {
        position: absolute;
        top: 100%;
        left: -9999px;
        width: 100%;
        border-top: 0;
        background: #fff;
        z-index:6000;
    }

    .search-choice .group-name, .chosen-single .group-name {
        margin-right: 4px;
        overflow: hidden;
        white-space: nowrap;
        text-overflow: ellipsis;
        color: #fff;

        &::after {
            content: ":";
            padding-left: 2px;
            vertical-align: top;
        }
    }

    .chosen-single {
        position: relative;
        display: block;
        overflow: hidden;
        text-align: left;
        padding: 0 35px 0 10px;
        height: 45px;
        background-color: #fff;
        text-decoration: none;
        white-space: nowrap;
        line-height: 45px;
        color: @text_color;
        border-radius: @border_radius;
        border: 1px solid @border_color;
        font-family: @body_font;
        .rems(13);

        @media @mobile {
            .rems(16);
        }

        span {
            display: block;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
            line-height: 43px;
        }

        .chosen-single-with-deselect span {
            margin-right: 38px;
        }

        abbr {
            position: absolute;
            top: 6px;
            right: 26px;
            display: block;
            width: 12px;
            height: 12px;
            font-size: 1px;
        }

        div {
            position: absolute;
            top: 0;
            right: 25px;
            display: block;
            width: 18px;
            height: 100%;

            b {
                display: block;
                width: 100%;
                height: 100%;

                &:after {
                    position: absolute;
                    right: -15px;
                    top: 0;
                    .fa(f107, @text_color);
                    transition: transform 0.2s ease 0s;
                }
            }
        }
    }

    .chosen-search, .search-field {
        .clearfix();
        position: relative;
        z-index: 1010;
        margin: 5px;
        padding: 0;
        white-space: nowrap;
        width: 100%;

        &:after {
            position: absolute;
            top: 50%;
            right: 10px;
            transform: translateY(-50%);
            .fa(f002);
            z-index: 1000;
        }

        a {
            text-decoration: none;
        }

        input[type="search"] {
            float: none;
            outline: 0;
            padding: 5px 10px;
            width: 100% !important;
        }
    }

    &.chosen-container-active {

        .chosen-single {
            border: 1px solid @highlight_color;
        }
    }
}

.chosen-drop {
    margin-top: -3px;
    border-radius: 0 0 @border_radius @border_radius;
    background-clip: padding-box;
    text-align: left;
    border: 1px solid @primary_color;
    border-top: 0;
    overflow: hidden;

    &.chosen-dropup {
        margin-top: 0;
        margin-bottom: -3px;
        border-radius: @border_radius @border_radius 0 0;
        border-top: 1px solid @primary_color;
        border-bottom: 0;
    }
}

&.chosen-with-drop .chosen-drop {
    left: 0;
}

.chosen-container-single.chosen-container-single-nosearch .chosen-search {
    position: absolute;
    left: -9999px;
}

.chosen-container {

    .chosen-results {
        float: left;
        width: 100%;
        background: #fff;
        position: relative;
        overflow-x: hidden;
        overflow-y: auto;
        max-height: 240px;
        -webkit-overflow-scrolling: touch;
        margin: 0;
        padding: 0;

        li {
            margin: 0;
            padding: 5px 10px;
            list-style-type: none;
            word-wrap: break-word;
            -webkit-touch-callout: none;
            color: @text_color;
            font-family: @body_font;
            .rems(13);

            @media @mobile {
                .rems(16);
            }

            em {
                font-style: normal;
                text-decoration: underline;
            }

            &.active-result {
                cursor: pointer;
            }

            &.disabled-result {
                display: list-item;
                color: #ccc;
                cursor: default;
            }

            &.highlighted {
                background-color: @primary_color;
                color: #fff;
            }

            .group-result {
                display: list-item;
                cursor: default;
            }

            .group-option {
                padding-left: 15px;
            }
        }
    }
}

.chosen-container-multi {

    .search-field {
        position: static;
        float: none;
        clear: none;
        width: auto;
    }

    .chosen-choices {
        position: relative;
        overflow: hidden;
        display: block;
        width: 100%;
        height: auto !important;
        background: #fff;
        border: 1px solid @border_color;
        border-radius: @border_radius;
        cursor: text;
        margin: 0;
        padding: 3px;

        &.chosen-with-drop {
            border-radius: @border_radius @border_radius 0 0;
        }

        li {
            float: left;
            list-style-type: none;

            &.search-field {
                margin: 0;

                input[type="search"] {
                    border: none;
                }
            }

            &.search-choice-focus {
                background: #d4d4d4;
            }

            &.search-choice {
                position: relative;
                padding: 3px 20px 3px 5px;
                margin: 3px;
                max-width: 100%;
                background-repeat: repeat-x;
                background-clip: padding-box;
                color: #fff;
                cursor: default;
                background-color: @med_color;

                span {
                    word-wrap: break-word;
                }

                .search-choice-close {
                    position: absolute;
                    top: 50%;
                    right: 0;
                    display: inline-block;
                    text-decoration: none;
                    margin: 0;
                    padding: 3px 5px;
                    transform: translateY(-50%);
                    border-radius: @border_radius;

                    &:after {
                        position: relative;
                        .fa(@fa-var-times, #fff, 'regular');
                    }
                }
            }
        }
    }

    .chosen-results {
        margin: 0;
        padding: 0;
    }

    .chosen-drop {

        &.chosen-dropup {
            border-radius: @border_radius @border_radius 0 0;
            margin-bottom: -2px;
        }

        .result-selected {
            display: list-item;
            color: #ccc;
            cursor: default;
        }
    }
}


.chosen-disabled {
    cursor: default;
    pointer-events: none;

    .chosen-single {
        cursor: default;
        background: @light_color;
        border: 1px solid  @border_color;
        color: @med_color;

        div b:after {
            color: @med_color;
        }
    }

    .chosen-choices .search-choice .search-choice-close {
        cursor: default;
    }
}

.chosen-container-active {

    &.chosen-with-drop {

        .chosen-single {

            div {
                border-left: none;
                background: transparent;

                b {

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

    .chosen-with-dropup .chosen-single {
        border-radius: 0 0 @border_radius @border_radius;
    }
}

.mobileChosen {
    position: relative;
    min-width: 200px;

    select {
        display: block !important;
        position: absolute;
        left: 0;
        top: 0;
        width: 100%;
        height: 100%;
        opacity: 0;
        cursor: pointer;
        z-index: 998;
    }
}
