/* N&R Features — filtros nas categorias */
.nrf {
	--nrf-accent: var(--ast-global-color-0, #0b6bcb);
	--nrf-text: #1f2937;
	--nrf-muted: #6b7280;
	--nrf-border: #d9dde3;
	--nrf-soft: #f3f5f8;
	--nrf-bg: #fff;
	width: 100%;
	flex: 0 0 100%;
	order: -1;
	margin: 0 0 18px;
	font-size: 14px;
	line-height: 1.35;
	color: var(--nrf-text);
	position: relative;
	z-index: 20;
	clear: both;
}
.nrf *, .nrf *::before, .nrf *::after { box-sizing: border-box; }
.nrf.is-loading { opacity: .55; pointer-events: none; transition: opacity .15s; }

/* Repor estilos de botões/inputs do tema (Astra) */
.nrf button, .nrf .nrf-apply, .nrf .nrf-open {
	font: inherit; text-transform: none; letter-spacing: normal; box-shadow: none;
	min-height: 0; margin: 0; line-height: 1.2; cursor: pointer;
}
.nrf input[type="number"], .nrf input[type="search"] {
	font: inherit; color: var(--nrf-text); background: #fff; border: 1px solid var(--nrf-border);
	border-radius: 8px; padding: 7px 9px; margin: 0; min-height: 0; box-shadow: none; width: 100%;
}
.nrf input[type="checkbox"] { accent-color: var(--nrf-accent); width: 16px; height: 16px; margin: 0; flex: 0 0 auto; }

/* Botão "Filtrar" (só telemóvel) e cabeçalho/rodapé da gaveta */
.nrf .nrf-open, .nrf-drawer-head, .nrf-drawer-foot { display: none; }

.nrf .nrf-badge {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px;
	background: var(--nrf-accent); color: #fff; font-size: 11px; font-weight: 700; line-height: 1;
}

/* ---------- Cada filtro ---------- */
.nrf-facet { position: relative; }
.nrf .nrf-facet__btn {
	display: inline-flex; align-items: center; gap: 7px;
	padding: 9px 14px; border: 1px solid var(--nrf-border); border-radius: 999px;
	background: var(--nrf-bg); color: var(--nrf-text); font-weight: 600; font-size: 14px;
	transition: border-color .15s, background-color .15s;
}
.nrf .nrf-facet__btn:hover { border-color: #aab1bc; background: var(--nrf-bg); color: var(--nrf-text); }
.nrf .nrf-facet.is-active > .nrf-facet__btn { border-color: var(--nrf-accent); color: var(--nrf-accent); }
.nrf-caret { transition: transform .15s; opacity: .7; }
.nrf-facet.is-open .nrf-caret { transform: rotate(180deg); }
@media (max-width: 768px) { .nrf-facet.is-open-m .nrf-caret { transform: rotate(180deg); } }

/* ---------- Opções ---------- */
.nrf-opts { list-style: none; margin: 0; padding: 0; }
.nrf-opt { margin: 0; padding: 0; }
.nrf-opt label {
	display: flex; align-items: center; gap: 9px; padding: 7px 6px; margin: 0;
	border-radius: 6px; cursor: pointer; font-weight: 400; color: var(--nrf-text);
}
.nrf-opt label:hover { background: var(--nrf-soft); }
.nrf-opt__l { flex: 1 1 auto; min-width: 0; overflow-wrap: anywhere; }
.nrf-opt__c { margin-left: auto; color: var(--nrf-muted); font-size: 12px; font-variant-numeric: tabular-nums; }
.nrf-opt.is-empty label { opacity: .45; }
.nrf-opt.nrf-more { display: none; }
.nrf-facet.show-all .nrf-opt.nrf-more { display: block; }
.nrf-facet.is-searching .nrf-opt { display: none; }
.nrf-facet.is-searching .nrf-opt.is-match { display: block; }
.nrf-facet.is-searching .nrf-more-btn { display: none; }
.nrf .nrf-search { margin-bottom: 8px; }
.nrf .nrf-more-btn {
	background: none; border: 0; padding: 6px; color: var(--nrf-accent); font-weight: 600; font-size: 13px;
}
.nrf .nrf-more-btn:hover { background: none; color: var(--nrf-accent); text-decoration: underline; }

/* Cores */
.nrf-sw { width: 20px; height: 20px; border-radius: 50%; border: 1px solid rgba(0,0,0,.18); flex: 0 0 auto; }
.nrf-sw--none { background: repeating-linear-gradient(45deg, #eee 0 3px, #fff 3px 6px); }

/* Botões (ex.: modelos, tamanhos) */
.nrf-facet--botoes .nrf-opts { display: flex; flex-wrap: wrap; gap: 6px; }
.nrf-facet--botoes .nrf-opt.nrf-more { display: none; }
.nrf-facet--botoes.show-all .nrf-opt.nrf-more,
.nrf-facet--botoes.is-searching .nrf-opt.is-match { display: block; }
.nrf-facet--botoes .nrf-opt label { border: 1px solid var(--nrf-border); padding: 6px 11px; gap: 6px; }
.nrf-facet--botoes .nrf-opt input { position: absolute; opacity: 0; pointer-events: none; }
.nrf-facet--botoes .nrf-opt label:has(input:checked) { border-color: var(--nrf-accent); background: var(--nrf-accent); color: #fff; }
.nrf-facet--botoes .nrf-opt label:has(input:checked) .nrf-opt__c { color: rgba(255,255,255,.85); }
.nrf-facet--botoes .nrf-opt__c { margin-left: 2px; }
.nrf-facet--botoes .nrf-opt label:has(input:focus-visible) { outline: 2px solid var(--nrf-accent); outline-offset: 2px; }

/* Intervalo (preço, lumens, …) */
.nrf-range { padding: 4px 2px; }
.nrf-range__sliders { position: relative; height: 30px; --a: 0%; --b: 100%; }
.nrf-range__sliders::before {
	content: ""; position: absolute; left: 0; right: 0; top: 13px; height: 4px; border-radius: 2px;
	background: linear-gradient(to right, #dde1e6 var(--a), var(--nrf-accent) var(--a), var(--nrf-accent) var(--b), #dde1e6 var(--b));
}
.nrf-range__sliders input[type="range"] {
	position: absolute; left: 0; top: 0; width: 100%; height: 30px; margin: 0; padding: 0;
	background: transparent; border: 0; pointer-events: none; -webkit-appearance: none; appearance: none;
}
.nrf-range__sliders input[type="range"]::-webkit-slider-runnable-track { background: transparent; border: 0; height: 30px; }
.nrf-range__sliders input[type="range"]::-moz-range-track { background: transparent; border: 0; }
.nrf-range__sliders input[type="range"]::-webkit-slider-thumb {
	-webkit-appearance: none; pointer-events: auto; width: 20px; height: 20px; margin-top: 5px; border-radius: 50%;
	background: #fff; border: 2px solid var(--nrf-accent); cursor: grab; box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.nrf-range__sliders input[type="range"]::-moz-range-thumb {
	pointer-events: auto; width: 16px; height: 16px; border-radius: 50%;
	background: #fff; border: 2px solid var(--nrf-accent); cursor: grab;
}
.nrf-range__inputs { display: flex; align-items: flex-end; gap: 8px; margin-top: 8px; }
.nrf-range__inputs label { flex: 1 1 0; display: block; position: relative; margin: 0; }
.nrf-range__inputs label span { display: block; font-size: 12px; color: var(--nrf-muted); margin-bottom: 3px; }
.nrf-range__inputs label em { position: absolute; right: 9px; bottom: 8px; font-style: normal; color: var(--nrf-muted); pointer-events: none; }
.nrf-range__inputs input[type="number"] { padding-right: 22px; -moz-appearance: textfield; }
.nrf-range__dash { padding-bottom: 8px; color: var(--nrf-muted); }
.nrf .nrf-range__go {
	padding: 8px 12px; border-radius: 8px; border: 0; background: var(--nrf-accent); color: #fff; font-weight: 700;
}
.nrf .nrf-range__go:hover { background: var(--nrf-accent); color: #fff; filter: brightness(.92); }

/* ---------- Etiquetas dos filtros ativos ---------- */
.nrf-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.nrf a.nrf-chip {
	display: inline-flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
	background: var(--nrf-soft); color: var(--nrf-text); text-decoration: none; font-size: 13px; border: 1px solid transparent;
}
.nrf a.nrf-chip:hover { border-color: var(--nrf-border); color: var(--nrf-text); }
.nrf a.nrf-chip span[aria-hidden] { font-size: 15px; line-height: 1; color: var(--nrf-muted); }
.nrf a.nrf-chip--clear { background: transparent; color: var(--nrf-accent); text-decoration: underline; }
.nrf-empty a { font-weight: 600; }

/* ======================================================================
   COMPUTADOR — barra horizontal com painéis
   ====================================================================== */
@media (min-width: 769px) {
	.nrf--barra .nrf-facets { display: flex; flex-wrap: wrap; gap: 8px; }
	.nrf--barra .nrf-facet__body {
		display: none; position: absolute; top: calc(100% + 6px); left: 0; z-index: 60;
		width: 300px; max-height: 400px; overflow: auto; padding: 12px;
		background: #fff; border: 1px solid var(--nrf-border); border-radius: 12px;
		box-shadow: 0 12px 32px rgba(17, 24, 39, .14);
	}
	.nrf--barra .nrf-facet--botoes .nrf-facet__body { width: 380px; }
	.nrf--barra .nrf-facet--intervalo .nrf-facet__body { width: 320px; }
	.nrf--barra .nrf-facet.is-open .nrf-facet__body { display: block; }
	.nrf--barra .nrf-facet.nrf-right .nrf-facet__body { left: auto; right: 0; }

	/* Vertical (barra lateral, pelo shortcode) */
	.nrf--vertical .nrf-facet { border-bottom: 1px solid var(--nrf-border); }
	.nrf--vertical .nrf-facet__btn {
		width: 100%; justify-content: space-between; border: 0; border-radius: 0; padding: 12px 2px; background: transparent;
	}
	.nrf--vertical .nrf-facet__btn:hover { background: transparent; }
	.nrf--vertical .nrf-facet__name { margin-right: auto; }
	.nrf--vertical .nrf-facet__body { display: none; padding: 0 0 12px; max-height: 360px; overflow: auto; }
	.nrf--vertical .nrf-facet.is-open-m .nrf-facet__body { display: block; }
	.nrf--vertical .nrf-facet.is-open-m .nrf-caret { transform: rotate(180deg); }
}

/* ======================================================================
   TELEMÓVEL — botão "Filtrar" + gaveta
   ====================================================================== */
@media (max-width: 768px) {
	.nrf .nrf-open {
		display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px;
		border: 1px solid var(--nrf-border); border-radius: 999px; background: #fff; color: var(--nrf-text); font-weight: 700;
	}
	.nrf .nrf-open:hover { background: #fff; color: var(--nrf-text); }
	.nrf-panel {
		position: fixed; inset: 0; z-index: 100000; background: #fff;
		display: flex; flex-direction: column;
		transform: translateX(-100%); visibility: hidden; transition: transform .22s ease, visibility 0s linear .22s;
	}
	.nrf.is-drawer .nrf-panel { transform: none; visibility: visible; transition: transform .22s ease; }
	.nrf-drawer-head {
		display: flex; align-items: center; justify-content: space-between;
		padding: 14px 16px; border-bottom: 1px solid var(--nrf-border); font-size: 17px;
	}
	.nrf .nrf-close { background: none; border: 0; font-size: 30px; line-height: 1; padding: 0 4px; color: var(--nrf-text); }
	.nrf .nrf-close:hover { background: none; color: var(--nrf-text); }
	.nrf-facets { flex: 1 1 auto; overflow-y: auto; padding: 0 16px; -webkit-overflow-scrolling: touch; }
	.nrf-facet { border-bottom: 1px solid var(--nrf-border); }
	.nrf .nrf-facet__btn {
		width: 100%; justify-content: space-between; border: 0; border-radius: 0; padding: 15px 2px; background: transparent; font-size: 15px;
	}
	.nrf .nrf-facet__btn:hover { background: transparent; }
	.nrf-facet__name { margin-right: auto; }
	.nrf-facet__body { display: none; padding: 0 0 14px; }
	.nrf-facet.is-open-m .nrf-facet__body { display: block; }
	.nrf-opt label { padding: 9px 4px; font-size: 15px; }
	.nrf input[type="checkbox"] { width: 19px; height: 19px; }
	.nrf-drawer-foot {
		display: flex; gap: 10px; padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
		border-top: 1px solid var(--nrf-border); background: #fff;
	}
	.nrf-clear-btn {
		flex: 0 0 auto; display: inline-flex; align-items: center; padding: 0 16px;
		color: var(--nrf-text); text-decoration: underline; font-weight: 600;
	}
	.nrf .nrf-apply {
		flex: 1 1 auto; padding: 14px; border: 0; border-radius: 10px;
		background: var(--nrf-accent); color: #fff; font-weight: 700; font-size: 15px;
	}
	.nrf .nrf-apply:hover { background: var(--nrf-accent); color: #fff; }
	.nrf .nrf-range__go { display: none; }
	html.nrf-lock, html.nrf-lock body { overflow: hidden; }
}
