﻿.select {
    position: relative;
    width: 100%;
}

.select > button {
    align-items: center;
    background-color: #fff;
    border: 1px solid #cdcdcd;
    border-radius: .4rem;
    display: flex;
    gap: 4px;
    padding: 4px 8px;
    width: 100%;
}

.select > button.open { border-radius: .4rem .4rem 0 0; }

.select > button .arrow {
    height: 12px;
    width: 12px;
    transition: transform 0.4s ease-in-out;
}

.select > button.open .arrow {transform: scaleY(-1); }

.select > button .text {
    flex: auto 1 1;
    overflow: hidden;
    text-align: left;
    text-overflow: ellipsis;
    white-space: nowrap;
    line-height: 1;
}

.select > button .text .selected-item { font-style: italic; }

.select > button .text .selected-item + .selected-item::before { content: ', '; }


.select > .options {
    border: 1px solid #cdcdcd;
    box-shadow: rgba(0, 0, 0, 0.15) 0 3px 3px;
    display: flex;
    flex-direction: column;
    left: 0;
    max-height: calc(20vh + 300px);
    overflow: auto;
    position: absolute;
    right: 0;
    top: calc(100% - 1px);
    z-index: 9;
}

.select > .options .option {
    align-items: center;
    background-color: #fff;
    border: none;
    box-shadow: none;
    display: flex;
    flex: 1 0 auto;
    padding: 0 4px;
    text-align: left;
    width: 100%;
}

.select > .options .option:hover { background-color: #f2f2f2; }

.select > .options .option .text { flex: auto; }

.select > .options .option .status {
    flex: 0 0 14px;
    height: 14px;
    margin: 5px;
    min-height: 14px;
    min-width: 14px;
    width: 14px;
}

.select.multi > .options .option .status { border: 1px solid #cdcdcd; }

.select > .options .option.selected .status {
    background-color: #39f;
    background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 10 10'%3e %3cpath fill='white' d='M8.23 3.14q.12.12.12.3 0 .17-.12.3L5.1 6.85l-.6.58q-.1.12-.28.12-.17 0-.3-.12l-.58-.58L1.77 5.3q-.12-.13-.12-.3 0-.17.12-.3l.6-.58q.1-.12.3-.12.16 0 .28.12L4.22 5.4l2.83-2.84q.12-.12.3-.12.17 0 .3.12z'/%3e %3c/svg%3e");
    border-color: #39f;
}