/**
 * BRZ Promo — Busca de produtos das listagens (inc/shop-search.php).
 * Tokens do tema (--brz-*, definidos em woocommerce.css) e escopo .brz-woo.
 * Propriedades de botão/campo declaradas por completo para o Kit do
 * Elementor (que estiliza button/input globalmente) não vazar aqui.
 */

.brz-woo .brz-ss {
	position: relative;
	z-index: 20;
	margin: 0 0 24px;
}

/* ---------- Campo ---------- */
.brz-woo .brz-ss__field {
	display: flex;
	align-items: center;
	gap: 6px;
	min-height: 58px;
	padding: 6px 6px 6px 18px;
	background: var(--brz-white);
	border: 1px solid var(--brz-line);
	border-radius: var(--brz-radius);
	box-shadow: 0 1px 2px rgba(31, 31, 31, .04);
	transition: border-color .2s ease, box-shadow .2s ease;
}
.brz-woo .brz-ss__field:hover { border-color: rgba(31, 31, 31, .24); }
.brz-woo .brz-ss__field:focus-within {
	border-color: var(--brz-coral);
	box-shadow: 0 0 0 3px rgba(20, 19, 155, .12), var(--brz-shadow-sm);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--brz-coral) 14%, transparent), var(--brz-shadow-sm);
}

.brz-woo .brz-ss__icon {
	flex: 0 0 auto;
	color: var(--brz-gray);
	transition: color .2s ease;
}
.brz-woo .brz-ss__field:focus-within .brz-ss__icon { color: var(--brz-coral); }

.brz-woo .brz-ss__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 6px;
	font-family: var(--brz-font-body);
	font-size: 15px;
	color: var(--brz-ink);
	background: transparent;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.brz-woo .brz-ss__input::placeholder { color: var(--brz-gray); opacity: .85; }
/* O anel de foco fica no campo inteiro (:focus-within acima). */
.brz-woo .brz-ss__input:focus,
.brz-woo .brz-ss__input:focus-visible { outline: none; box-shadow: none; }
.brz-woo .brz-ss__input::-webkit-search-decoration,
.brz-woo .brz-ss__input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

.brz-woo .brz-ss__spinner {
	display: none;
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0 4px;
	border: 2px solid var(--brz-line);
	border-top-color: var(--brz-coral);
	border-radius: 50%;
	animation: brz-ss-spin .7s linear infinite;
}
.brz-woo .brz-ss.is-loading .brz-ss__spinner { display: block; }

.brz-woo .brz-ss__clear {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	margin: 0;
	padding: 0;
	color: var(--brz-gray);
	background: var(--brz-off);
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	cursor: pointer;
	transition: var(--brz-ease);
}
.brz-woo .brz-ss__clear[hidden] { display: none; }
.brz-woo .brz-ss__clear:hover { color: var(--brz-white); background: var(--brz-ink); }

.brz-woo .brz-ss__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	height: 46px;
	margin: 0 0 0 4px;
	padding: 0 26px;
	font-family: var(--brz-font-display);
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: 0;
	text-transform: none;
	color: var(--brz-white);
	background: var(--brz-coral);
	border: 0;
	border-radius: var(--brz-radius-sm);
	box-shadow: none;
	cursor: pointer;
	transition: var(--brz-ease);
}
.brz-woo .brz-ss__submit:hover { color: var(--brz-white); background: var(--brz-black); }

/* ---------- Prévia ---------- */
.brz-woo .brz-ss__panel {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	max-height: min(70vh, 540px);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--brz-white);
	border: 1px solid var(--brz-line);
	border-radius: var(--brz-radius);
	box-shadow: var(--brz-shadow);
	animation: brz-ss-in .18s ease-out;
}
.brz-woo .brz-ss__panel[hidden] { display: none; }

.brz-woo .brz-ss__list {
	margin: 0;
	padding: 6px;
	list-style: none;
	transition: opacity .2s ease;
}
/* Nova consulta em andamento: mantém a lista anterior, esmaecida. */
.brz-woo .brz-ss.is-loading .brz-ss__list { opacity: .55; }

.brz-woo .brz-ss__item {
	display: grid;
	grid-template-columns: 56px minmax(0, 1fr);
	align-items: center;
	gap: 14px;
	padding: 8px 10px;
	color: var(--brz-ink);
	text-decoration: none;
	border-radius: var(--brz-radius);
	opacity: 1; /* links do tema têm opacity .8 (woocommerce.css). */
	transition: background-color .15s ease, box-shadow .15s ease;
}
.brz-woo .brz-ss__item:hover,
.brz-woo .brz-ss__item.is-active { background: var(--brz-off); }
.brz-woo .brz-ss__item.is-active { box-shadow: inset 3px 0 0 var(--brz-coral); }

.brz-woo .brz-ss__thumb {
	width: 56px;
	height: 56px;
	object-fit: contain;
	background: var(--brz-white);
	border: 1px solid var(--brz-line);
	border-radius: var(--brz-radius-sm);
}

.brz-woo .brz-ss__body {
	display: flex;
	flex-direction: column;
	gap: 3px;
	min-width: 0;
}
.brz-woo .brz-ss__name {
	display: -webkit-box;
	overflow: hidden;
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
}
.brz-woo .brz-ss__sku {
	font-family: var(--brz-font-display);
	font-size: 11.5px;
	font-weight: 600;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--brz-gray);
}
.brz-woo .brz-ss mark {
	padding: 0;
	font-weight: 700;
	color: var(--brz-coral);
	background: transparent;
}

.brz-woo .brz-ss__empty {
	margin: 0;
	padding: 22px 20px;
	font-size: 14px;
	text-align: center;
	color: var(--brz-gray);
}

.brz-woo .brz-ss__all {
	position: sticky;
	bottom: 0;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	font-family: var(--brz-font-display);
	font-size: 13.5px;
	font-weight: 600;
	color: var(--brz-coral);
	text-decoration: none;
	background: var(--brz-white);
	border-top: 1px solid var(--brz-line);
	opacity: 1;
}
.brz-woo .brz-ss__all:hover { background: var(--brz-off); }
.brz-woo .brz-ss__all-arrow { transition: transform .2s ease; }
.brz-woo .brz-ss__all:hover .brz-ss__all-arrow { transform: translateX(3px); }

@keyframes brz-ss-spin { to { transform: rotate(360deg); } }
@keyframes brz-ss-in { from { opacity: 0; transform: translateY(-4px); } }

@media (max-width: 600px) {
	.brz-woo .brz-ss { margin-bottom: 18px; }
	.brz-woo .brz-ss__field { min-height: 52px; padding-left: 14px; }
	.brz-woo .brz-ss__input { font-size: 16px; } /* < 16px faz o iOS dar zoom no foco. */
	.brz-woo .brz-ss__submit { height: 40px; padding: 0 16px; }
	.brz-woo .brz-ss__item { grid-template-columns: 48px minmax(0, 1fr); gap: 12px; }
	.brz-woo .brz-ss__thumb { width: 48px; height: 48px; }
}

@media (prefers-reduced-motion: reduce) {
	.brz-woo .brz-ss__panel { animation: none; }
	.brz-woo .brz-ss__spinner { animation-duration: 1.6s; }
}
