/* Nota: não se usa container-type aqui. Dentro de alguns construtores
   de páginas (Elementor) um container de consulta faz o bloco que o
   contém ficar bem mais alto do que o conteúdo — sobrava um espaço
   enorme por baixo no telemóvel. As medidas passam por @media. */
/* Orçamentos — Pesquisa de produtos (hero): [pesquisa_produtos] */

.fpp {
	--fpp-accent: #1F3664;
	--fpp-ink: #0f172a;
	--fpp-muted: #6b7789;
	--fpp-faint: #9aa4b2;
	--fpp-line: #e8ebf0;
	--fpp-soft: #f6f8fa;
	--fpp-r: 15px;
	--fpp-t: .18s cubic-bezier(.2, .8, .2, 1);
	position: relative;
	width: 100%;
	max-width: 1350px;
	margin: 0 auto;
	font-family: inherit;
	color: var(--fpp-ink);
	text-align: left;
	-webkit-font-smoothing: antialiased;
}
.fpp *, .fpp *::before, .fpp *::after { box-sizing: border-box; }
.fpp svg { width: 18px; height: 18px; flex: none; }

/* ---------- barra ---------- */
.fpp-bar {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1.8fr) repeat(var(--fpp-campos), minmax(0, 1fr)) auto;
	align-items: stretch;
	padding: 7px 7px 7px 6px;
	background: linear-gradient(180deg, #fff, #fcfdfe);
	border: 1px solid rgba(15, 23, 42, .10);
	border-radius: 21px;
	box-shadow: none;            /* sem sombra, por pedido */
}

.fpp-campo {
	position: relative;
	min-width: 0;
	min-height: 72px;
	border-radius: var(--fpp-r);
	transition: background var(--fpp-t), box-shadow var(--fpp-t);
}
/* divisórias finas, que se apagam junto ao campo ativo */
.fpp-campo + .fpp-campo::before {
	content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 1px;
	background: var(--fpp-line); transition: opacity var(--fpp-t);
}
.fpp-campo:hover { background: var(--fpp-soft); }
.fpp-campo:hover::before, .fpp-campo:hover + .fpp-campo::before,
.fpp-campo:focus-within::before, .fpp-campo:focus-within + .fpp-campo::before { opacity: 0; }
.fpp-campo:focus-within {
	background: #fff; z-index: 2;
	box-shadow:
		0 0 0 1px color-mix(in srgb, var(--fpp-accent) 55%, transparent),
		0 0 0 5px color-mix(in srgb, var(--fpp-accent) 10%, transparent);
}

.fpp-label {
	position: absolute; left: 22px; top: 17px; right: 38px;
	font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; line-height: 1;
	color: var(--fpp-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	pointer-events: none; transition: color var(--fpp-t);
}
/* Rótulos sempre a preto: antes mudavam para a cor de destaque ao clicar
   (e noutro site ficavam brancos). !important para o tema não os pintar. */
.fpp .fpp-label,
.fpp .fpp-campo:focus-within .fpp-label,
.fpp .fpp-campo.is-set .fpp-label { color: #0f172a !important; }

/* pesquisa */
.fpp-q-wrap { position: absolute; inset: 0; display: flex; align-items: flex-end; }
.fpp-q-ico { position: absolute; left: 22px; bottom: 18px; color: var(--fpp-faint); width: 17px !important; height: 17px !important; transition: color var(--fpp-t); }
.fpp-campo--q:focus-within .fpp-q-ico { color: var(--fpp-accent); }
.fpp .fpp-q {
	width: 100%; height: 100%; margin: 0; padding: 35px 42px 14px 47px;
	border: 0; outline: 0; background: transparent; box-shadow: none; border-radius: var(--fpp-r);
	font: inherit; font-size: 15.5px; font-weight: 550; line-height: 1.3; color: var(--fpp-ink);
	-webkit-appearance: none; appearance: none;
}
.fpp .fpp-q::placeholder { color: var(--fpp-faint); font-weight: 400; opacity: 1; }
.fpp .fpp-q::-webkit-search-cancel-button { display: none; }
.fpp-q-limpar {
	position: absolute; right: 12px; bottom: 15px; width: 26px; height: 26px; padding: 0; margin: 0;
	display: grid; place-items: center; border: 0; border-radius: 50%;
	background: #eceff3; color: var(--fpp-muted); cursor: pointer; transition: background var(--fpp-t), color var(--fpp-t);
}
.fpp-q-limpar svg { width: 13px; height: 13px; }
.fpp-q-limpar:hover { background: #e0e5eb; color: var(--fpp-ink); }
.fpp-q-limpar[hidden] { display: none; }
.fpp.is-a-procurar .fpp-q-ico { animation: fpp-pulso 1s ease-in-out infinite; }
@keyframes fpp-pulso { 50% { opacity: .3; } }

/* selects: o select cobre o campo todo (clicar no rótulo também abre) */
.fpp-sel-wrap { position: absolute; inset: 0; }
.fpp .fpp-sel {
	position: absolute; inset: 0; width: 100%; height: 100%; margin: 0;
	padding: 35px 40px 14px 22px;
	border: 0; outline: 0; background: transparent; box-shadow: none; border-radius: var(--fpp-r);
	font: inherit; font-size: 15.5px; font-weight: 400; line-height: 1.3; color: var(--fpp-faint);
	white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
	cursor: pointer; -webkit-appearance: none; appearance: none;
}
.fpp-campo.is-set .fpp-sel { color: var(--fpp-ink); font-weight: 550; }
.fpp .fpp-sel option { color: var(--fpp-ink); font-weight: 400; }
.fpp .fpp-sel option:disabled { color: #b6bfcb; }
.fpp-sel-seta {
	position: absolute; right: 16px; bottom: 17px; width: 15px !important; height: 15px !important;
	color: var(--fpp-faint); pointer-events: none; transition: transform var(--fpp-t), color var(--fpp-t);
}
.fpp-campo:focus-within .fpp-sel-seta { transform: rotate(180deg); color: var(--fpp-accent); }
.fpp-campo.is-set .fpp-sel-seta { color: var(--fpp-accent); }

/* botão: compacto, centrado na barra */
.fpp-acao { display: flex; align-items: center; padding-left: 10px; }
.fpp .fpp-btn {
	position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
	height: 50px; margin: 0; padding: 0 20px;
	border: 0; border-radius: 13px;
	background: linear-gradient(180deg, color-mix(in srgb, var(--fpp-accent) 88%, #fff), var(--fpp-accent));
	color: #fff;
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, .22),
		0 1px 2px rgba(15, 23, 42, .2),
		0 8px 18px -10px color-mix(in srgb, var(--fpp-accent) 85%, transparent);
	font: inherit; font-size: 14.5px; font-weight: 600; letter-spacing: .01em; line-height: 1;
	cursor: pointer; white-space: nowrap;
	transition: transform var(--fpp-t), box-shadow var(--fpp-t), filter var(--fpp-t);
}
.fpp .fpp-btn-ico { width: 16px !important; height: 16px !important; }
.fpp .fpp-btn:hover {
	filter: brightness(1.07);
	box-shadow:
		inset 0 1px 0 rgba(255, 255, 255, .25),
		0 2px 4px rgba(15, 23, 42, .18),
		0 14px 26px -12px color-mix(in srgb, var(--fpp-accent) 85%, transparent);
}
.fpp .fpp-btn:active { transform: translateY(1px); }
.fpp .fpp-btn:focus-visible { outline: 2px solid #fff; outline-offset: 2px; }
/* a seta só aparece ao passar o rato */
.fpp-btn-ir { width: 0 !important; height: 16px !important; margin-left: -9px; opacity: 0; transition: width var(--fpp-t), margin var(--fpp-t), opacity var(--fpp-t); }
.fpp .fpp-btn:hover .fpp-btn-ir { width: 16px !important; margin-left: 0; opacity: 1; }
.fpp.is-a-enviar .fpp-btn { pointer-events: none; }
.fpp.is-a-enviar .fpp-btn-ico { animation: fpp-roda .7s linear infinite; }
@keyframes fpp-roda { to { transform: rotate(360deg); } }

/* ---------- sugestões ---------- */
.fpp-sug {
	position: absolute; left: -7px; top: calc(100% + 13px); z-index: 50;
	width: max(100% + 14px, 520px); max-width: 100%; max-height: min(460px, 70vh); overflow-y: auto;
	padding: 8px; background: #fff; border-radius: 18px;
	box-shadow: 0 30px 70px -20px rgba(15, 23, 42, .4), 0 0 0 1px rgba(15, 23, 42, .07);
	animation: fpp-entra .16s ease-out;
}
.fpp-sug[hidden] { display: none; }
@keyframes fpp-entra { from { opacity: 0; transform: translateY(-4px); } }
.fpp-sug-grupo { padding: 8px 12px 6px; font-size: 10.5px; font-weight: 600; letter-spacing: .09em; text-transform: uppercase; color: var(--fpp-muted); }
.fpp .fpp-sug-item {
	display: flex; align-items: center; gap: 12px; width: 100%; margin: 0; padding: 8px 12px;
	border: 0; border-radius: 12px; background: transparent; color: var(--fpp-ink);
	font: inherit; text-align: left; text-decoration: none; cursor: pointer;
}
.fpp .fpp-sug-item[aria-selected="true"] { background: var(--fpp-soft); }
.fpp-sug-img {
	width: 44px; height: 44px; flex: none; overflow: hidden; border-radius: 10px;
	background: var(--fpp-soft) linear-gradient(135deg, #eef1f5, #e3e8ee); border: 1px solid var(--fpp-line);
}
.fpp-sug-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
.fpp-sug-txt { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.fpp-sug-nome { font-size: 14px; font-weight: 600; line-height: 1.25; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpp-sug-meta { display: flex; gap: 8px; align-items: center; font-size: 12px; color: var(--fpp-muted); min-width: 0; }
.fpp-sug-meta code { font-family: ui-monospace, "SF Mono", SFMono-Regular, Menlo, monospace; font-size: 11.5px; background: none; padding: 0; color: inherit; }
.fpp-sug-meta span::before { content: "·"; margin-right: 8px; }
.fpp-sug-meta span:first-child::before { content: none; }
.fpp .fpp-sug mark { background: color-mix(in srgb, var(--fpp-accent) 14%, transparent); color: inherit; border-radius: 3px; padding: 0 1px; }
.fpp-sug-vazio { padding: 14px 12px; font-size: 13.5px; color: var(--fpp-muted); }
.fpp .fpp-sug-todos {
	margin-top: 6px; padding: 12px; border-top: 1px solid var(--fpp-line); border-radius: 0 0 12px 12px;
	font-size: 13.5px; font-weight: 600; color: var(--fpp-accent);
}
.fpp .fpp-sug-todos span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fpp .fpp-sug-todos b { padding: 3px 8px; border-radius: 999px; background: color-mix(in srgb, var(--fpp-accent) 10%, transparent); font-size: 12px; }
.fpp .fpp-sug-todos[aria-selected="true"] { border-radius: 12px; }

/* ---------- ecrãs estreitos ---------- */
@media (max-width: 980px) {
	.fpp-bar { grid-template-columns: repeat(var(--fpp-campos), minmax(0, 1fr)); gap: 6px 0; padding: 7px; }
	.fpp-campo--q { grid-column: 1 / -1; background: var(--fpp-soft); }
	.fpp-campo--q + .fpp-campo::before { content: none; }
	.fpp-acao { grid-column: 1 / -1; padding: 3px 0 0; }
	.fpp .fpp-btn { width: 100%; height: 52px; }
	.fpp-sug { left: 0; width: 100%; }
}
@media (max-width: 620px) {
	.fpp-bar { grid-template-columns: 1fr 1fr; }
	.fpp-campo--sel { background: var(--fpp-soft); margin: 0 3px; }
	.fpp-campo--sel::before { content: none !important; }
	/* número ímpar de caixas: a última ocupa a linha toda */
	.fpp-campo--sel:nth-child(even):nth-last-child(2) { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
	.fpp-bar { grid-template-columns: 1fr; }
	.fpp-campo--sel { margin: 0; }
}

@media (prefers-reduced-motion: reduce) {
	.fpp *, .fpp *::before, .fpp *::after { animation: none !important; transition: none !important; }
}
