/*
 * Camada animada (v2) em cima do tema Dealer One — padrão do site na home,
 * no inventário e no produto (body.avt-v2). Tudo escopado em .avt-v2 pra não
 * vazar pra versão clássica (?vitrine=v1).
 * Tokens (--avt-*) vêm de catalogo.css. Sem biblioteca: CSS + vitrine-v2.js.
 */

/* =====================================================================
   1. Hero: vídeo ou foto com zoom lento, texto palavra a palavra
   ===================================================================== */
.avt-v2 .v2-hero {
	position: relative;
	min-height: min(88vh, 720px);
	display: flex;
	align-items: center;
	overflow: hidden;
	background: var(--avt-graphite);
	color: var(--avt-text-contrast);
}
.avt-v2 .v2-hero__midia { position: absolute; inset: 0; }
.avt-v2 .v2-hero__video,
.avt-v2 .v2-hero__foto {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	background-size: cover;
	background-position: center;
	transform-origin: 55% 45%;
}
/* slides: cada foto entra em crossfade e ganha o zoom lento enquanto está ativa */
.avt-v2 .v2-hero__foto {
	opacity: 0;
	transition: opacity .6s ease; /* troca rápida; a foto fica 10 s (data-intervalo no PHP) */
	will-change: opacity, transform;
}
.avt-v2 .v2-hero__foto.ativa { opacity: 1; animation: v2KenBurns 14s ease-out both; }
.avt-v2 .v2-hero__foto.saindo { animation: none; transform: scale(1.1); }
@keyframes v2KenBurns { from { transform: scale(1); } to { transform: scale(1.1); } }
.avt-v2 .v2-hero__slide[hidden] { display: none; }
/* indicador dos slides: só as barrinhas de progresso (sem setas/pausa) */
.avt-v2 .v2-hero__nav {
	display: flex;
	align-items: center;
	margin-top: 36px;
}
.avt-v2 .v2-hero__pontos { display: flex; gap: 8px; }
.avt-v2 .v2-hero__pontos button {
	position: relative;
	width: 34px;
	height: 18px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	cursor: pointer;
}
.avt-v2 .v2-hero__pontos button span {
	position: absolute;
	left: 0; right: 0; top: 7px;
	height: 4px;
	border-radius: 2px;
	background: rgba(255, 255, 255, .35);
	overflow: hidden;
}
.avt-v2 .v2-hero__pontos button span::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--avt-primary);
	transform: scaleX(0);
	transform-origin: left;
}
.avt-v2 .v2-hero__pontos button.ativo span::after { animation: v2Progresso var(--v2-dur, 10s) linear forwards; }
.avt-v2 .v2-hero--pausado .v2-hero__pontos button.ativo span::after { animation-play-state: paused; }
@keyframes v2Progresso { to { transform: scaleX(1); } }
.avt-v2 .v2-hero__pontos button:hover span { background: rgba(255, 255, 255, .6); }
.avt-v2 .v2-hero__overlay {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(20, 24, 28, .88) 0%, rgba(20, 24, 28, .55) 50%, rgba(20, 24, 28, .2) 100%),
		linear-gradient(180deg, rgba(20, 24, 28, .1) 60%, rgba(20, 24, 28, .75) 100%);
}
.avt-v2 .v2-hero__conteudo {
	position: relative;
	z-index: 1;
	max-width: var(--avt-container);
	padding-top: 96px;
	padding-bottom: 120px;
}
.avt-v2 .v2-hero__conteudo > * { max-width: 640px; }
.avt-v2 .v2-hero__titulo {
	font: 700 clamp(36px, 6vw, 68px)/1.05 var(--avt-font-heading);
	text-transform: uppercase;
	color: var(--avt-text-contrast);
	margin: 0 0 18px;
	text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
	display: flex;
	flex-wrap: wrap;
	gap: 0 .28em;
}
.avt-v2 .v2-palavra {
	display: inline-block;
	opacity: 0;
	transform: translateY(.6em) rotate(2deg);
	animation: v2Palavra .7s cubic-bezier(.2, .8, .2, 1) both;
	animation-delay: calc(var(--i, 0) * 90ms + 150ms);
	transform-origin: left bottom;
}
@keyframes v2Palavra { to { opacity: 1; transform: none; } }
.avt-v2 .v2-entra {
	opacity: 0;
	animation: v2Entra .7s ease both;
	animation-delay: calc(var(--i, 0) * 90ms + 200ms);
}
@keyframes v2Entra { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.avt-v2 .v2-hero__conteudo p { font-size: 17px; line-height: 26px; color: rgba(255, 255, 255, .9); margin: 0 0 26px; }
.avt-v2 .v2-hero .hero-slide__acoes { display: flex; gap: 12px; flex-wrap: wrap; }
.avt-v2 .v2-hero__scroll {
	position: absolute;
	left: 50%;
	bottom: 26px;
	z-index: 1;
	width: 26px;
	height: 42px;
	margin-left: -13px;
	border: 2px solid rgba(255, 255, 255, .7);
	border-radius: 14px;
	opacity: 0;
	animation: v2Entra .8s 1.4s ease both;
}
.avt-v2 .v2-hero__scroll span {
	position: absolute;
	left: 50%;
	top: 8px;
	width: 4px;
	height: 8px;
	margin-left: -2px;
	border-radius: 2px;
	background: var(--avt-primary);
	animation: v2Scroll 1.6s ease-in-out infinite;
}
@keyframes v2Scroll { 0% { transform: translateY(0); opacity: 1; } 70% { transform: translateY(14px); opacity: 0; } 100% { opacity: 0; } }

/* botão magnético + brilho (JS move; CSS faz o brilho) */
.avt-v2 .v2-magnetico { position: relative; overflow: hidden; transition: transform .18s ease-out, background .15s ease, box-shadow .2s ease; will-change: transform; }
.avt-v2 .v2-magnetico::after {
	content: "";
	position: absolute;
	top: -60%;
	left: -70%;
	width: 40%;
	height: 220%;
	background: rgba(255, 255, 255, .35);
	transform: skewX(-25deg);
	transition: left .55s ease;
	pointer-events: none;
}
.avt-v2 .v2-magnetico:hover::after { left: 140%; }
.avt-v2 .v2-magnetico:hover { box-shadow: 0 10px 28px rgba(37, 211, 102, .4); }

/* =====================================================================
   2. Letreiro (marquee) de marcas e diferenciais
   ===================================================================== */
.avt-v2 .v2-letreiro {
	background: var(--avt-graphite);
	border-top: 1px solid var(--avt-border-contrast);
	padding: 14px 0;
	overflow: hidden;
}
.avt-v2 .v2-letreiro__faixa { overflow: hidden; }
.avt-v2 .v2-letreiro__faixa + .v2-letreiro__faixa { margin-top: 8px; }
.avt-v2 .v2-letreiro__trilho {
	display: flex;
	gap: 48px;
	width: max-content;
	padding-right: 48px;
	animation: v2Letreiro 26s linear infinite;
}
.avt-v2 .v2-letreiro__faixa--promessas .v2-letreiro__trilho { animation-duration: 34s; animation-direction: reverse; }
.avt-v2 .v2-letreiro:hover .v2-letreiro__trilho { animation-play-state: paused; }
.avt-v2 .v2-letreiro__trilho span {
	white-space: nowrap;
	font: 800 22px/1 var(--avt-font-heading);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .55);
}
.avt-v2 .v2-letreiro__faixa--promessas span { font-size: 13px; font-weight: 700; color: var(--avt-primary); letter-spacing: .14em; }
.avt-v2 .v2-letreiro__faixa--promessas span::before { content: "◆"; margin-right: 48px; color: rgba(255, 255, 255, .25); font-size: 9px; vertical-align: 2px; }
@keyframes v2Letreiro { to { transform: translateX(-50%); } }

/* =====================================================================
   3. Linha d'água entre seções
   ===================================================================== */
.avt-v2 .v2-onda { position: relative; height: 64px; overflow: hidden; line-height: 0; }
.avt-v2 .v2-onda__svg {
	position: absolute;
	left: 0;
	bottom: 0;
	width: 200%;
	height: 100%;
	animation: v2Onda 11s linear infinite;
}
.avt-v2 .v2-onda__svg--tras { animation-duration: 17s; animation-direction: reverse; }
@keyframes v2Onda { to { transform: translateX(-50%); } }

/* =====================================================================
   4. Cards: 2ª foto no hover + entrada em cascata
   ===================================================================== */
.avt-v2 .avt-card__imagem { position: relative; }
.avt-v2 .avt-card__imagem img { transition: transform .6s ease, opacity .5s ease; }
.avt-v2 .avt-card__foto2 {
	position: absolute !important;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	object-fit: cover;
	opacity: 0;
	transform: scale(1.04);
}
.avt-v2 .avt-card:hover .avt-card__imagem img:not(.avt-card__foto2),
.avt-v2 .avt-card.toque .avt-card__imagem img:not(.avt-card__foto2) { opacity: 0; transform: scale(1.06); }
.avt-v2 .avt-card:hover .avt-card__foto2,
.avt-v2 .avt-card.toque .avt-card__foto2 { opacity: 1; transform: scale(1.06); }

.avt-v2 .avt-painel li.product,
.avt-v2 .v2-esteira li.product { opacity: 0; transform: translateY(18px); }
.avt-v2 li.product.v2-in {
	animation: v2Card .6s cubic-bezier(.2, .8, .2, 1) both;
	animation-delay: calc(var(--i, 0) * 70ms);
}
@keyframes v2Card { to { opacity: 1; transform: none; } }

/* =====================================================================
   5. Contadores
   ===================================================================== */
.avt-v2 .v2-contadores { padding-bottom: 8px; }
.avt-v2 .v2-contadores + .avt-secao--escura { padding-top: 28px; }
.avt-v2 .v2-contadores__grade {
	display: grid;
	grid-template-columns: repeat(var(--n, 3), 1fr);
	gap: 20px;
	text-align: center;
}
.avt-v2 .v2-contador { padding: 18px 8px; border-left: 1px solid var(--avt-border-contrast); }
.avt-v2 .v2-contador:first-child { border-left: 0; }
.avt-v2 .v2-num {
	display: block;
	font: 800 clamp(36px, 5vw, 56px)/1 var(--avt-font-heading);
	color: var(--avt-text-contrast);
	font-variant-numeric: tabular-nums;
}
.avt-v2 .v2-contador small {
	display: block;
	margin-top: 8px;
	font: 700 11px/1.3 var(--avt-font-heading);
	letter-spacing: .12em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .65);
}

/* =====================================================================
   6. Esteira horizontal de ofertas
   ===================================================================== */
.avt-v2 .v2-esteira__setas { display: flex; gap: 6px; }
.avt-v2 button.v2-esteira__seta {
	width: 40px;
	height: 40px;
	padding: 0;
	margin: 0;
	border: 1px solid var(--avt-border);
	border-radius: 50%;
	background: var(--avt-bg);
	color: var(--avt-text);
	font-size: 26px;
	line-height: 1;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .15s ease, color .15s ease;
}
.avt-v2 button.v2-esteira__seta:hover { background: var(--avt-primary); border-color: var(--avt-primary); color: #fff; }
.avt-v2 .v2-esteira {
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	padding: 4px 0 12px;
}
.avt-v2 .v2-esteira::-webkit-scrollbar { display: none; }
/* Trilho de borda a borda: com mais cards do que cabe, começa na esquerda
   da tela (nada de faixa vazia em monitor largo); cabendo tudo, centraliza
   ("safe center" não esconde o começo quando transborda). */
.avt-v2 ul.products.v2-esteira__trilho,
.avt-v2 .woocommerce ul.products.v2-esteira__trilho {
	display: flex !important;
	gap: 20px;
	width: max-content;
	min-width: 100%;
	max-width: none;
	box-sizing: border-box;
	margin: 0 !important;
	padding: 0 16px;
	justify-content: safe center;
}
.avt-v2 .v2-esteira__trilho li.product {
	flex: 0 0 300px;
	width: 300px !important;
	scroll-snap-align: start;
	scroll-margin-left: 16px;
}

/* =====================================================================
   7. Parallax leve nas imagens de categoria do "Sobre"
   ===================================================================== */
.avt-v2 .avt-categoria { overflow: hidden; }
.avt-v2 .avt-categoria img { transform: translateY(var(--v2-plx, 0)) scale(1.12); will-change: transform; transition: none; }
.avt-v2 .avt-categoria:hover img { transform: translateY(var(--v2-plx, 0)) scale(1.18); }

/* =====================================================================
   8. Responsivo e acessibilidade
   ===================================================================== */
@media (max-width: 860px) {
	.avt-v2 .v2-hero { min-height: 560px; }
	.avt-v2 .v2-hero__conteudo { padding-top: 64px; padding-bottom: 96px; }
	.avt-v2 .v2-hero__nav { margin-top: 26px; }
	.avt-v2 .v2-hero__pontos button { width: 26px; }
	.avt-v2 .v2-contadores__grade { grid-template-columns: repeat(2, 1fr); gap: 8px; }
	.avt-v2 .v2-contador { border-left: 0; }
	.avt-v2 .v2-esteira__trilho li.product { flex-basis: 260px; width: 260px !important; }
	.avt-v2 .v2-letreiro__trilho span { font-size: 18px; }
}
@media (max-width: 520px) {
	.avt-v2 .v2-contadores__grade { grid-template-columns: 1fr 1fr; }
	.avt-v2 .v2-esteira__setas { display: none; }
}
@media (prefers-reduced-motion: reduce) {
	.avt-v2 .v2-hero__foto, .avt-v2 .v2-hero__foto.ativa, .avt-v2 .v2-hero__pontos button.ativo span::after, .avt-v2 .v2-palavra, .avt-v2 .v2-entra, .avt-v2 .v2-hero__scroll, .avt-v2 .v2-hero__scroll span,
	.avt-v2 .v2-letreiro__trilho, .avt-v2 .v2-onda__svg, .avt-v2 li.product.v2-in { animation: none !important; }
	.avt-v2 .v2-palavra, .avt-v2 .v2-entra, .avt-v2 .v2-hero__scroll, .avt-v2 .avt-painel li.product, .avt-v2 .v2-esteira li.product { opacity: 1; transform: none; }
	.avt-v2 .v2-hero__foto { transition: opacity .3s ease; transform: none; }
	.avt-v2 .v2-hero__pontos button.ativo span::after { transform: scaleX(1); }
	.avt-v2 .v2-magnetico, .avt-v2 .avt-card__imagem img { transition: none; }
	.avt-v2 .avt-categoria img { transform: none; }
}
/* sem JS, nada fica preso em opacity:0 */
.no-js .avt-v2 .avt-painel li.product, .no-js .avt-v2 .v2-esteira li.product { opacity: 1; transform: none; }

/* =====================================================================
   9. Comparador (até 3) — home v2 e inventário v2
   ===================================================================== */
.avt-v2 .avt-card { position: relative; }
.avt-v2 button.avt-card__comparar {
	position: absolute;
	top: 10px;
	right: 10px;
	z-index: 3;
	width: 34px;
	height: 34px;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(35, 38, 40, .7);
	color: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transition: background .15s ease, transform .15s ease;
}
.avt-v2 .avt-card__comparar .dashicons { font-size: 18px; width: 18px; height: 18px; }
.avt-v2 .avt-card__comparar:hover { background: var(--avt-secondary-dark); transform: scale(1.08); }
.avt-v2 .avt-card__comparar[aria-pressed="true"] { background: var(--avt-primary); }
.avt-v2 .avt-card__comparar[aria-pressed="true"] .dashicons::before { content: "\f147"; } /* dashicons-yes */
[data-vista="lista"] .avt-card__comparar { top: 12px; right: 12px; }

/* barra flutuante */
.v2-comparar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 380;
	background: var(--avt-graphite);
	color: #fff;
	box-shadow: 0 -8px 30px rgba(0, 0, 0, .35);
	transform: translateY(110%);
	transition: transform .35s cubic-bezier(.2, .8, .2, 1);
}
.v2-comparar.visivel { transform: none; }
body.avt-comparando .avt-whats-flutuante { bottom: 96px; }
body.avt-comparando .inv2-filtro-btn { bottom: 92px; }
.v2-comparar__linha {
	max-width: var(--avt-container);
	margin: 0 auto;
	padding: 12px 16px;
	display: flex;
	align-items: center;
	gap: 14px;
}
.v2-comparar__itens { display: flex; gap: 10px; flex: 1; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.v2-comparar__itens::-webkit-scrollbar { display: none; }
.v2-comparar__item {
	position: relative;
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 30px 4px 4px;
	border-radius: 6px;
	background: rgba(255, 255, 255, .08);
	animation: v2Entra .3s ease both;
}
.v2-comparar__item img { width: 48px; height: 36px; object-fit: cover; border-radius: 4px; display: block; }
.v2-comparar__item span { font: 600 12px/14px var(--avt-font-heading); max-width: 150px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.v2-comparar__item button {
	position: absolute;
	right: 4px;
	top: 50%;
	transform: translateY(-50%);
	width: 22px;
	height: 22px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: rgba(255, 255, 255, .7);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}
.v2-comparar__item button:hover { color: var(--avt-badge-sold); }
.v2-comparar__vaga {
	flex: 0 0 auto;
	width: 120px;
	height: 44px;
	border: 1px dashed rgba(255, 255, 255, .3);
	border-radius: 6px;
	display: flex;
	align-items: center;
	justify-content: center;
	font: 600 11px var(--avt-font-heading);
	letter-spacing: .06em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .45);
}
.v2-comparar__acoes { display: flex; gap: 8px; flex: 0 0 auto; }
.v2-comparar__acoes .avt-btn { padding: 12px 16px 11px; font-size: 12px; }
.v2-comparar__acoes .avt-btn--contorno-claro { border-color: rgba(255, 255, 255, .3); }
.v2-comparar__acoes .avt-btn[disabled] { opacity: .4; cursor: not-allowed; }

/* painel lado a lado */
.v2-painel {
	position: fixed;
	inset: 0;
	z-index: 500;
	background: rgba(20, 24, 28, .7);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	opacity: 0;
	transition: opacity .25s ease;
}
.v2-painel.visivel { opacity: 1; }
/* fechado: some de vez — sem isto o display:flex acima vence o [hidden] e o
   overlay invisível continua cobrindo a página (barra de comparar sem clique) */
.v2-painel[hidden] { display: none; }
.v2-painel:not(.visivel) { pointer-events: none; }
.v2-painel__caixa {
	width: min(1100px, 100%);
	max-height: 92vh;
	overflow: auto;
	background: var(--avt-bg);
	color: var(--avt-text);
	border-radius: 10px;
	box-shadow: var(--avt-shadow-elevated);
	transform: translateY(20px);
	transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.v2-painel.visivel .v2-painel__caixa { transform: none; }
.v2-painel__topo {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	background: var(--avt-bg);
	border-bottom: 1px solid var(--avt-border-card);
}
.v2-painel__topo h2 { margin: 0; font: 700 20px var(--avt-font-heading); text-transform: uppercase; }
.v2-painel__topo h2 span { color: var(--avt-primary); }
.v2-painel__fechar { width: 36px; height: 36px; padding: 0; border: 0; border-radius: 50%; background: var(--avt-bg-shade); color: var(--avt-text); font-size: 22px; line-height: 1; cursor: pointer; }
.v2-painel__fechar:hover { background: var(--avt-badge-sold); color: #fff; }
.v2-tabela { width: 100%; border-collapse: collapse; }
.v2-tabela th, .v2-tabela td { padding: 12px 16px; border-bottom: 1px solid var(--avt-border-card); vertical-align: top; text-align: left; }
.v2-tabela th:first-child, .v2-tabela td:first-child { width: 150px; font: 700 11px/1.3 var(--avt-font-heading); letter-spacing: .08em; text-transform: uppercase; color: var(--avt-text-muted); background: var(--avt-bg-shade); }
.v2-tabela thead th { vertical-align: bottom; }
.v2-tabela .v2-prod { display: grid; gap: 8px; }
.v2-tabela .v2-prod img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 6px; }
.v2-tabela .v2-prod b { font: 700 14px/18px var(--avt-font-heading); text-transform: uppercase; color: var(--avt-text-title); }
.v2-tabela .v2-prod .price { font: 700 18px/1 var(--avt-font-heading); color: var(--avt-primary); }
.v2-tabela .v2-prod .price del { font-size: 12px; font-weight: 400; color: var(--avt-text-faint); margin-right: 6px; }
.v2-tabela .v2-prod .price ins { text-decoration: none; }
.v2-tabela td.v2-dif { background: rgba(108, 152, 224, .08); }
.v2-tabela td .v2-vazio { color: var(--avt-text-faint); }
.v2-tabela .v2-prod__acoes { display: grid; gap: 6px; }
.v2-tabela .v2-prod__acoes .botao-whatsapp, .v2-tabela .v2-prod__acoes .avt-btn { padding: 10px 12px 9px; font-size: 11px; width: 100%; }
.v2-tabela .v2-prod__remover { background: transparent; border: 0; color: var(--avt-text-muted); font-size: 12px; cursor: pointer; text-decoration: underline; padding: 0; }
.v2-painel__dica { padding: 12px 20px 18px; font-size: 12px; color: var(--avt-text-muted); }
@media (max-width: 760px) {
	.v2-comparar__linha { flex-wrap: wrap; }
	.v2-comparar__item span { display: none; }
	.v2-comparar__item { padding-right: 26px; }
	.v2-comparar__vaga { width: 60px; font-size: 0; }
	.v2-comparar__vaga::before { content: "+"; font-size: 20px; }
	.v2-tabela th:first-child, .v2-tabela td:first-child { width: 90px; padding: 10px 8px; font-size: 10px; }
	.v2-tabela th, .v2-tabela td { padding: 10px 8px; font-size: 13px; }
	.v2-tabela .v2-prod b { font-size: 12px; line-height: 15px; }
}
@media (prefers-reduced-motion: reduce) {
	.v2-comparar, .v2-painel, .v2-painel__caixa, .v2-comparar__item { transition: none; animation: none; }
}
