/* ================================================================
   Live Search Autocomplete — Brand Gadgets
   ================================================================ */

.advanced-search {
    position: relative;
}

/* Dropdown container */
#bgSearchDropdown {
    position: absolute;
    top: calc(100% + 2px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, .13);
    z-index: 99999;
    max-height: 500px;
    overflow-y: auto;
    font-family: 'Muli', sans-serif;
    font-size: 14px;
    opacity: 0;
    transform: translateY(-6px);
    transition: opacity .18s ease, transform .18s ease;
    pointer-events: none;
}

#bgSearchDropdown.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

/* Section header */
.bg-search__header {
    padding: 8px 14px 6px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .6px;
    text-transform: uppercase;
    color: #aaa;
    border-bottom: 1px solid #f0f0f0;
}

/* Single result item */
.bg-search__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 9px 14px;
    text-decoration: none;
    color: #333;
    transition: background .12s;
    cursor: pointer;
}

.bg-search__item:hover,
.bg-search__item.is-active {
    background: #f0f7ff;
    color: #333;
    text-decoration: none;
}

/* Thumbnail */
.bg-search__img {
    flex-shrink: 0;
    width: 52px;
    height: 52px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bg-search__img img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Text block */
.bg-search__info {
    flex: 1;
    min-width: 0;
}

.bg-search__name {
    display: block;
    font-weight: 600;
    font-size: 13px;
    color: #222;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.bg-search__name mark {
    background: #fff3cd;
    color: #222;
    padding: 0 1px;
    border-radius: 2px;
}

.bg-search__code {
    display: block;
    font-size: 11px;
    color: #999;
    margin-top: 2px;
}

/* Price block */
.bg-search__price {
    flex-shrink: 0;
    text-align: right;
}

.bg-search__price-brutto {
    display: block;
    font-weight: 700;
    font-size: 14px;
    color: #0c83e2;
    white-space: nowrap;
}

.bg-search__price-netto {
    display: block;
    font-size: 11px;
    color: #aaa;
    white-space: nowrap;
}

/* Footer — "show all results" */
.bg-search__footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 14px;
    border-top: 1px solid #f0f0f0;
    font-size: 13px;
    color: #555;
    text-decoration: none;
    background: #fafafa;
    border-radius: 0 0 6px 6px;
    transition: background .12s;
}

.bg-search__footer:hover {
    background: #f0f7ff;
    color: #0c83e2;
    text-decoration: none;
}

.bg-search__footer strong {
    color: #0c83e2;
    font-weight: 700;
}

/* Empty state */
.bg-search__empty {
    padding: 20px 14px;
    text-align: center;
    color: #aaa;
    font-size: 13px;
}

.bg-search__empty i {
    display: block;
    font-size: 28px;
    margin-bottom: 8px;
    color: #ddd;
}

/* Loading state */
.bg-search__loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 14px;
    color: #aaa;
    font-size: 13px;
}

.bg-search__spinner {
    width: 18px;
    height: 18px;
    border: 2px solid #e0e0e0;
    border-top-color: #0c83e2;
    border-radius: 50%;
    animation: bgSearchSpin .7s linear infinite;
    flex-shrink: 0;
}

@keyframes bgSearchSpin {
    to { transform: rotate(360deg); }
}
