/* Pagina de produto: reserva o espaco da galeria (o product-v2.js monta as fotos depois) */
@media screen and (max-width: 768px) {
  .v2-imagens .product-image {
    min-height: 400px;
  }
}

@media screen and (max-width: 400px) {
  .v2-imagens .product-image {
    min-height: 350px;
  }
}

/* Banner condicional vazio: ocupava ~20px ate o product-v2.js esconder (pulo do breadcrumb).
   Quando o handleBannerCondicional coloca um src, a regra deixa de valer. */
#bannerImgNovo[src=""],
#bannerImgNovo:not([src]) {
  display: none;
}

/* Item 7: preco no Pix e "de/por".
   O h4 do preco nascia vazio (0px) e crescia quando o geo_18.js preenchia: altura reservada.
   O h4.product-old-price (geo_18.js) entrava e saia com 26px: escondido; o "de" agora e a linha .dmm-de. */
.shelf__product .__info .__listPrice h4 {
  min-height: 32px;
}

.shelf__product .__info .__listPrice h4.product-old-price {
  display: none !important;
}

.shelf__product .__info .__listPrice .dmm-de {
  margin: 0;
  font-size: 14px;
  line-height: 18px;
  color: #777;
}

.shelf__product .__info .__listPrice .dmm-de:empty {
  display: none;
}

.shelf__product .__info .__listPrice .dmm-pix {
  margin: 4px 0 0;
  min-height: 26px;
  font-family: 'Montserrat', sans-serif;
  font-size: 16px;
  line-height: 26px;
  color: #004A77;
}

.shelf__product .__info .__listPrice .dmm-pix.dmm-vazio {
  display: none;
}

.shelf__product .__info .__listPrice .dmm-pix strong {
  font-size: 20px;
  color: #0B8A45;
}

.shelf__product .__info .__listPrice .dmm-pix .dmm-pix-selo {
  display: inline-block;
  margin-left: 4px;
  padding: 1px 6px;
  border-radius: 4px;
  background: #0B8A45;
  color: #fff;
  font-size: 12px;
  font-style: normal;
  font-weight: 700;
  line-height: 18px;
  vertical-align: 2px;
}

/* miniatura da variacao entra depois (geo_18.js): reserva a altura */
.shelf__product .__info .__variations {
  min-height: 49px;
}

/* Item 1: barra fixa do Comprar (DMM-comprar-fixo.js) */
.dmm-barra {
  position: fixed;
  left: 0;
  right: 0;
  z-index: 900;
  background: #fff;
  font-family: 'Montserrat', sans-serif;
  transition: transform .2s ease-out;
  visibility: hidden;
}

.dmm-barra.dmm-barra-aberta {
  transform: translateY(0);
  visibility: visible;
}

.dmm-barra-dentro {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 1144px;
  margin: 0 auto;
  padding: 8px 12px;
  box-sizing: border-box;
}

.dmm-barra-info {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-width: 0;
}

.dmm-barra-nome {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-size: 14px;
  line-height: 18px;
  color: #000;
}

.dmm-barra-preco {
  font-size: 18px;
  font-weight: 700;
  line-height: 22px;
  color: #004A77;
}

.dmm-barra-pix {
  font-size: 13px;
  font-weight: 700;
  line-height: 16px;
  color: #0B8A45;
}

.dmm-barra-pix:empty {
  display: none;
}

.dmm-barra-botao {
  flex: 0 0 auto;
  height: 48px;
  padding: 0 24px;
  border: 0;
  border-radius: 4px;
  background: #00B912;
  color: #fff;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
}

.dmm-barra-esgotado .dmm-barra-botao {
  background: #004A77;
}

.dmm-barra-foto {
  flex: 0 0 auto;
  width: 48px;
  height: 48px;
  object-fit: contain;
}

/* celular: embaixo, so preco + botao */
@media (max-width: 768px) {
  .dmm-barra {
    bottom: 0;
    transform: translateY(100%);
    box-shadow: 0 -2px 8px rgba(0, 0, 0, .12);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .dmm-barra-foto,
  .dmm-barra-nome {
    display: none;
  }

  .dmm-barra-botao {
    min-width: 170px;
  }

  /* espaco pro rodape nao ficar atras da barra */
  body.produto {
    padding-bottom: 64px;
  }
}

/* desktop: em cima */
@media (min-width: 769px) {
  .dmm-barra {
    top: 0;
    transform: translateY(-100%);
    box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
  }

  .dmm-barra-info {
    flex-direction: row;
    align-items: baseline;
    gap: 16px;
  }

  .dmm-barra-nome {
    flex: 1;
    font-size: 16px;
    font-weight: 700;
  }

  .dmm-barra-botao {
    width: 290px;
  }
}

/* Item 5: rodape livre no celular.
   WhatsApp (widget mbz) sobe pra cima da barra; aviso de cookies vai pro topo. */
@media (max-width: 768px) {
  /* sempre acima da altura do botao (barra fechada: o Comprar original fica no pe da tela) */
  body.produto [data-mbz-button-popup-wrapper] {
    bottom: 76px !important;
  }

  body.produto .modal-cookies {
    top: 8px !important;
    bottom: auto !important;
  }
}

/* Item 8: calculo de frete (shippingCalculate.js), tabela mais compacta */
.shelf__product .__info .__shipping {
  margin-top: 24px;
}

#table-result-shipping td {
  padding: 6px 8px;
  font-size: 14px;
  line-height: 20px;
  vertical-align: middle;
}

#table-result-shipping td:first-child {
  white-space: nowrap;
  font-weight: 700;
}

#table-result-shipping img {
  margin-left: 0;
}

#table-result-shipping th {
  padding: 6px 8px;
  font-size: 13px;
  line-height: 18px;
}

/* Item 9: compre junto compacto, dentro do .__info (compre-junto-responsivo.js monta os cards) */
.shelf__product .__info .buy-together-dmm {
  max-width: none;
  margin: 24px 0 0;
}

/* tabela nativa da VTEX so aparece montada nos cards (evita o pulo da tabela grande) */
.buy-together-dmm:not(.dmm-cj-pronto) #divCompreJunto {
  display: none;
}

/* espaco reservado ate os cards ficarem prontos (titulo 36px + 143px por combinacao),
   senao a descricao pula quando o JS monta os cards */
.buy-together-dmm:not(.dmm-cj-pronto):has(#divCompreJunto tr) { min-height: 179px; }
.buy-together-dmm:not(.dmm-cj-pronto):has(#divCompreJunto tr + tr) { min-height: 322px; }
.buy-together-dmm:not(.dmm-cj-pronto):has(#divCompreJunto tr + tr + tr) { min-height: 465px; }

.buy-together-dmm .dmm-cj-titulo {
  margin: 0 0 12px;
  font-family: 'Montserrat', sans-serif;
  font-size: 18px;
  font-weight: 700;
  line-height: 24px;
  color: #004A77;
}

.buy-together-dmm .dmm-cj-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 12px;
  margin-bottom: 12px;
  border: 1px solid #e4e4e4;
  border-radius: 6px;
  font-family: 'Montserrat', sans-serif;
}

.buy-together-dmm .dmm-cj-fotos {
  display: flex;
  align-items: center;
  flex: 0 0 auto;
}

.buy-together-dmm .dmm-cj-foto,
.buy-together-dmm .dmm-cj-foto img {
  display: block;
  width: 64px;
  height: 64px;
  border: 0;
  object-fit: contain;
}

.buy-together-dmm .dmm-cj-mais {
  padding: 0 4px;
  font-size: 20px;
  color: #004A77;
}

.buy-together-dmm .dmm-cj-info {
  flex: 1;
  min-width: 0;
}

.buy-together-dmm .dmm-cj-info p {
  margin: 0;
}

.buy-together-dmm .dmm-cj-nome {
  display: block;
  margin-bottom: 4px;
  border: 0;
  font-size: 14px;
  font-weight: 700;
  line-height: 18px;
  color: #000;
}

.buy-together-dmm .dmm-cj-de {
  font-size: 13px;
  color: #777;
}

.buy-together-dmm .dmm-cj-total {
  font-size: 14px;
  line-height: 20px;
  color: #004A77;
}

.buy-together-dmm .dmm-cj-total strong {
  font-size: 18px;
}

.buy-together-dmm .dmm-cj-parcelas {
  font-size: 13px;
  line-height: 18px;
  color: #004A77;
}

.buy-together-dmm .dmm-cj-economia {
  display: inline-block;
  margin-top: 4px !important;
  padding: 1px 6px;
  border-radius: 4px;
  background: #0B8A45;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.buy-together-dmm .dmm-cj-comprar {
  display: inline-block;
  margin-top: 8px;
  padding: 8px 16px;
  border: 0;
  border-radius: 4px;
  background: #00B912;
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  text-decoration: none;
}

.buy-together-dmm .dmm-cj-comprar:hover {
  color: #fff;
  opacity: .85;
}

/* Faixa de mensagens do topo (header): o padding final (0 15px) so chegava num <style> no fim do body
   e antes do slick as 3 mensagens apareciam empilhadas: a pagina inteira subia 20px duas vezes.
   Aqui ja nasce com o tamanho final. Vale pro site todo: o ideal e levar pro CSS do header. */
body .header-carrousel {
  padding: 0 15px !important;
}

.header-carrousel:not(.slick-initialized) > div + div {
  display: none;
}

/* .shelf__product .container e grid: o clearfix do bootstrap (::before/::after) virava uma celula
   do grid com a altura da linha e sumia no carregamento (pulo de ~0,26 no desktop). Em grid nao precisa. */
.shelf__product .container::before,
.shelf__product .container::after {
  content: none;
}

/* desktop: preco e botao lado a lado; a linha fica com 64px depois que preco + Pix montam */
@media (min-width: 769px) {
  .shelf__product .__info .__price {
    min-height: 64px;
  }
}

.dmm-barra-esgotado .dmm-barra-preco {
  font-size: 14px;
  color: #777;
}
