/* ============================================================
   TV da home (demonstrativo do formato "TV patrocinada"), no lugar do carrossel de banners. Hoje mostra a Linha Premium da própria TGAD.
   O quadro é uma tela 16:9 e tudo dentro dela se mede em cqw (a largura da própria tela): a mesma cena vale no computador e no celular.
   As cenas passam por animação de CSS; as chaves (@keyframes tv-*) são escritas pelo tv.js conforme o número de cenas, então sem JS
   fica a primeira cena parada e os botões de pausa e som não aparecem.
   Peças: o aparelho (.tv-aparelho, com o neon girando) e a prateleira à esquerda; o selo, o título, os produtos e os botões à direita (.tv-info).
   ============================================================ */

@property --ang { syntax: '<angle>'; initial-value: 0deg; inherits: false; }

.tv-faixa {
  --tv-fundo: var(--navy-900, #0a1f3d);
  --tv-vermelho: var(--red-500, #d01229);
  --tv-vermelho-claro: var(--red-400, #ff4d5e);
  --tv-apoio: #b9c8de;       /* texto de apoio sobre o marinho (9:1) */
  --tv-ciano: #6cc8ff;
  --tv-dur: 4s;              /* quanto cada cena fica no ar; o ciclo é essa duração vezes o número de cenas (--tv-ciclo, escrito pelo tv.js) */
  --ps: running;             /* "paused" para tudo de uma vez: botão de pausa, fora da tela e aba escondida */
  position: relative; overflow: hidden; color: #fff; background: var(--tv-fundo);
  font-family: var(--sans, "Archivo", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif);
}
.tv-faixa.is-pausada, .tv-faixa.is-fora, .tv-faixa.is-oculta { --ps: paused; }
.tv-faixa :focus-visible { outline: 3px solid #fff; outline-offset: 2px; }

.tv-conteudo { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; align-items: center; padding-top: 56px; padding-bottom: 0; }

/* ---------- o aparelho ---------- */
.tv-palco { min-width: 0; }
.tv-aparelho-caixa { position: relative; padding: 0 2%; }
.tv-aparelho {
  position: relative; padding: 10px 10px 14px; border-radius: 12px; background: linear-gradient(180deg, #23262c 0%, #0d0e11 55%, #17191d 100%);
  box-shadow: inset 0 0 0 1px #34373e, inset 0 1px 0 rgba(255, 255, 255, .12), 0 46px 70px -20px rgba(0, 0, 0, .75), 0 0 140px 10px rgba(42, 90, 160, .45);
}
/* o neon: um anel de luz que gira em volta da moldura (o ângulo é uma propriedade registrada; onde o navegador não a anima, o anel fica parado) */
.tv-neon {
  position: absolute; inset: -3px; padding: 3px; border-radius: 15px; pointer-events: none;
  background: conic-gradient(from var(--ang), rgba(56, 170, 255, .28) 0deg, rgba(56, 170, 255, .28) 200deg, #1f7bff 260deg, #5cc8ff 315deg, #e8f7ff 333deg, #5cc8ff 345deg, rgba(56, 170, 255, .28) 360deg);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0); -webkit-mask-composite: xor; mask-composite: exclude;
  animation: tv-neon 4s linear infinite; animation-play-state: var(--ps, running);
}
.tv-neon-brilho { position: absolute; inset: 0; filter: blur(9px); opacity: .95; pointer-events: none; }
@keyframes tv-neon { to { --ang: 360deg; } }

.tv-tela { position: relative; aspect-ratio: 16 / 9; border-radius: 3px; overflow: hidden; background: #000; container: tv / inline-size; }
.tv-led { position: absolute; bottom: 4px; left: 50%; width: 6px; height: 4px; margin-left: -3px; border-radius: 2px; background: #c8202f; box-shadow: 0 0 6px #ff3b4c; }
.tv-base { width: 44%; height: 22px; margin: 26px auto 0; border-radius: 8px; background: linear-gradient(180deg, #3d424b 0%, #16181c 100%); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .18), 0 10px 18px rgba(0, 0, 0, .5); }
.tv-prateleira { height: 18px; margin-top: 4px; border-radius: 4px 4px 0 0; background: linear-gradient(180deg, #8a6440 0%, #5d4128 60%, #3e2b1a 100%); box-shadow: inset 0 -2px 0 rgba(255, 255, 255, .06); }

/* ---------- as cenas ---------- */
.tv-cena {
  position: absolute; inset: 0; opacity: 0; background: var(--tv-fundo);
  animation: tv-cena var(--tv-ciclo, 24s) linear infinite; animation-delay: calc(var(--i, 0) * var(--tv-dur)); animation-play-state: var(--ps, running);
}
.tv-cena:first-child { opacity: 1; }   /* sem JS (ou sem as chaves) fica só a abertura */
/* parada na abertura (quem pediu menos movimento): sem animação nenhuma até o botão "Retomar" */
.tv-faixa.is-parada :is(.tv-cena, .tv-pin, .tv-txt, .tv-kb, .tv-prog__barra, .tv-neon) { animation: none; }
.tv-faixa.is-parada .tv-prog__barra { transform: scaleX(0); }
.tv-pin, .tv-txt, .tv-kb { animation-duration: var(--tv-ciclo, 24s); animation-delay: calc(var(--i, 0) * var(--tv-dur)); animation-iteration-count: infinite; animation-play-state: var(--ps, running); }
.tv-pin { animation-name: tv-pin; animation-timing-function: ease-out; }
.tv-txt { animation-name: tv-txt; animation-timing-function: ease-out; }
.tv-kb { animation-name: tv-kb; animation-timing-function: linear; }

.tv-cena--abertura, .tv-cena--fecho { display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.tv-cena--abertura { gap: 2.4cqw; }
.tv-cena__logo { display: block; width: auto; height: 22cqw; }
.tv-cena__apresenta { color: #fff; font-size: 2.2cqw; font-weight: 600; letter-spacing: .5em; text-indent: .5em; text-transform: uppercase; }
.tv-cena__marca { max-width: 90%; color: var(--tv-vermelho-claro); font-size: 5.2cqw; font-weight: 800; font-style: italic; letter-spacing: -.01em; line-height: 1.1; }

.tv-cena--produto { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.tv-cena__foto { display: flex; align-items: center; justify-content: center; overflow: hidden; background: #fff; }
.tv-cena__foto img { width: 88%; height: 88%; object-fit: contain; }
.tv-cena__texto { display: flex; flex-direction: column; justify-content: center; gap: 1.4cqw; padding: 0 5cqw; min-width: 0; color: #fff; }
.tv-cena__kicker { align-self: flex-start; padding: .6cqw 1.2cqw; border-radius: .6cqw; background: var(--tv-vermelho); color: #fff; font-size: 1.6cqw; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tv-cena__nome { font-size: 4.4cqw; font-weight: 800; line-height: 1.05; overflow-wrap: anywhere; }
.tv-cena__sub { color: var(--tv-apoio); font-size: 2cqw; }

.tv-cena--foto { overflow: hidden; }
.tv-cena--foto img { display: block; width: 100%; height: 100%; object-fit: cover; }

.tv-cena--fecho { gap: 2cqw; padding: 0 4cqw; }
.tv-cena--fecho .tv-cena__logo { height: 13cqw; }
.tv-cena__chamada { font-size: 4.6cqw; font-weight: 800; line-height: 1.05; }
.tv-cena__portal { color: var(--tv-ciano); font-size: 2cqw; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; }

.tv-tela__selo {
  position: absolute; top: 2.4cqw; left: 2.4cqw; padding: .7cqw 1.2cqw; border: 1px solid rgba(255, 255, 255, .18); border-radius: .6cqw;
  background: rgba(10, 31, 61, .72); color: #fff; font-size: 1.35cqw; font-weight: 700; letter-spacing: .14em; text-transform: uppercase;
}
.tv-prog { position: absolute; left: 0; right: 0; bottom: 0; height: .5cqw; background: rgba(255, 255, 255, .15); }
.tv-prog__barra { height: 100%; background: var(--red-marca, #e8142c); transform-origin: left center; animation: tv-prog var(--tv-ciclo, 24s) linear infinite; animation-play-state: var(--ps, running); }
.tv-reflexo { position: absolute; inset: 0; pointer-events: none; background: linear-gradient(118deg, rgba(255, 255, 255, .13) 0%, rgba(255, 255, 255, .04) 26%, rgba(255, 255, 255, 0) 38%); }
@keyframes tv-prog { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* tela pequena (celular): o texto da cena cresce em proporção, que o quadro encolheu */
@container tv (max-width: 600px) {
  .tv-cena__apresenta { font-size: 2.6cqw; }
  .tv-cena__marca { font-size: 6cqw; }
  .tv-cena__texto { gap: 1.6cqw; padding: 0 4cqw; }
  .tv-cena__kicker { padding: .8cqw 1.4cqw; border-radius: .8cqw; font-size: 2.2cqw; letter-spacing: .1em; }
  .tv-cena__nome { font-size: 5cqw; }
  .tv-cena__sub { font-size: 2.6cqw; }
  .tv-cena__chamada { font-size: 5.4cqw; }
  .tv-cena__portal { font-size: 2.6cqw; }
  .tv-tela__selo { padding: .9cqw 1.6cqw; border-radius: .8cqw; font-size: 2.3cqw; letter-spacing: .12em; }
  .tv-prog { height: .8cqw; }
}

/* ---------- ao lado: selo, título, produtos e botões ---------- */
.tv-info {
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-content: center; min-width: 0; padding-bottom: 40px;
  grid-template-areas: "selo" "cabeca" "produtos" "controles" "cta" "anuncie";
}
.tv-selo { grid-area: selo; display: flex; flex-wrap: wrap; align-items: center; gap: 8px 10px; margin: 0; font-size: 13px; }
.tv-etiqueta { padding: 5px 10px; border-radius: 6px; background: var(--tv-vermelho); color: #fff; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
.tv-legenda { color: var(--tv-apoio); text-wrap: balance; }
.tv-cabeca { grid-area: cabeca; min-width: 0; }
.tv-titulo { margin: 0; font-size: 32px; font-weight: 800; line-height: 1.12; color: #fff; text-wrap: balance; overflow-wrap: anywhere; }
.tv-titulo em { color: var(--tv-vermelho-claro); }
.tv-texto { margin: 10px 0 0; color: var(--tv-apoio); font-size: 15px; line-height: 1.5; overflow-wrap: anywhere; }
.tv-produtos { grid-area: produtos; display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; list-style: none; }
.tv-produto { display: flex; align-items: center; gap: 14px; padding: 10px; border: 1px solid rgba(255, 255, 255, .12); border-radius: 12px; background: rgba(255, 255, 255, .06); color: #fff; text-decoration: none; transition: background .15s ease, border-color .15s ease; }
.tv-produto:hover { background: rgba(255, 255, 255, .12); border-color: rgba(255, 255, 255, .3); color: #fff; }
.tv-produto img { flex: none; width: 64px; height: 64px; border-radius: 8px; background: #fff; object-fit: contain; }
.tv-produto__texto { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.tv-produto__texto b { font-size: 14px; line-height: 1.25; }
.tv-produto__texto span { color: var(--tv-apoio); font-size: 13px; }
.tv-controles { grid-area: controles; display: flex; gap: 10px; }
.tv-botao {
  display: inline-flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 16px; border: 1px solid rgba(255, 255, 255, .25); border-radius: 10px;
  background: transparent; color: #fff; font: inherit; font-size: 14px; font-weight: 600; white-space: nowrap; cursor: pointer; transition: background .15s ease, border-color .15s ease;
}
.tv-botao:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .5); }
.tv-botao svg { flex: none; width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2.2; stroke-linecap: round; stroke-linejoin: round; }
html:not(.js) .tv-controles { display: none; }   /* os dois botões só têm o que fazer com o script */
/* o botão fica colado nos dois de cima (10 px, e não os 18 do resto da coluna): os três formam um bloco só */
.tv-cta { grid-area: cta; justify-self: start; display: inline-flex; align-items: center; min-height: 44px; margin-top: -8px; padding: 0 18px; border-radius: 10px; background: var(--tv-vermelho); color: #fff; font-size: 14px; font-weight: 700; text-decoration: none; white-space: nowrap; transition: background .15s ease; }
.tv-cta:hover { background: var(--red-600, #a80e22); color: #fff; }
.tv-anuncie { grid-area: anuncie; justify-self: start; padding: 6px 0; color: var(--tv-apoio); font-size: 13px; text-decoration: underline; text-underline-offset: 3px; }
.tv-anuncie:hover { color: #fff; }
.tv-info audio { display: none; }

/* ---------- celular e tablet: a TV em cima, o texto embaixo e os produtos numa fileira que desliza ---------- */
@media (max-width: 999px) {
  .tv-conteudo { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 28px; padding-bottom: 24px; }
  .tv-aparelho-caixa { padding: 0; }
  .tv-aparelho { padding: 6px 6px 9px; border-radius: 9px; box-shadow: inset 0 0 0 1px #34373e, inset 0 1px 0 rgba(255, 255, 255, .12), 0 28px 40px -14px rgba(0, 0, 0, .75), 0 0 70px 4px rgba(42, 90, 160, .5); }
  .tv-neon { border-radius: 12px; }
  .tv-neon-brilho { display: none; }   /* o brilho borrado e girando é o que mais pesa no celular */
  .tv-tela { border-radius: 2px; }
  .tv-led { bottom: 3px; width: 5px; height: 3px; margin-left: -2.5px; }
  .tv-base { width: 46%; height: 12px; margin-top: 14px; border-radius: 6px; }
  /* a prateleira vai de ponta a ponta da tela, passando pela margem do conteúdo */
  .tv-prateleira { height: 10px; margin: 3px -22px 0; border-radius: 0; }
  .tv-info {
    padding-bottom: 0; row-gap: 12px; grid-template-columns: 1fr auto;
    grid-template-areas: "selo controles" "cabeca cabeca" "produtos produtos" "cta cta" "anuncie anuncie";
  }
  .tv-selo { font-size: 12px; }
  .tv-etiqueta { padding: 4px 8px; letter-spacing: .1em; }
  .tv-titulo { font-size: 23px; line-height: 1.15; }
  .tv-produtos { flex-direction: row; gap: 10px; margin-inline: -22px; padding: 2px 22px 4px; overflow-x: auto; scroll-snap-type: x mandatory; scroll-padding-inline: 22px; scrollbar-width: none; }
  .tv-produtos::-webkit-scrollbar { display: none; }
  .tv-produtos li { flex: 0 0 150px; scroll-snap-align: start; display: flex; }
  .tv-produto { flex: 1; flex-direction: column; align-items: stretch; gap: 8px; padding: 8px; }
  .tv-produto img { width: 100%; height: 110px; }
  .tv-produto__texto { gap: 2px; }
  .tv-produto__texto b { font-size: 13px; }
  .tv-produto__texto span { font-size: 12px; }
  .tv-produto__ver { display: none; }
  .tv-controles { gap: 6px; align-self: start; }
  .tv-botao { justify-content: center; width: 44px; padding: 0; }
  .tv-botao__rotulo { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .tv-cta { justify-self: stretch; justify-content: center; margin-top: 0; }
  .tv-anuncie { padding: 10px 0; }
}

/* no tablet os três cartões dividem a linha em vez de ficarem encostados na esquerda */
@media (min-width: 560px) and (max-width: 999px) {
  .tv-produtos li { flex: 1 1 0; }
}

@media (prefers-reduced-motion: reduce) {
  .tv-neon { animation: none; }
}
