/* Blocos da página de produto (ver.php) */
.pv-container {
  --pv-block-width: 920px;
  --pv-block-height: 640px; /* aumentar altura da Div 3 para evitar esmagamento */
  /* AJUSTE: altura da Div 2 para comportar seus cards sem quebrar */
  --pv-videos-height: calc((var(--pv-video-item-height) * 4) + 80px);
  --pv-video-item-height: 288px; /* altura fixa de cada player/placeholder */
  /* AJUSTE: altura da imagem grande (Div 1) */
  --pv-gallery-height: 544px;
  /* AJUSTE: escala da faixa de miniaturas (Div 1) */
  --pv-thumbs-scale: 0.5;
  /* AJUSTE: espaçamento entre miniaturas (Div 1) */
  --pv-thumbs-between: 32px;
  /* AJUSTE: largura dos cards de vídeo (Div 2) */
  --pv-vcard-width: 64%;
}

/* Layout geral: 3 blocos (galeria, vídeos, informações) empilhados e centralizados */
/* AJUSTE: garantir 1 coluna por linha (sem 2 frações) */
.product-view .pv-grid {
  display: grid !important;
  grid-template-columns: 1fr !important;
  grid-auto-flow: row;
  gap: 24px;
  justify-items: center;
}
.pv-gallery {
  width: var(--pv-block-width);
  max-width: 92vw;
  height: var(--pv-gallery-height);
  margin: 0 auto;
}
.pv-info {
  width: var(--pv-block-width);
  max-width: 92vw;
  height: var(--pv-block-height);
  margin: 0 auto;
  overflow-y: auto;
  padding: 16px 20px; /* respiro interno suave */
}
.pv-videos {
  width: var(--pv-block-width);
  max-width: 92vw;
  height: var(--pv-videos-height);
  margin: 0 auto;
}
/* Galeria: imagem principal em cima e 5 thumbs uniformes embaixo */
.pv-gallery {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.pv-main {
  position: relative;
  width: 100%;
  display: block;
  flex: 1 1 auto;
  min-height: 0;
}
.pv-main .media-fit {
  width: 100%;
  height: 100%;
  display: block;
  border-radius: 2px;
  object-fit: cover;
}
.pv-thumbs {
  /* AJUSTE: distribuição das miniaturas (space-between) */
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  flex: 0 0 auto;
  width: calc(var(--pv-block-width) * var(--pv-thumbs-scale));
  align-self: center;
}
.pv-thumb {
  position: relative;
  display: block;
  aspect-ratio: 1/1;
  /* AJUSTE: largura calculada com espaçamento fixo entre 5 itens */
  width: calc((100% - (4 * var(--pv-thumbs-between))) / 5);
}
.pv-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 4px;
}

/* Estado ativo opcional para a thumb */
.pv-thumb.active img {
  outline: 2px solid var(--accent, #2bb673);
  outline-offset: 2px;
}

@media (max-width: 600px) {
  .pv-main {
    min-height: 160px;
  }
}

/* Vídeos: um embaixo do outro dentro da segunda div */
.pv-videos {
  margin-top: 0;
  display: flex;
  flex-direction: column;
}
.pv-videos h3 {
  font-size: 1.05rem;
  margin: 4px 0 8px;
  flex: 0 0 auto;
}
.pv-vgrid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
  /* sem scroll interno; a altura da seção já comporta os vídeos */
}
.pv-vcard {
  overflow: hidden;
  /* AJUSTE: altura do card de vídeo (Div 2) */
  height: var(--pv-video-item-height);
  /* AJUSTE: largura dos cards de vídeo (Div 2) */
  width: var(--pv-vcard-width);
  margin: 0 auto;
}
.pv-vcard video {
  display: block;
  width: 100%;
  /* AJUSTE: vídeo ocupa 100% do card */
  height: 100%;
  /* AJUSTE: preencher todo o espaço do card (corta bordas se necessário) */
  object-fit: cover;
  background: #000;
  border-radius: 2px;
}
.pv-vcard .pv-vplaceholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0f0f10;
  color: #bbb;
  border-radius: 2px;
  /* AJUSTE: placeholder ocupa 100% do card */
  height: 100%;
}
.pv-vcard .pv-vplaceholder img {
  display: block;
  max-width: 90%;
  max-height: 90%;
  width: auto;
  height: auto;
  object-fit: contain;
  opacity: 0.7;
}

/* Responsividade ver.php (alinhado às media queries do projeto) */
@media (min-width: 769px) and (max-width: 1024px) {
  .product-view .pv-container {
    /* Tablet: largura mais fluida e alturas ajustadas */
    --pv-block-width: 92vw;
    --pv-block-height: 560px; /* mais respiro na Div 3 */
    --pv-gallery-height: 480px; /* altura total da galeria (imagem + thumbs) */
    --pv-thumbs-scale: 0.6;
    --pv-thumbs-between: 16px;
    --pv-video-item-height: 220px;
    --pv-vcard-width: 82%;
    --pv-videos-height: calc((var(--pv-video-item-height) * 4) + 72px);
  }
}

@media (min-width: 320px) and (max-width: 768px) {
  .product-view .pv-container {
    /* Mobile: ocupar quase toda a largura; cards e thumbs mais compactos */
    --pv-block-width: 96vw;
    --pv-block-height: 520px; /* aumentar no mobile para não apertar */
    --pv-gallery-height: 420px; /* considerar espaço da faixa de thumbs */
    --pv-thumbs-scale: 0.9;
    --pv-thumbs-between: 10px;
    --pv-video-item-height: 200px;
    --pv-vcard-width: 100%;
    --pv-videos-height: calc((var(--pv-video-item-height) * 4) + 64px);
  }
  /* garantir largura aplicada conforme escala no mobile */
  .product-view .pv-thumbs {
    width: calc(var(--pv-block-width) * var(--pv-thumbs-scale));
  }
}

/* Respiro suave entre elementos da seção de informações */
.pv-info .pv-title {
  margin-bottom: 12px;
}
.pv-info .pv-desc {
  margin-bottom: 14px;
  line-height: 1.6;
  font-size: 1rem;
  color: var(--secondary);
  min-height: 4.8rem; /* mínimo de 3 linhas (3 * 1.6rem) */
  word-break: break-word;
}
.pv-info .pv-flow {
  display: grid;
  gap: 12px;
}
.pv-info .pv-specs-title {
  margin-top: 8px;
  margin-bottom: 6px;
}
.pv-info .pv-specs-list {
  margin: 0;
  padding-left: 18px;
}
