<!-- SALES POP Futbol360Academia - "El Camino al Futbol Profesional" -->
<style>
.salespop-wrapper {
position: fixed;
left: 1rem;
bottom: 1rem;
z-index: 9999;
pointer-events: none;
font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, sans-serif;
}
.salespop {
display: flex;
align-items: center;
gap: .75rem;
background: #0d1117;
color: #fff;
border-radius: 14px;
padding: .8rem 1rem;
box-shadow: 0 12px 30px rgba(0,0,0,.25);
transform: translateY(120%);
opacity: 0;
transition: transform .45s ease, opacity .45s ease, box-shadow .3s ease;
pointer-events: auto;
max-width: min(92vw, 360px);
}
.salespop.is-visible {
transform: translateY(0);
opacity: 1;
}
.salespop:hover { box-shadow: 0 16px 40px rgba(0,0,0,.34); }
.salespop-avatar {
width: 42px; height: 42px; border-radius: 50%;
background: #10b981; display: grid; place-items: center;
font-weight: 700; color: #071b0c;
}
.salespop-body { line-height: 1.25 }
.salespop-title { font-size: .95rem; font-weight: 700; margin-bottom: .15rem; }
.salespop-meta { font-size: .8rem; opacity: .9 }
/* BOTÓN CON VIBRACIÓN SUAVE */
.salespop-cta {
margin-left: auto;
font-size: .78rem; font-weight: 700; padding: .4rem .6rem;
background: #22c55e; color: #071b0c; border-radius: 10px;
text-decoration: none;
transition: background .2s ease;
animation: softPulse 2.2s ease-in-out infinite;
}
.salespop-cta:hover { background:#16a34a; }
@keyframes softPulse {
0%, 100% { transform: scale(1); box-shadow: 0 0 0 0 rgba(34,197,94,0.4); }
50% { transform: scale(1.04); box-shadow: 0 0 10px 4px rgba(34,197,94,0.15); }
}
@media (max-width: 360px){
.salespop { max-width: 92vw; }
}
</style>
<div class="salespop-wrapper" aria-live="polite" aria-atomic="true"></div>
<script>
(() => {
const CONFIG = {
productName: "El Camino al Futbol Profesional",
ctaText: "Descargar ahora",
ctaLink: "https://2ruidj-me.myshopify.com/cart/45437284122814:1",
minDelay: 9000,
maxDelay: 18000,
displayTime: 5200,
maxShowsPerSession: 12,
showOnIdleMs: 2500,
randomizeOrder: true,
useDemoSeed: true,
};
const demoEvents = [
{ name: "María", city: "Mendoza", action: "compró" },
{ name: "Luciano", city: "Rosario", action: "compró" },
{ name: "Valentina", city: "Córdoba", action: "compró" },
{ name: "Franco", city: "Buenos Aires", action: "compró" },
{ name: "Lautaro", city: "Mar del Plata", action: "compró" },
{ name: "Sofía", city: "Comodoro Rivadavia", action: "compró" },
{ name: "Ignacio", city: "Salta", action: "compró" },
{ name: "Camila", city: "Santa Fe", action: "compró" },
{ name: "Julieta", city: "Tucumán", action: "compró" },
{ name: "Tomás", city: "Neuquén", action: "compró" }
];
const wrap = document.querySelector(".salespop-wrapper");
if (!wrap) return;
const SKEY = "salespop_shown_count";
const shownCount = () => parseInt(sessionStorage.getItem(SKEY) || "0", 10);
const bumpShown = () => sessionStorage.setItem(SKEY, String(shownCount() + 1));
let eventsQueue = [...demoEvents];
if (CONFIG.randomizeOrder) {
for (let i = eventsQueue.length - 1; i > 0; i--) {
const j = Math.floor(Math.random() * (i + 1));
[eventsQueue[i], eventsQueue[j]] = [eventsQueue[j], eventsQueue[i]];
}
}
const pageVisible = () => !document.hidden;
function avatarInitials(name = "") {
const parts = name.trim().split(/\s+/);
return ((parts[0]?.[0] || "") + (parts[1]?.[0] || "")).toUpperCase() || "OK";
}
function buildPop(evt) {
const pop = document.createElement("div");
pop.className = "salespop";
pop.innerHTML = `
<div class="salespop-avatar">${avatarInitials(evt.name)}</div>
<div class="salespop-body">
<div class="salespop-title">${evt.name} de ${evt.city}</div>
<div class="salespop-meta">
${evt.action} <strong>${CONFIG.productName}</strong> hace ${Math.floor(Math.random() * 10) + 2} min
</div>
</div>
<a class="salespop-cta" href="${CONFIG.ctaLink}" rel="nofollow">${CONFIG.ctaText}</a>
`;
return pop;
}
function sleep(ms){ return new Promise(r => setTimeout(r, ms)); }
function rand(min, max){ return Math.floor(Math.random()*(max-min+1))+min; }
async function cycle() {
if (shownCount() >= CONFIG.maxShowsPerSession) return;
if (eventsQueue.length === 0) eventsQueue = [...demoEvents];
const evt = eventsQueue.shift();
const el = buildPop(evt);
wrap.appendChild(el);
requestAnimationFrame(() => el.classList.add("is-visible"));
bumpShown();
await sleep(CONFIG.displayTime);
el.classList.remove("is-visible");
await sleep(400);
el.remove();
await sleep(rand(CONFIG.minDelay, CONFIG.maxDelay));
if (pageVisible()) cycle();
}
setTimeout(() => { if (pageVisible()) cycle(); }, CONFIG.showOnIdleMs);
})();
</script>