/* ==========================================================================
   LeBox Search — Autocomplete & Search Results
   ========================================================================== */

/* --- Autocomplete dropdown --- */
.lebox-search {
    position: relative;
}

.lebox-search__dropdown {
    position: absolute;
    top: 100%;
    left: 50%;
    right: auto;
    width: min(680px, calc(100vw - 2rem));
    transform: translateX(-50%);
    z-index: 1050;
    display: none;
    background: #fff;
    border: 1px solid rgba(0, 0, 0, .15);
    border-top: none;
    border-radius: 0 0 .375rem .375rem;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .1);
    max-height: 420px;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

@media (max-width: 767.98px) {
    .lebox-search__dropdown {
        left: 0;
        right: 0;
        width: auto;
        transform: none;
    }
}

.lebox-search__dropdown.is-open {
    display: block;
}

/* --- Autocomplete items --- */
.lebox-autocomplete__item {
    transition: background-color .15s ease;
    border-bottom: 1px solid rgba(0, 0, 0, .05);
}

.lebox-autocomplete__item:last-child {
    border-bottom: none;
}

.lebox-autocomplete__item:hover,
.lebox-autocomplete__item:focus,
.lebox-autocomplete__item.is-focused {
    background-color: #f8f9fa;
}

.lebox-autocomplete__simple {
    color: #212529;
}

.lebox-autocomplete__text {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lebox-autocomplete__thumb img {
    width: 48px;
    height: 48px;
    object-fit: contain;
    border-radius: .25rem;
    background: #fff;
}

.lebox-autocomplete__no-thumb {
    width: 48px;
    height: 48px;
    background: #f8f9fa;
    border-radius: .25rem;
}

.lebox-autocomplete__icon {
    width: 48px;
    height: 48px;
}

.lebox-autocomplete__name mark {
    padding: 0;
    background-color: #fff3cd;
}

.lebox-autocomplete__show-all {
    border-top: 1px solid rgba(0, 0, 0, .1);
    color: #FB3199 !important;
    font-size: .875rem;
}

.lebox-autocomplete__show-all:hover {
    background: #f8f9fa;
    color: #CE006A !important;
}

.lebox-autocomplete__empty {
    font-size: .875rem;
}

/* --- Search results page — product cards --- */
.search-product-card {
    border: 1px solid rgba(0, 0, 0, .08);
    transition: background-color .15s ease, box-shadow .15s ease;
}

.search-product-card:hover {
    background-color: #f8f9fa;
    box-shadow: 0 .125rem .375rem rgba(0, 0, 0, .08);
}

.search-product-card__image img {
    width: 80px;
    height: 80px;
    object-fit: contain;
    border-radius: .25rem;
    background: #fff;
}

.search-product-card__no-image {
    width: 80px;
    height: 80px;
    background: #f8f9fa;
    border-radius: .25rem;
}

.search-product-card__name {
    line-height: 1.3;
}

.search-product-card__name mark {
    padding: 0;
    background-color: #fff3cd;
}

.search-product-card__brand {
    font-size: .8rem;
}

.search-product-card__price {
    font-size: 1rem;
    white-space: nowrap;
}

/* --- Responsive --- */
@media (max-width: 575.98px) {
    .search-product-card__image img {
        width: 60px;
        height: 60px;
    }

    .search-product-card__no-image {
        width: 60px;
        height: 60px;
    }

    .lebox-autocomplete__thumb img {
        width: 40px;
        height: 40px;
    }

    .lebox-autocomplete__no-thumb {
        width: 40px;
        height: 40px;
    }

    .lebox-autocomplete__icon {
        width: 40px;
        height: 40px;
    }
}
