
// ═══════════════════════════════════════════════════
//  components.jsx — Navbar · Hero · Services
// ═══════════════════════════════════════════════════
const { useState, useEffect, useRef } = React;

/* ── Shared Hooks ─────────────────────────────── */
const useInView = (threshold = 0.15) => {
  const ref = useRef(null);
  const [inView, setInView] = useState(false);
  useEffect(() => {
    const obs = new IntersectionObserver(([e]) => { if (e.isIntersecting) setInView(true); }, { threshold });
    if (ref.current) obs.observe(ref.current);
    return () => obs.disconnect();
  }, []);
  return [ref, inView];
};

const useCounter = (target, active, duration = 2000) => {
  const [val, setVal] = useState(0);
  useEffect(() => {
    if (!active) return;
    let n = 0; const step = target / (duration / 16);
    const t = setInterval(() => { n += step; if (n >= target) { setVal(target); clearInterval(t); } else setVal(Math.floor(n)); }, 16);
    return () => clearInterval(t);
  }, [active, target]);
  return val;
};

/* ── Cursor Glow ──────────────────────────────── */
const CursorGlow = () => {
  const pos = useRef({ x: -200, y: -200 });
  const dotRef = useRef(null);
  useEffect(() => {
    const move = (e) => {
      pos.current = { x: e.clientX, y: e.clientY };
      if (dotRef.current) {
        dotRef.current.style.transform = `translate(${e.clientX - 6}px, ${e.clientY - 6}px)`;
      }
    };
    window.addEventListener('mousemove', move);
    return () => window.removeEventListener('mousemove', move);
  }, []);
  return (
    <div ref={dotRef} style={{
      position: 'fixed', top: 0, left: 0, width: '12px', height: '12px', borderRadius: '50%',
      background: '#0ea5e9', pointerEvents: 'none', zIndex: 9999, mixBlendMode: 'screen',
      boxShadow: '0 0 20px 4px rgba(14,165,233,0.5)', transition: 'transform 0.06s linear',
    }} />
  );
};

/* ── Navbar ───────────────────────────────────── */
const Navbar = ({ accent }) => {
  const [scrolled, setScrolled] = useState(false);
  const [open, setOpen] = useState(false);
  const ac = accent || '#0ea5e9';
  useEffect(() => {
    const fn = () => setScrolled(window.scrollY > 60);
    window.addEventListener('scroll', fn);
    return () => window.removeEventListener('scroll', fn);
  }, []);
  const go = (id) => { document.querySelector(id)?.scrollIntoView({ behavior: 'smooth' }); setOpen(false); };
  const links = [['Servicios','#servicios'],['Proceso','#proceso'],['Testimonios','#testimonios'],['FAQ','#faq']];
  const navBg = scrolled ? 'rgba(7,11,20,0.92)' : 'transparent';
  return (
    <nav style={{ position:'fixed', top:0, left:0, right:0, zIndex:100, padding:'1rem 2rem', display:'flex', alignItems:'center', justifyContent:'space-between', background:navBg, backdropFilter:scrolled?'blur(22px)':'none', borderBottom:scrolled?'1px solid rgba(255,255,255,0.05)':'1px solid transparent', transition:'all 0.4s ease' }}>
      <div style={{ display:'flex', alignItems:'center', gap:'0.6rem', cursor:'pointer' }} onClick={() => go('#hero')}>
        <img src="uploads/logo-1779233943449.png" alt="Soluciones Web" style={{ height:'38px', width:'auto' }} />
        <span style={{ color:'#f0f6ff', fontFamily:'Space Grotesk,sans-serif', fontWeight:700, fontSize:'1rem', letterSpacing:'-0.02em' }}>
          Soluciones<span style={{ color:ac }}>Web</span>
        </span>
      </div>
      <div className="nav-links" style={{ display:'flex', gap:'2.5rem', alignItems:'center' }}>
        {links.map(([l,h]) => (
          <button key={h} onClick={() => go(h)} style={{ background:'none', border:'none', color:'rgba(240,246,255,0.62)', fontFamily:'DM Sans,sans-serif', fontSize:'0.93rem', cursor:'pointer', transition:'color 0.2s', padding:0 }}
            onMouseEnter={e => e.target.style.color = ac} onMouseLeave={e => e.target.style.color = 'rgba(240,246,255,0.62)'}>{l}</button>
        ))}
        <button onClick={() => window.open('https://wa.me/50255580173','_blank')} style={{ background:`linear-gradient(135deg,${ac},#4f46e5)`, border:'none', color:'#fff', padding:'0.58rem 1.4rem', borderRadius:'8px', fontFamily:'Space Grotesk,sans-serif', fontWeight:600, fontSize:'0.88rem', cursor:'pointer', transition:'opacity 0.2s,transform 0.2s', letterSpacing:'0.01em' }}
          onMouseEnter={e=>{e.currentTarget.style.opacity='0.82';e.currentTarget.style.transform='translateY(-1px)';}} onMouseLeave={e=>{e.currentTarget.style.opacity='1';e.currentTarget.style.transform='none';}}>
          Contactar
        </button>
      </div>
      <button onClick={() => setOpen(!open)} className="nav-burger" style={{ background:'none', border:'none', cursor:'pointer', flexDirection:'column', gap:'5px', padding:'4px' }}>
        {[0,1,2].map(i=><span key={i} style={{ display:'block', width:'22px', height:'2px', background:ac, transform:open?(i===0?'rotate(45deg) translate(5px,5px)':i===2?'rotate(-45deg) translate(5px,-5px)':'scaleX(0)'):'none', transition:'transform 0.3s' }} />)}
      </button>
      {open && (
        <div style={{ position:'absolute', top:'100%', left:0, right:0, background:'rgba(7,11,20,0.98)', backdropFilter:'blur(20px)', borderBottom:'1px solid rgba(255,255,255,0.06)', padding:'1.5rem 2rem', display:'flex', flexDirection:'column', gap:'1.25rem' }}>
          {links.map(([l,h])=><button key={h} onClick={()=>go(h)} style={{ background:'none', border:'none', color:'rgba(240,246,255,0.75)', fontFamily:'DM Sans,sans-serif', fontSize:'1.05rem', cursor:'pointer', textAlign:'left', padding:0 }}>{l}</button>)}
          <button onClick={()=>window.open('https://wa.me/50255580173','_blank')} style={{ background:`linear-gradient(135deg,${ac},#4f46e5)`, border:'none', color:'#fff', padding:'0.75rem 1.5rem', borderRadius:'8px', fontFamily:'Space Grotesk,sans-serif', fontWeight:600, fontSize:'0.95rem', cursor:'pointer', alignSelf:'flex-start' }}>WhatsApp</button>
        </div>
      )}
    </nav>
  );
};

/* ── Hero ─────────────────────────────────────── */
const HeroSection = ({ accent }) => {
  const ac = accent || '#0ea5e9';
  const words = ['impactan','convierten','destacan','venden'];
  const [wi, setWi] = useState(0);
  const [vis, setVis] = useState(true);
  const [ref, inView] = useInView(0.1);
  const c1 = useCounter(15, inView);
  const c3 = useCounter(100, inView);

  useEffect(() => {
    const iv = setInterval(() => {
      setVis(false);
      setTimeout(() => { setWi(i => (i+1) % words.length); setVis(true); }, 380);
    }, 2600);
    return () => clearInterval(iv);
  }, []);

  const btnPrimary = { display:'inline-flex', alignItems:'center', gap:'0.6rem', background:`linear-gradient(135deg,${ac},#4f46e5)`, border:'none', color:'#fff', padding:'0.95rem 2rem', borderRadius:'10px', fontFamily:'Space Grotesk,sans-serif', fontWeight:700, fontSize:'1rem', cursor:'pointer', boxShadow:`0 8px 32px ${ac}45`, transition:'transform 0.2s,box-shadow 0.2s', letterSpacing:'0.01em' };
  const btnSecondary = { background:'transparent', border:`1px solid rgba(255,255,255,0.12)`, color:'#f0f6ff', padding:'0.95rem 2rem', borderRadius:'10px', fontFamily:'Space Grotesk,sans-serif', fontWeight:600, fontSize:'1rem', cursor:'pointer', transition:'border-color 0.2s,background 0.2s' };

  return (
    <section id="hero" ref={ref} style={{ minHeight:'100vh', display:'flex', alignItems:'center', padding:'9rem 2rem 5rem', position:'relative', overflow:'hidden' }}>
      {/* dot grid */}
      <div style={{ position:'absolute', inset:0, backgroundImage:`radial-gradient(circle,${ac}22 1.2px,transparent 1.2px)`, backgroundSize:'30px 30px', maskImage:'radial-gradient(ellipse 70% 80% at 50% 50%,black,transparent)', WebkitMaskImage:'radial-gradient(ellipse 70% 80% at 50% 50%,black,transparent)', pointerEvents:'none' }} />
      {/* skewed bg shape echoing logo */}
      <div style={{ position:'absolute', top:0, right:'-8%', width:'52%', height:'100%', background:`linear-gradient(160deg,${ac}07 0%,#4f46e508 100%)`, clipPath:'polygon(12% 0,100% 0,88% 100%,0 100%)', pointerEvents:'none' }} />
      {/* glow */}
      <div style={{ position:'absolute', top:'15%', right:'20%', width:'500px', height:'500px', background:`radial-gradient(circle,${ac}18,transparent 65%)`, pointerEvents:'none' }} />

      <div className="hero-grid" style={{ maxWidth:'1200px', margin:'0 auto', width:'100%', display:'grid', gridTemplateColumns:'1fr 1fr', gap:'3rem', alignItems:'center' }}>
        {/* Left */}
        <div style={{ position:'relative', zIndex:2 }}>
          <div style={{ display:'inline-flex', alignItems:'center', gap:'0.5rem', padding:'0.38rem 0.9rem', borderRadius:'100px', border:`1px solid ${ac}40`, background:`${ac}0D`, marginBottom:'1.6rem' }}>
            <span style={{ width:'7px', height:'7px', borderRadius:'50%', background:ac, boxShadow:`0 0 10px ${ac}`, display:'inline-block' }} />
            <span style={{ color:ac, fontFamily:'DM Sans,sans-serif', fontSize:'0.82rem', letterSpacing:'0.06em', fontWeight:600 }}>Desarrollo Web · Guatemala</span>
          </div>
          <h1 style={{ fontFamily:'Space Grotesk,sans-serif', fontSize:'clamp(2.8rem,5vw,4.6rem)', fontWeight:800, color:'#f0f6ff', lineHeight:1.06, letterSpacing:'-0.03em', marginBottom:'1.4rem' }}>
            Sitios web<br />que{' '}
            <span style={{ color:ac, display:'inline-block', opacity:vis?1:0, transform:vis?'translateY(0)':'translateY(14px)', transition:'opacity 0.32s ease,transform 0.32s ease', minWidth:'200px' }}>
              {words[wi]}
            </span>
          </h1>
          <p style={{ fontFamily:'DM Sans,sans-serif', fontSize:'1.05rem', color:'rgba(240,246,255,0.55)', lineHeight:1.75, marginBottom:'2.5rem', maxWidth:'460px' }}>
            Transformamos tu negocio con tecnología a medida: páginas web, tiendas online, bots de WhatsApp y automatizaciones que trabajan por ti las 24 horas.
          </p>
          <div style={{ display:'flex', gap:'1rem', flexWrap:'wrap', marginBottom:'3.5rem' }}>
            <button style={btnPrimary} onClick={() => window.open('https://wa.me/50255580173?text=Hola%2C%20me%20interesa%20conocer%20m%C3%A1s%20sobre%20sus%20servicios','_blank')}
              onMouseEnter={e=>{e.currentTarget.style.transform='translateY(-2px)';e.currentTarget.style.boxShadow=`0 16px 48px ${ac}55`;}} onMouseLeave={e=>{e.currentTarget.style.transform='none';e.currentTarget.style.boxShadow=`0 8px 32px ${ac}45`;}}>
              <svg width="19" height="19" viewBox="0 0 24 24" fill="currentColor"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51a5.526 5.526 0 00-.57-.01c-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>
              Hablar por WhatsApp
            </button>
            <button style={btnSecondary} onClick={() => document.querySelector('#servicios')?.scrollIntoView({behavior:'smooth'})}
              onMouseEnter={e=>{e.currentTarget.style.borderColor=`${ac}60`;e.currentTarget.style.background=`${ac}08`;}} onMouseLeave={e=>{e.currentTarget.style.borderColor='rgba(255,255,255,0.12)';e.currentTarget.style.background='transparent';}}>
              Ver servicios
            </button>
          </div>
          <div style={{ display:'flex', gap:'2.5rem', flexWrap:'wrap' }}>
            {[{v:c1,s:'+',l:'Proyectos'},{v:'<24',s:'h',l:'Respuesta'},{v:c3,s:'%',l:'Satisfacción'}].map(st => (
              <div key={st.l}>
                <div style={{ fontFamily:'Space Grotesk,sans-serif', fontWeight:800, fontSize:'2rem', color:'#f0f6ff', letterSpacing:'-0.02em', lineHeight:1 }}>{st.v}{st.s}</div>
                <div style={{ fontFamily:'DM Sans,sans-serif', fontSize:'0.8rem', color:'rgba(240,246,255,0.38)', marginTop:'0.2rem' }}>{st.l}</div>
              </div>
            ))}
          </div>
        </div>

        {/* Right – browser mockup */}
        <div className="hero-visual" style={{ position:'relative', display:'flex', justifyContent:'center', alignItems:'center' }}>
          <div style={{ width:'100%', maxWidth:'460px', background:'rgba(10,17,30,0.92)', borderRadius:'16px', border:'1px solid rgba(255,255,255,0.07)', boxShadow:'0 40px 100px rgba(0,0,0,0.55)', overflow:'hidden' }}>
            {/* browser bar */}
            <div style={{ padding:'0.7rem 1rem', background:'rgba(7,11,20,0.8)', display:'flex', alignItems:'center', gap:'0.6rem', borderBottom:'1px solid rgba(255,255,255,0.04)' }}>
              <div style={{ display:'flex', gap:'5px' }}>
                {['#ff5f57','#febc2e','#28c840'].map(c=><div key={c} style={{ width:'9px', height:'9px', borderRadius:'50%', background:c, opacity:.75 }} />)}
              </div>
              <div style={{ flex:1, background:'rgba(255,255,255,0.04)', borderRadius:'5px', padding:'0.22rem 0.75rem' }}>
                <span style={{ fontFamily:'DM Sans,sans-serif', fontSize:'0.68rem', color:'rgba(240,246,255,0.28)' }}>solucionesweb.gt</span>
              </div>
            </div>
            {/* content preview */}
            <div style={{ padding:'1.5rem 1.5rem 2rem' }}>
              <div style={{ display:'flex', alignItems:'center', gap:'0.5rem', marginBottom:'1.2rem' }}>
                <div style={{ width:'22px', height:'22px', borderRadius:'4px', background:`${ac}30` }} />
                <div style={{ height:'6px', background:`linear-gradient(90deg,${ac},#4f46e5)`, borderRadius:'3px', width:'40%' }} />
              </div>
              <div style={{ height:'3.5px', background:'rgba(255,255,255,0.07)', borderRadius:'2px', width:'90%', marginBottom:'0.45rem' }} />
              <div style={{ height:'3.5px', background:'rgba(255,255,255,0.07)', borderRadius:'2px', width:'70%', marginBottom:'0.45rem' }} />
              <div style={{ height:'3.5px', background:'rgba(255,255,255,0.04)', borderRadius:'2px', width:'55%', marginBottom:'1.5rem' }} />
              <div style={{ display:'grid', gridTemplateColumns:'1fr 1fr 1fr', gap:'0.6rem', marginBottom:'1.5rem' }}>
                {[`${ac}18`,`#4f46e515`,`${ac}10`].map((bg,i) => (
                  <div key={i} style={{ height:'68px', background:bg, borderRadius:'10px', border:`1px solid ${ac}12` }} />
                ))}
              </div>
              <div style={{ height:'28px', background:`linear-gradient(90deg,${ac},#4f46e5)`, borderRadius:'6px', width:'45%', opacity:0.85 }} />
            </div>
          </div>

          {/* Float card: WhatsApp bot */}
          <div className="float-card-1" style={{ position:'absolute', bottom:'-1.5rem', left:'-2rem', background:'rgba(9,16,28,0.96)', border:`1px solid ${ac}28`, borderRadius:'14px', padding:'1rem 1.2rem', backdropFilter:'blur(18px)', boxShadow:'0 20px 50px rgba(0,0,0,0.5)', minWidth:'175px' }}>
            <div style={{ display:'flex', alignItems:'center', gap:'0.5rem', marginBottom:'0.75rem' }}>
              <div style={{ width:'26px', height:'26px', borderRadius:'50%', background:'#25d366', display:'flex', alignItems:'center', justifyContent:'center', flexShrink:0 }}>
                <svg width="13" height="13" viewBox="0 0 24 24" fill="white"><path d="M17.472 14.382c-.297-.149-1.758-.867-2.03-.967-.273-.099-.471-.148-.67.15-.197.297-.767.966-.94 1.164-.173.199-.347.223-.644.075-.297-.15-1.255-.463-2.39-1.475-.883-.788-1.48-1.761-1.653-2.059-.173-.297-.018-.458.13-.606.134-.133.298-.347.446-.52.149-.174.198-.298.298-.497.099-.198.05-.371-.025-.52-.075-.149-.669-1.612-.916-2.207-.242-.579-.487-.5-.669-.51a5.526 5.526 0 00-.57-.01c-.198 0-.52.074-.792.372-.272.297-1.04 1.016-1.04 2.479 0 1.462 1.065 2.875 1.213 3.074.149.198 2.096 3.2 5.077 4.487.709.306 1.262.489 1.694.625.712.227 1.36.195 1.871.118.571-.085 1.758-.719 2.006-1.413.248-.694.248-1.289.173-1.413-.074-.124-.272-.198-.57-.347m-5.421 7.403h-.004a9.87 9.87 0 01-5.031-1.378l-.361-.214-3.741.982.998-3.648-.235-.374a9.86 9.86 0 01-1.51-5.26c.001-5.45 4.436-9.884 9.888-9.884 2.64 0 5.122 1.03 6.988 2.898a9.825 9.825 0 012.893 6.994c-.003 5.45-4.437 9.884-9.885 9.884m8.413-18.297A11.815 11.815 0 0012.05 0C5.495 0 .16 5.335.157 11.892c0 2.096.547 4.142 1.588 5.945L.057 24l6.305-1.654a11.882 11.882 0 005.683 1.448h.005c6.554 0 11.89-5.335 11.893-11.893a11.821 11.821 0 00-3.48-8.413z"/></svg>
              </div>
              <span style={{ fontFamily:'Space Grotesk,sans-serif', fontWeight:600, fontSize:'0.78rem', color:'#f0f6ff' }}>Bot de WhatsApp</span>
            </div>
            <div style={{ display:'flex', flexDirection:'column', gap:'0.35rem' }}>
              <div style={{ background:'rgba(37,211,102,0.1)', border:'1px solid rgba(37,211,102,0.18)', borderRadius:'7px 7px 7px 2px', padding:'0.32rem 0.55rem', fontSize:'0.68rem', color:'rgba(240,246,255,0.65)', fontFamily:'DM Sans,sans-serif', maxWidth:'125px' }}>
                Hola, ¿en qué te ayudo?
              </div>
              <div style={{ background:`${ac}15`, border:`1px solid ${ac}20`, borderRadius:'7px 7px 2px 7px', padding:'0.32rem 0.55rem', fontSize:'0.68rem', color:'rgba(240,246,255,0.65)', fontFamily:'DM Sans,sans-serif', alignSelf:'flex-end', maxWidth:'120px' }}>
                Ver catálogo
              </div>
            </div>
          </div>

          {/* Float card: sales */}
          <div className="float-card-2" style={{ position:'absolute', top:'-1.5rem', right:'-1.8rem', background:'rgba(9,16,28,0.96)', border:'1px solid rgba(79,70,229,0.28)', borderRadius:'14px', padding:'0.9rem 1.15rem', backdropFilter:'blur(18px)', boxShadow:'0 20px 50px rgba(0,0,0,0.5)' }}>
            <div style={{ fontFamily:'DM Sans,sans-serif', fontSize:'0.68rem', color:'rgba(240,246,255,0.35)', marginBottom:'0.3rem' }}>Ventas hoy</div>
            <div style={{ fontFamily:'Space Grotesk,sans-serif', fontWeight:800, fontSize:'1.4rem', color:'#f0f6ff', letterSpacing:'-0.02em', lineHeight:1 }}>Q 4,280</div>
            <div style={{ display:'flex', alignItems:'center', gap:'0.3rem', marginTop:'0.35rem' }}>
              <span style={{ color:'#22c55e', fontSize:'0.72rem', fontFamily:'DM Sans,sans-serif', fontWeight:600 }}>+23%</span>
              <span style={{ color:'rgba(240,246,255,0.28)', fontSize:'0.68rem', fontFamily:'DM Sans,sans-serif' }}>vs. ayer</span>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
};

/* ── Service Card ─────────────────────────────── */
const ServiceCard = ({ service, delay, inView }) => {
  const [hov, setHov] = useState(false);
  const c = service.color;
  return (
    <div onMouseEnter={() => setHov(true)} onMouseLeave={() => setHov(false)} style={{
      background: hov ? 'rgba(11,19,34,0.97)' : 'rgba(11,18,32,0.72)',
      border: `1px solid ${hov ? c + '45' : 'rgba(255,255,255,0.06)'}`,
      borderRadius:'16px', padding:'2rem',
      transition:'all 0.35s ease',
      boxShadow: hov ? `0 24px 64px ${c}18, 0 0 0 1px ${c}12` : 'none',
      opacity: inView ? 1 : 0, transform: inView ? (hov ? 'translateY(-6px)' : 'none') : 'translateY(32px)',
      transitionDelay: `${delay}s`, cursor:'default',
    }}>
      <div style={{ display:'flex', justifyContent:'space-between', alignItems:'flex-start', marginBottom:'1.5rem' }}>
        <span style={{ fontFamily:'Space Grotesk,sans-serif', fontWeight:800, fontSize:'2.8rem', color:c+'1A', letterSpacing:'-0.04em', lineHeight:1 }}>{service.number}</span>
        <div style={{ width:'38px', height:'4px', background:c, borderRadius:'2px', boxShadow:`0 0 16px ${c}90`, marginTop:'0.5rem' }} />
      </div>
      <h3 style={{ fontFamily:'Space Grotesk,sans-serif', fontWeight:700, fontSize:'1.45rem', color:'#f0f6ff', letterSpacing:'-0.02em', marginBottom:'0.25rem' }}>{service.title}</h3>
      <p style={{ fontFamily:'DM Sans,sans-serif', fontSize:'0.75rem', color:c, fontWeight:600, letterSpacing:'0.06em', textTransform:'uppercase', marginBottom:'0.9rem' }}>{service.subtitle}</p>
      <p style={{ fontFamily:'DM Sans,sans-serif', fontSize:'0.93rem', color:'rgba(240,246,255,0.52)', lineHeight:1.75, marginBottom:'1.5rem' }}>{service.description}</p>
      <div style={{ display:'flex', flexDirection:'column', gap:'0.45rem' }}>
        {service.features.map(f => (
          <div key={f} style={{ display:'flex', alignItems:'center', gap:'0.6rem' }}>
            <div style={{ width:'5px', height:'5px', borderRadius:'50%', background:c, flexShrink:0, boxShadow:`0 0 6px ${c}` }} />
            <span style={{ fontFamily:'DM Sans,sans-serif', fontSize:'0.88rem', color:'rgba(240,246,255,0.65)' }}>{f}</span>
          </div>
        ))}
      </div>
    </div>
  );
};

/* ── Services Section ─────────────────────────── */
const ServicesSection = ({ accent }) => {
  const ac = accent || '#0ea5e9';
  const [ref, inView] = useInView(0.1);
  const main = [
    { number:'01', title:'Páginas Web', subtitle:'Landing pages & sitios corporativos', description:'Diseños únicos, rápidos y optimizados para SEO. Tu presencia digital profesional que realmente convierte visitantes en clientes.', features:['Diseño 100% a medida','SEO y velocidad optimizados','Certificado SSL incluido','Responsive en todos los dispositivos'], color:ac },
    { number:'02', title:'E-commerce', subtitle:'Tu tienda online que vende sola', description:'Tiendas online completas con gestión de productos, carrito, pagos en línea y panel de administración intuitivo.', features:['Pagos en línea seguros','Gestión de inventario','Panel de administración','Reportes de ventas'], color:'#4f46e5' },
    { number:'03', title:'Bots de WhatsApp', subtitle:'Atención al cliente automatizada 24/7', description:'Respuestas automáticas, captura de leads, menús interactivos y conexión con tus sistemas para atender a tus clientes sin parar.', features:['Respuestas 24/7','Captura de prospectos','Menús interactivos','Integración con tu negocio'], color:'#22c55e' },
  ];
  const extras = ['Sistemas de inventario','Sistemas de reservas','Automatizaciones','Marketing digital'];
  return (
    <section id="servicios" ref={ref} style={{ padding:'8rem 2rem 7rem', position:'relative', background:'rgba(5,9,18,0.4)' }}>
      <div style={{ maxWidth:'1200px', margin:'0 auto' }}>
        <div style={{ marginBottom:'4rem', opacity:inView?1:0, transform:inView?'none':'translateY(28px)', transition:'all 0.7s ease' }}>
          <div style={{ display:'flex', alignItems:'center', gap:'0.85rem', marginBottom:'0.9rem' }}>
            <div style={{ height:'2px', width:'36px', background:`linear-gradient(90deg,transparent,${ac})` }} />
            <span style={{ fontFamily:'DM Sans,sans-serif', fontSize:'0.8rem', letterSpacing:'0.14em', textTransform:'uppercase', color:ac, fontWeight:600 }}>Servicios</span>
          </div>
          <h2 style={{ fontFamily:'Space Grotesk,sans-serif', fontWeight:800, fontSize:'clamp(2rem,4vw,3.2rem)', color:'#f0f6ff', letterSpacing:'-0.03em', lineHeight:1.1 }}>
            Todo lo que tu negocio<br /><span style={{ color:ac }}>necesita en un solo lugar</span>
          </h2>
        </div>
        <div style={{ display:'grid', gridTemplateColumns:'repeat(auto-fit,minmax(300px,1fr))', gap:'1.25rem', marginBottom:'3rem' }}>
          {main.map((s,i) => <ServiceCard key={s.number} service={s} delay={i*0.15} inView={inView} />)}
        </div>
        <div style={{ opacity:inView?1:0, transform:inView?'none':'translateY(18px)', transition:'all 0.7s ease 0.55s' }}>
          <p style={{ fontFamily:'DM Sans,sans-serif', fontSize:'0.78rem', color:'rgba(240,246,255,0.32)', letterSpacing:'0.1em', textTransform:'uppercase', marginBottom:'0.9rem' }}>También ofrecemos</p>
          <div style={{ display:'flex', gap:'0.65rem', flexWrap:'wrap' }}>
            {extras.map(e => <div key={e} style={{ padding:'0.45rem 1.1rem', borderRadius:'100px', border:`1px solid ${ac}22`, fontFamily:'DM Sans,sans-serif', fontSize:'0.88rem', color:'rgba(240,246,255,0.5)', background:`${ac}05` }}>{e}</div>)}
          </div>
        </div>
      </div>
    </section>
  );
};

Object.assign(window, { Navbar, HeroSection, ServicesSection, ServiceCard, CursorGlow, useInView, useCounter });
