/* Smart Search Styles */

.smart-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    max-height: 500px;
    overflow-y: auto;
    z-index: 1050;
    margin-top: 8px;
}

.smart-search-content {
    padding: 0.5rem;
}

.search-section {
    padding: 0.5rem;
}

.search-section-title {
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    color: #6c757d;
    margin-bottom: 0.75rem;
    padding: 0 0.5rem;
}

/* Popular Searches */
.popular-searches {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.popular-search-item {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    padding: 0.75rem;
    color: #495057;
    text-decoration: none;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.popular-search-item:hover {
    background: #f8f9fa;
    color: var(--bs-primary);
}

.popular-search-item i {
    color: #adb5bd;
    font-size: 1rem;
}

/* Search Results */
.search-result-item {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 0.75rem;
    text-decoration: none;
    color: inherit;
    border-radius: 6px;
    transition: all 0.2s ease;
    margin-bottom: 0.25rem;
}

.search-result-item:hover,
.search-result-item.active {
    background: #f8f9fa;
    transform: translateX(4px);
}

.search-result-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: #f8f9fa;
}

.search-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.search-result-details {
    flex-grow: 1;
    min-width: 0;
}

.search-result-name {
    font-weight: 500;
    font-size: 0.875rem;
    color: #212529;
    margin-bottom: 0.25rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.search-result-name mark {
    background: #fff3cd;
    padding: 0 0.2em;
    border-radius: 2px;
}

.search-result-category {
    font-size: 0.75rem;
    color: #6c757d;
    margin-bottom: 0.25rem;
}

.search-result-price {
    font-size: 0.875rem;
}

.search-result-stock {
    flex-shrink: 0;
}

.search-result-stock .badge {
    font-size: 0.7rem;
    padding: 0.35em 0.65em;
}

/* Loading State */
.spinner-border-sm {
    width: 1.5rem;
    height: 1.5rem;
}

/* Scrollbar Styling */
.smart-search-results::-webkit-scrollbar {
    width: 6px;
}

.smart-search-results::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 10px;
}

.smart-search-results::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 10px;
}

.smart-search-results::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
    .smart-search-results {
        position: fixed;
        top: 60px;
        left: 0;
        right: 0;
        max-height: calc(100vh - 70px);
        border-radius: 0;
        border-left: none;
        border-right: none;
    }

    .search-result-item {
        padding: 1rem;
    }

    .search-result-image {
        width: 60px;
        height: 60px;
    }
}

/* Animation */
@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.smart-search-results[style*="display: block"] {
    animation: slideDown 0.2s ease;
}
