/* ══════════════════════════════════════════════════════
   NOVATEKS GAMES — improvements.css
   Arquivo de melhorias de performance, UX e conversão.
   Deve ser carregado APÓS style.css e seo-styles.css.
   NÃO substitui regras existentes — apenas adiciona/ajusta.
   ══════════════════════════════════════════════════════ */


/* ══════════════════════════════════════════════════════
   FIX CRÍTICO: Imagens grandes nos cards — aspect-ratio responsivo
   Problema: height: 182px fixo cortava imagens grandes
   Solução: aspect-ratio adaptável + object-fit: cover centralizado
   ══════════════════════════════════════════════════════ */

/* Desktop padrão: ratio 16:10 (estilo banner, mais horizontal) */
.product-img-wrap {
  height: auto !important;           /* remove altura fixa problemática */
  aspect-ratio: 16 / 10;             /* proporção consistente em todos os cards */
  overflow: hidden;
  position: relative;
  background: var(--bg-deep);
}

/* Garante que a imagem preencha SEM distorcer, cortando o excesso pelo centro */
.product-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: contain;                 /* cobre todo o espaço, corta o excesso */
  object-position: center center;    /* centraliza o corte - foco no meio da imagem */
  display: block;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

/* Efeito hover de zoom mantido */
.product-card:hover .product-img-wrap img {
  transform: scale(1.07);
}

/* Mobile (até 600px): ratio 1:1 (quadrado, melhor para 2 colunas) */
@media (max-width: 600px) {
  .product-img-wrap {
    aspect-ratio: 1 / 1 !important;
  }
}

/* Tablet (601px - 900px): ratio 4:3 (meio-termo) */
@media (min-width: 601px) and (max-width: 900px) {
  .product-img-wrap {
    aspect-ratio: 4 / 3 !important;
  }
}


/* ────────────────────────────────────────────────────
   1. GRID MOBILE: 2 colunas em vez de 1
   ──────────────────────────────────────────────────── */
@media (max-width: 600px) {
  .products-grid {
    grid-template-columns: repeat(2, 1fr) !important;
    gap: 10px !important;
  }

  .product-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 0.78rem !important;
    line-height: 1.3 !important;
    min-height: 2.6em;
  }

  .product-desc,
  .product-rating,
  .product-sales {
    display: none;
  }

  .product-body {
    padding: 8px 8px 10px !important;
  }

  .price-current {
    font-size: 0.95rem !important;
  }

  .pbadge {
    font-size: 0.48rem !important;
    padding: 2px 5px !important;
  }

  .btn-buy {
    width: 100%;
    font-size: 0.72rem !important;
    padding: 9px 6px !important;
    justify-content: center;
  }

  .product-actions {
    gap: 6px !important;
  }

  .btn-fav {
    min-width: 34px;
    min-height: 34px;
    padding: 0 !important;
    display: flex;
    align-items: center;
    justify-content: center;
  }
}

/* Em telas entre 601px e 900px: 3 colunas */
@media (min-width: 601px) and (max-width: 900px) {
  .products-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}


/* ────────────────────────────────────────────────────
   2. TÍTULO DO PRODUTO: 2 linhas máximo (desktop)
   ──────────────────────────────────────────────────── */
.product-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 2.4em;
}


/* ────────────────────────────────────────────────────
   2.1 DESCRIÇÃO: 2 linhas máximo no desktop
   ──────────────────────────────────────────────────── */
.product-desc {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}


/* ────────────────────────────────────────────────────
   3. DESTAQUE VISUAL DO PREÇO
   ──────────────────────────────────────────────────── */
.product-price-row {
  background: rgba(0, 255, 180, 0.04);
  border: 1px solid rgba(0, 255, 180, 0.12);
  border-radius: 6px;
  padding: 6px 10px;
  margin: 6px 0 !important;
}

.price-current {
  font-size: 1.15rem !important;
  font-weight: 700 !important;
  color: var(--neon-green) !important;
  text-shadow: 0 0 12px rgba(0, 255, 180, 0.3);
}


/* ────────────────────────────────────────────────────
   4. BOTÃO COMPRAR: texto mais forte + microcopy
   ──────────────────────────────────────────────────── */
.btn-buy {
  gap: 7px !important;
  font-size: 0.78rem !important;
  letter-spacing: 0.8px !important;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1) !important;
}

.btn-buy:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 6px 20px rgba(0, 255, 180, 0.35) !important;
}

.product-microcopy {
  display: flex;
  align-items: center;
  gap: 5px;
  font-size: 0.68rem;
  color: var(--text-dim);
  margin-top: 5px;
  justify-content: center;
}

.product-microcopy i {
  color: var(--neon-green);
  font-size: 0.65rem;
}

.product-microcopy.popular {
  color: var(--neon-orange);
}
.product-microcopy.popular i {
  color: var(--neon-orange);
}


/* ────────────────────────────────────────────────────
   5. SKELETON LOADING MELHORADO
   ──────────────────────────────────────────────────── */
.product-skeleton {
  background: var(--bg-card);
  border: 1px solid var(--border-dim);
  border-radius: var(--radius);
  overflow: hidden;
}

.skeleton-img {
  aspect-ratio: 16 / 10;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: skeletonWave 1.6s ease-in-out infinite;
}

.skeleton-body {
  padding: 12px 14px 16px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.skeleton-line {
  height: 11px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    rgba(255,255,255,0.03) 25%,
    rgba(255,255,255,0.07) 50%,
    rgba(255,255,255,0.03) 75%
  );
  background-size: 200% 100%;
  animation: skeletonWave 1.6s ease-in-out infinite;
}
.skeleton-line.medium  { width: 75%; }
.skeleton-line.short   { width: 45%; }
.skeleton-line.full    { width: 100%; }

.skeleton-btn {
  height: 36px;
  border-radius: 6px;
  margin-top: 4px;
  background: linear-gradient(
    90deg,
    rgba(0,255,180,0.03) 25%,
    rgba(0,255,180,0.08) 50%,
    rgba(0,255,180,0.03) 75%
  );
  background-size: 200% 100%;
  animation: skeletonWave 1.6s ease-in-out infinite;
}

.product-skeleton:nth-child(1) .skeleton-img,
.product-skeleton:nth-child(1) .skeleton-line,
.product-skeleton:nth-child(1) .skeleton-btn { animation-delay: 0s; }
.product-skeleton:nth-child(2) .skeleton-img,
.product-skeleton:nth-child(2) .skeleton-line,
.product-skeleton:nth-child(2) .skeleton-btn { animation-delay: 0.1s; }
.product-skeleton:nth-child(3) .skeleton-img,
.product-skeleton:nth-child(3) .skeleton-line,
.product-skeleton:nth-child(3) .skeleton-btn { animation-delay: 0.2s; }
.product-skeleton:nth-child(4) .skeleton-img,
.product-skeleton:nth-child(4) .skeleton-line,
.product-skeleton:nth-child(4) .skeleton-btn { animation-delay: 0.15s; }

@keyframes skeletonWave {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}


/* ────────────────────────────────────────────────────
   7. BOTÃO "CARREGAR MAIS"
   ──────────────────────────────────────────────────── */
.load-more-wrap {
  display: flex;
  justify-content: center;
  margin-top: 32px;
  padding-bottom: 8px;
}

.btn-load-more {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: transparent;
  border: 1.5px solid rgba(0, 255, 180, 0.35);
  color: var(--neon-green);
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  padding: 12px 28px;
  border-radius: 40px;
  cursor: pointer;
  transition: all 0.25s ease;
  position: relative;
  overflow: hidden;
}

.btn-load-more::before {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(0, 255, 180, 0.06);
  transform: scaleX(0);
  transition: transform 0.25s ease;
  transform-origin: left;
}

.btn-load-more:hover {
  border-color: var(--neon-green);
  box-shadow: 0 0 20px rgba(0, 255, 180, 0.2);
}

.btn-load-more:hover::before {
  transform: scaleX(1);
}

.btn-load-more:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  pointer-events: none;
}

.btn-load-more i {
  transition: transform 0.3s ease;
}

.btn-load-more:hover i {
  transform: rotate(90deg);
}


/* ────────────────────────────────────────────────────
   8. CTA FIXO MOBILE
   ──────────────────────────────────────────────────── */
.mobile-cta-bar {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 900;
  background: linear-gradient(135deg, #00d496, #00c8ff);
  padding: 0;
  transform: translateY(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 -4px 20px rgba(0, 255, 180, 0.3);
}

.mobile-cta-bar.visible {
  transform: translateY(0);
}

.mobile-cta-bar.hidden {
  transform: translateY(100%);
}

.mobile-cta-link {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 14px 20px;
  color: #050508;
  font-family: var(--font-head);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 1px;
  text-decoration: none;
  text-transform: uppercase;
}

.mobile-cta-link:active {
  opacity: 0.85;
}

@media (max-width: 768px) {
  .mobile-cta-bar {
    display: block;
  }
}


/* ────────────────────────────────────────────────────
   9. IMAGENS DOS CARDS — sem layout shift (CLS = 0)
   JÁ RESOLVIDO PELO FIX CRÍTICO ACIMA (aspect-ratio)
   Mantido para compatibilidade com lazy loading
   ──────────────────────────────────────────────────── */
.product-img-wrap img.loaded,
.product-img-wrap img[loading="eager"] {
  opacity: 1;
}


/* ────────────────────────────────────────────────────
   10. FAQ — ÍCONE EXPANDIR/RECOLHER melhorado
   ──────────────────────────────────────────────────── */
.faq-item h3::after {
  content: '\f078';
  font-family: 'Font Awesome 6 Free';
  font-weight: 900;
  font-size: 0.65rem !important;
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1) !important;
  color: var(--text-dim);
  right: 18px;
}

.faq-item.active h3::after {
  transform: translateY(-50%) rotate(-180deg) !important;
  color: var(--neon-green);
}

.faq-item.active h3 {
  color: var(--neon-green);
}

.faq-item > div > div {
  opacity: 0;
  transition: opacity 0.3s ease 0.05s !important;
}

.faq-item.active > div > div {
  opacity: 1 !important;
}


/* ────────────────────────────────────────────────────
   11. BADGE A/B TEST (experimental)
   ──────────────────────────────────────────────────── */
.ab-variant-b .btn-buy {
  background: linear-gradient(135deg, #00ffb4, #00c8ff) !important;
  color: #050508 !important;
  font-weight: 800 !important;
}

.ab-variant-b .btn-buy:hover {
  background: linear-gradient(135deg, #00e0a0, #00b0e0) !important;
}


/* ────────────────────────────────────────────────────
   12. SMOOTH SCROLL nas âncoras de categoria
   ──────────────────────────────────────────────────── */
html {
  scroll-padding-top: 80px;
}