/* ============================================================
 * 검색 / 검색 결과 드롭다운 / 검색 페이지
 * uses tokens from style.css
 * ============================================================ */

#headerCalculatorSearch { min-width: 250px; }

.position-relative { position: relative; }

.search-results {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    background: var(--bg-card, #fff);
    border: 1px solid var(--border-subtle, #e2e8f0);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1050;
    display: none;
    box-shadow: var(--shadow-lg, 0 12px 32px rgba(15, 23, 42, .12));
    border-radius: var(--radius-md, .75rem);
}

.search-results.show { display: block; }

.search-result-item {
    padding: .85rem 1rem;
    border-bottom: 1px solid var(--border-subtle, #e2e8f0);
    cursor: pointer;
    transition: background-color .15s, color .15s;
    text-align: left;
    color: var(--text-body, #334155);
}

.search-result-item:hover {
    background: var(--brand-primary-soft, #eef2ff);
    color: var(--brand-primary, #4f46e5);
}

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

.search-result-name {
    font-weight: 600;
    color: var(--text-strong, #0f172a);
    margin-bottom: .25rem;
    display: block;
}
.search-result-item:hover .search-result-name { color: var(--brand-primary, #4f46e5); }

.search-result-category {
    font-size: .82rem;
    color: var(--text-muted, #64748b);
    display: block;
}

@media (max-width: 991.98px) {
    #headerCalculatorSearch {
        width: 100%;
        margin-top: 10px;
        margin-bottom: 10px;
    }
    .header-search { max-width: 100% !important; }
}

#calculatorSearch:focus,
#headerCalculatorSearch:focus {
    border-color: var(--brand-primary, #4f46e5);
    box-shadow: var(--ring, 0 0 0 4px rgba(79, 70, 229, .15));
}

.search-loading {
    padding: 1rem;
    text-align: center;
    color: var(--text-muted, #64748b);
}
.search-loading::after {
    content: "...";
    animation: dots 1.5s steps(4, end) infinite;
}
@keyframes dots {
    0%, 20%   { content: "."; }
    40%       { content: ".."; }
    60%, 100% { content: "..."; }
}
