/* SIC 24/11/2026 — estrelas de avaliação no topo dos cards da HOME
   (logo abaixo da foto/faixa, antes do nome), no mesmo lugar das Ofertas Relâmpago.
   v2: no Para Lisos, o bloco de info (estrelas, nome, preços, COMPRAR)
   passa a ocupar o espaço sobrando de forma equilibrada — o vão único
   entre parcelas e COMPRAR some; o botão segue no rodapé do card.
   Só body.template-home; o arquivo é incluído apenas em templates/home.tpl,
   então não entra em produto, categoria nem busca.
   Não altera o HTML nem o CSS das próprias Ofertas Relâmpago (.sor-card). */

/* ------------------------------------------------------------------
   1) Estrelas no topo — todas as vitrines nativas da home
   ------------------------------------------------------------------ */

/* O bloco de info já é flex-column no tema; reforçamos para o order funcionar
   em todas as vitrines nativas (Mais Vendidos, marcas, Para Lisos, etc.). */
html body.template-home .js-item-product .product-item-information{
  display:flex !important;
  flex-direction:column !important;
}

/* O widget BK Reviews (.collection-star-section) é irmão de a.product-item-link,
   depois dele no DOM. order:-1 coloca as estrelas imediatamente abaixo da foto
   e antes do nome (e dos preços). */
html body.template-home .js-item-product .collection-star-section,
html body.template-home .js-item-product .bk-reviews{
  order:-1 !important;
  flex:0 0 auto;
  min-height:22px;
  margin:12px 0 4px !important;
  position:relative;
  z-index:1;
  text-align:left;
}

/* Nas Ofertas o wrapper tw-my-[0.75rem] é zerado; repetimos o mesmo recorte. */
html body.template-home .js-item-product .collection-star-section .tw-my-\[0\.75rem\],
html body.template-home .js-item-product .bk-reviews .tw-my-\[0\.75rem\]{
  margin:0 !important;
}

html body.template-home .js-item-product .bk-container{
  justify-content:flex-start !important;
}

/* ------------------------------------------------------------------
   2) Para Lisos — info equilibrada no espaço sobrando
   O card tem altura fixa igual ao banner; a foto é quadrada (v4).
   A altura que sobra na coluna de info era um vão único entre
   parcelas e COMPRAR (margin-top:auto no form, sic-card-comprar-fluxo-v1).

   Usamos grid (não flex+absolute): preço e parcelas são irmãos no DOM,
   então position:absolute no card as jogava por cima do botão.
   Linhas: estrelas | 1fr | nome | 1fr | preço+parcelas | 1fr | COMPRAR.
   As parcelas compartilham a célula do preço (align-self:end + padding
   no container do preço) e ficam grudadas nele. O botão fica no rodapé.
   Itens vazios do tema saem do fluxo para não criar linhas fantasma.
   ------------------------------------------------------------------ */

html body.template-home section.spl .js-item-product:not(.product-item-reduced):has(.sic-buy) .product-item-information{
  display:grid !important;
  grid-template-columns:1fr;
  grid-template-rows:auto 1fr auto 1fr auto 1fr auto;
  flex:1 1 auto;
  min-height:0;
  align-items:stretch;
  padding:8px 12px 10px !important;
  box-sizing:border-box;
}

/* display:contents no link: nome, preço e form participam do grid da info. */
html body.template-home section.spl .js-item-product:not(.product-item-reduced):has(.sic-buy) .product-item-information > a.product-item-link{
  display:contents;
}

/* Tira do grid itens vazios/auxiliares (slots Nuvemshop, variantes, configs). */
html body.template-home section.spl .js-item-product .product-item-information .js-nubesdk-slot,
html body.template-home section.spl .js-item-product .product-item-information .js-free-shipping-combines-config,
html body.template-home section.spl .js-item-product .product-item-information .js-item-variants,
html body.template-home section.spl .js-item-product .product-item-information .hidden,
html body.template-home section.spl .js-item-product .product-item-information .labels:empty,
html body.template-home section.spl .js-item-product .product-item-information .payment-discount-price-product-container:empty{
  display:none !important;
}

/* Labels do tema (order-first) não devem ocupar linha do grid;
   badges de desconto (.sic-badge) já são position:absolute na foto. */
html body.template-home section.spl .js-item-product .product-item-information .labels{
  position:absolute;
  left:0;
  top:0;
  width:0;
  height:0;
  overflow:visible;
  margin:0 !important;
  padding:0 !important;
  pointer-events:none;
}

/* Estrelas: linha 1, no topo da info, logo abaixo da foto.
   nowrap evita o (1784) quebrar para a linha de baixo em cards estreitos (1280). */
html body.template-home section.spl .js-item-product .collection-star-section,
html body.template-home section.spl .js-item-product .bk-reviews{
  grid-row:1;
  grid-column:1;
  order:unset;
  flex:none;
  margin:0 !important;
  min-height:22px;
  width:100%;
  position:relative;
  z-index:1;
  align-self:start;
}
html body.template-home section.spl .js-item-product .collection-star-section .tw-flex,
html body.template-home section.spl .js-item-product .bk-reviews .tw-flex,
html body.template-home section.spl .js-item-product .bk-container{
  flex-wrap:nowrap !important;
  justify-content:flex-start !important;
  width:auto;
  max-width:100%;
}

/* Nome: linha 3 (um 1fr depois das estrelas). Fonte um pouco maior no desktop. */
html body.template-home section.spl .js-item-product .product-item-name,
html body.template-home section.spl .js-item-product .js-item-name{
  grid-row:3;
  grid-column:1;
  margin:0 !important;
  font-size:16px !important;
  line-height:1.35 !important;
  align-self:start;
}

@media (min-width:1024px){
  html body.template-home section.spl .js-item-product .product-item-name,
  html body.template-home section.spl .js-item-product .js-item-name{
    font-size:17px !important;
    line-height:1.35 !important;
  }
}
@media (min-width:1440px){
  html body.template-home section.spl .js-item-product .product-item-name,
  html body.template-home section.spl .js-item-product .js-item-name{
    font-size:18px !important;
    line-height:1.35 !important;
  }
}

/* Preço e parcelas compartilham a linha 5. O padding-bottom do container
   reserva a altura das parcelas, que se alinham no fim da mesma célula. */
html body.template-home section.spl .js-item-product .product-item-price-container{
  grid-row:5;
  grid-column:1;
  position:relative !important;
  margin:0 !important;
  width:100%;
  align-self:start;
}

html body.template-home section.spl .js-item-product .product-item-information:has(.js-max-installments-container) .product-item-price-container,
html body.template-home section.spl .js-item-product .product-item-information:has(.custom-installments) .product-item-price-container{
  padding-bottom:1.5em;
}

html body.template-home section.spl .js-item-product .js-max-installments-container,
html body.template-home section.spl .js-item-product .custom-installments{
  grid-row:5;
  grid-column:1;
  position:static !important;
  left:auto !important;
  right:auto !important;
  top:auto !important;
  bottom:auto !important;
  width:100% !important;
  max-width:100%;
  margin:0 !important;
  align-self:end;
  justify-self:stretch;
  text-align:left !important;
  float:none !important;
  z-index:1;
}
html body.template-home section.spl .js-item-product .js-max-installments-container,
html body.template-home section.spl .js-item-product .custom-installments,
html body.template-home section.spl .js-item-product .js-max-installments-container *,
html body.template-home section.spl .js-item-product .custom-installments *{
  text-align:left !important;
  justify-content:flex-start !important;
}

/* COMPRAR na última linha, no rodapé do card.
   Zera o margin-top:auto do sic-card-comprar-fluxo-v1. */
html body.template-home section.spl .js-item-product:not(.product-item-reduced) form.sic-buy,
html body.template-home section.spl .js-item-product:not(.product-item-reduced) .js-product-form.sic-buy{
  grid-row:7;
  grid-column:1;
  flex:none;
  position:static !important;
  left:auto !important;
  right:auto !important;
  top:auto !important;
  bottom:auto !important;
  width:100%;
  max-width:none;
  margin:0 !important;
  z-index:auto;
  align-self:end;
}

/* Mobile: mesma grade (espaço menor, gaps menores).
   Não mexe em --spl-h / --spl-info / --spl-img — banner e cards
   continuam com a mesma altura (dTop/dBottom 0). */
@media (max-width:1023.98px){
  html body.template-home section.spl .js-item-product:not(.product-item-reduced):has(.sic-buy) .product-item-information{
    padding:6px 10px 8px !important;
  }
  html body.template-home section.spl .js-item-product .collection-star-section,
  html body.template-home section.spl .js-item-product .bk-reviews{
    margin:0 !important;
  }
  html body.template-home section.spl .js-item-product .product-item-name,
  html body.template-home section.spl .js-item-product .js-item-name{
    font-size:15px !important;
    margin:0 !important;
  }
}
