/* Live Search Dropdown */
.live-search-wrapper {
    position: relative;
}

.live-search-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1050;
    background: #fff;
    border: 1px solid #e4e4e4;
    border-top: none;
    border-radius: 0 0 6px 6px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    max-height: 420px;
    overflow-y: auto;
    display: none;
}

.live-search-dropdown.is-open {
    display: block;
}

/* Scrollbar */
.live-search-dropdown::-webkit-scrollbar {
    width: 5px;
}
.live-search-dropdown::-webkit-scrollbar-track {
    background: #f5f5f5;
}
.live-search-dropdown::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

/* Result item */
.live-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    text-decoration: none;
    color: #333;
    border-bottom: 1px solid #f2f2f2;
    transition: background-color 0.15s ease;
    cursor: pointer;
}

.live-search-item:last-child {
    border-bottom: none;
}

.live-search-item:hover,
.live-search-item.active {
    background-color: #f8f9fa;
    color: #333;
    text-decoration: none;
}

.live-search-item:hover .live-search-item__title,
.live-search-item.active .live-search-item__title {
    color: var(--primary, #373b98);
}

/* Thumbnail */
.live-search-item__image {
    width: 48px;
    height: 48px;
    flex-shrink: 0;
    border-radius: 4px;
    overflow: hidden;
    background: #f9f9f9;
    border: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-search-item__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Info (title + sku) */
.live-search-item__info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.live-search-item__title {
    font-size: 0.875rem;
    font-weight: 600;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color 0.15s ease;
}

.live-search-item__sku {
    font-size: 0.75rem;
    color: #999;
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

/* Price */
.live-search-item__price {
    flex-shrink: 0;
    text-align: right;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 1px;
}

.live-search-item__price-current {
    font-size: 0.875rem;
    font-weight: 700;
    color: var(--primary, #373b98);
    white-space: nowrap;
}

.live-search-item__price-old {
    font-size: 0.75rem;
    color: #aaa;
    text-decoration: line-through;
    white-space: nowrap;
}

/* Footer */
.live-search-footer {
    display: block;
    text-align: center;
    padding: 12px 16px;
    border-top: 1px solid #e4e4e4;
    color: var(--primary, #373b98);
    font-size: 0.85rem;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.15s ease;
    background: #fafbfc;
    border-radius: 0 0 6px 6px;
}

.live-search-footer:hover {
    background-color: #f0f1f5;
    color: var(--primary, #373b98);
    text-decoration: none;
}

.live-search-footer i {
    margin-left: 4px;
    font-size: 0.75rem;
}

/* Loading */
.live-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    color: #999;
    font-size: 0.85rem;
    gap: 8px;
}

.live-search-loading i {
    font-size: 1rem;
}

/* Empty */
.live-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 24px 16px;
    color: #999;
    font-size: 0.85rem;
    gap: 6px;
}

.live-search-empty i {
    font-size: 1.5rem;
    opacity: 0.5;
}

/* Header search: override parent overflow:hidden */
.header-search-row {
    overflow: visible !important;
}

/* Header search specific adjustments */
.header-search-box.live-search-wrapper .live-search-dropdown {
    border-radius: 0 0 6px 6px;
    min-width: 360px;
    right: 0;
    left: auto;
}

/* Responsive */
@media (max-width: 991px) {
    .mobile-search-bar .live-search-dropdown {
        position: absolute;
        left: 0;
        right: 0;
        top: 100%;
        max-height: 60vh;
        border-radius: 0 0 8px 8px;
        border: 1px solid #e4e4e4;
        border-top: none;
    }
}
