/*
    typeahead
    ---------
    Floating suggestion menu for the generic TypeaheadInput component
    (Components/Inputs/TypeaheadInput.razor). Mirrors the address-lookup
    menu styling so all suggestion dropdowns look identical, minus the
    in-field icon (typeahead inputs are plain form-controls).
*/

.typeahead {
    position: relative;
}

/* Wraps the input + right-edge toggle button so the button can
   absolutely-position inside the field without clipping. */
.typeahead__field {
    position: relative;
}

/* Reserve room on the right so text never runs under the toggle. */
.typeahead__input {
    padding-right: 2rem;
}

/* Clear (X) / open (chevron) affordance inside the right edge of the
   input. Kept out of the Tab order (tabindex=-1 in markup); shown
   muted until hovered, like a Bootstrap select caret. */
.typeahead__toggle {
    position: absolute;
    top: 50%;
    right: 0.3rem;
    transform: translateY(-50%);
    border: 0;
    background: transparent;
    padding: 0.1rem 0.3rem;
    font-size: 1rem;
    line-height: 1;
    color: #6c757d;
    cursor: pointer;
}

.typeahead__toggle:hover,
.typeahead__toggle:focus {
    color: #212529;
}

.typeahead__toggle:disabled {
    opacity: 0.5;
    cursor: default;
    pointer-events: none;
}

.typeahead__menu {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, 0.15);
    border-radius: 0.375rem;
    max-height: 280px;
    overflow-y: auto;
    padding: 0.25rem 0;
}

.typeahead__item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 0.4rem 0.75rem;
    background: transparent;
    border: 0;
    cursor: pointer;
    line-height: 1.25;
    color: #212529;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.typeahead__item:hover,
.typeahead__item:focus {
    background: #f5f7fa;
}

.typeahead__item--muted {
    color: #6c757d;
    cursor: default;
}
