/**
 * Sperikon Live Search Styles
 */

/* Loading Indicator */
.sperikon-search-loading {
    display: none;
    position: absolute;
    right: 50px; /* Adjust based on your search button width */
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #ccc;
    border-top-color: #333;
    border-radius: 50%;
    animation: sperikon-spin 0.8s linear infinite;
    z-index: 10;
}

@keyframes sperikon-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* Results Container */
.sperikon-live-search-results {
    display: none;
    position: absolute;
    background: #fff;
    border: 1px solid #eee;
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    z-index: 9999;
    max-height: 400px;
    overflow-y: auto;
    border-radius: 4px;
}

.sperikon-live-search-results ul {
    list-style: none;
    margin: 0;
    padding: 0;
}

.sperikon-live-search-results li {
    border-bottom: 1px solid #f5f5f5;
}

.sperikon-live-search-results li:last-child {
    border-bottom: none;
}

.sperikon-live-search-results li a {
    display: flex;
    align-items: center;
    padding: 10px 15px;
    text-decoration: none;
    color: #333;
    transition: background 0.2s;
}

.sperikon-live-search-results li:hover,
.sperikon-live-search-results li.sku-match {
    background: #f9f9f9;
}

.sperikon-live-search-results .thumb {
    width: 40px;
    height: 40px;
    margin-right: 12px;
    flex-shrink: 0;
}

.sperikon-live-search-results .thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 2px;
}

.sperikon-live-search-results .info {
    flex-grow: 1;
}

.sperikon-live-search-results .title {
    font-size: 14px;
    line-height: 1.4;
    font-weight: 500;
}

.sperikon-live-search-results .title strong {
    color: #e53935; /* Highlight Color */
}

.sperikon-live-search-results .meta {
    margin-top: 4px;
    font-size: 12px;
    color: #888;
}

.sperikon-live-search-results .sku {
    display: inline-block;
    background: #eee;
    padding: 2px 6px;
    border-radius: 3px;
    color: #555;
}

.sperikon-live-search-results .sku strong {
    color: #333;
}

.sperikon-live-search-results .no-results {
    padding: 15px;
    text-align: center;
    color: #999;
    font-size: 13px;
}

/* Mobile Adjustments */
@media (max-width: 768px) {
    .sperikon-live-search-results {
        width: 100% !important; /* Force full width on mobile */
        left: 0 !important;
        right: 0 !important;
        position: fixed; /* Fixed position for better mobile experience */
        top: 60px !important; /* Adjust based on header height */
        max-height: calc(100vh - 80px);
    }
}
