@import "_Mixins.scss";

.typeahead_3 {
    background-image: $caret-down-icon;
    padding-right: 20px !important;
    background-size: .45em;
    background-position: calc(100% - 0.9em) center;
    background-repeat: no-repeat;
    text-overflow: ellipsis;
}

.typeahead-small + .typeahead.dropdown-menu {
    li > a > table > tbody > tr > td {
        padding: 0px;
    }
}

.typeahead-normal + .typeahead.dropdown-menu {
    li > a > table > tbody > tr > td {
        padding: 8px;
    }
}

.typeahead.dropdown-menu {
    border-radius: 0;
    margin-top: 1px;
    min-width: 100%;
    border: 10px solid $input-background-color;

    & > li:nth-child(2n) {
        background-color: $table-even-row-background-color;
    }

    & > li:nth-child(2n + 1) {
        background-color: $table-odd-row-background-color;
    }

    & > li.active > a:hover, .active > a:focus, & > li.active > a {
        background-color: $table-hover-row-background-color;
    }

    & > li > a thead {
        background-color: $table-header-background-color;
    }

    .dropdown-item {
        padding: 0;
        margin: 0;
        border-radius: 0;

        table {
            margin-bottom: 0;
            background-color: transparent;
            color: $table-font-color;

            & > thead > tr > th {
                border-bottom: 2px solid $table-border-color;
                border-top: 0;

                &:not(:last-child) {
                    max-width: 0;
                }
            }

            & > tbody > tr > td {
                @include overflow-ellipsis();
                border-top: 1px solid $table-border-color;

                &:not(:last-child) {
                    max-width: 0;
                }
            }
        }
    }
}

.side-content-move-to-left + .typeahead.dropdown-menu {
    left: -85px !important;
    min-width: 250px;
}

.typeahead.dropdown-menu > .active > a, .typeahead.dropdown-menu > .active > a:focus, .typeahead.dropdown-menu > .active > a:hover {
    color: black;
}

ul.typeahead {
    height: auto;
    max-height: 300px;
    overflow-x: hidden;
}

.typeahead_large + .typeahead.dropdown-menu {
    width: 100%;

    @media(min-width:992px) {
        width: 235%;
    }
}

.typeahead_wide + .typeahead.dropdown-menu {
    width: 100%;

    @media(min-width:992px) {
        width: 200%;
    }
}

.typeahead_medium + .typeahead.dropdown-menu {
    width: 100%;

    @media(min-width:992px) {
        width: 125%;
    }
}

#ItemSearch + .typeahead.dropdown-menu {
    width: 100%;

    @media(min-width:992px) {
        width: 70%;
    }
}

.typeahead-ident-filter {
    .typeahead.dropdown-menu {
        min-width: 500px;

        @media(min-width: 320px) {
            min-width: 200px;
        }

        .dropdown-item {
            padding: 0;
            margin: 0;
            border-radius: 0;

            table {
                & > tbody > tr > td {
                    max-width: 100px;

                    @media(min-width: 320px) {
                        max-width: 50px;
                    }
                }
            }
        }
    }
}

.cancel-invoice-typeahead-container {
    .typeahead.dropdown-menu {
        min-width: 900px;
    }
}