/* =====================================================
   SB Canlı Arama Overlay
   ===================================================== */

.sb-search-overlay {
    position: fixed;
    inset: 0;
    z-index: 99990;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: clamp(40px, 8vh, 100px);
}

.sb-search-overlay[hidden] { display: none !important; }

.sb-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, .65);
    animation: sbSearchFadeIn .18s ease;
}

@keyframes sbSearchFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.sb-search-box {
    position: relative;
    z-index: 1;
    width: min(640px, calc(100vw - 32px));
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 24px 64px rgba(0,0,0,.25), 0 0 0 1px rgba(0,0,0,.06);
    overflow: hidden;
    animation: sbSearchSlideDown .2s cubic-bezier(.4,0,.2,1);
}

@keyframes sbSearchSlideDown {
    from { opacity: 0; transform: translateY(-12px); }
    to   { opacity: 1; transform: translateY(0); }
}

.sb-search-input-wrap {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    border-bottom: 1px solid #F1F5F9;
}

.sb-search-icon-inp { width: 20px; height: 20px; flex-shrink: 0; color: #94A3B8; }

.sb-search-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 16px;
    font-family: inherit;
    background: transparent;
    color: #1E293B;
    min-width: 0;
}

.sb-search-input::placeholder { color: #94A3B8; }
.sb-search-input::-webkit-search-cancel-button { display: none; }

.sb-search-clear,
.sb-search-close {
    background: none;
    border: none;
    cursor: pointer;
    color: #94A3B8;
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 4px 8px;
    border-radius: 6px;
    font-size: 11px;
    font-family: inherit;
    white-space: nowrap;
    transition: background .15s, color .15s;
}

.sb-search-clear:hover, .sb-search-close:hover {
    background: #F1F5F9;
    color: #334155;
}

.sb-search-clear svg, .sb-search-close svg { width: 16px; height: 16px; }

.sb-search-close kbd {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    background: #F1F5F9;
    border: 1px solid #CBD5E1;
    color: #64748B;
}

.sb-search-results {
    max-height: min(400px, 50vh);
    overflow-y: auto;
    overscroll-behavior: contain;
}

.sb-search-results:empty { display: none; }

.sb-search-result {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    padding: 12px 16px;
    text-decoration: none;
    color: inherit;
    border-bottom: 1px solid #F8FAFC;
    transition: background .12s;
}

.sb-search-result:hover,
.sb-search-result[aria-selected="true"] {
    background: #F8FAFC;
    text-decoration: none;
    color: inherit;
}

.sb-search-result:last-child { border-bottom: none; }

.sb-result-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    object-fit: cover;
    flex-shrink: 0;
    background: #E2E8F0;
}

.sb-result-no-thumb {
    width: 56px;
    height: 56px;
    border-radius: 8px;
    background: #F1F5F9;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #CBD5E1;
}

.sb-result-no-thumb svg { width: 22px; height: 22px; }
.sb-result-meta { flex: 1; min-width: 0; }

.sb-result-cat {
    display: inline-block;
    font-size: 10.5px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: var(--sb-general-color, #1E40AF);
    margin-bottom: 3px;
}

.sb-result-title {
    font-size: 13.5px;
    font-weight: 600;
    color: #1E293B;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.sb-result-excerpt {
    font-size: 12px;
    color: #64748B;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sb-result-date { font-size: 11px; color: #94A3B8; margin-top: 3px; }

.sb-search-msg {
    padding: 24px 16px;
    text-align: center;
    color: #94A3B8;
    font-size: 14px;
}

.sb-search-spinner {
    width: 22px;
    height: 22px;
    border: 2px solid #E2E8F0;
    border-top-color: var(--sb-general-color, #1E40AF);
    border-radius: 50%;
    animation: sbSpin .6s linear infinite;
    margin: 0 auto 8px;
}

@keyframes sbSpin { to { transform: rotate(360deg); } }

.sb-search-footer {
    padding: 8px 16px;
    background: #F8FAFC;
    border-top: 1px solid #F1F5F9;
}

.sb-search-hint { font-size: 11px; color: #94A3B8; }

.sb-search-hint kbd {
    font-size: 10px;
    padding: 1px 5px;
    border-radius: 4px;
    background: #fff;
    border: 1px solid #CBD5E1;
    color: #64748B;
}

[data-sb-search-open] { cursor: pointer; }
