/* Tamborim - Loja: filtros */

body.tb-loja .tb-f { position: relative; clear: both; width: 100%; margin: 8px 0 14px; }
body.tb-loja h2.tb-grid-title { float: none; display: block; width: 100%; margin-bottom: 12px; }
body.tb-loja .tb-f__form { margin: 0; }
body.tb-loja .tb-f .screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
}

/* Botão "Filtrar" e cabeçalho do painel: só no celular */
body.tb-loja .tb-f__open,
body.tb-loja .tb-f__sheet-head,
body.tb-loja .tb-f__backdrop { display: none; }

/* ---------- Linha de filtros (computador) ---------- */
body.tb-loja .tb-f__panel {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
}
body.tb-loja .tb-f__groups {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px;
	flex: 1 1 auto;
}
body.tb-loja .tb-f__group { position: relative; margin: 0; }
body.tb-loja .tb-f__sum,
body.tb-loja .tb-f__toggle {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 16px;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #d8d5cc;
	border-radius: 999px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	color: var(--tb-ink);
	cursor: pointer;
	user-select: none;
	transition: border-color .15s ease, background-color .15s ease;
}
body.tb-loja .tb-f__sum { list-style: none; }
body.tb-loja .tb-f__sum::-webkit-details-marker { display: none; }
body.tb-loja .tb-f__sum::marker { content: ""; }
body.tb-loja .tb-f__sum:hover,
body.tb-loja .tb-f__toggle:hover { border-color: var(--tb-ink); }
body.tb-loja .tb-f__group[open] > .tb-f__sum { border-color: var(--tb-ink); background: var(--tb-soft); }
body.tb-loja .tb-f__sum:focus-visible,
body.tb-loja .tb-f__toggle:focus-within { outline: 3px solid var(--tb-gold); outline-offset: 2px; }
body.tb-loja .tb-f__chev { transition: transform .15s ease; }
body.tb-loja .tb-f__group[open] .tb-f__chev { transform: rotate(180deg); }

body.tb-loja .tb-f__badge {
	display: inline-grid;
	place-items: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	box-sizing: border-box;
	border-radius: 999px;
	background: var(--tb-gold);
	color: #111;
	font-size: 12px;
	font-weight: 800;
}
body.tb-loja .tb-f__n {
	margin-left: auto;
	font-size: 12px;
	font-weight: 600;
	color: var(--tb-muted);
	font-variant-numeric: tabular-nums;
}

/* Interruptores */
body.tb-loja .tb-f__toggle { position: relative; padding-left: 12px; }
body.tb-loja .tb-f__toggle input { position: absolute; opacity: 0; width: 1px; height: 1px; }
body.tb-loja .tb-f__switch {
	position: relative;
	flex: 0 0 auto;
	width: 34px;
	height: 20px;
	border-radius: 999px;
	background: #cfccc3;
	transition: background-color .15s ease;
}
body.tb-loja .tb-f__switch::after {
	content: "";
	position: absolute;
	top: 3px;
	left: 3px;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .25);
	transition: transform .15s ease;
}
body.tb-loja .tb-f__toggle input:checked + .tb-f__switch { background: var(--tb-green); }
body.tb-loja .tb-f__toggle input:checked + .tb-f__switch::after { transform: translateX(14px); }
body.tb-loja .tb-f__toggle:has(input:checked) { border-color: var(--tb-green); background: #f0f8f3; }
body.tb-loja .tb-f__toggle .tb-f__n { margin-left: 2px; }
body.tb-loja .tb-f__toggle.is-zero:not(:has(input:checked)) { opacity: .5; }

/* Menu suspenso */
body.tb-loja .tb-f__pop {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	z-index: 60;
	width: 300px;
	max-width: calc(100vw - 32px);
	padding: 14px;
	box-sizing: border-box;
	background: #fff;
	border: 1px solid var(--tb-line);
	border-radius: 14px;
	box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
}
body.tb-loja .tb-f__search { display: block; margin: 0 0 10px; }
body.tb-loja .tb-f__search input {
	width: 100%;
	min-height: 42px;
	padding: 8px 12px !important;
	box-sizing: border-box;
	border: 1px solid #d8d5cc !important;
	border-radius: 10px !important;
	background: #fff !important;
	font-size: 14px !important;
	color: var(--tb-ink) !important;
	box-shadow: none !important;
}
body.tb-loja .tb-f__search input:focus { outline: 3px solid var(--tb-gold); outline-offset: 1px; border-color: var(--tb-ink) !important; }
body.tb-loja .tb-f__list {
	max-height: 290px;
	margin: 0;
	padding: 0;
	overflow-y: auto;
	list-style: none;
	overscroll-behavior: contain;
}
body.tb-loja .tb-f__list--plain { max-height: none; }
body.tb-loja .tb-f__list li { margin: 0; padding: 0; }
body.tb-loja .tb-f__list li::before { display: none; }
body.tb-loja .tb-f__list li[hidden] { display: none; }
body.tb-loja .tb-f__opt {
	display: flex;
	align-items: center;
	gap: 10px;
	min-height: 40px;
	padding: 4px 8px;
	border-radius: 8px;
	font-size: 14px;
	line-height: 1.25;
	color: var(--tb-ink);
	cursor: pointer;
}
body.tb-loja .tb-f__opt:hover { background: var(--tb-soft); }
body.tb-loja .tb-f__opt input {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	margin: 0;
	accent-color: var(--tb-ink);
}
body.tb-loja .tb-f__opt.is-zero { color: #9a9a9a; }
body.tb-loja .tb-f__opt:has(input:checked) { font-weight: 700; }
body.tb-loja .tb-f__nomatch { margin: 8px; font-size: 13px; color: var(--tb-muted); }

body.tb-loja .tb-f__range-title {
	margin: 12px 0 8px;
	padding: 12px 0 0;
	border-top: 1px solid var(--tb-line);
	font-size: 12.5px;
	font-weight: 700;
	color: var(--tb-ink-2);
}
body.tb-loja .tb-f__range {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: 8px;
}
body.tb-loja .tb-f__range label { display: block; min-width: 0; margin: 0; }
body.tb-loja .tb-f__range input {
	width: 100% !important;
	min-width: 0;
	margin: 0 !important;
	min-height: 42px;
	padding: 8px 10px !important;
	box-sizing: border-box;
	border: 1px solid #d8d5cc !important;
	border-radius: 10px !important;
	background: #fff !important;
	font-size: 14px !important;
	color: var(--tb-ink) !important;
	box-shadow: none !important;
}
body.tb-loja .tb-f__range input:focus { outline: 3px solid var(--tb-gold); outline-offset: 1px; }
body.tb-loja .tb-f__hint { margin: 10px 0 0; font-size: 12px; line-height: 1.4; color: var(--tb-muted); }

body.tb-loja .tb-f__popfoot { margin: 12px -14px -14px; padding: 10px 14px; border-top: 1px solid var(--tb-line); text-align: right; }
body.tb-loja .tb-f__apply-sm,
body.tb-loja .tb-f__apply {
	min-height: 42px;
	padding: 0 18px;
	border: 0 !important;
	border-radius: 10px !important;
	background: var(--tb-ink) !important;
	color: #fff !important;
	font-size: 14px !important;
	font-weight: 800 !important;
	line-height: 1;
	cursor: pointer;
	box-shadow: none !important;
	transition: background-color .15s ease;
}
body.tb-loja .tb-f__apply-sm:hover,
body.tb-loja .tb-f__apply:hover { background: #000 !important; }
body.tb-loja .tb-f__apply:disabled { opacity: .45; cursor: not-allowed; }
body.tb-loja .tb-f__apply-sm:focus-visible,
body.tb-loja .tb-f__apply:focus-visible { outline: 3px solid var(--tb-gold); outline-offset: 2px; }

/* No computador, os menus têm "Aplicar", os interruptores aplicam sozinhos e os chips têm "Limpar tudo" */
body.tb-loja .tb-f__actions { display: none; }
body.tb-loja .tb-f__clear { font-size: 14px; font-weight: 700; color: var(--tb-ink-2) !important; text-decoration: underline !important; }

/* Filtros aplicados */
body.tb-loja .tb-f__chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 0; }
body.tb-loja .tb-f__chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 36px;
	padding: 0 12px 0 14px;
	box-sizing: border-box;
	border-radius: 999px;
	background: var(--tb-ink);
	color: #fff !important;
	font-size: 13px;
	font-weight: 700;
	text-decoration: none !important;
}
body.tb-loja .tb-f__chip span { font-size: 17px; line-height: 1; opacity: .8; }
body.tb-loja .tb-f__chip:hover span { opacity: 1; }
body.tb-loja .tb-f__chip--clear { background: transparent; color: var(--tb-ink) !important; text-decoration: underline !important; padding: 0 6px; }

body.tb-loja .tb-f.is-loading { opacity: .6; pointer-events: none; }

/* Sem resultados */
body.tb-loja .tb-f-empty {
	margin: 18px 0 40px;
	padding: 28px;
	text-align: center;
	background: var(--tb-soft);
	border: 1px dashed #d8d5cc;
	border-radius: 14px;
}
body.tb-loja .tb-f-empty p { margin: 0 auto 14px; max-width: 52ch; font-size: 15px; line-height: 1.5; color: var(--tb-ink-2); }
body.tb-loja .tb-f-empty strong { display: block; margin-bottom: 4px; color: var(--tb-ink); font-size: 17px; }
body.tb-loja a.tb-f-empty__btn {
	display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px;
	border-radius: 10px; background: var(--tb-ink); color: #fff !important; font-weight: 800; text-decoration: none !important;
}
body.tb-loja:has(.tb-f-empty) .woocommerce-no-products-found { display: none !important; }

/* ---------- Celular: botão + painel que sobe de baixo ---------- */
@media (max-width: 767px) {
	body.tb-loja .tb-f { margin: 4px 0 12px; }
	body.tb-loja .tb-f__open {
		display: inline-flex;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: 100%;
		min-height: 48px;
		padding: 0 16px;
		border: 1px solid var(--tb-ink) !important;
		border-radius: 12px !important;
		background: #fff !important;
		color: var(--tb-ink) !important;
		font-size: 15px !important;
		font-weight: 800 !important;
		box-shadow: none !important;
	}
	body.tb-loja .tb-f__panel {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 100001;
		display: flex;
		flex-direction: column;
		flex-wrap: nowrap;
		align-items: stretch;
		gap: 0;
		max-height: 88vh;
		max-height: 88dvh;
		background: #fff;
		border-radius: 20px 20px 0 0;
		box-shadow: 0 -12px 40px rgba(0, 0, 0, .25);
		transform: translateY(105%);
		visibility: hidden;
		transition: transform .25s ease, visibility 0s linear .25s;
	}
	body.tb-loja .tb-f.is-open .tb-f__panel { transform: none; visibility: visible; transition: transform .28s ease; }
	body.tb-loja .tb-f.is-open .tb-f__backdrop {
		display: block;
		position: fixed;
		inset: 0;
		z-index: 100000;
		background: rgba(0, 0, 0, .5);
	}
	html.tb-f-locked, html.tb-f-locked body { overflow: hidden; }
	/* Barra inferior do tema e botão do WhatsApp ficariam por cima do painel */
	html.tb-f-locked .mfn-footer-stickymenu,
	html.tb-f-locked .criativa-wa,
	html.tb-f-locked .grecaptcha-badge { display: none !important; }

	body.tb-loja .tb-f__sheet-head {
		display: flex;
		align-items: center;
		justify-content: space-between;
		padding: 14px 12px 10px 20px;
		border-bottom: 1px solid var(--tb-line);
		font-size: 18px;
		color: var(--tb-ink);
	}
	body.tb-loja .tb-f__close {
		display: grid;
		place-items: center;
		width: 44px;
		height: 44px;
		padding: 0 !important;
		border: 0 !important;
		background: transparent !important;
		color: var(--tb-ink) !important;
		box-shadow: none !important;
	}
	body.tb-loja .tb-f__groups {
		flex: 1 1 auto;
		min-height: 0;
		flex-direction: column;
		align-items: stretch;
		flex-wrap: nowrap;
		gap: 0;
		padding: 4px 20px 16px;
		overflow-y: auto;
		overscroll-behavior: contain;
	}
	body.tb-loja .tb-f__group { border-bottom: 1px solid var(--tb-line); }
	body.tb-loja .tb-f__sum {
		width: 100%;
		min-height: 52px;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: none !important;
		font-size: 16px;
	}
	body.tb-loja .tb-f__sum .tb-f__chev { margin-left: auto; }
	body.tb-loja .tb-f__pop {
		position: static;
		width: auto;
		max-width: none;
		padding: 0 0 14px;
		border: 0;
		box-shadow: none;
	}
	body.tb-loja .tb-f__list { max-height: 240px; }
	body.tb-loja .tb-f__popfoot { display: none; }
	body.tb-loja .tb-f__toggle {
		justify-content: flex-start;
		width: 100%;
		min-height: 54px;
		padding: 0;
		border: 0;
		border-bottom: 1px solid var(--tb-line);
		border-radius: 0;
		background: none !important;
		font-size: 15px;
	}
	body.tb-loja .tb-f__toggle .tb-f__n { margin-left: auto; }
	body.tb-loja .tb-f__actions {
		display: flex;
		gap: 12px;
		margin: 0;
		padding: 12px 20px calc(12px + env(safe-area-inset-bottom));
		border-top: 1px solid var(--tb-line);
		background: #fff;
	}
	body.tb-loja .tb-f__actions .tb-f__apply { display: block; flex: 1 1 auto; min-height: 50px; font-size: 15px !important; }
	body.tb-loja .tb-f__clear { padding: 0 6px; }

	body.tb-loja .tb-f__chips {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		margin-right: -15px;
		padding-right: 15px;
	}
	body.tb-loja .tb-f__chips::-webkit-scrollbar { display: none; }
	body.tb-loja .tb-f__chip { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
	body.tb-loja .tb-f__panel,
	body.tb-loja .tb-f__switch,
	body.tb-loja .tb-f__switch::after,
	body.tb-loja .tb-f__chev { transition: none !important; }
}
