.search-bar {
    position: relative;
}

#live-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: white;
    border-radius: 8px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
    margin-top: 8px;
    max-height: 0;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
    z-index: 1000;
}

#live-search-results.show {
    max-height: 600px;
    opacity: 1;
    visibility: visible;
    overflow-y: auto;
}

.live-search-header {
    padding: 12px 16px;
    border-bottom: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 8px 8px 0 0;
}

.live-search-count {
    font-size: 13px;
    color: #6b7280;
    font-weight: 500;
}

.live-search-items {
    padding: 8px 0;
}

.live-search-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.2s ease;
    border-bottom: 1px solid #f3f4f6;
}

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

.live-search-item:hover {
    background-color: #f9fafb;
}

.live-search-item-image {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    background: #f3f4f6;
    display: flex;
    align-items: center;
    justify-content: center;
}

.live-search-item-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.live-search-item-content {
    flex: 1;
    min-width: 0;
}

.live-search-item-code {
    font-weight: 600;
    font-size: 14px;
    color: #111827;
    margin-bottom: 4px;
}

.live-search-item-name {
    font-size: 13px;
    color: #6b7280;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-search-footer {
    padding: 12px 16px;
    border-top: 1px solid #e5e7eb;
    background: #f9fafb;
    border-radius: 0 0 8px 8px;
}

.live-search-view-all {
    display: block;
    text-align: center;
    color: #2563eb;
    font-weight: 500;
    font-size: 14px;
    text-decoration: none;
    transition: color 0.2s ease;
}

.live-search-view-all:hover {
    color: #1d4ed8;
}

.live-search-loading {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    gap: 12px;
}

.live-search-spinner {
    width: 32px;
    height: 32px;
    border: 3px solid #e5e7eb;
    border-top-color: #2563eb;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

.live-search-loading span {
    font-size: 14px;
    color: #6b7280;
}

.live-search-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 40px 20px;
    text-align: center;
}

.live-search-empty svg {
    color: #d1d5db;
    margin-bottom: 16px;
}

.live-search-empty p {
    font-size: 14px;
    color: #6b7280;
    margin: 0;
}

.live-search-empty strong {
    color: #111827;
}

.live-search-error {
    padding: 20px;
    text-align: center;
}

.live-search-error p {
    font-size: 14px;
    color: #dc2626;
    margin: 0;
}

#live-search-results::-webkit-scrollbar {
    width: 8px;
}

#live-search-results::-webkit-scrollbar-track {
    background: #f3f4f6;
    border-radius: 0 8px 8px 0;
}

#live-search-results::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 4px;
}

#live-search-results::-webkit-scrollbar-thumb:hover {
    background: #9ca3af;
}

@media (max-width: 768px) {
    #live-search-results {
        left: -16px;
        right: -16px;
        border-radius: 0;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    }
    
    .live-search-item-image {
        width: 50px;
        height: 50px;
    }
}
