/**
 * WC Ajax Search - Frontend Styles
 * Compatibile con UIKit 3
 */

/* Wrapper principale */
.wcas-search-wrapper {
    position: relative;
    width: 100%;
}

/* Dropdown risultati */
.wcas-results-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    z-index: 1000;
    max-height: 450px;
    overflow-y: auto;
    margin-top: 5px;
    border-radius: 4px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
    background: #fff;
}

/* Lista risultati */
.wcas-results-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Singolo risultato */
.wcas-result-item {
    display: flex;
    align-items: center;
    padding: 12px 15px;
    cursor: pointer;
    transition: background-color 0.15s ease;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #e5e5e5;
}

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

.wcas-result-item:hover,
.wcas-result-item:focus,
.wcas-result-item.wcas-active {
    background-color: #f8f8f8;
    outline: none;
}

/* Immagine prodotto */
.wcas-result-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    margin-right: 15px;
    border-radius: 4px;
    overflow: hidden;
    background: #f5f5f5;
}

.wcas-result-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Info prodotto */
.wcas-result-info {
    flex: 1;
    min-width: 0;
    overflow: hidden;
}

/* Nome prodotto */
.wcas-result-name {
    font-size: 14px;
    font-weight: 500;
    margin: 0 0 4px 0;
    line-height: 1.3;
    color: #333;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Highlight match */
.wcas-highlight {
    background-color: #fff3cd;
    padding: 0 2px;
    border-radius: 2px;
}

/* Prezzo */
.wcas-result-price {
    font-size: 13px;
    color: #666;
    margin: 0;
}

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

.wcas-result-price ins {
    text-decoration: none;
    color: #e74c3c;
}

/* Messaggio nessun risultato */
.wcas-no-results,
.wcas-message {
    padding: 20px 15px;
    text-align: center;
    color: #666;
    font-size: 14px;
}

/* Spinner nel campo input */
.wcas-spinner {
    pointer-events: none;
}

/* Stato di caricamento */
.wcas-loading .wcas-results-list {
    opacity: 0.6;
}

/* Freccia attiva per navigazione tastiera */
.wcas-result-item.wcas-keyboard-focus {
    background-color: #f0f7ff;
    outline: 2px solid #1e87f0;
    outline-offset: -2px;
}

/* Responsive */
@media (max-width: 640px) {
    .wcas-results-dropdown {
        max-height: 350px;
    }
    
    .wcas-result-image {
        width: 40px;
        height: 40px;
        margin-right: 10px;
    }
    
    .wcas-result-name {
        font-size: 13px;
    }
    
    .wcas-result-price {
        font-size: 12px;
    }
}

/* Customizzazioni per inserimento nel menu */
.wcas-search-wrapper.wcas-in-menu {
    max-width: 250px;
}

.wcas-search-wrapper.wcas-in-menu .uk-input {
    height: 36px;
    font-size: 13px;
}

/* Scrollbar personalizzata per dropdown */
.wcas-results-dropdown::-webkit-scrollbar {
    width: 6px;
}

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

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

.wcas-results-dropdown::-webkit-scrollbar-thumb:hover {
    background: #999;
}
