/**
 * WooCommerce Predictive Search Styles
 */

#woo-predictive-search-results {
    position: fixed;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    max-height: 500px;
    overflow-y: auto;
    z-index: 9999;
    display: none;
    min-width: 250px;
}

#woo-predictive-search-results.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 20px;
    height: 20px;
    border: 2px solid #f3f3f3;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: woo-search-spin 1s linear infinite;
}

@keyframes woo-search-spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Results list */
.woo-predictive-results-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

/* Individual result item */
.woo-result-item {
    padding: 0;
    border-bottom: 1px solid #f0f0f0;
    display: flex;
    align-items: stretch;
    transition: background-color 0.15s ease;
    cursor: pointer;
    outline: none;
}

.woo-result-item:hover,
.woo-result-item:focus {
    background-color: #f9f9f9;
    outline: 2px solid #3498db;
    outline-offset: -2px;
}

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

/* Result link */
.woo-result-link {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 12px;
    text-decoration: none;
    color: inherit;
    flex: 1;
    width: 100%;
}

/* Product image */
.woo-result-image {
    flex-shrink: 0;
    width: 50px;
    height: 50px;
    background: #f5f5f5;
    border-radius: 3px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

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

/* Product info */
.woo-result-info {
    flex: 1;
    min-width: 0;
}

.woo-result-title {
    font-weight: 500;
    font-size: 14px;
    color: #333;
    margin: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.woo-result-price {
    font-size: 12px;
    color: #666;
    margin: 4px 0 0 0;
}

.woo-result-price .amount {
    color: #3498db;
    font-weight: 600;
}

/* No results message */
.woo-no-results {
    padding: 20px;
    text-align: center;
    color: #999;
    font-size: 14px;
}

/* Search error message */
.woo-search-error {
    padding: 20px;
    text-align: center;
    color: #e74c3c;
    font-size: 14px;
}

/* Mobile responsive */
@media (max-width: 768px) {
    #woo-predictive-search-results {
        position: absolute;
        max-height: 400px;
    }

    .woo-result-item {
        padding: 8px 0;
    }

    .woo-result-link {
        padding: 8px 10px;
    }

    .woo-result-image {
        width: 45px;
        height: 45px;
    }

    .woo-result-title {
        font-size: 13px;
    }
}

/* Tablet responsive */
@media (max-width: 480px) {
    #woo-predictive-search-results {
        max-height: 350px;
    }

    .woo-result-link {
        padding: 8px 8px;
        gap: 8px;
    }

    .woo-result-image {
        width: 40px;
        height: 40px;
    }

    .woo-result-title {
        font-size: 12px;
    }

    .woo-result-price {
        font-size: 11px;
    }
}

/* Print styles */
@media print {
    #woo-predictive-search-results {
        display: none !important;
    }
}
