/* ==========================================================================
   G&G Master | Efeitos de movimento
   Carregamento, revelação na rolagem, parallax, fundos animados e hover.
   Animações só em transform/opacity (e propriedades translate/scale).
   Tudo desligado em prefers-reduced-motion.
   ========================================================================== */


/* 1. Carregamento ---------------------------------------------------------- */
@keyframes fxIn { from { opacity: 0; translate: 0 18px; } to { opacity: 1; translate: 0 0; } }
@keyframes fxBar { from { transform: skewX(-18deg) scaleX(0); } to { transform: skewX(-18deg) scaleX(1); } }
@keyframes fxUnhide { to { opacity: 1; } }

.js .fx-load { opacity: 0; animation: fxIn .9s var(--ease) var(--d, 0s) forwards; }
.js .c-hero__title::before { transform-origin: left; animation: fxBar .8s var(--ease) .1s both; }

/* Título dividido em palavras (gerado pelo JS) */
.js [data-split]:not(.is-split) { opacity: 0; animation: fxUnhide 0s 1.6s forwards; }
[data-split] .w { display: inline-block; overflow: hidden; vertical-align: top; padding: .12em 0 .1em; margin: -.12em 0 -.1em; }
[data-split] .wi { display: inline-block; translate: 0 105%; animation: fxWord .9s var(--ease) calc(var(--i) * 55ms + .12s) forwards; }
@keyframes fxWord { to { translate: 0 0; } }

/* 2. Revelação na rolagem --------------------------------------------------- */
.js .reveal { opacity: 0; translate: 0 26px; transition: opacity .8s var(--ease), translate .9s var(--ease), scale .9s var(--ease); transition-delay: var(--rd, 0ms); }
.js .reveal--left { translate: -36px 0; }
.js .reveal--right { translate: 36px 0; }
.js .reveal--zoom { translate: 0 0; scale: .94; }
.js .reveal.is-in { opacity: 1; translate: 0 0; scale: 1; }

/* Imagem com cortina vermelha */
.fx-wipe { position: relative; overflow: hidden; border-radius: var(--r-card); }
.fx-wipe img { scale: 1.12; transition: scale 1.4s var(--ease) .15s; }
.fx-wipe::after { content: ""; position: absolute; inset: 0; z-index: 2; background: var(--red); transform: scaleX(1); transform-origin: right; transition: transform 1s cubic-bezier(.77, 0, .18, 1); pointer-events: none; }
.fx-wipe::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--ink); transform: scaleX(1); transform-origin: right; transition: transform 1s cubic-bezier(.77, 0, .18, 1) .12s; pointer-events: none; }
.fx-wipe.is-in img { scale: 1; }
.fx-wipe.is-in::after, .fx-wipe.is-in::before { transform: scaleX(0); }

/* Contador */
[data-count] { font-variant-numeric: tabular-nums; }

/* 3. Parallax ---------------------------------------------------------------- */
[data-parallax] img { scale: 1.14; will-change: translate; }
[data-parallax-inner] { overflow: hidden; }
[data-parallax-inner] img { scale: 1.16; will-change: translate; }

@supports (animation-timeline: view()) {
  [data-parallax="hero"] img { animation: fxParHero linear both; animation-timeline: view(); animation-range: exit 0% exit 100%; }
  [data-parallax-inner] img { animation: fxParIn linear both; animation-timeline: view(); animation-range: cover 0% cover 100%; }
  @keyframes fxParHero { from { translate: 0 0; } to { translate: 0 22%; } }
  @keyframes fxParIn { from { translate: 0 -7%; } to { translate: 0 7%; } }
}
/* Imagem com cortina + parallax: margem extra de escala */
.fx-wipe[data-parallax-inner] img { scale: 1.3; }
.fx-wipe.is-in[data-parallax-inner] img { scale: 1.16; }
/* Fallback (sem scroll-driven animations): JS define --py */
.no-sdt [data-parallax] img, .no-sdt [data-parallax-inner] img { translate: 0 var(--py, 0px); }

/* 4. Fundos animados --------------------------------------------------------- */
.fx-host { position: relative; isolation: isolate; }
.fx-host > .l-wrap { position: relative; z-index: 2; }
.fx-bg { position: absolute; inset: 0; z-index: 0; overflow: hidden; pointer-events: none; }
.fx-bg__beam { position: absolute; top: -10%; bottom: -10%; width: 180px; left: -20%; background: linear-gradient(90deg, transparent, rgba(255,255,255,.05), transparent); transform: skewX(-18deg); animation: fxBeam 9s var(--ease) infinite; }
@keyframes fxBeam { 0% { transform: translateX(0) skewX(-18deg); } 60%, 100% { transform: translateX(160vw) skewX(-18deg); } }
.fx-paused .fx-bg__beam { animation-play-state: paused; }

/* Faixa diagonal do CTA em movimento */
.c-ctaband::after { animation: fxSweep 7s ease-in-out infinite alternate; }
.c-ctaband::before { content: ""; position: absolute; right: 180px; top: 0; bottom: 0; width: 70px; background: rgba(0,0,0,.08); transform: skewX(-18deg); animation: fxSweep 9s ease-in-out infinite alternate-reverse; pointer-events: none; }
@keyframes fxSweep { from { translate: 0 0; } to { translate: -90px 0; } }

/* Faixa vermelha do destaque Flexíveis entrando */
.c-flex::before { z-index: 3; }
.js .c-flex::before { transform: skewX(-24deg) scaleX(0); transition: transform 1.1s var(--ease); }
.js .c-flex.is-in::before { transform: skewX(-24deg) scaleX(1); }

/* Fluxo Dry Blend: setas pulsando */
.c-flow__arrow .ico { animation: fxNudge 1.6s ease-in-out infinite; }
@keyframes fxNudge { 0%, 100% { translate: 0 0; } 50% { translate: 6px 0; } }

/* Amostras perolizado / metalizado com brilho */
.c-swatch { position: relative; overflow: hidden; }
.c-swatch::after { content: ""; position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255,255,255,.55) 50%, transparent 65%); transform: translateX(-120%); animation: fxSheen 4.5s ease-in-out infinite; }
.c-swatch--color::after { opacity: .5; }
@keyframes fxSheen { 0%, 55% { transform: translateX(-120%); } 85%, 100% { transform: translateX(120%); } }

/* WhatsApp flutuante: anel suave */
.c-fab::before { content: ""; position: absolute; inset: 0; border-radius: 50%; border: 2px solid var(--wa); animation: fxRing 3.2s var(--ease) infinite; }
@keyframes fxRing { 0% { transform: scale(1); opacity: .7; } 70%, 100% { transform: scale(1.55); opacity: 0; } }

/* Header compacto ao rolar */
.c-header { transition: box-shadow .3s; }
.c-header__logo img { transition: transform .4s var(--ease); transform-origin: left center; }
.c-header.is-scrolled { box-shadow: 0 12px 30px -18px rgba(0,0,0,.8); }
@media (min-width: 1100px) { .c-header.is-scrolled .c-header__logo img { transform: scale(.88); } }

/* Mega menu: itens em cascata */
.c-mega li, .c-mega__feature { opacity: 0; translate: 0 8px; transition: opacity .35s var(--ease), translate .45s var(--ease); }
.has-mega.is-open .c-mega li, .has-mega:focus-within .c-mega li, .has-mega.is-open .c-mega__feature, .has-mega:focus-within .c-mega__feature { opacity: 1; translate: 0 0; }
@media (hover: hover) and (min-width: 1100px) { .has-mega:hover .c-mega li, .has-mega:hover .c-mega__feature { opacity: 1; translate: 0 0; } }
.c-mega li:nth-child(2) { transition-delay: 40ms; } .c-mega li:nth-child(3) { transition-delay: 80ms; } .c-mega li:nth-child(4) { transition-delay: 120ms; }
.c-mega li:nth-child(5) { transition-delay: 160ms; } .c-mega li:nth-child(6) { transition-delay: 200ms; } .c-mega li:nth-child(n+7) { transition-delay: 240ms; }

/* FAQ abrindo */
.c-faq__item[open] .c-faq__a { animation: fxIn .5s var(--ease); }

/* Progresso de leitura (artigos) */
.c-progress { position: fixed; left: 0; right: 0; top: 0; height: 3px; z-index: 120; background: var(--red); transform-origin: left; transform: scaleX(0); pointer-events: none; }
@supports (animation-timeline: scroll()) { .c-progress { animation: fxProg linear both; animation-timeline: scroll(root); } @keyframes fxProg { to { transform: scaleX(1); } } }

/* 5. Hover: botões ----------------------------------------------------------- */
.c-btn { position: relative; overflow: hidden; isolation: isolate; }
.c-btn::after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%; z-index: -1; background: linear-gradient(90deg, transparent, rgba(255,255,255,.28), transparent); transform: translateX(-140%) skewX(-20deg); transition: transform .7s var(--ease); pointer-events: none; }
.c-btn:hover::after { transform: translateX(320%) skewX(-20deg); }
.c-btn:hover { transform: translateY(-2px); }
.c-btn:active { transform: translateY(0) scale(.98); }
.c-btn--primary:hover { box-shadow: 0 14px 28px -14px rgba(215,3,15,.75); }
.c-btn--light:hover, .c-btn--outline:hover { box-shadow: 0 14px 28px -16px rgba(20,20,22,.5); }
.c-btn .ico { transition: transform .35s var(--ease); }
.c-btn:hover .ico { transform: translateX(3px); }
.c-btn--wa:hover .ico, .c-btn--ghost-light:hover .ico:first-child:not(:last-child) { transform: rotate(-10deg) scale(1.08); }
.fx-ripple { position: absolute; z-index: -1; width: 12px; height: 12px; margin: -6px 0 0 -6px; border-radius: 50%; background: rgba(255,255,255,.45); transform: scale(0); animation: fxRipple .65s ease-out forwards; pointer-events: none; }
.c-btn--outline .fx-ripple, .c-btn--light .fx-ripple { background: rgba(20,20,22,.18); }
@keyframes fxRipple { to { transform: scale(26); opacity: 0; } }
.c-header__wa { transition: background-color .2s, transform .3s var(--ease); }
.c-header__wa:hover { transform: translateY(-1px); }
.c-header__wa:hover .ico { animation: fxWiggle .6s ease; }
@keyframes fxWiggle { 25% { transform: rotate(-12deg); } 50% { transform: rotate(10deg); } 75% { transform: rotate(-5deg); } }
.c-link { position: relative; }
.c-link::after { content: ""; position: absolute; left: 0; right: 24px; bottom: -3px; height: 1px; background: currentColor; transform: scaleX(0); transform-origin: right; transition: transform .35s var(--ease); }
.c-link:hover::after, a:hover > .c-link::after { transform: scaleX(1); transform-origin: left; }

/* 6. Hover: cards ------------------------------------------------------------ */
.fx-card { transition: border-color .25s, transform .35s var(--ease), box-shadow .35s var(--ease); }
.fx-has-bar { position: relative; overflow: hidden; }
.fx-bar { position: absolute; left: 0; right: 0; bottom: 0; z-index: 3; height: 3px; background: var(--red); transform: scaleX(0); transform-origin: left; transition: transform .5s var(--ease); pointer-events: none; }
.is-redbg .fx-bar { background: #fff; }
.fx-card:hover .fx-bar, .fx-card:focus-visible .fx-bar { transform: scaleX(1); }
.fx-card:hover { box-shadow: var(--shadow); }

/* Inclinação 3D leve (desktop com mouse) */
.js .fx-tilt { transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)) translateY(var(--ty, 0px)); transform-style: preserve-3d; }
.js .fx-tilt:hover { --ty: -4px; }

/* Zoom de imagem nos cards */
.c-bento__cell--hero img, .c-artcard__media img, .c-cat__media img, .c-segfeature__media img { transition: scale .9s var(--ease); }
.c-bento__cell--hero:hover img, .c-artcard a:hover .c-artcard__media img, .c-cat:hover .c-cat__media img, .c-segfeature:hover .c-segfeature__media img { scale: 1.06; }
.c-artcard__media, .c-cat__media, .c-segfeature__media { overflow: hidden; display: block; }

/* Ícones dos cards reagindo ao hover */
.c-acard__ico, .c-diffs__ico, .c-checks__ico { transition: transform .45s var(--ease), background-color .3s; }
.fx-card:hover .c-acard__ico, .c-diffs li:hover .c-diffs__ico { transform: rotate(-8deg) scale(1.08); }
.c-diffs li:hover .c-diffs__ico { background: var(--red); color: #fff; }
.c-checks li:hover .c-checks__ico { transform: scale(1.12); }
.c-diffs li, .c-checks li { transition: translate .35s var(--ease); }
.c-diffs li:hover, .c-checks li:hover { translate: 4px 0; }
.c-chip { transition: border-color .25s, color .25s, transform .3s var(--ease); }
.c-chips .c-chip:hover { border-color: var(--red); color: var(--red); transform: translateY(-2px); }
.c-steps li { transition: border-color .25s, transform .35s var(--ease); }
.c-steps li:hover { border-color: var(--ink); transform: translateX(4px); }
.c-steps li::before { transition: background-color .3s; }
.c-steps li:hover::before { background: var(--red); }
.c-regions__uf { transition: transform .4s var(--ease), background-color .3s; }
.c-regions__list li:hover .c-regions__uf, .c-regcards__item:hover .c-regions__uf { background: var(--red); transform: translateX(3px); }

/* Categorias (página Produtos) */
.c-cats { display: grid; gap: 16px; }
.c-cat { display: grid; background: var(--white); border: 1px solid var(--line); border-radius: var(--r-card); overflow: hidden; }
.c-cat__media img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.c-cat__body { display: flex; flex-direction: column; padding: 22px 24px 24px; }
.c-cat__body h3 { font-size: 20px; }
.c-cat__body h3 a { text-decoration: none; color: var(--ink); }
.c-cat__body p { color: var(--muted); }
.c-cat__body .c-link { margin-top: auto; }
.c-cat__subs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.c-cat__subs a { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; border: 1px solid var(--line); border-radius: var(--r-btn); text-decoration: none; font-weight: 500; font-size: 15px; transition: border-color .25s, color .25s; }
.c-cat__subs a:hover { border-color: var(--red); color: var(--red); }
@media (min-width: 760px) { .c-cats { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 760px) { .c-cat--lead { grid-column: 1 / -1; grid-template-columns: 1.25fr 1fr; } .c-cat--lead .c-cat__media img { height: 100%; aspect-ratio: auto; min-height: 320px; } .c-cat--lead .c-cat__body { padding: clamp(24px, 3vw, 44px); justify-content: center; } .c-cat--lead .c-cat__body .c-link { margin-top: 8px; } }
@media (min-width: 1100px) {
  .c-cats { grid-template-columns: repeat(4, 1fr); }
  .c-cat--lead .c-cat__body h3 { font-size: 32px; }
}
.c-scard--all { background: var(--ink); }
.c-scard--all .c-scard__name { color: #fff; }
.c-scard--all .c-scard__desc { color: var(--muted-light); }
.c-scard--all:hover { background: var(--red); }
.c-scard--all:hover .c-scard__arrow { color: #fff; }

/* 7. Movimento reduzido ---------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .js .fx-load, .js [data-split]:not(.is-split), [data-split] .wi, .js .reveal { opacity: 1 !important; translate: none !important; scale: none !important; animation: none !important; }
  .fx-wipe::after, .fx-wipe::before, .fx-bg__beam, .c-ctaband::before, .c-fab::before { display: none; }
  .fx-wipe img, [data-parallax] img, [data-parallax-inner] img { scale: 1 !important; translate: none !important; animation: none !important; }
  .js .fx-tilt { transform: none !important; }
  .c-btn:hover, .c-btn::after { transform: none; }
}

/* Ajustes de borda no hover dos cards coloridos */
.c-bento__cell--red:hover { border-color: var(--red); }
.c-bento__cell--dark:hover, .c-types__item.is-dark:hover { border-color: #000; }

/* Revelação lateral não pode gerar rolagem horizontal */
html, body { overflow-x: clip; }
@media (max-width: 760px) { .js .reveal--left { translate: -16px 0; } .js .reveal--right { translate: 16px 0; } }
.c-cat--lead .c-cat__media picture { height: 100%; }
