/**
 * Optimized Part Search - Frontend Styles
 * Matches Porto theme's live search styling
 */

/* Loading state for search input */
.ops-loading {
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="20" height="20" viewBox="0 0 20 20"><circle cx="10" cy="10" r="8" fill="none" stroke="%23666" stroke-width="2"><animate attributeName="stroke-dasharray" values="1,150;90,150;90,150" dur="1.5s" repeatCount="indefinite"/><animate attributeName="stroke-dashoffset" values="0;-35;-124" dur="1.5s" repeatCount="indefinite"/></circle></svg>') !important;
    background-repeat: no-repeat !important;
    background-position: right 10px center !important;
    background-size: 20px 20px !important;
}

/* Use Porto's existing live-search-list container structure */
.searchform .live-search-list .ops-results-container {
    font-family: var(--porto-body-ff, sans-serif);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    box-shadow: 0 10px 20px 5px var(--porto-normal-bc);
    max-height: 80vh;
}

/* Match Porto's autocomplete-suggestion styling */
.ops-autocomplete-suggestion {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    border-bottom: 1px solid rgba(0, 0, 0, .05);
    white-space: normal;
    padding: 10px 20px;
    line-height: 1.5em;
    min-height: 0;
    text-align: left;
}

.ops-autocomplete-suggestion:last-child {
    border-bottom-color: transparent;
}

.ops-autocomplete-suggestion:hover,
.ops-autocomplete-suggestion.autocomplete-selected {
    background-color: rgba(0, 0, 0, .05);
}

/* SKU on the left */
.ops-autocomplete-suggestion .search-sku {
    flex: 1;
    font-size: 14px;
    color: inherit;
    font-weight: normal;
}

.ops-autocomplete-suggestion .search-sku strong {
    font-weight: 600;
    color: inherit;
}

/* Price on the right */
.ops-autocomplete-suggestion .search-price {
    font-weight: 600;
    font-size: 14px;
    color: inherit;
    margin-left: 15px;
    white-space: nowrap;
}

.ops-autocomplete-suggestion .search-price .amount {
    font-weight: 600;
}

/* No results message */
.ops-results-container.ops-no-results {
    padding: 15px 20px;
}

.ops-results-container.ops-no-results p {
    margin: 0;
    color: inherit;
    text-align: center;
    font-size: 14px;
}

/* Scrollbar styling - match Porto */
.searchform .live-search-list .ops-results-container::-webkit-scrollbar {
    width: 5px;
}

.searchform .live-search-list .ops-results-container::-webkit-scrollbar-thumb {
    border-radius: 0px;
    background: rgba(204, 204, 204, 0.5);
}

/* Responsive adjustments */
@media (max-width: 576px) {
    .ops-autocomplete-suggestion {
        flex-wrap: wrap;
    }
    
    .ops-autocomplete-suggestion .search-price {
        width: 100%;
        margin-left: 0;
        margin-top: 5px;
        text-align: right;
    }
}

