/**
 * Vitrine "app" — categorias circulares, busca pílula, cards arredondados, barra inferior.
 * Sistemanovoagente
 */

/* ---------- Cards produto — desktop (borda + sombra, referência) ---------- */
@media (min-width: 992px) {
	.categoria .produto,
	.categoria .novoproduto,
	.categoria .swiper-slide .produto,
	.categoria .swiper-slide .novoproduto {
		border: 1px solid rgba(37, 99, 235, 0.42);
		border-radius: 16px;
		box-shadow: 0 4px 20px rgba(15, 23, 42, 0.09);
		background: #fff;
		overflow: hidden;
		box-sizing: border-box;
	}
	.categoria .produto .capa,
	.categoria .novoproduto .capa {
		border-radius: 12px;
	}
	.categoria .produto .capa img,
	.categoria .novoproduto .capa img {
		border-radius: 10px;
	}
	.tv-grid .produto,
	.col-infinite .produto {
		border: 1px solid rgba(37, 99, 235, 0.42);
		border-radius: 16px;
		box-shadow: 0 4px 20px rgba(15, 23, 42, 0.09);
		background: #fff;
	}
}

/* ---------- Cabeçalho mobile: cantos arredondados só na faixa de baixo (capa / bloco logo) ---------- */
@media (max-width: 991px) {
	body.has-tv-app-nav .header .top {
		border-radius: 0 !important;
		border-bottom: 1px solid rgba(255, 255, 255, 0.14);
		box-shadow:
			inset 0 1px 0 rgba(255, 255, 255, 0.06),
			0 1px 0 rgba(0, 0, 0, 0.12);
	}

	/* Home: cantos inferiores arredondados na capa */
	body.has-tv-app-nav #main.body-estabelecimento > .header + .sceneElement:not(:has(> .header-interna)) > .container.nopadd .cover {
		border-bottom-left-radius: 32px;
		border-bottom-right-radius: 32px;
		overflow: hidden;
		box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
	}

	/* Páginas internas: bloco sob a logo fixa (avatar no .locked-bar) */
	body.has-tv-app-nav #main.body-estabelecimento > .header + .sceneElement:has(> .header-interna) .header-interna {
		/* fundo: cor do lojista (app/estabelecimento/css/style.php) */
		border-bottom-left-radius: 32px;
		border-bottom-right-radius: 32px;
		box-shadow: 0 10px 28px rgba(15, 23, 42, 0.14);
		padding-bottom: 12px;
		margin-top: 0;
		min-height: 64px;
	}

	body.has-tv-app-nav #main.body-estabelecimento > .header + .sceneElement:has(> .header-interna) .holder-interna.visible-xs.visible-sm,
	body.has-tv-app-nav #main.body-estabelecimento > .header + .sceneElement:has(> .header-interna) .holder-interna-nopadd {
		height: 20px;
		min-height: 0;
	}

	/* Home: faixa da capa — preenchimento como desktop */
	.sceneElement > .container.nopadd.visible-xs .cover,
	.sceneElement > .container.nopadd.visible-sm .cover {
		background-size: cover !important;
		background-position: center top !important;
	}
}

/* ---------- Chips de categoria (círculo + label) — todos os breakpoints ---------- */
/* Sobrescreve .tv-infinite-menu a do template.css (sem isso, img no desktop estoura o layout). */
.tv-cat-pill-row.tv-infinite-menu,
.tv-infinite-menu.tv-cat-pill-row {
	display: flex;
	flex-direction: row;
	flex-wrap: wrap;
	align-items: flex-start;
	gap: 14px 16px;
	padding: 10px 4px 16px;
	justify-content: flex-start;
	width: 100%;
	box-sizing: border-box;
}

.tv-infinite-menu.tv-cat-pill-row a.tv-cat-pill,
a.tv-cat-pill {
	display: inline-flex !important;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	text-decoration: none !important;
	color: #222 !important;
	min-width: 72px;
	max-width: 88px;
	flex-shrink: 0;
	padding: 0 !important;
	font-size: inherit !important;
	font-weight: 400 !important;
	border-bottom: none !important;
	box-sizing: border-box;
	line-height: 1.2;
}

.tv-infinite-menu.tv-cat-pill-row a.tv-cat-pill:hover,
a.tv-cat-pill:hover {
	color: #222 !important;
	border-bottom: none !important;
}

.tv-infinite-menu.tv-cat-pill-row a.tv-cat-pill.active,
a.tv-cat-pill.active {
	border-bottom: none !important;
}

.tv-cat-pill__circle {
	width: 64px;
	height: 64px;
	min-width: 64px;
	min-height: 64px;
	max-width: 64px;
	max-height: 64px;
	border-radius: 50%;
	background: #f3f4f6;
	border: 2px solid #e8e8e8;
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	transition: border-color 0.2s, background 0.2s;
	flex-shrink: 0;
	box-sizing: border-box;
}
.tv-cat-pill__circle img {
	width: 100% !important;
	height: 100% !important;
	max-width: 64px !important;
	max-height: 64px !important;
	object-fit: cover;
	display: block;
	vertical-align: middle;
}
.tv-cat-pill__circle--empty {
	color: #9ca3af;
	font-size: 26px;
}
.tv-cat-pill__txt {
	margin-top: 8px;
	font-size: 12px;
	line-height: 1.2;
	text-align: center;
	max-width: 88px;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
	text-transform: lowercase;
}
.tv-cat-pill.active .tv-cat-pill__circle {
	border-color: var(--tv-brand, #2563eb);
	background: rgba(37, 99, 235, 0.08);
}
.tv-cat-pill.active .tv-cat-pill__txt {
	font-weight: 600;
	color: var(--tv-brand, #2563eb) !important;
}

/* Mobile: carrossel horizontal nesta fila */
@media (max-width: 991px) {
	.tv-cat-pill-row.tv-infinite-menu {
		flex-wrap: nowrap;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
	}
	.tv-cat-pill-row.tv-infinite-menu::-webkit-scrollbar {
		display: none;
	}
}

/* ---------- Busca mobile ---------- */
@media (max-width: 991px) {
	.tv-search-app form {
		border-radius: 999px;
		overflow: hidden;
		border: 2px solid rgba(0, 0, 0, 0.08);
		box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
		background: #fff;
	}
	.tv-search-app input[type="text"] {
		border-radius: 999px 0 0 999px !important;
		border: none !important;
		padding: 14px 16px !important;
	}
	.tv-search-app button {
		border-radius: 0 999px 999px 0 !important;
		min-width: 52px;
	}

	/* ---------- Cards produto (tv-infinite) — 2 por linha, como tv-grid col-xs-6 ---------- */
	.categoria .produtos .row > .tv-infinite {
		display: flex;
		flex-wrap: wrap;
		align-items: stretch;
		width: 100%;
		margin-left: 0;
		margin-right: 0;
		column-gap: 10px;
		row-gap: 12px;
		box-sizing: border-box;
	}

	/* Evita margens negativas do Bootstrap a cortar a grelha 2 colunas */
	.categoria .produtos .row:has(> .tv-infinite) {
		margin-left: 0;
		margin-right: 0;
	}

	.produtos .tv-infinite .col-infinite {
		width: calc(50% - 5px) !important;
		max-width: calc(50% - 5px) !important;
		min-width: 0 !important;
		flex: 0 0 calc(50% - 5px) !important;
		margin-right: 0 !important;
		float: none !important;
		padding-left: 0 !important;
		padding-right: 0 !important;
		box-sizing: border-box;
	}

	/* “Ver tudo” no carrossel antigo — largura total abaixo da grelha */
	.produtos .tv-infinite .col-infinite-last {
		flex: 0 0 100% !important;
		width: 100% !important;
		max-width: 100% !important;
		margin-top: 4px;
		text-align: center;
	}

	.categoria .produto {
		border: 1px solid rgba(37, 99, 235, 0.22);
		border-radius: 16px;
		padding: 8px 8px 8px !important;
		box-shadow: 0 4px 18px rgba(15, 23, 42, 0.1);
		background: #fff;
		margin-bottom: 14px !important;
		min-height: 0 !important;
		display: flex;
		flex-direction: column;
		box-sizing: border-box;
	}
	.categoria .produto > a {
		display: flex;
		flex-direction: column;
		flex: 1;
		align-items: stretch;
		min-height: 0;
		color: inherit;
		text-decoration: none !important;
	}

	.categoria .produto .capa {
		display: block !important;
		position: relative;
		width: 100%;
		aspect-ratio: 1 / 1;
		max-height: none !important;
		margin: 0 0 6px 0 !important;
		border-radius: 12px;
		overflow: hidden;
		background-size: cover !important;
		background-position: center center !important;
		box-shadow: none;
		flex-shrink: 0;
	}
	.categoria .produto .capa::after {
		content: "";
		position: absolute;
		left: 0;
		right: 0;
		bottom: 0;
		height: 48%;
		background: linear-gradient(to top, rgba(0, 0, 0, 0.72) 0%, rgba(0, 0, 0, 0.15) 55%, transparent 100%);
		pointer-events: none;
		border-radius: inherit;
		z-index: 0;
	}
	.categoria .produto .capa .nome {
		position: absolute !important;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 2;
		display: block !important;
		height: auto !important;
		min-height: 0 !important;
		width: 100%;
		margin: 0 !important;
		padding: 10px 10px 12px !important;
		text-align: center;
		color: #fff !important;
		font-weight: 700;
		font-size: 13px;
		line-height: 1.2;
		text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
		background: none !important;
		background-image: none !important;
		box-sizing: border-box;
	}

	.categoria .produto .valor_anterior {
		margin: 0 0 2px 0 !important;
		padding: 0 4px;
	}

	.categoria .produto .apenas {
		margin: 0 0 2px 0 !important;
		line-height: 1.2 !important;
		font-size: 11px !important;
		color: rgba(0, 0, 0, 0.45) !important;
	}
	.categoria .produto .apenas-single {
		max-width: 100% !important;
		margin: 2px auto 2px !important;
	}
	.categoria .produto .valor {
		margin: 0 0 6px 0 !important;
		font-size: 17px !important;
		line-height: 1.2 !important;
		color: #111 !important;
		font-weight: 700;
	}

	.categoria .produto .detalhes {
		display: flex !important;
		align-items: center;
		justify-content: center;
		gap: 6px;
		width: 100%;
		margin: 0 !important;
		padding: 10px 6px !important;
		border-radius: 12px;
		background: var(--tv-brand, #1e3a5f) !important;
		color: #fff !important;
		box-sizing: border-box;
		flex-shrink: 0;
	}
	.categoria .produto .detalhes span {
		transform: none !important;
		font-weight: 600;
		font-size: 12px;
	}
	.categoria .produto .detalhes i {
		transform: none !important;
		margin: 0 !important;
		font-size: 20px !important;
	}

	.categoria .produto .label-estatisticas,
	.categoria .produto .mt-2 {
		margin-top: 4px !important;
		margin-bottom: 4px !important;
	}
	.categoria .produto p {
		margin: 4px 0 !important;
	}

	.categoria .produto .capa img {
		border-radius: 10px;
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}

	.categoria .novoproduto,
	.novoproduto {
		border: 1px solid #e8e8e8;
		border-radius: 16px;
		padding: 8px 10px !important;
		margin-bottom: 14px !important;
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
		background: #fff;
	}
	.novoproduto .capa img {
		border-radius: 12px;
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}
	.novoproduto .valor-green {
		color: #16a34a !important;
		font-weight: 700;
	}

	/* Grid / swiper produtos */
	.tv-grid .produto {
		border: 1px solid #e8e8e8;
		border-radius: 16px;
		padding: 8px;
		box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
		background: #fff;
	}
	.col-infinite .produto {
		border-radius: 16px;
		border: 1px solid #eaeaea;
		overflow: hidden;
	}

	/* Página categoria / home (tv-grid): foto quadrada; layout fino no bloco específico abaixo */
	.categoria .produtos .row.tv-grid .produto .capa {
		aspect-ratio: 1 / 1;
		max-height: none !important;
		min-height: 0;
		background-size: cover !important;
		background-position: center center !important;
	}
	.categoria .produtos .row.tv-grid .produto .capa .nome {
		height: auto !important;
		min-height: 0 !important;
	}
}

/* Cor da marca (usa cor da loja se existir no theme) */
.tv-app-nav {
	--tv-brand: #2563eb;
}

/* ---------- Barra inferior tipo app (5 colunas: Home | Categorias | FAB | Carrinho | Menu) ---------- */
.tv-app-nav {
	display: none;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 10050;
	background: #fff;
	border-top: 1px solid #e8e8e8;
	box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
	padding: 4px 4px calc(6px + env(safe-area-inset-bottom, 0));
	grid-template-columns: repeat(5, minmax(0, 1fr));
	align-items: end;
	justify-items: center;
	column-gap: 2px;
}
@media (max-width: 991px) {
	/*
	 * Altura até ao topo da barra fixa do app (padding + linha ~FAB + safe area).
	 * Usado para posicionar a faixa “Adicionar à sacola” logo acima do nav, sem o cobrir.
	 */
	body.has-tv-app-nav {
		--tv-app-nav-offset: calc(4px + 74px + 6px + env(safe-area-inset-bottom, 0px));
	}

	/*
	 * SmoothState (transitions.css) mete animation/transform em .sceneElement; com isso,
	 * position:fixed dos filhos deixa de ser relativamente à janela — ao rolar, a barra de
	 * compra “descia” atrás da tv-app-nav. Neutraliza só na ficha de produto.
	 */
	body.has-tv-app-nav .sceneElement:has(.single-produto #the_form) {
		transform: none !important;
		-webkit-transform: none !important;
		filter: none !important;
		perspective: none !important;
		animation: none !important;
		-webkit-animation: none !important;
	}

	/* grid — não use visible-xs/sm no <nav>: o Bootstrap força display:block !important e quebra a fila */
	.tv-app-nav {
		display: grid !important;
		grid-template-columns: repeat(5, minmax(0, 1fr));
		grid-auto-rows: auto;
		align-items: end;
		justify-items: center;
		column-gap: 2px;
		width: 100%;
		max-width: 100vw;
		box-sizing: border-box;
	}
}

.tv-app-nav__item {
	grid-column: auto;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	overflow: visible;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	padding: 4px 2px 4px;
	text-decoration: none !important;
	color: var(--tv-brand, #2563eb) !important;
	border: none;
	background: none;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	font-family: inherit;
	box-sizing: border-box;
}
/*
 * forms.css: `button span { color: #fff }` e padding grande em todo `button`.
 * Home/Carrinho são <a>; Categoria/Menu são <button> — rótulos ficavam brancos no fundo branco.
 */
.tv-app-nav button.tv-app-nav__item {
	padding: 4px 2px 4px !important;
	background: none !important;
	border-radius: 0 !important;
}
.tv-app-nav button.tv-app-nav__item .tv-app-nav__label {
	color: var(--tv-brand, #2563eb) !important;
}
/* Ícones só dentro de .tv-app-nav__ic — evita margem dupla e rótulos cortados */
.tv-app-nav__item .tv-app-nav__ic i {
	font-size: 22px;
	margin-bottom: 0;
	line-height: 1;
	flex-shrink: 0;
	color: var(--tv-brand, #2563eb) !important;
}
.tv-app-nav__ic {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 2px;
}
/* rótulo sempre visível (mesma linha que Home / Carrinho) */
.tv-app-nav__label {
	display: block;
	font-size: 11px;
	line-height: 1.2;
	text-align: center;
	max-width: 100%;
	word-break: break-word;
	hyphens: auto;
	padding: 0 1px;
}
.tv-app-nav__item--active,
.tv-app-nav__item--active .tv-app-nav__label {
	color: var(--tv-brand, #2563eb) !important;
	font-weight: 600;
}

.tv-app-nav__badge {
	position: absolute;
	top: -4px;
	right: -4px;
	background: #dc2626;
	color: #fff;
	font-size: 10px;
	min-width: 18px;
	height: 18px;
	line-height: 18px;
	text-align: center;
	border-radius: 9px;
	font-style: normal;
	padding: 0 4px;
}
.tv-app-nav__fab-cell {
	display: flex;
	align-items: flex-end;
	justify-content: center;
	width: 100%;
	max-width: 100%;
	min-width: 0;
	pointer-events: none;
	margin-bottom: 2px;
	align-self: end;
}
.tv-app-nav__fab-cell .tv-app-nav__fab {
	pointer-events: auto;
}

.tv-app-nav__fab {
	width: 56px;
	height: 56px;
	border-radius: 50%;
	border: none;
	background: var(--tv-brand, #2563eb);
	color: #fff !important;
	font-size: 28px;
	line-height: 1;
	margin-top: -26px;
	margin-bottom: 0;
	box-shadow: 0 6px 20px rgba(37, 99, 235, 0.5);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	flex-shrink: 0;
}

/* Menu popup do + */
.tv-fab-menu {
	display: none;
	position: fixed;
	left: 50%;
	bottom: calc(var(--tv-app-nav-offset, 88px) + 10px);
	transform: translateX(-50%);
	z-index: 10058;
	background: #fff;
	border-radius: 16px;
	box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
	min-width: 240px;
	max-width: 92vw;
	overflow: hidden;
	border: 1px solid #eee;
}
.tv-fab-menu.is-open {
	display: block;
}
.tv-fab-menu::after {
	content: "";
	position: absolute;
	bottom: -8px;
	left: 50%;
	transform: translateX(-50%);
	border: 8px solid transparent;
	border-top-color: #fff;
	filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.06));
}
.tv-fab-menu a {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 14px 16px;
	color: #1e3a5f !important;
	text-decoration: none !important;
	border-bottom: 1px solid #f0f0f0;
	font-size: 14px;
}
.tv-fab-menu a:last-child {
	border-bottom: none;
}
.tv-fab-menu a i {
	font-size: 20px;
	color: var(--tv-brand, #2563eb);
}

/* Modal categorias */
.tv-modal-cats__backdrop {
	display: none;
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.45);
	z-index: 10060;
	-webkit-overflow-scrolling: touch;
}
.tv-modal-cats__backdrop.is-open {
	display: block;
}
.tv-modal-cats {
	display: none;
	position: fixed;
	left: 50%;
	top: 50%;
	transform: translate(-50%, -50%);
	z-index: 10061;
	width: 92vw;
	max-width: 400px;
	max-height: 80vh;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	background: #fff;
	border-radius: 24px;
	box-shadow: 0 20px 50px rgba(0, 0, 0, 0.2);
	padding: 18px 16px 20px;
	box-sizing: border-box;
}
.tv-modal-cats.is-open {
	display: block;
}
@media (max-width: 991px) {
	.tv-modal-cats {
		max-height: min(80vh, calc(100dvh - 100px));
	}
}
.tv-modal-cats__head {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto;
	align-items: center;
	gap: 8px;
	margin-bottom: 16px;
}
.tv-modal-cats__head strong {
	font-size: 18px;
	min-width: 0;
}
.tv-modal-cats__close {
	border: none;
	background: none;
	color: #ea580c;
	font-size: 26px;
	cursor: pointer;
	line-height: 1;
	/* Alinha ao canto direito das caixas da grelha (padding 16px do modal; sem margem negativa que empurrava o × para fora) */
	padding: 4px 2px 4px 12px;
	margin: -4px 0 -4px 0;
	justify-self: end;
	flex-shrink: 0;
}
.tv-modal-cats__grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 14px 10px;
}
.tv-modal-cats__grid a {
	display: flex;
	flex-direction: column;
	align-items: center;
	text-align: center;
	text-decoration: none !important;
	color: #222 !important;
	font-size: 12px;
}
.tv-modal-cats__grid .tv-cat-pill__circle {
	width: 56px;
	height: 56px;
	min-width: 56px;
	min-height: 56px;
	max-width: 56px;
	max-height: 56px;
}
.tv-modal-cats__grid .tv-cat-pill__circle img {
	max-width: 56px !important;
	max-height: 56px !important;
}

/* Modal de categorias só com nomes (painel: fotos na vitrine desligadas) */
.tv-modal-cats__grid--lista {
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 10px 12px;
	align-items: stretch;
}
.tv-modal-cats__grid--lista .tv-modal-cats__chip {
	display: flex !important;
	flex-direction: row !important;
	align-items: center !important;
	justify-content: center !important;
	text-align: center !important;
	min-height: 44px;
	padding: 10px 12px;
	background: #f3f4f6;
	border-radius: 12px;
	font-size: 13px !important;
	font-weight: 600;
	color: #1e3a5f !important;
	line-height: 1.25;
	word-break: break-word;
	box-sizing: border-box;
}

/* Espaço para a barra inferior do app + barra fixa “Comprar” na página do produto — só mobile */
@media (max-width: 991px) {
	/*
	 * Listagens: .footer fica fora do .sceneElement; padding gigante só criava vão entre
	 * o último card e o rodapé (a folga para a tv-app-nav fica no margin-bottom do .footer).
	 */
	body.has-tv-app-nav .sceneElement:not(:has(.single-produto)) {
		padding-bottom: 10px;
	}

	/*
	 * Página do produto: total + “Adicionar a sacola” ficam numa faixa fixa
	 * imediatamente acima da tv-app-nav (referência loja teste).
	 */
	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar {
		position: fixed;
		left: max(12px, env(safe-area-inset-left, 0px)) !important;
		right: max(12px, env(safe-area-inset-right, 0px)) !important;
		width: auto !important;
		max-width: 100% !important;
		margin-left: 0 !important;
		margin-right: 0 !important;
		transform: none !important;
		/*
		 * A variável superestima a distância até ao topo branco do nav; sem desconto fica
		 * faixa vazia. Referência “leite”: faixa colada — ~24px costuma fechar o vão.
		 */
		bottom: calc(var(--tv-app-nav-offset) - 24px) !important;
		margin-bottom: 0 !important;
		z-index: 10049;
		background: #fff;
		border: 1px solid rgba(0, 0, 0, 0.08);
		border-radius: 20px;
		box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
		padding: 12px 14px;
		box-sizing: border-box;
		min-height: 56px;
		display: flex;
		align-items: center;
		justify-content: center;
	}
	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar .row {
		display: flex;
		flex-wrap: nowrap;
		align-items: center;
		justify-content: space-between;
		margin-left: 0 !important;
		margin-right: 0 !important;
		width: 100%;
		max-width: 100%;
	}
	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar .row > [class*="col-"] {
		width: auto !important;
		float: none !important;
		flex: 0 1 auto;
		padding-left: 4px !important;
		padding-right: 4px !important;
	}
	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar .row > [class*="col-"]:last-child:not(:only-child) {
		flex: 0 0 auto;
		margin-left: auto;
		text-align: right;
	}
	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar .subtotal {
		text-align: left !important;
		margin: 0 !important;
		font-size: 15px;
		line-height: 1.3;
	}
	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar .subtotal strong {
		font-weight: 600;
		color: rgba(0, 0, 0, 0.55);
		font-size: 13px;
	}
	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar .subtotal span {
		font-weight: 700;
		color: #111;
		margin-left: 4px;
	}
	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar .sacola-adicionar,
	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar .botao-acao {
		float: none !important;
		display: inline-flex !important;
		align-items: center;
		justify-content: center;
		gap: 8px;
		width: auto !important;
		min-width: 0;
		padding: 12px 18px !important;
		border-radius: 999px !important;
		margin: 0 !important;
		box-sizing: border-box;
	}
	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar br {
		display: none !important;
	}

	body.has-tv-app-nav .single-produto #the_form .line.botoes.subtotal-adicionar .pull-right {
		float: none !important;
	}
}

/* Desktop: barra do app oculta; evita folha desnecessária em telas grandes */
@media (min-width: 992px) {
	body.has-tv-app-nav .sceneElement {
		padding-bottom: 0;
	}
}

/* Mobile com barra app: roda-pé com endereço fica o “fim” da página; some o bloco da agência */
@media (max-width: 991px) {
	body.has-tv-app-nav .footer .copyright {
		display: none !important;
		margin: 0 !important;
		padding: 0 !important;
		height: 0 !important;
		min-height: 0 !important;
		overflow: hidden !important;
		visibility: hidden !important;
	}

	/*
	 * O endereço (.footer-info) fica fora do .sceneElement; sem folga, a tv-app-nav fixa
	 * cobre a última linha (ex.: cidade/UF). Só padding no rodapé — a barra do app não muda.
	 */
	body.has-tv-app-nav {
		scroll-padding-bottom: calc(var(--tv-app-nav-offset, 84px) + 8px);
	}

	body.has-tv-app-nav #main.body-estabelecimento > .footer {
		margin-top: 0;
		/* Folga ≥ altura da tv-app-nav (+ respiro) — evita a barra cobrir o endereço */
		margin-bottom: calc(var(--tv-app-nav-offset, 84px) + 8px);
	}

	body.has-tv-app-nav #main.body-estabelecimento > .footer .footer-info {
		position: relative;
		z-index: 1;
		padding: 14px 12px 12px;
		box-sizing: border-box;
		overflow: visible;
	}

	body.has-tv-app-nav #main.body-estabelecimento > .footer .footer-info span {
		display: block;
		line-height: 1.45;
		overflow: visible;
		white-space: normal;
		word-break: break-word;
		text-overflow: unset;
		margin: 0 0 6px 0;
		padding-bottom: 0;
	}

	body.has-tv-app-nav #main.body-estabelecimento > .footer .footer-info .social {
		position: static;
		margin: 0;
		padding: 0 0 2px 0;
		justify-content: center;
	}

	/* Produto: menos folga no fim do conteúdo (faixa Comprar já é fixa) */
	body.has-tv-app-nav .sceneElement:has(.single-produto) {
		padding-bottom: calc(var(--tv-app-nav-offset) + 28px);
	}
}

/* Preferência do painel: sem fotos nas categorias — só rótulos (comportamento antigo) */
body.tv-categoria-sem-foto .tv-cat-pill__circle {
	display: none !important;
}
body.tv-categoria-sem-foto .tv-cat-pill__txt {
	margin-top: 0 !important;
}
body.tv-categoria-sem-foto .tv-modal-cats__grid .tv-cat-pill__circle {
	display: none !important;
}
body.tv-categoria-sem-foto .tv-modal-cats__grid > a > span:last-child {
	margin-top: 0 !important;
}

/* Paginação nas listagens da loja: corrige sobreposição sobre os cards no mobile
   (template.css usa margin-top negativo + translateY na .paginacao até 991px) */
@media (max-width: 991px) {
	#main.body-estabelecimento .paginacao {
		transform: none !important;
		margin-top: 16px !important;
		margin-bottom: 10px !important;
		position: relative;
		z-index: 1;
		clear: both;
	}
}

/*
 * Grelha 2 colunas: listagem quase edge-to-edge com micro-respiro lateral, gap entre células,
 * cartões com cantos arredondados e borda fina (referência vitrine).
 */
@media (max-width: 991px) {
	/* Sai um pouco do padding do .container, mas mantém ~6px de respiro em relação à borda do ecrã */
	#main.body-estabelecimento .container .categoria > .produtos {
		margin-left: -9px;
		margin-right: -9px;
		width: calc(100% + 18px);
		max-width: none;
		box-sizing: border-box;
	}

	#main.body-estabelecimento .categoria .produtos > .row.tv-grid {
		column-gap: 5px !important;
		row-gap: 8px !important;
	}

	#main.body-estabelecimento .categoria .produtos > .row.tv-grid > [class*="col-"] {
		padding-left: 0 !important;
		padding-right: 0 !important;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto {
		padding: 0 !important;
		margin-bottom: 0 !important;
		overflow: hidden;
		display: flex;
		flex-direction: column;
		min-height: 0 !important;
		height: 100%;
		box-sizing: border-box;
		border-radius: 12px !important;
		border: 1px solid rgba(37, 99, 235, 0.38);
		box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
		background: #fff;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto > a {
		display: flex;
		flex-direction: column;
		flex: 1 1 auto;
		min-height: 0;
		align-items: stretch;
		text-decoration: none !important;
		color: inherit;
		height: 100%;
		padding: 0;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .capa {
		aspect-ratio: 1 / 1;
		width: 100%;
		margin: 0 !important;
		border-radius: 12px 12px 0 0;
		flex-shrink: 0;
		min-height: 0;
		max-height: none !important;
	}

	/* Card com <img> na capa: sem gradiente nem título sobre a foto */
	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .capa::after {
		display: none !important;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .capa img {
		border-radius: 12px 12px 0 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .nome {
		position: static !important;
		color: #111 !important;
		text-shadow: none !important;
		background: none !important;
		padding: 10px 8px 4px !important;
		margin: 0 !important;
		font-size: 13px !important;
		line-height: 1.25 !important;
		font-weight: 700 !important;
		text-align: center;
		display: block !important;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .valor_anterior {
		padding: 0 8px;
		margin: 0 !important;
		font-size: 11px !important;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .apenas {
		padding: 0 8px !important;
		margin: 2px 0 !important;
		font-size: 11px !important;
		line-height: 1.25 !important;
		color: rgba(0, 0, 0, 0.5) !important;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .apenas-single {
		max-width: 100% !important;
		margin: 2px auto !important;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .valor {
		padding: 0 8px 10px !important;
		margin: 0 !important;
		font-size: 16px !important;
		line-height: 1.2 !important;
		font-weight: 700 !important;
		color: #111 !important;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .detalhes,
	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .detalhes.sem-estoque {
		margin-top: auto !important;
		width: 100% !important;
		max-width: none !important;
		border-radius: 0 0 11px 11px !important;
		padding: 12px 10px !important;
		flex-shrink: 0;
		box-sizing: border-box;
	}

	#main.body-estabelecimento .categoria .produtos .row.tv-grid .produto .produto-stats-holder {
		padding: 0 8px 8px;
		margin: 0 !important;
	}
}
