// Aplica padrões SEO e contedo para pginas de produto e utilitrio de fallback
(function(){
try{
var path = location.pathname.replace(/\/+/g,'/');
var m = path.match(/\/produtos\/([a-z0-9-]+)-omnilife\/?$/i);
var slug = '';
if(m){ slug = m[1]; }
else {
var fn = path.split('/').pop() || '';
slug = (fn.replace(/\.html?$/i,'')||'').toLowerCase();
}
if(!slug) return;
var NAMES = {
omniplus:'Omniplus', omnimix:'Omnimix', omniviu:'Omniviu', omniost:'Omniost', onecmix:'One C Mix',
kenyan:'Kenyan', starbien:'Starbien', egolife:'Egolife', fem:'Fem', homo:'Homo', uzo:'Uzo',
aqtua:'Aqtua', aoecx:'Ao CX', aoeliq:'Ao Lquido', cafelife:'Cafelife', teatino:'Teatino',
dolcevita:'Dolce Vita', fiber:'Fiber’n Plus', shake:'Shake', pmaker:'P+Maker', pump:'Pump',
magnus:'Magnus', magnussup:'Magnus Supreme', ego10:'Ego 10'
};
var product = NAMES[slug] || slug.replace(/-/g,' ').replace(/\b\w/g, s=>s.toUpperCase());
// Helper: set PAGE_TITLE and PAGE_DESCRIPTION (fallbacks)
var titleStd = product+" Omnilife Comprar, Benefcios e Como Usar";
var descStd = product+" Omnilife: o que , como tomar e benefcios. Cadastre-se para comprar com desconto e receber em casa.";
if(document.title.trim().length < 10 || /detalhes do produto/i.test(document.title)){
document.title = titleStd;
}
var md=document.querySelector('meta[name="description"]');
if(!md){ md=document.createElement('meta'); md.setAttribute('name','description'); document.head.appendChild(md); }
var mdc=md.getAttribute('content')||'';
if(mdc.trim().length < 40){ md.setAttribute('content', descStd); }
// H1
var h1=document.querySelector('h1');
if(h1){ h1.textContent = product+" Omnilife"; }
// Coluna principal
var mainCol=document.querySelector('.col-12.col-lg-7 .surface');
// Remover H2 sumrio (no teremos contedo para linkar)
try{ var oldNav=document.getElementById('prod-nav'); if(oldNav) oldNav.remove(); }catch(_e){}
// ALT do hero
var hero=document.getElementById('heroImg');
if(hero){ hero.alt = product+" Omnilife embalagem"; }
// Remover CTA para cadastro (ficou poludo)
try{ var oldCta=document.getElementById('cta-cadastro'); if(oldCta) oldCta.remove(); }catch(_e){}
// Footer (mesmo padro das pginas com seo.js)
try{
if(!document.querySelector('footer.site-foot')){
var f=document.createElement('footer'); f.className='site-foot mt-5';
f.innerHTML = '
';
document.body.appendChild(f);
}
}catch(_e){}
// Ajusta cones flutuantes para os mesmos emojis usados em produtos
try{
var wa=document.querySelector('.wa-float a'); if(wa) wa.textContent='💬';
var cart=document.querySelector('.cart-fab a#openCart'); if(cart) cart.textContent='🛒';
}catch(_e){}
// Relacionados + Blog
var suggest=document.getElementById('suggest');
if(!suggest){
var col=document.querySelector('.col-12.col-lg-4');
if(col){ var d=document.createElement('div'); d.className='surface p-3 mt-3'; d.innerHTML='Talvez goste
'; col.appendChild(d); suggest=document.getElementById('suggest'); }
}
if(suggest && suggest.children.length < 2){
var rel=[
{id:'omniplus', text:'Omniplus multinutriente', href:'omniplus.html'},
{id:'teatino', text:'Teatino ch com cromo', href:'teatino.html'},
{id:'dolcevita', text:'Dolce Vita controle de glicose', href:'dolcevita.html'}
];
suggest.innerHTML = rel.map(r=>''+r.text+' ').join('');
}
// Trust/Vantagens (mesmo visual de produtos_FINAL)
try{
if(!document.getElementById('trustBlock')){
// Injeta CSS apenas uma vez
if(!document.getElementById('trustStyles')){
var st=document.createElement('style');
st.id='trustStyles';
st.textContent = '.trust .icon{width:42px;height:42px;border-radius:50%;display:inline-flex;align-items:center;justify-content:center;background:#efe9ff;color:var(--brand);font-weight:900}';
document.head.appendChild(st);
}
var colSide=document.querySelector('.col-12.col-lg-4');
if(colSide){
var trust=document.createElement('div');
trust.className='surface p-3 mt-3 trust';
trust.id='trustBlock';
trust.innerHTML = ''
+ 'Por que comprar aqui?
'
+ ''
+ '
✓
'
+ '
Segurança em primeiro lugar
'
+ '
Pagamento com Mercado Pago e Pix. Acompanhamento via WhatsApp.
'
+ '
'
+ '
'
+ ''
+ '
✓
'
+ '
Entrega direta da Omnilife
'
+ '
Frete grátis em compras elegíveis e entrega rápida conforme região.
'
+ '
'
+ '
'
+ ''
+ '
✓
'
+ '
Suporte personalizado
'
+ '
Finalize com um consultor de confiança e tire dúvidas nutricionais.
'
+ '
'
+ '
';
// Adiciona no topo da coluna lateral
colSide.insertBefore(trust, colSide.firstChild);
}
}
}catch(_e){}
}catch(_e){}
// Normalize legacy back links to produtos list
try{
var fixBackLinks = function(){
try{
document.querySelectorAll('a[href="/produtos/"],a[href="/produtos"],a[href="/produtos/"]')
.forEach(function(a){ a.setAttribute('href','/produtos/'); });
}catch(_e){}
};
if(document.readyState==='loading'){ document.addEventListener('DOMContentLoaded', fixBackLinks); } else { fixBackLinks(); }
}catch(_e){}
// Overrides: corrigir ícones dos balões flutuantes e remover bloco de vantagens injetado por engano
try{
// Remover bloco de vantagens caso exista
var _trust=document.getElementById('trustBlock'); if(_trust) _trust.remove();
var _trustCss=document.getElementById('trustStyles'); if(_trustCss) _trustCss.remove();
// Substituir conteúdo dos botões flutuantes por SVGs do produtos_FINAL
var _wa=document.querySelector('.wa-float a');
if(_wa){
_wa.innerHTML = ''
+ ' '
+ ' ';
}
var _cart=document.querySelector('.cart-fab a#openCart');
if(_cart){
_cart.innerHTML = ''
+ ' '
+ ' '
+ ' '
+ ' ';
}
}catch(_e){}
})();