.ajax-product-search-widget {
    position: relative;
    max-width: 600px;
    margin: 0 auto;
}

.search-form {
    margin-bottom: 0;
    position: relative;
}

.search-form svg {
    position: absolute;
    right: 17px;
    top: 17px;
    z-index: 10;
    width: 19px;
    opacity: 0.25;
}

.ajax-search-input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
    background-color: #fff;
    box-sizing: border-box;
}

.ajax-search-input:focus {
    border-color: #007cba;
}

/* Results container - relative positioning to push content down */
.search-results {
    position: relative;
    width: 100%;
    background: white;
    border: 1px solid #ddd;
    border-top: none;
    border-radius: 0 0 5px 5px;
    box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    z-index: 100;
    max-height: 400px;
    overflow-y: auto;
    margin-top: -1px; /* Overlap with input border */
}

.loading {
    padding: 20px;
    text-align: center;
    color: #666;
    font-style: italic;
}

.no-results, .search-error {
    padding: 20px;
    text-align: center;
    color: #666;
}

.search-error {
    color: #d63638;
}

.product-results {
    max-height: 380px;
    overflow-y: auto;
}

.product-item {
    display: flex;
    padding: 15px;
    border-bottom: 1px solid #eee;
    cursor: pointer;
    transition: background-color 0.2s ease;
    position: relative;
}

.product-item:hover,
.product-item.keyboard-active {
    background-color: #f9f9f9;
}

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

.product-item.out-of-stock {
    opacity: 0.6;
}

.product-image {
    width: 60px;
    height: 60px;
    margin-right: 15px;
    flex-shrink: 0;
    position: relative;
    overflow: hidden;
    border-radius: 3px;
}

.product-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sale-badge {
    position: absolute;
    top: 2px;
    right: 2px;
    background-color: #e74c3c;
    color: white;
    font-size: 10px;
    padding: 2px 4px;
    border-radius: 2px;
    font-weight: bold;
}

.product-info {
    flex: 1;
    min-width: 0;
}

.trendi-ajax-search-widget .product-title {
    margin: 0 0 5px 0;
    font-size: 16px;
    font-weight: 300;
    color: #333;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.product-price {
    color: #000;
    font-weight: 600;
    margin-bottom: 5px;
}

.product-price del {
    color: #999;
    margin-right: 5px;
}

.product-excerpt {
    margin: 5px 0 0 0;
    font-size: 14px;
    color: #666;
    line-height: 1.4;
}

.stock-status {
    display: inline-block;
    font-size: 12px;
    color: #d63638;
    font-weight: 500;
    margin-top: 5px;
}

/* Keyboard navigation highlight */
.product-item.keyboard-active {
    background-color: #e3f2fd !important;
    border-left: 3px solid #007cba;
}

/* Responsive Design */
@media (max-width: 768px) {
    .product-item {
        padding: 12px;
    }
    
    .product-image {
        width: 50px;
        height: 50px;
        margin-right: 12px;
    }
    
    .product-title {
        font-size: 14px;
    }
    
    .product-excerpt {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .ajax-product-search-widget {
        margin: 0;
    }
    
    .product-item {
        padding: 10px;
    }
    
    .product-image {
        width: 45px;
        height: 45px;
        margin-right: 10px;
    }
}

/* Loading Animation */
.loading span::after {
    content: '';
    animation: dots 1.5s steps(5, end) infinite;
}

@keyframes dots {
    0%, 20% {
        color: rgba(0,0,0,0);
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    40% {
        color: #666;
        text-shadow:
            .25em 0 0 rgba(0,0,0,0),
            .5em 0 0 rgba(0,0,0,0);
    }
    60% {
        text-shadow:
            .25em 0 0 #666,
            .5em 0 0 rgba(0,0,0,0);
    }
    80%, 100% {
        text-shadow:
            .25em 0 0 #666,
            .5em 0 0 #666;
    }
}

/* Scrollbar Styling */
.product-results::-webkit-scrollbar {
    width: 6px;
}

.product-results::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.product-results::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.product-results::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* Smooth transitions */
.search-results {
    transition: all 0.2s ease-in-out;
}

/* Focus states for accessibility */
.ajax-search-input:focus + .search-results {
    border-color: #007cba;
}
