/* NTI Search — colours can be overridden per site on .nti-search. */
.nti-search {
    --nti-accent: #4caf50;
    --nti-border: #d0d5dd;
    --nti-text: #1f2933;
    --nti-muted: #6b7280;
    --nti-hover: #f3f7f3;
    --nti-mark: #e3f2e4;
    position: relative;
    width: 100%;
    margin: 0;
    font-size: 15px;
    color: var(--nti-text);
}

.nti-search__field {
    position: relative;
    display: flex;
    align-items: center;
}

.nti-search__icon {
    position: absolute;
    left: 16px;
    width: 20px;
    height: 20px;
    fill: var(--nti-muted);
    pointer-events: none;
}

.nti-search .nti-search__input {
    width: 100%;
    height: 54px;
    margin: 0;
    padding: 0 48px 0 46px;
    font-size: 16px;
    color: var(--nti-text);
    background: #fff;
    border: 1px solid var(--nti-border);
    border-radius: 10px;
    box-shadow: 0 1px 2px rgba(16, 24, 40, .05);
    outline: none;
    transition: border-color .15s, box-shadow .15s;
    -webkit-appearance: none;
    appearance: none;
}

.nti-search .nti-search__input:focus {
    border-color: var(--nti-accent);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, .18);
}

.nti-search__input::-webkit-search-cancel-button { display: none; }

.nti-search__clear {
    position: absolute;
    right: 10px;
    width: 32px;
    height: 32px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
    color: var(--nti-muted);
    background: transparent;
    border: 0;
    border-radius: 50%;
    cursor: pointer;
}

.nti-search__clear:hover { color: var(--nti-text); background: var(--nti-hover); }

/* Themes often set display on buttons, which defeats the hidden attribute. */
.nti-search .nti-search__clear[hidden] { display: none; }

.nti-search__spinner {
    position: absolute;
    right: 48px;
    width: 18px;
    height: 18px;
    border: 2px solid var(--nti-border);
    border-top-color: var(--nti-accent);
    border-radius: 50%;
    opacity: 0;
    animation: nti-spin .7s linear infinite;
    transition: opacity .15s;
}

.nti-search.is-loading .nti-search__spinner { opacity: 1; }

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

.nti-search__panel {
    position: absolute;
    top: calc(100% + 6px);
    left: 0;
    right: 0;
    z-index: 9999;
    max-height: min(70vh, 520px);
    overflow-y: auto;
    padding: 6px;
    background: #fff;
    border: 1px solid var(--nti-border);
    border-radius: 10px;
    box-shadow: 0 12px 32px rgba(16, 24, 40, .14);
}

.nti-search__panel[hidden] { display: none; }

.nti-search__label {
    padding: 10px 10px 4px;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: var(--nti-muted);
}

.nti-search__item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 8px 10px;
    color: var(--nti-text);
    text-decoration: none;
    border-radius: 8px;
}

.nti-search__item:hover,
.nti-search__item.is-active {
    color: var(--nti-text);
    text-decoration: none;
    background: var(--nti-hover);
}

.nti-search__thumb {
    flex: 0 0 48px;
    width: 48px;
    height: 48px;
    object-fit: contain;
    background: #fff;
    border: 1px solid #eef0f3;
    border-radius: 6px;
}

.nti-search__text {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    flex-direction: column;
    gap: 2px;
}

.nti-search__title {
    overflow: hidden;
    font-weight: 600;
    line-height: 1.3;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nti-search__meta {
    overflow: hidden;
    font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
    font-size: 12px;
    color: var(--nti-muted);
    text-overflow: ellipsis;
    white-space: nowrap;
}

.nti-search__price {
    flex: 0 0 auto;
    font-size: 14px;
    font-weight: 600;
    text-align: right;
    white-space: nowrap;
}

.nti-search__price del { display: block; font-size: 12px; font-weight: 400; color: var(--nti-muted); }
.nti-search__price ins { text-decoration: none; }

.nti-search mark {
    padding: 0 1px;
    color: inherit;
    background: var(--nti-mark);
    border-radius: 2px;
}

.nti-search__all {
    justify-content: center;
    margin-top: 4px;
    padding: 12px;
    font-weight: 600;
    color: var(--nti-accent);
    border-top: 1px solid #eef0f3;
    border-radius: 0 0 8px 8px;
}

.nti-search__all:hover,
.nti-search__all.is-active { color: var(--nti-accent); }

.nti-search__empty {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 18px 12px;
    text-align: center;
    color: var(--nti-text);
}

.nti-search__empty span { font-size: 13px; color: var(--nti-muted); }

@media (max-width: 600px) {
    .nti-search__price { font-size: 13px; }
    .nti-search__thumb { flex-basis: 40px; width: 40px; height: 40px; }
}
