.live-search-wrapper {
    position: relative;
    width: 100%;
}

.live-search-wrapper input[data-live-search="true"] {
    position: relative !important;
    z-index: 2 !important;
    background: transparent !important;
}

.live-search-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #fff;
    border: none;
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.18);
    z-index: 9999;
    max-height: 450px;
    overflow-y: auto;
    display: none;
}

.live-search-dropdown.show {
    display: block;
    animation: slideDown 0.25s ease-out;
}

@keyframes slideDown {
    from {
        opacity: 0;
        transform: translateY(-8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.live-search-results {
    list-style: none;
    margin: 0;
    padding: 8px 0;
}

.live-search-item {
    margin: 0 8px;
    border-radius: 8px;
    transition: background-color 0.15s ease;
}

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

.live-search-item.active,
.live-search-item:hover {
    background-color: #f5f7fa;
}

.live-search-item.active::after {
    content: '\f061';
    font-family: 'Font Awesome 5 Free';
    font-weight: 900;
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    color: #0d6efd;
    font-size: 14px;
    opacity: 0.5;
}

.live-search-item {
    position: relative;
}

.live-search-link {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    text-decoration: none !important;
    color: inherit;
    gap: 14px;
}

.live-search-link:hover {
    text-decoration: none !important;
    color: inherit;
}

.live-search-image {
    flex-shrink: 0;
    width: 56px;
    height: 56px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #eee;
}

.live-search-image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    padding: 4px;
}

.live-search-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.live-search-name {
    font-size: 14px;
    font-weight: 500;
    color: #1a1a1a;
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.live-search-name mark {
    background-color: #fef3cd;
    color: #1a1a1a;
    padding: 1px 3px;
    border-radius: 3px;
    font-weight: 600;
}

.live-search-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-top: 4px;
    flex-wrap: wrap;
}

.live-search-price {
    font-size: 15px;
    font-weight: 700;
    color: #dc3545;
}

.live-search-brand {
    font-size: 11px;
    color: #6c757d;
    font-weight: 500;
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 10px;
}

.live-search-stock {
    font-size: 10px;
    padding: 3px 8px;
    border-radius: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.live-search-stock.in-stock {
    background-color: #d1e7dd;
    color: #0f5132;
}

.live-search-stock.out-of-stock {
    background-color: #f8d7da;
    color: #842029;
}

.live-search-footer {
    padding: 14px 16px;
    background: linear-gradient(to top, #f8f9fa, #fff);
    border-top: 1px solid #eee;
    text-align: center;
    border-radius: 0 0 12px 12px;
}

.live-search-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #0d6efd;
    font-weight: 600;
    text-decoration: none !important;
    font-size: 13px;
    padding: 8px 16px;
    background: #e7f1ff;
    border-radius: 20px;
    transition: all 0.2s ease;
}

.live-search-all:hover {
    background: #0d6efd;
    color: #fff !important;
    text-decoration: none !important;
}

.live-search-all i {
    font-size: 11px;
    transition: transform 0.2s ease;
}

.live-search-all:hover i {
    transform: translateX(3px);
}

.live-search-loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 32px 20px;
    color: #6c757d;
    font-size: 14px;
}

.live-search-spinner {
    width: 20px;
    height: 20px;
    border: 2px solid #e9ecef;
    border-top-color: #0d6efd;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
}

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

.live-search-no-results {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 40px 20px;
    color: #6c757d;
    text-align: center;
}

.live-search-no-results i {
    font-size: 32px;
    color: #dee2e6;
}

.live-search-no-results span {
    font-size: 14px;
    max-width: 280px;
}

.live-search-autocorrect-notice {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    margin: 8px 8px 4px;
    background: linear-gradient(135deg, #e7f3ff 0%, #f0f8ff 100%);
    border: 1px solid #b6d4fe;
    border-radius: 8px;
    font-size: 13px;
    color: #084298;
    line-height: 1.5;
}

.live-search-autocorrect-notice i {
    font-size: 16px;
    color: #0a58ca;
    flex-shrink: 0;
}

.live-search-autocorrect-notice strong {
    color: #052c65;
    font-weight: 600;
}

.live-search-typo {
    color: #6c757d;
    text-decoration: line-through;
    text-decoration-color: #dc3545;
    text-decoration-thickness: 2px;
    opacity: 0.7;
}

.live-search-section-label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px 4px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    color: #6c757d;
}

.live-search-section-label i {
    font-size: 10px;
}

.live-search-item-category .live-search-link {
    position: relative;
}

.live-search-category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e7f1ff 0%, #f0f0ff 100%);
    border: 1px solid #d4e2f4;
    color: #4a6fa5;
    font-size: 20px;
}

.live-search-category-icon img {
    padding: 4px;
}

.live-search-category-count {
    font-size: 12px;
    color: #6c757d;
    font-weight: 500;
}

.live-search-category-desc {
    font-size: 11px;
    color: #9ca3af;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 200px;
}

.live-search-category-arrow {
    flex-shrink: 0;
    color: #c0c6cc;
    font-size: 11px;
    transition: transform 0.2s ease, color 0.2s ease;
}

.live-search-item-category:hover .live-search-category-arrow {
    color: #0d6efd;
    transform: translateX(3px);
}

.live-search-item-category.active .live-search-category-arrow,
.live-search-item-category:hover .live-search-category-arrow {
    color: #0d6efd;
}

.live-search-section + .live-search-section {
    border-top: 1px solid #eee;
    margin-top: 4px;
}

@media (max-width: 991px) {
    .live-search-dropdown {
        position: fixed;
        top: 120px;
        left: 15px;
        right: 15px;
        max-height: 55vh;
        border-radius: 16px;
    }
    
    .live-search-image {
        width: 48px;
        height: 48px;
    }
    
    .live-search-link {
        padding: 8px 10px;
        gap: 12px;
    }
    
    .live-search-name {
        font-size: 13px;
    }
    
    .live-search-price {
        font-size: 14px;
    }
    
    .live-search-stock {
        font-size: 9px;
        padding: 2px 6px;
    }
}

.live-search-dropdown::-webkit-scrollbar {
    width: 5px;
}

.live-search-dropdown::-webkit-scrollbar-track {
    background: transparent;
}

.live-search-dropdown::-webkit-scrollbar-thumb {
    background: #d1d5db;
    border-radius: 10px;
}

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

.header-search-form {
    width: 100%;
}

.header-search-form .input {
    position: relative;
    width: 100% !important;
}

.header-search-form .input input {
    width: 100%;
    padding-right: 50px;
}

.header-search-form .input button {
    position: absolute;
    top: 4px;
    right: 4px;
    bottom: 4px;
    left: auto !important;
    z-index: 3 !important;
}

.header-search-form .live-search-dropdown {
    width: 100%;
    min-width: 400px;
}
