/* ── WP Elasticsearch – Frontend Styles ── */

.wpes-search-box {
    position: relative;
    width: 100%;
    max-width: 600px;
    font-family: inherit;
}

.wpes-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.wpes-input {
    width: 100%;
    padding: 10px 40px 10px 16px;
    border: 2px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
    transition: border-color .2s, box-shadow .2s;
    box-sizing: border-box;
}

.wpes-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 3px rgba(0,115,170,.15);
}

.wpes-spinner-icon {
    position: absolute;
    right: 12px;
    font-size: 16px;
    animation: wpes-spin 1s linear infinite;
}

@keyframes wpes-spin {
    from { transform: rotate(0deg); }
    to   { transform: rotate(360deg); }
}

.wpes-results-dropdown {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0,0,0,.15);
    z-index: 99999;
    overflow: hidden;
    max-height: 480px;
    display: flex;
    flex-direction: column;
}

.wpes-results-list {
    overflow-y: auto;
    flex: 1;
}

.wpes-result-item {
    display: flex;
    gap: 12px;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background .15s;
}

.wpes-result-item:hover {
    background: #f7f9ff;
}

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

.wpes-result-thumb {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
    background: #eee;
}

.wpes-result-body {
    flex: 1;
    min-width: 0;
}

.wpes-result-title {
    font-weight: 600;
    font-size: 14px;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
}

.wpes-result-title mark {
    background: #fff3cd;
    border-radius: 2px;
    font-style: normal;
}

.wpes-result-excerpt {
    font-size: 12px;
    color: #666;
    line-height: 1.5;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.wpes-result-excerpt mark {
    background: #fff3cd;
    border-radius: 2px;
}

.wpes-result-meta {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.wpes-result-cats {
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    margin-top: 4px;
}

.wpes-result-cat {
    background: #e8f0fe;
    color: #1a73e8;
    font-size: 10px;
    padding: 1px 6px;
    border-radius: 20px;
}

.wpes-no-results, .wpes-error {
    padding: 20px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

.wpes-error { color: #c0392b; }

.wpes-results-footer {
    padding: 8px 16px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 12px;
}

.wpes-see-all {
    color: #0073aa;
    text-decoration: none;
    font-weight: 600;
}

.wpes-see-all:hover { text-decoration: underline; }

.wpes-total-count { color: #888; }
