/* SIC 24/11/2026 (Ultron) — barra fixa de compra na PDP v2.
   v1 deixava um vão (~90px) no iPhone Safari quando a toolbar colapsa:
   position:fixed; bottom:0 fica preso ao layout viewport, não ao visualViewport.
   v2: bottom: var(--sic-barra-inset) (o JS iguala ao visual viewport);
   safe-area só como padding INTERNO; ::after estende o fundo #1b1b1b para baixo
   (overscroll / home indicator / frame da toolbar). Sem vh/dvh na posição.
   Não mexe em layout.tpl (viewport-fit=cover ausente no head-tags; ver RELATORIO). */
html body.template-product{
  --sic-barra-h: 97px;
  --sic-barra-inset: 0px;
  padding-bottom: calc(var(--sic-barra-h) + env(safe-area-inset-bottom, 0px)) !important;
}
html body.template-product .sic-barra{
  position:fixed; left:0; right:0; z-index:9990;
  bottom: var(--sic-barra-inset, 0px);
  width:100%; box-sizing:border-box;
  background:#1b1b1b;
  box-shadow:0 -6px 24px 0 rgba(0,0,0,.08);
  /* safe-area só como padding interno — o fundo cobre até a borda */
  padding:8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
  color:#e6e6e6; font-family:inherit;
  overflow:visible;
}
/* Estende o #1b1b1b abaixo da barra (vão da toolbar, rubber-band, home indicator). */
html body.template-product .sic-barra::after{
  content:""; position:absolute; left:0; right:0; top:100%;
  height:100vh; height:100dvh;
  background:#1b1b1b; pointer-events:none; z-index:-1;
}
html body.template-product .sic-barra *{box-sizing:border-box}
html body.template-product .sic-barra__inner{
  display:flex; flex-direction:column; align-items:stretch; gap:6px;
  width:100%; padding:0 10px; margin:0;
}
html body.template-product .sic-barra__thumb{display:none}
html body.template-product .sic-barra__name{display:none}
html body.template-product .sic-barra__info{display:block; width:100%}
html body.template-product .sic-barra__prices{
  display:flex; align-items:baseline; justify-content:center; gap:8px;
  width:100%;
}
html body.template-product .sic-barra__now{
  color:#329e66; font-size:18px; font-weight:600; line-height:22px;
  letter-spacing:-.36px; font-variant-numeric:tabular-nums;
}
html body.template-product .sic-barra__was{
  color:#8f8f8f; font-size:13px; font-weight:400; line-height:22px;
  letter-spacing:.28px; text-decoration:line-through; font-variant-numeric:tabular-nums;
}
html body.template-product .sic-barra__was:empty{display:none}
html body.template-product .sic-barra__cta,
html body.template-product button.sic-barra__cta{
  display:flex; align-items:center; justify-content:center; gap:6px;
  width:100%; appearance:none; -webkit-appearance:none; cursor:pointer;
  background:#3cbd7a; color:#fff; border:0;
  border-radius:8px; padding:12px 16px;
  font-family:inherit; font-size:14px; font-weight:600; line-height:normal;
  letter-spacing:.28px; text-transform:none; box-shadow:none;
  min-height:48px;
}
html body.template-product .sic-barra__cta:hover{filter:brightness(1.04)}
html body.template-product .sic-barra__cta:disabled{opacity:.55; cursor:default; filter:none}
html body.template-product .sic-barra[hidden]{display:none !important}

/* Esconde seletor nativo +/- e o Comprar original; permanecem no DOM (o .sic-qtd
   seta .js-quantity-input e a barra clica .js-addtocart). */
html body.template-product #product_form .js-form-quantity-container,
html body.template-product #product_form .cart-button-container{
  display:none !important;
}
html body.template-product #product_form > .grid.mb-4:has(.js-form-quantity-container),
html body.template-product #product_form > .grid.mb-4:has(.cart-button-container){
  margin-bottom:0 !important; min-height:0 !important;
}


/* "Consulte-nos pelo WhatsApp" do formulário: some em todas as larguras.
   O flutuante .btn-whatsapp permanece (só é repositionado acima da barra). */
html body.template-product #product_form .btn-whatsapp-product,
html body.template-product .product-info .btn-whatsapp-product,
html body.template-product a.btn-whatsapp-product{
  display:none !important;
}
/* WhatsApp flutuante: sobe acima da barra (na Prohall ele encosta na faixa de preço). */
html body.template-product .btn-whatsapp{
  bottom: calc(var(--sic-barra-h) + 12px + var(--sic-barra-inset, 0px) + env(safe-area-inset-bottom, 0px)) !important;
  z-index:9991;
}
/* Cookie / aviso fixo do tema: também sobe, para não cobrir a barra. */
html body.template-product .notification-fixed-bottom,
html body.template-product .js-notification-fixed-bottom{
  bottom: calc(var(--sic-barra-h) + var(--sic-barra-inset, 0px) + env(safe-area-inset-bottom, 0px)) !important;
  z-index:9992;
}

@media (min-width:768px){
  html body.template-product{ --sic-barra-h: 79px; }
  html body.template-product .sic-barra{ padding:12px 0; }
  html body.template-product .sic-barra__inner{
    flex-direction:row; align-items:center; gap:18px; padding:0 40px;
  }
  html body.template-product .sic-barra__thumb{
    display:block; flex:0 0 54px; width:54px; height:54px; border-radius:8px;
    overflow:hidden; background:#121212;
  }
  html body.template-product .sic-barra__thumb img{
    width:54px; height:54px; object-fit:contain; display:block; background:#121212;
  }
  html body.template-product .sic-barra__info{flex:1 1 auto; min-width:0}
  html body.template-product .sic-barra__name{
    display:block; color:#f2f2f2; font-size:15px; font-weight:500; line-height:1.25;
    letter-spacing:.28px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
  }
  html body.template-product .sic-barra__prices{
    justify-content:flex-start; gap:10px; margin-top:2px;
  }
  html body.template-product .sic-barra__now{font-size:19px; letter-spacing:-.38px}
  html body.template-product .sic-barra__cta,
  html body.template-product button.sic-barra__cta{
    width:305px; flex:0 0 305px; padding:14px 26px; font-size:16px;
    letter-spacing:.64px; min-height:53px; gap:10px;
  }
}
