/* K-TEC Live Search — persistent top-right bar */

.ktec-ls-bar {
    position: fixed;
    top: 12px;
    right: 12px;
    z-index: 99999;
    width: 340px;
    max-width: calc(100vw - 24px);
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.ktec-ls-wrap {
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
    border: 1px solid #e0e0e0;
    display: flex;
    align-items: center;
    padding: 0 14px;
    height: 40px;
    transition: box-shadow 0.15s;
}
.ktec-ls-wrap:focus-within {
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
    border-color: #1a5d96;
}

.ktec-ls-icon {
    color: #888;
    flex-shrink: 0;
}

.ktec-ls-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    padding: 0 0 0 8px;
    background: transparent;
    color: #1d1d1d;
    min-width: 0;
}
.ktec-ls-input::placeholder { color: #aaa; }

.ktec-ls-clear {
    background: transparent;
    border: none;
    color: #888;
    cursor: pointer;
    font-size: 18px;
    padding: 0 4px;
    line-height: 1;
    flex-shrink: 0;
}
.ktec-ls-clear:hover { color: #1d1d1d; }
.ktec-ls-clear[hidden] { display: none; }

.ktec-ls-dropdown {
    position: absolute;
    top: 48px;
    left: 0;
    right: 0;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.18);
    border: 1px solid #e0e0e0;
    max-height: 70vh;
    overflow-y: auto;
    padding: 6px 0;
}
.ktec-ls-dropdown[hidden] { display: none; }

.ktec-ls-hint {
    padding: 18px 16px;
    text-align: center;
    color: #555;
    font-size: 12px;
    line-height: 1.6;
}
.ktec-ls-hint-popular {
    margin-top: 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}
.ktec-ls-chip {
    background: #f0f4f8;
    color: #1a5d96;
    border: 1px solid #d6deea;
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 11px;
    cursor: pointer;
    transition: background 0.1s;
}
.ktec-ls-chip:hover { background: #e0e8f0; }

.ktec-ls-result {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 14px;
    cursor: pointer;
    text-decoration: none;
    color: #1d1d1d;
    transition: background 0.1s;
}
.ktec-ls-result:hover,
.ktec-ls-result.ktec-ls-active {
    background: #f6f7f9;
}
.ktec-ls-result-img {
    width: 40px;
    height: 40px;
    flex-shrink: 0;
    background: #f6f6f6;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.ktec-ls-result-img img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}
.ktec-ls-no-img {
    color: #aaa;
    font-size: 10px;
}
.ktec-ls-result-body { flex: 1; min-width: 0; }
.ktec-ls-result-title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.3;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.ktec-ls-result-title mark {
    background: #fff3a3;
    color: #1d1d1d;
    padding: 0 1px;
}
.ktec-ls-result-meta {
    font-size: 11px;
    color: #888;
    margin-top: 2px;
    display: flex;
    gap: 8px;
}
.ktec-ls-result-brand {
    background: #1a5d96;
    color: #fff;
    padding: 1px 6px;
    border-radius: 3px;
    font-size: 10px;
}
.ktec-ls-result-price { font-weight: 600; color: #1d1d1d; }
.ktec-ls-result-stock { font-size: 10px; color: #888; min-width: 50px; text-align: right; }

.ktec-ls-loading,
.ktec-ls-empty,
.ktec-ls-error {
    padding: 14px 16px;
    text-align: center;
    color: #888;
    font-size: 12px;
}
.ktec-ls-error { color: #b32d2d; }

.ktec-ls-footer {
    padding: 8px 14px;
    border-top: 1px solid #e5e5e5;
    background: #f8f9fa;
    font-size: 11px;
    color: #666;
    text-align: center;
}
.ktec-ls-footer a { color: #1a5d96; text-decoration: none; }
.ktec-ls-footer a:hover { text-decoration: underline; }

/* Brand archive link shown when query matches a known brand */
.ktec-ls-brand-link {
    display: block;
    padding: 10px 14px;
    text-align: center;
    background: #eaf2fb;
    border-top: 1px solid #c8d6e8;
    color: #1a5d96 !important;
    font-size: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.1s;
}
.ktec-ls-brand-link:hover {
    background: #d6e4f3;
    text-decoration: none;
}

@media (max-width: 600px) {
    .ktec-ls-bar {
        top: 8px;
        right: 8px;
        left: 8px;
        width: auto;
    }
}