/**
 * BPH Ajax Search — Stylesheet
 * Version: 1.2.0
 * Author:  Arazy
 */

/* ── Wrapper ─────────────────────────────────────────────────────────────── */

.bph-ajax-search-wrap {
    position: relative;
    max-width: 480px;
    width: 100%;
    font-family: inherit;
    margin-left: auto;
    margin-right: auto;
}

/* ── Input row ───────────────────────────────────────────────────────────── */

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

.bph-search-input {
    width: 100%;
    padding: 12px 44px 12px 20px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 20px;
    outline: none;
    box-sizing: border-box;
    transition: border-color 0.2s;
    background: #fff;
    color: inherit;
}

.bph-search-input:focus {
    border-color: #0073aa;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.2);
}

/* ── Spinner ─────────────────────────────────────────────────────────────── */

.bph-search-spinner {
    position: absolute;
    right: 16px;
    width: 16px;
    height: 16px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.bph-search-spinner.bph-spinning {
    opacity: 1;
    animation: bph-spin 0.7s linear infinite;
}

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

/* ── mode="ajax" — Dropdown results ─────────────────────────────────────── */

.bph-search-results {
    position: absolute;
    top: calc(100% + 4px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.12);
    list-style: none;
    margin: 0;
    padding: 6px 0;
    z-index: 9999;
    max-height: 320px;
    overflow-y: auto;
}

.bph-search-results[hidden] {
    display: none;
}

.bph-result-item a {
    display: block;
    padding: 9px 14px;
    color: #222;
    text-decoration: none;
    font-size: 0.95rem;
    transition: background 0.15s, color 0.15s;
}

.bph-result-item a:hover,
.bph-result-item.bph-focused a {
    background: #f0f7ff;
    color: #0073aa;
}

.bph-no-results {
    padding: 10px 14px;
    color: #888;
    font-size: 0.9rem;
}

/* ── mode="filter" / mode="loop" — In-loop messages ─────────────────────── */

.bph-filter-no-results,
.bph-loop-no-results {
    padding: 16px;
    color: #888;
    font-size: 0.95rem;
    margin: 0;
}
