/* SuperTrophy — pretraga. Koristi tokene teme (--stp-*) sa fallback vrednostima. */

[hidden].stp-search-panel,
[hidden].stp-search__results { display: none !important; }

/* ===== Lupa u headeru ===== */
.stp-search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 1px solid var(--stp-line, #e8dfcd);
	border-radius: 50%;
	background: var(--stp-surface, #fff);
	color: var(--stp-ink, #17140f);
	cursor: pointer;
	transition: background-color .15s, border-color .15s;
}
.stp-search-toggle:hover { background: var(--stp-soft, #f1ede4); }
.stp-search-toggle:focus-visible { outline: 2px solid var(--stp-gold, #e09900); outline-offset: 2px; }
.stp-search-toggle[aria-expanded="true"] { background: var(--stp-gold-soft, #fdf3e0); border-color: var(--stp-gold, #e09900); }
.stp-search-toggle__close,
.stp-search-toggle[aria-expanded="true"] .stp-search-toggle__open { display: none; }
.stp-search-toggle[aria-expanded="true"] .stp-search-toggle__close { display: block; }

/* ===== Panel ispod headera ===== */
.stp-search-panel {
	position: absolute;
	left: 0;
	right: 0;
	top: 100%;
	z-index: 61;
	background: var(--stp-surface, #fff);
	border-bottom: 1px solid var(--stp-line, #e8dfcd);
	box-shadow: var(--stp-shadow-lg, 0 14px 30px rgba(23, 20, 15, .1));
	animation: stp-s-drop .14s ease-out;
}
.stp-search-panel__in {
	max-width: var(--stp-max, 1180px);
	margin: 0 auto;
	padding: 1rem var(--stp-pad, 1.25rem) 1.1rem;
}
@keyframes stp-s-drop { from { opacity: 0; transform: translateY(-6px); } }

/* ===== Forma: pilula je iz teme (.stp-search u main.css); ovde samo pozicija za dropdown ===== */
.stp-search--live { position: relative; }
.stp-search--live.is-loading .stp-search__ico { animation: stp-s-pulse .7s ease-in-out infinite alternate; }
@keyframes stp-s-pulse { to { opacity: .3; } }
.stp-search--live input[type="search"]::-webkit-search-cancel-button { cursor: pointer; }
.stp-search-panel .stp-search { max-width: 760px; margin-inline: auto; }

/* Sekcija sa otvorenim dropdownom (npr. hero: overflow hidden + z-index) ide iznad sledeće. */
.stp-sr-lift { position: relative; z-index: 40 !important; overflow-x: clip !important; overflow-y: visible !important; }
.stp-sr-lift-in { position: relative; z-index: 30 !important; }

/* ===== Dropdown ===== */
.stp-search__results {
	position: absolute;
	left: 0;
	right: 0;
	top: calc(100% + 8px);
	z-index: 70;
	max-height: min(70vh, 560px);
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: .4rem;
	background: var(--stp-surface, #fff);
	border: 1px solid var(--stp-line, #e8dfcd);
	border-radius: var(--stp-r, 16px);
	box-shadow: var(--stp-shadow-lg, 0 14px 30px rgba(23, 20, 15, .1));
	text-align: left;
	line-height: 1.35;
}
.stp-sr-group {
	padding: .55rem .6rem .3rem;
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--stp-mute, #7c7365);
}
.stp-sr {
	display: flex;
	align-items: center;
	gap: .8rem;
	padding: .45rem .6rem;
	border-radius: var(--stp-r-sm, 12px);
	color: var(--stp-ink, #17140f);
	text-decoration: none;
}
.stp-sr:hover,
.stp-sr.is-active { background: var(--stp-gold-soft, #fdf3e0); color: var(--stp-ink, #17140f); }
.stp-sr img {
	flex: none;
	width: 56px;
	height: 56px;
	object-fit: contain;
	padding: 3px;
	background: #fff;
	border: 1px solid var(--stp-line, #e8dfcd);
	border-radius: 10px;
}
.stp-sr__txt { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: .95rem; }
.stp-sr__txt strong { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stp-sr__meta { font-size: .8rem; color: var(--stp-mute, #7c7365); }
.stp-sr__price { font-size: .8rem; font-weight: 600; color: var(--stp-gold-dk, #8a5a00); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stp-sr mark { background: none; color: var(--stp-gold-dk, #8a5a00); font-weight: 700; }
.stp-sr--post .stp-sr__txt::before { content: "↗ "; color: var(--stp-mute, #7c7365); }

.stp-sr-chips { display: flex; flex-wrap: wrap; gap: .4rem; padding: .2rem .6rem .5rem; }
.stp-sr-chip {
	display: inline-flex;
	align-items: center;
	gap: .35rem;
	padding: .35rem .8rem;
	border: 1px solid var(--stp-line, #e8dfcd);
	border-radius: var(--stp-pill, 100px);
	background: var(--stp-bg, #faf7f1);
	color: var(--stp-ink, #17140f);
	font-size: .85rem;
	font-weight: 500;
	text-decoration: none;
}
.stp-sr-chip span { color: var(--stp-mute, #7c7365); font-size: .75rem; }
.stp-sr-chip:hover,
.stp-sr-chip.is-active { border-color: var(--stp-gold, #e09900); background: var(--stp-gold-soft, #fdf3e0); }
.stp-sr-hint { margin: .2rem .6rem .5rem; font-size: .8rem; color: var(--stp-mute, #7c7365); }
.stp-sr-loading { margin: 0; padding: .9rem .8rem; font-size: .9rem; color: var(--stp-mute, #7c7365); }
.stp-sr-empty { padding: .7rem .6rem .8rem; font-size: .92rem; }
.stp-sr-empty p { margin: 0 0 .35rem; color: var(--stp-ink2, #4b453c); }
.stp-sr-devis { font-weight: 700; color: var(--stp-gold-dk, #8a5a00); text-decoration: none; border-radius: 6px; }
.stp-sr-devis:hover,
.stp-sr-devis.is-active { text-decoration: underline; }
.stp-sr-all {
	display: block;
	margin-top: .3rem;
	padding: .7rem;
	border-top: 1px solid var(--stp-line, #e8dfcd);
	text-align: center;
	font-weight: 700;
	font-size: .92rem;
	color: var(--stp-gold-dk, #8a5a00);
	text-decoration: none;
}
.stp-sr-all:hover,
.stp-sr-all.is-active { background: var(--stp-gold-soft, #fdf3e0); }

/* ===== Stranica rezultata ===== */
.stp-search-page__wrap { max-width: var(--stp-max, 1180px); margin: 0 auto; padding: 2rem var(--stp-pad, 1.25rem) 4rem; }
.stp-search-page__head { margin-bottom: 1.8rem; text-align: center; }
.stp-search-page__title { margin: 0 0 .25rem; }
.stp-search-page__count { margin: 0 0 1rem; color: var(--stp-mute, #7c7365); font-weight: 600; }
.stp-search-page__form .stp-search { margin-inline: auto; text-align: left; }
.stp-search-page__empty { padding: 1.75rem; border: 1px solid var(--stp-line, #e8dfcd); border-radius: var(--stp-r, 16px); background: var(--stp-surface, #fff); }
.stp-search-page__cta { display: flex; flex-wrap: wrap; gap: 1rem; align-items: center; }
.stp-search-page__cats { display: flex; flex-wrap: wrap; gap: .5rem; list-style: none; padding: 0; margin: 1.25rem 0 0; }
.stp-search-page__cats a { display: inline-block; padding: .4rem .9rem; border: 1px solid var(--stp-line, #e8dfcd); border-radius: var(--stp-pill, 100px); text-decoration: none; color: inherit; font-size: .9rem; }
.stp-search-page__posts { margin-top: 3rem; }
.stp-search-page__posts-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1.5rem; }

@media (max-width: 860px) {
	.stp-search-toggle { width: 38px; height: 38px; }
}
@media (max-width: 480px) {
	.stp-search-panel .stp-search .stp-btn { display: none; }
	.stp-search-panel .stp-search { padding-right: 1rem; }
	.stp-search-panel__in { padding: .75rem; }
	.stp-search__results { max-height: calc(100vh - 160px); }
}
