/* ============================================================
   Smart Search — Elementor Widget Styles
   ============================================================ */

/* ── Wrapper ──────────────────────────────────────────────── */
.ss-search-wrapper {
    position: relative;
    width: 100%;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen, sans-serif;
}

/* ── Form ─────────────────────────────────────────────────── */
.ss-search-form {
    position: relative;
    width: 100%;
}

.ss-input-group {
    display: flex;
    align-items: center;
    border: 2px solid #ddd;
    border-radius: 999px;
    background: #fff;
    overflow: hidden;
    transition: border-color 0.2s, box-shadow 0.2s;
}

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

.ss-input {
    flex: 1;
    border: none;
    outline: none;
    padding: 10px 18px;
    font-size: 15px;
    background: transparent;
    color: #333;
    min-width: 0;
    font-family: inherit;
}

.ss-input::placeholder { color: #aaa; }

.ss-submit {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    border: none;
    background: #0073aa;
    color: #fff;
    padding: 10px 16px;
    cursor: pointer;
    transition: background 0.2s;
    flex-shrink: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
}

.ss-submit:hover  { background: #005a87; }
.ss-submit svg    { display: block; flex-shrink: 0; }

/* ── Live results dropdown ────────────────────────────────── */
.ss-live-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.12);
    z-index: 99999;
    max-height: 70vh;
    overflow-y: auto;
    scroll-behavior: smooth;
}

.ss-live-results[hidden] { display: none; }

/* ── Result items ─────────────────────────────────────────── */
.ss-result-item {
    display: block;
    padding: 14px 18px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #f0f0f0;
    transition: background 0.15s;
}

.ss-result-item:last-of-type { border-bottom: none; }

.ss-result-item:hover,
.ss-result-item:focus {
    background: #f5f9ff;
    outline: none;
}

.ss-result-item:focus {
    box-shadow: inset 0 0 0 2px #0073aa;
}

.ss-result-title {
    font-weight: 600;
    font-size: 15px;
    color: #0073aa;
    margin: 0 0 4px;
    line-height: 1.3;
}

.ss-result-excerpt {
    font-size: 13px;
    color: #555;
    margin: 0;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Highlight ────────────────────────────────────────────── */
mark.ss-highlight {
    background: #fff3cd;
    color: inherit;
    border-radius: 2px;
    padding: 0 1px;
}

/* ── Loading ──────────────────────────────────────────────── */
.ss-loading {
    text-align: center;
    padding: 16px;
    color: #888;
    font-size: 14px;
}

.ss-spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid #ddd;
    border-top-color: #0073aa;
    border-radius: 50%;
    animation: ss-spin 0.7s linear infinite;
    vertical-align: middle;
    margin-right: 6px;
}

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

/* ── No results ───────────────────────────────────────────── */
.ss-no-results {
    padding: 18px;
    text-align: center;
    color: #888;
    font-size: 14px;
}

/* ── "See all" footer ─────────────────────────────────────── */
.ss-see-all {
    display: block;
    text-align: center;
    padding: 10px;
    font-size: 13px;
    font-weight: 600;
    color: #0073aa;
    text-decoration: none;
    border-top: 1px solid #eee;
    background: #fafafa;
    border-radius: 0 0 12px 12px;
}

.ss-see-all:hover { background: #f0f7ff; text-decoration: underline; }

/* ── Parsed query notice ──────────────────────────────────── */
.ss-parsed-notice {
    font-size: 12px;
    color: #888;
    padding: 8px 18px 0;
    font-style: italic;
}

/* ── Powered by ───────────────────────────────────────────── */
.ss-powered-by {
    font-size: 10px;
    color: #ccc;
    text-align: right;
    margin-top: 4px;
    padding-right: 4px;
}

/* ── Elementor editor preview ─────────────────────────────── */
.elementor-editor-active .ss-input {
    pointer-events: none;
}

/* ── Responsive ───────────────────────────────────────────── */
@media ( max-width: 600px ) {
    .ss-input {
        font-size: 16px; /* Prevent iOS auto-zoom */
        padding: 10px 14px;
    }

    .ss-live-results {
        border-radius: 8px;
        max-height: 60vh;
    }
}
