/* AJAX Live Search Styles */

.osty-search-results {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transform: translateY(10px);
    transition: all 0.3s ease;
    margin-top: 10px;
}

.osty-search-results.active {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

/* Loading spinner */
.osty-search-loading {
    padding: 30px;
    text-align: center;
}

.osty-search-loading .spinner {
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #f0f0f0;
    border-top-color: #121212;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

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

/* Search item */
.osty-search-item {
    border-bottom: 1px solid #f0f0f0;
    transition: background-color 0.2s ease;
}

.osty-search-item:last-of-type {
    border-bottom: none;
}

.osty-search-item:hover,
.osty-search-item.active {
    background-color: #f8f8f8;
}

.osty-search-item a {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px 15px;
    text-decoration: none;
    color: inherit;
}

/* Product image */
.osty-search-item-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    border-radius: 6px;
    overflow: hidden;
    background: #f5f5f5;
}

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

/* Product content */
.osty-search-item-content {
    flex: 1;
    min-width: 0;
}

.osty-search-item-title {
    font-size: 14px;
    font-weight: 500;
    color: #121212;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.osty-search-item-title mark {
    background-color: #fff3cd;
    color: inherit;
    padding: 0 2px;
    border-radius: 2px;
}

.osty-search-item-price {
    font-size: 13px;
    color: #666;
}

.osty-search-item-price del {
    opacity: 0.5;
    margin-left: 5px;
}

.osty-search-item-price ins {
    text-decoration: none;
    font-weight: 600;
    color: #e74c3c;
}

/* View all results */
.osty-search-view-all {
    padding: 12px 15px;
    text-align: center;
    background: #f8f8f8;
    border-top: 1px solid #f0f0f0;
}

.osty-search-view-all a {
    font-size: 13px;
    font-weight: 600;
    color: #121212;
    text-decoration: none;
    transition: color 0.2s ease;
}

.osty-search-view-all a:hover {
    color: #666;
}

/* No results */
.osty-search-no-results,
.osty-search-error {
    padding: 30px 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Scrollbar styling */
.osty-search-results::-webkit-scrollbar {
    width: 6px;
}

.osty-search-results::-webkit-scrollbar-track {
    background: #f0f0f0;
    border-radius: 3px;
}

.osty-search-results::-webkit-scrollbar-thumb {
    background: #ccc;
    border-radius: 3px;
}

.osty-search-results::-webkit-scrollbar-thumb:hover {
    background: #999;
}

/* RTL Support */
[dir="rtl"] .osty-search-item a,
.rtl .osty-search-item a {
    flex-direction: row-reverse;
}

[dir="rtl"] .osty-search-item-price del,
.rtl .osty-search-item-price del {
    margin-left: 0;
    margin-right: 5px;
}

/* Mobile responsive */
@media (max-width: 767px) {
    .osty-search-results {
        max-height: 300px;
    }

    .osty-search-item a {
        padding: 10px 12px;
        gap: 10px;
    }

    .osty-search-item-image {
        width: 45px;
        height: 45px;
    }

    .osty-search-item-title {
        font-size: 13px;
    }

    .osty-search-item-price {
        font-size: 12px;
    }
}
