/* ElasticPress Autosuggest Enhanced Styles */

.autosuggest-item--enhanced .autosuggest-link {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    transition: background-color 0.15s ease;
}

.autosuggest-item--enhanced:hover .autosuggest-link,
.autosuggest-item--enhanced[aria-selected="true"] .autosuggest-link {
    background-color: #f5f5f5;
}

.autosuggest-thumbnail {
    flex-shrink: 0;
    width: 60px;
    height: 60px;
    border-radius: 4px;
    overflow: hidden;
    background-color: #eee;
}

.autosuggest-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.autosuggest-content {
    flex: 1;
    min-width: 0;
}

.autosuggest-title {
    font-weight: 600;
    font-size: 14px;
    line-height: 1.3;
    margin-bottom: 4px;
    color: #1a1a1a;
}

.autosuggest-excerpt {
    font-size: 13px;
    line-height: 1.4;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Ensure dropdown has enough width */
.ep-autosuggest {
    min-width: 320px;
}

/* Pagination styles */
.autosuggest-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #eee;
    font-size: 13px;
}

.autosuggest-pagination__count {
    color: #666;
}

.autosuggest-pagination__nav {
    display: flex;
    align-items: center;
    gap: 4px;
}

.autosuggest-pagination__num,
.autosuggest-pagination__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 28px;
    height: 28px;
    padding: 0 6px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s ease;
}

.autosuggest-pagination__num:hover,
.autosuggest-pagination__arrow:hover:not(:disabled) {
    background: #f5f5f5;
    border-color: #ccc;
}

.autosuggest-pagination__num--active {
    background: #1a1a1a;
    border-color: #1a1a1a;
    color: #fff;
}

.autosuggest-pagination__num--active:hover {
    background: #333;
    border-color: #333;
}

.autosuggest-pagination__arrow:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.autosuggest-pagination__arrow span[aria-hidden] {
    font-size: 16px;
    line-height: 1;
}

.screen-reader-text {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

/* Loading state - positioned independently from ep-autosuggest */
.autosuggest-loading {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    margin-top: 4px;
    position: absolute;
    z-index: 9999;
    min-width: 200px;
}

.autosuggest-loading__spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #eee;
    border-top-color: #666;
    border-radius: 50%;
    animation: autosuggest-spin 0.8s linear infinite;
}

.autosuggest-loading__text {
    font-size: 13px;
    color: #666;
}

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