// Wapido Landing v4 — wireframe
const { useState, useEffect, useRef } = React;

const PALETTES = {
  paper: { '--paper': '#F6F1E8', '--paper-deep': '#EFE7D6' },
  white: { '--paper': '#FFFFFF', '--paper-deep': '#F4F4F2' },
  cream: { '--paper': '#FAF3E0', '--paper-deep': '#F2E9D2' },
  bone: { '--paper': '#F0EBE0', '--paper-deep': '#E6E0D2' },
  sage: { '--paper': '#EEF1E6', '--paper-deep': '#E2E7D6' }
};

// ─── Wireframe primitives ──────────────────────────────
const Mono = ({ children, style }) =>
<span style={{
  fontFamily: 'var(--mono)', letterSpacing: '0.14em',
  textTransform: 'uppercase', color: 'var(--ink-faint)', ...style, fontSize: "13px", width: "550px"
}}>{children}</span>;


// gray placeholder box w/ label — for things that aren't built yet
const Box = ({ label, height = 200, children, style }) =>
<div style={{
  border: '1.5px dashed #B8B0A0',
  background: 'rgba(0,0,0,0.025)',
  borderRadius: 8,
  minHeight: height,
  display: 'flex', alignItems: 'center', justifyContent: 'center',
  color: '#9A8E7C', fontFamily: 'var(--mono)', fontSize: 12,
  letterSpacing: '0.08em', textTransform: 'uppercase',
  padding: 24, textAlign: 'center',
  ...style
}}>
    {children || label}
  </div>;


// section label (top-left, monospaced)
const SectionLabel = ({ num, name }) =>
<div style={{
  display: 'flex', alignItems: 'center', gap: 12,
  marginBottom: 48
}}>
    <span style={{
    fontFamily: 'var(--mono)', fontSize: 11, letterSpacing: '0.16em',
    color: 'var(--ink-faint)', textTransform: 'uppercase'
  }}>
      {num} ─ {name}
    </span>
  </div>;


// section wrapper — consistent vertical rhythm
const Section = ({ id, label, num, children, minHeight = '90vh' }) =>
<section id={id} style={{
  minHeight,

  position: 'relative', padding: "140px 0px"
}}>
    <div className="stage">
      {children}
    </div>
  </section>;


// ─── NAV ──────────────────────────────────────────────
function Nav() {
  const [hidden, setHidden] = useState(false);
  const lastY = useRef(0);
  useEffect(() => {
    const onScroll = () => {
      const y = window.scrollY;
      const dy = y - lastY.current;
      if (y < 80) setHidden(false);else
      if (dy > 4) setHidden(true);else
      if (dy < -4) setHidden(false);
      lastY.current = y;
    };
    window.addEventListener('scroll', onScroll, { passive: true });
    return () => window.removeEventListener('scroll', onScroll);
  }, []);

  const linkStyle = { fontSize: 14, color: 'var(--ink-soft)' };

  return (
    <header style={{
      position: 'fixed', top: 0, left: 0, right: 0, zIndex: 50,
      background: '#FFFFFF',
      transform: hidden ? 'translateY(-100%)' : 'translateY(0)',
      transition: 'transform 0.32s cubic-bezier(0.4, 0, 0.2, 1)'
    }}>
      <div style={{
        background: 'var(--ink)',

        textAlign: 'center',
        padding: '8px 16px',
        fontFamily: 'var(--mono, ui-monospace, SFMono-Regular, monospace)',
        fontSize: 11,
        letterSpacing: '0.12em',
        textTransform: 'uppercase',
        display: 'flex',
        alignItems: 'center',
        justifyContent: 'center',
        gap: 10, backgroundColor: "rgb(67, 201, 138)", color: "rgb(0, 0, 0)"
      }}>
        <span style={{
          display: 'inline-block',
          width: 6, height: 6, borderRadius: '50%',
          background: 'var(--mint-deep, #6BBF8A)',
          boxShadow: '0 0 0 0 rgba(107,191,138,0.7)',
          animation: 'wapidoBetaPulse 2s ease-out infinite', backgroundColor: "rgb(255, 255, 255)"
        }} />
        <span>PROMO: IMPLEMENTACIÓN GRATIS PARA RESTAURANTES EN CANCÚN</span>
      </div>
      <style>{`@keyframes wapidoBetaPulse {
        0% { box-shadow: 0 0 0 0 rgba(107,191,138,0.55); }
        70% { box-shadow: 0 0 0 8px rgba(107,191,138,0); }
        100% { box-shadow: 0 0 0 0 rgba(107,191,138,0); }
      }`}</style>
      <div className="stage" style={{
        display: 'grid',
        gridTemplateColumns: '1fr auto 1fr',
        alignItems: 'center',
        padding: '14px 32px',
        gap: 24
      }}>
        <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer" style={{ display: 'flex', alignItems: 'center', justifySelf: 'start' }}>
          <img src="assets/wapido-logo.svg" alt="wapido" style={{ height: 30, display: 'block' }} />
        </a>
        <nav style={{ display: 'flex', gap: 28, alignItems: 'center', justifySelf: 'center' }}>
          <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer" style={linkStyle}>Precio</a>
          <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer" style={linkStyle}>Preguntas Frecuentes</a>
        </nav>
        <div style={{ display: 'flex', alignItems: 'center', justifySelf: 'end' }}>
          <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer" style={{
            background: 'var(--ink)', color: '#FFF',
            padding: '8px 16px', borderRadius: 12, fontSize: 13
          }}>Contáctanos</a>
        </div>
      </div>
    </header>);

}

// ─── 01 HERO ──────────────────────────────────────────
function Hero() {
  return (
    <section id="top" style={{
      paddingTop: 140, paddingBottom: 180, position: 'relative',
      minHeight: '92vh',
      display: 'flex', alignItems: 'center', justifyContent: 'center', padding: "140px 0px 150px"
    }}>
      <div className="stage">

        <img
          className="hero-gif"
          src="assets/wapi.gif?v=2"
          alt="Wapi"
          style={{
            display: 'block',
            margin: '0 auto 24px',
            width: 'min(360px, 70vw)',
            height: 'auto',
            userSelect: 'none',
            pointerEvents: 'none'
          }} />
        

        <h1 style={{
          fontFamily: 'var(--garamond)',
          fontSize: 'clamp(44px, 7vw, 96px)',
          lineHeight: 0.98,
          letterSpacing: '-0.025em',
          fontWeight: 400,
          textAlign: 'center',
          maxWidth: 980, margin: '0 auto',
          textWrap: 'balance', color: "rgb(67, 201, 138)"

        }}>Contesta Wápido,{' '}<span style={{ color: 'var(--ink)' }}>tú cocinas</span>
        </h1>

        <p style={{
          maxWidth: 560,
          textAlign: 'center', fontSize: 19, lineHeight: 1.55,
          color: 'var(--ink-soft)', width: "550px", margin: "46px 207.984px 0px"
        }}>Wápido toma los pedidos a domicilio y pickup por WhatsApp de tu restaurante, pasa la comanda a tu cocina, y los datos de entrega al repartidor


        </p>

        <div style={{
          display: 'flex', gap: 16, justifyContent: 'center', alignItems: 'center',
          marginTop: 48, flexWrap: 'wrap'
        }}>
          <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer" style={{
            background: 'var(--ink)', color: '#FFF',
            padding: '14px 26px', fontSize: 15, fontWeight: 500, borderRadius: "12px"
          }}>Inicia ahora</a>
        </div>
      </div>

      <BenefitsMarquee />
    </section>);

}

// ─── PARA QUIÉN — estilo Opennote (split + card grid) ─
const PARA_QUIEN_TITLES = {
  ideal:    '¿Wápido es para tu restaurante?',
  paraTi:   '¿Wapido es para tu restaurante?',
  hecho:    'Hecho para restaurantes ocupados',
  suena:    'Si esto te suena, Wapido es para ti',
  pegado:   'Pensado para quien vive pegado al WhatsApp',
  comoEl:   'Para restaurantes como el tuyo'
};

function ParaQuien({ titleKey = 'ideal' }) {
  const tipos = [
  {
    label: 'Para los dueños/gerentes que toman los pedidos por WhatsApp',
    body: 'La tarea que parecía imposible delegarle a tu equipo, ahora es más fácil que nunca. Recupera horas diarias de tu día y libérate de estar pegado al celular atendiendo pedidos.',
    quote: '"En la noche entran 80 chats al mismo tiempo. Wapi los atiende todos sin que yo levante el celular."',
    author: 'Lalo, Tacos El Compa',
    illu: 'tacos'
  },
  {
    label: 'Para restaurantes con 10+ pedidos al día',
    body: 'De primera mano, sabemos el trabajo que lleva responder los pedidos y, por eso mismo, sabemos la importancia de ofrecer un servicio rápido y consistente. Wapido te ayuda a llevar esa parte al siguiente nivel sin tener que depender de tu personal para ofrecer un servicio extraordinario.',
    quote: '"Antes contestaba yo todo el día. Ahora Wapi atiende y yo cocino. Vendo más sin trabajar más."',
    author: 'Sebastián, dueño de Sabor Casero',
    illu: 'cocina'
  }];


  const [active, setActive] = useState(1);
  const tipo = tipos[active];

  return (
    <section id="para-quien" style={{
      background: 'var(--paper)',

      position: 'relative', padding: "140px 0px"
    }}>
      <div className="stage">
        <div style={{
          display: 'grid',
          gridTemplateColumns: '1fr 1fr',
          gap: 80, alignItems: 'flex-start',
          maxWidth: 1080, margin: '0 auto'
        }}>
          {/* Izquierda — título + lista */}
          <div style={{ paddingTop: 12 }}>
            <h2 style={{
              fontFamily: 'var(--garamond)',
              fontSize: 'clamp(36px, 4.6vw, 56px)',
              lineHeight: 1.05, fontWeight: 400, letterSpacing: '-0.02em',
              marginBottom: 56, textWrap: 'balance', color: 'var(--ink)',
              maxWidth: 360
            }}>{PARA_QUIEN_TITLES[titleKey] || PARA_QUIEN_TITLES.ideal}

            </h2>

            <div style={{ display: 'flex', flexDirection: 'column', gap: 4 }}>
              {tipos.map((t, i) => {
                const isActive = i === active;
                return (
                  <button key={i} onClick={() => setActive(i)} style={{
                    textAlign: 'left',
                    background: 'transparent',
                    border: 'none',
                    padding: '14px 0',
                    cursor: 'pointer',
                    fontFamily: 'var(--sans)',
                    color: 'var(--ink)',
                    transition: 'padding 0.2s ease'
                  }}>
                    <div style={{
                      display: 'flex', alignItems: 'center', gap: 12,
                      fontSize: 16, fontWeight: 500
                    }}>
                      <span style={{
                        fontFamily: 'var(--garamond)',
                        fontSize: 20, fontWeight: 300,
                        color: 'var(--ink)',
                        transform: isActive ? 'rotate(45deg)' : 'rotate(0)',
                        transition: 'transform 0.25s ease',
                        display: 'inline-block', width: 14
                      }}>+</span>
                      {t.label}
                    </div>
                    <div style={{
                      display: 'grid',
                      gridTemplateRows: isActive ? '1fr' : '0fr',
                      opacity: isActive ? 1 : 0,
                      transition: 'grid-template-rows 0.32s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.28s ease'
                    }}>
                      <div style={{ overflow: 'hidden' }}>
                        <p style={{
                          marginTop: 12, marginLeft: 26,
                          fontSize: 14, lineHeight: 1.55,
                          color: 'var(--ink-faint)', maxWidth: 380,
                          transform: isActive ? 'translateY(0)' : 'translateY(-4px)',
                          transition: 'transform 0.32s cubic-bezier(0.4, 0, 0.2, 1)'
                        }}>{t.body}</p>
                      </div>
                    </div>
                  </button>);

              })}
            </div>
          </div>

          {/* Derecha — card con grid + ilustración + quote */}
          <div style={{
            background: '#FBF8F1',
            border: '1px solid var(--rule)',
            borderRadius: 4,
            padding: 32,
            position: 'relative',
            minHeight: 480,
            display: 'flex', flexDirection: 'column'
          }}>
            {/* Grid pattern */}
            <div aria-hidden style={{
              position: 'absolute', inset: 0,
              backgroundImage:
              'linear-gradient(to right, rgba(31,27,22,0.08) 1px, transparent 1px),' +
              'linear-gradient(to bottom, rgba(31,27,22,0.08) 1px, transparent 1px)',
              backgroundSize: '32px 32px',
              pointerEvents: 'none', borderRadius: 4
            }} />

            {/* Ilustración a mano — cambia según tipo activo */}
            <div style={{
              flex: 1,
              display: 'flex', alignItems: 'center', justifyContent: 'center',
              position: 'relative', zIndex: 1, padding: '24px 0'
            }}>
              {tipo.illu === 'tacos' &&
              <svg key="tacos" width="280" height="240" viewBox="0 0 280 240" fill="none"
              stroke="var(--ink)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
                {/* Comal con tortillas */}
                <ellipse cx="140" cy="170" rx="80" ry="14" />
                <ellipse cx="140" cy="166" rx="80" ry="14" fill="rgba(31,27,22,0.04)" />
                {/* Taco 1 */}
                <path d="M70 130 Q90 100 130 110 Q150 116 145 140 Q120 150 90 145 Q72 142 70 130 Z" fill="var(--mint)" />
                <path d="M82 124 Q100 118 120 122" />
                <circle cx="92" cy="128" r="1.2" fill="var(--ink)" />
                <circle cx="106" cy="126" r="1.2" fill="var(--ink)" />
                <circle cx="118" cy="130" r="1.2" fill="var(--ink)" />
                {/* Taco 2 */}
                <path d="M150 120 Q170 92 210 102 Q230 108 225 132 Q200 142 170 137 Q152 134 150 120 Z" />
                <path d="M162 114 Q180 108 200 112" />
                <circle cx="172" cy="118" r="1.2" fill="var(--ink)" />
                <circle cx="186" cy="116" r="1.2" fill="var(--ink)" />
                <circle cx="198" cy="120" r="1.2" fill="var(--ink)" />
                {/* Vapor */}
                <path d="M100 80 Q104 70 100 60 Q96 50 102 42" opacity="0.6" />
                <path d="M140 70 Q144 60 140 50 Q136 40 142 32" opacity="0.6" />
                <path d="M180 78 Q184 68 180 58 Q176 48 182 40" opacity="0.6" />
                {/* Notas */}
                <text x="44" y="60" style={{ fontFamily: 'var(--hand)', fontSize: 16, fill: 'var(--ink-faint)', stroke: 'none' }}>x200/noche</text>
                <path d="M232 180 L240 192 M236 184 L228 188" opacity="0.5" />
              </svg>
              }
              {tipo.illu === 'cocina' &&
              <svg key="cocina" width="280" height="240" viewBox="0 0 280 240" fill="none"
              stroke="var(--ink)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
                {/* Mano arriba */}
                <path d="M70 30 Q88 28 100 36 L120 50 Q126 56 122 64 L114 70" />
                <path d="M100 36 L108 28 M108 28 L118 30 M118 30 L120 38" />
                <path d="M114 70 L130 80" />
                {/* Stack de tickets */}
                <rect x="80" y="74" width="80" height="22" />
                <rect x="80" y="74" width="80" height="22" fill="rgba(31,27,22,0.04)" />
                <circle cx="92" cy="80" r="0.8" fill="var(--ink)" />
                <circle cx="98" cy="80" r="0.8" fill="var(--ink)" />
                <circle cx="104" cy="80" r="0.8" fill="var(--ink)" />
                <circle cx="92" cy="86" r="0.8" fill="var(--ink)" />
                <circle cx="98" cy="86" r="0.8" fill="var(--ink)" />
                <rect x="74" y="100" width="92" height="22" fill="var(--mint)" stroke="var(--mint-deep)" />
                <path d="M82 110 L102 110 M82 116 L96 116" stroke="var(--ink)" />
                <rect x="84" y="126" width="76" height="22" />
                <circle cx="94" cy="134" r="0.8" fill="var(--ink)" />
                <circle cx="100" cy="134" r="0.8" fill="var(--ink)" />
                <circle cx="106" cy="134" r="0.8" fill="var(--ink)" />
                <rect x="78" y="152" width="86" height="22" />
                <rect x="172" y="138" width="40" height="22" transform="rotate(-8 192 149)" />
                <circle cx="186" cy="146" r="0.8" fill="var(--ink)" />
                <circle cx="194" cy="146" r="0.8" fill="var(--ink)" />
                <path d="M180 60 L184 68 L192 72 L184 76 L180 84 L176 76 L168 72 L176 68 Z" fill="none" />
                <path d="M50 140 L52 144 L56 146 L52 148 L50 152 L48 148 L44 146 L48 144 Z" fill="none" />
                <path d="M56 100 Q62 96 60 90 Q58 84 64 82" />
                <circle cx="220" cy="180" r="2" fill="var(--ink)" />
              </svg>
              }
              {tipo.illu === 'delivery' &&
              <svg key="delivery" width="280" height="240" viewBox="0 0 280 240" fill="none"
              stroke="var(--ink)" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round">
                {/* Moto delivery */}
                <circle cx="80" cy="180" r="22" />
                <circle cx="80" cy="180" r="6" />
                <circle cx="200" cy="180" r="22" />
                <circle cx="200" cy="180" r="6" />
                <path d="M80 180 L120 130 L180 130 L200 180" />
                <path d="M120 130 L130 100 L150 100" />
                {/* Caja del delivery con bolsa */}
                <rect x="160" y="80" width="60" height="50" fill="var(--mint)" stroke="var(--mint-deep)" />
                <path d="M170 90 L210 90 M170 96 L210 96 M170 102 L200 102" stroke="var(--ink)" opacity="0.5" />
                <text x="174" y="118" style={{ fontFamily: 'var(--hand)', fontSize: 13, fill: 'var(--ink)', stroke: 'none' }}>Wapido</text>
                {/* Líneas de velocidad */}
                <path d="M30 140 L50 140 M20 152 L50 152 M30 164 L50 164" opacity="0.5" />
                {/* Pin de mapa */}
                <path d="M230 60 Q230 40 240 40 Q250 40 250 60 Q250 70 240 80 Q230 70 230 60 Z" />
                <circle cx="240" cy="58" r="4" />
                <text x="42" y="60" style={{ fontFamily: 'var(--hand)', fontSize: 16, fill: 'var(--ink-faint)', stroke: 'none' }}>180/día</text>
              </svg>
              }
            </div>

            {/* Quote */}
            <div style={{ position: 'relative', zIndex: 1 }}>
              <p style={{
                fontFamily: 'var(--garamond)',
                fontSize: 19, lineHeight: 1.35, color: 'var(--ink)',
                marginBottom: 12, textWrap: 'balance'
              }}>
                {tipo.quote}
              </p>
              <div style={{
                fontSize: 13, color: 'var(--ink-faint)',
                fontFamily: 'var(--sans)'
              }}>
                {tipo.author}
              </div>
            </div>
          </div>
        </div>
      </div>
    </section>);

}

// ─── BENEFICIOS — estilo Opennote (doodles + scroll) ──
function Beneficios() {
  const items = [
  {
    title: 'Te recuerda en el cumpleaños',
    body: 'Wapi guarda la fecha y manda un mensaje en tu nombre con un detalle. El cliente regresa porque alguien se acordó de él.'
  },
  {
    title: '"Lo de siempre" funciona',
    body: 'Reconoce a tus clientes habituales, recuerda qué pidieron y les contesta como si los conociera de toda la vida.'
  },
  {
    title: 'Pide reseña en el momento justo',
    body: 'Después de la entrega, Wapi pide la reseña con el tono de tu marca. Más estrellas, sin que tú tengas que hacer nada.'
  },
  {
    title: 'Re‑activa al que se enfrió',
    body: 'Si un cliente lleva semanas sin pedir, Wapi le manda un mensaje suave con algo que sabe que le gusta. No spam, contexto.'
  }];


  // SVG doodles — pequeños y dibujados a mano
  const doodles = [
  // Pastel + vela
  <svg width="120" height="120" viewBox="0 0 120 120" fill="none" stroke="var(--ink)" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round">
      <path d="M40 70 Q60 64 82 70 L82 92 Q60 98 40 92 Z" />
      <path d="M40 70 Q60 76 82 70" />
      <path d="M48 75 L48 85 M56 76 L56 86 M64 76 L64 86 M72 75 L72 85" opacity="0.6" />
      <path d="M61 50 Q63 56 61 62 Q57 58 61 50 Z" fill="var(--mint)" stroke="var(--mint-deep)" />
      <path d="M61 50 L61 44" />
      <path d="M30 95 Q40 100 50 95" opacity="0.5" />
    </svg>,
  // Corazón con flechita
  <svg width="120" height="120" viewBox="0 0 120 120" fill="none" stroke="var(--ink)" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round">
      <path d="M60 88 Q40 72 38 56 Q38 44 50 44 Q57 44 60 52 Q63 44 70 44 Q82 44 82 56 Q80 72 60 88 Z" fill="rgba(255,179,199,0.5)" />
      <path d="M30 70 Q45 60 90 50" />
      <path d="M86 47 L92 50 L88 56" />
      <text x="22" y="62" style={{ fontFamily: 'var(--hand)', fontSize: 14, fill: 'var(--ink-faint)', stroke: 'none' }}>otra vez!</text>
    </svg>,
  // Estrellas + carita
  <svg width="120" height="120" viewBox="0 0 120 120" fill="none" stroke="var(--ink)" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round">
      <circle cx="60" cy="62" r="22" />
      <circle cx="53" cy="58" r="1.5" fill="var(--ink)" />
      <circle cx="67" cy="58" r="1.5" fill="var(--ink)" />
      <path d="M52 68 Q60 74 68 68" />
      <path d="M30 38 L33 44 L39 45 L34 49 L36 55 L30 52 L24 55 L26 49 L21 45 L27 44 Z" fill="var(--post-yellow)" />
      <path d="M88 32 L90 36 L94 37 L91 40 L92 44 L88 42 L84 44 L85 40 L82 37 L86 36 Z" fill="var(--post-yellow)" />
      <path d="M92 80 L94 84 L98 85 L95 88 L96 92 L92 90 L88 92 L89 88 L86 85 L90 84 Z" fill="var(--post-yellow)" />
    </svg>,
  // Flecha + reloj
  <svg width="120" height="120" viewBox="0 0 120 120" fill="none" stroke="var(--ink)" strokeWidth="1.4" strokeLinecap="round" strokeLinejoin="round">
      <circle cx="60" cy="60" r="24" />
      <path d="M60 46 L60 60 L70 66" />
      <path d="M30 90 Q50 100 90 80" />
      <path d="M86 76 L92 80 L86 84" />
      <text x="20" y="40" style={{ fontFamily: 'var(--hand)', fontSize: 13, fill: 'var(--ink-faint)', stroke: 'none' }}>3 semanas...</text>
    </svg>];


  // Garabatos decorativos para los márgenes (sticky)
  return (
    <section id="beneficios" style={{
      background: 'var(--paper)',

      position: 'relative',
      overflow: 'hidden', padding: "140px 0px"
    }}>
      {/* Garabatos sticky en los márgenes */}
      <div aria-hidden style={{
        position: 'absolute', inset: 0, pointerEvents: 'none', zIndex: 0
      }}>
        {/* Izquierda */}
        <svg style={{ position: 'absolute', top: 80, left: '4%', opacity: 0.55 }} width="90" height="90" viewBox="0 0 90 90" fill="none" stroke="var(--ink-faint)" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
          <path d="M10 45 Q30 10 60 30 Q80 50 50 70 Q20 80 10 45 Z" />
          <path d="M30 35 L60 55 M60 35 L30 55" opacity="0.4" />
        </svg>
        <svg style={{ position: 'absolute', top: 320, left: '6%', opacity: 0.5 }} width="80" height="80" viewBox="0 0 80 80" fill="none" stroke="var(--ink-faint)" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
          <path d="M10 60 Q15 30 35 25 Q55 22 65 40 Q70 55 55 65" />
          <path d="M40 38 L40 50 M34 44 L46 44" opacity="0.5" />
          <text x="6" y="14" style={{ fontFamily: 'var(--hand)', fontSize: 13, fill: 'var(--ink-faint)', stroke: 'none' }}>cliente VIP</text>
        </svg>
        <svg style={{ position: 'absolute', top: 640, left: '3%', opacity: 0.5 }} width="100" height="80" viewBox="0 0 100 80" fill="none" stroke="var(--ink-faint)" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
          <path d="M10 50 Q20 20 50 25 Q80 30 88 55" />
          <path d="M84 50 L88 55 L92 50" />
          <path d="M22 60 L34 60 M22 65 L30 65" opacity="0.4" />
        </svg>
        <svg style={{ position: 'absolute', bottom: 200, left: '5%', opacity: 0.55 }} width="100" height="100" viewBox="0 0 100 100" fill="none" stroke="var(--ink-faint)" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
          <circle cx="50" cy="50" r="22" />
          <path d="M50 28 L50 22 M50 78 L50 72 M28 50 L22 50 M78 50 L72 50" />
          <path d="M50 50 L50 38 M50 50 L62 50" />
        </svg>

        {/* Derecha */}
        <svg style={{ position: 'absolute', top: 100, right: '4%', opacity: 0.5 }} width="90" height="80" viewBox="0 0 90 80" fill="none" stroke="var(--ink-faint)" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
          <path d="M15 60 L40 25 L65 55 L80 30" />
          <path d="M76 30 L80 30 L80 34" />
          <text x="14" y="18" style={{ fontFamily: 'var(--hand)', fontSize: 13, fill: 'var(--ink-faint)', stroke: 'none' }}>+ ticket</text>
        </svg>
        <svg style={{ position: 'absolute', top: 360, right: '6%', opacity: 0.5 }} width="80" height="100" viewBox="0 0 80 100" fill="none" stroke="var(--ink-faint)" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
          <path d="M20 80 Q15 50 30 35 Q50 20 60 40 Q65 60 50 75 Z" />
          <path d="M30 50 Q40 55 50 50" />
          <circle cx="32" cy="42" r="1.5" fill="var(--ink-faint)" />
          <circle cx="48" cy="42" r="1.5" fill="var(--ink-faint)" />
        </svg>
        <svg style={{ position: 'absolute', top: 700, right: '4%', opacity: 0.5 }} width="100" height="90" viewBox="0 0 100 90" fill="none" stroke="var(--ink-faint)" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
          <path d="M20 70 L20 30 L80 30 L80 70 Z" />
          <path d="M20 30 L50 50 L80 30" />
          <text x="14" y="20" style={{ fontFamily: 'var(--hand)', fontSize: 13, fill: 'var(--ink-faint)', stroke: 'none' }}>vuelve!</text>
        </svg>
        <svg style={{ position: 'absolute', bottom: 240, right: '5%', opacity: 0.55 }} width="100" height="100" viewBox="0 0 100 100" fill="none" stroke="var(--ink-faint)" strokeWidth="1.1" strokeLinecap="round" strokeLinejoin="round">
          <path d="M50 15 L58 38 L82 40 L64 56 L70 80 L50 66 L30 80 L36 56 L18 40 L42 38 Z" />
        </svg>
      </div>

      <div className="stage" style={{ position: 'relative', zIndex: 1 }}>
        {/* Título */}
        <h2 style={{
          fontFamily: 'var(--garamond)',
          fontSize: 'clamp(36px, 5vw, 64px)',
          lineHeight: 1.08, fontWeight: 400, letterSpacing: '-0.02em',
          textWrap: 'balance', textAlign: 'center',
          maxWidth: 820,
          color: 'var(--ink)', margin: "0px 181px 81px"
        }}>
          Wapi fideliza a tus clientes,<br />
          <em style={{ color: 'var(--mint-deep)' }}>no solo responde mensajes.</em>
        </h2>

        {/* Bullets en columna central, mucho aire */}
        <div style={{
          display: 'flex', flexDirection: 'column',
          alignItems: 'center',
          maxWidth: 460, margin: '0 auto', gap: "81px"
        }}>
          {items.map((it, i) =>
          <div key={i} style={{
            display: 'flex', flexDirection: 'column',
            alignItems: 'center', textAlign: 'center'
          }}>
              <div style={{ marginBottom: 32, margin: "0px 0px 2px" }}>
                {doodles[i]}
              </div>
              <h3 style={{
              fontFamily: 'var(--garamond)',
              fontSize: 22, lineHeight: 1.2, fontWeight: 500, letterSpacing: '-0.01em',
              marginBottom: 14, textWrap: 'balance', maxWidth: 280,
              color: 'var(--ink)'
            }}>{it.title}</h3>
              <p style={{
              fontSize: 15, lineHeight: 1.55, color: 'var(--ink-faint)',
              maxWidth: 300, textWrap: 'pretty'
            }}>{it.body}</p>
            </div>
          )}
        </div>
      </div>
    </section>);

}

// ─── BENEFITS MARQUEE ─────────────────────────────────
function BenefitsMarquee() {
  const items = [
  'Atiende 24/7',
  'Toma pedidos completos',
  'Valida pago y ubicaci',
  'Suena como tu negocio',
  'Manda todo a cocina',
  'Setup en 1 día',
  'Sin app que descargar',
  'Funciona con tu WhatsApp Business'];

  const repeat = [...items, ...items, ...items];
  return (
    <div style={{
      position: 'absolute', left: 0, right: 0, bottom: 60,
      overflow: 'hidden',
      maskImage: 'linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent)',
      WebkitMaskImage: 'linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent)'
    }}>
      <div style={{
        display: 'flex', gap: 56, whiteSpace: 'nowrap',
        animation: 'wapido-marquee 50s linear infinite',
        width: 'max-content'
      }}>
        {repeat.map((it, i) =>
        <span key={i} style={{
          display: 'inline-flex', alignItems: 'center', gap: 56,
          fontFamily: 'var(--garamond)', fontStyle: 'italic',
          fontSize: 22, color: 'var(--ink-soft)'
        }}>
            {it}
            <span style={{
            display: 'inline-block', width: 6, height: 6,
            background: 'var(--mint-deep)', borderRadius: '50%',
            opacity: 0.5
          }} />
          </span>
        )}
      </div>
      <style>{`
        @keyframes wapido-marquee {
          from { transform: translateX(0); }
          to   { transform: translateX(-33.33%); }
        }
      `}</style>
    </div>);

}

// ─── 02 DOLOR → VALOR ─────────────────────────────────
function DolorValor() {
  const rows = [
  {
    antes: 'Tu celular vibra desde las 11am hasta cierre.',
    despues: 'Wapido contesta en segundos, todo el día.'
  },
  {
    antes: 'Pedidos a medias, sin dirección ni pago.',
    despues: 'Pide lo que falta, valida pago y dirección.'
  },
  {
    antes: 'El que toma pedidos hoy no es el de mañana.',
    despues: 'La voz del negocio es siempre la misma.'
  },
  {
    antes: 'Cada error es comida regalada.',
    despues: 'Lo que llega a cocina, llega completo.'
  }];


  return (
    <Section id="dolor" num="02" label="el dolor → el valor" data-comment-anchor="96d7429be8-section-54-1">
      <h2 style={{
        fontFamily: 'var(--garamond)',
        fontSize: 'clamp(32px, 4.6vw, 56px)',
        lineHeight: 1.05, fontWeight: 400, letterSpacing: '-0.02em',
        maxWidth: 820, marginBottom: 56, textWrap: 'balance', textAlign: 'center',
        margin: '0 auto 56px'
      }}>
        Atender pedidos por WhatsApp <em style={{ color: 'var(--mint-deep)' }}>no debería costarte el día.</em>
      </h2>

      {/* Split ticket — antes / después como una sola comanda partida */}
      <div style={{
        maxWidth: 980, margin: '0 auto',
        display: 'grid', gridTemplateColumns: '1fr 1fr',
        position: 'relative',
        background: '#FFFCF6',
        boxShadow: '0 24px 60px -28px rgba(31,27,22,0.28), 0 4px 12px -6px rgba(31,27,22,0.12)',
        borderRadius: 4
      }}>
        {/* Holes / perforación central */}
        <div aria-hidden style={{
          position: 'absolute',
          left: '50%', top: 0, bottom: 0,
          width: 1, transform: 'translateX(-0.5px)',
          backgroundImage: 'repeating-linear-gradient(to bottom, var(--ink) 0, var(--ink) 4px, transparent 4px, transparent 10px)',
          opacity: 0.35,
          zIndex: 2
        }} />

        {/* ANTES — sticky note amarillo, ligeramente rotado */}
        <div style={{
          background: 'var(--post-yellow)',
          padding: '40px 36px 56px',
          position: 'relative',
          transform: 'rotate(-0.6deg)',
          transformOrigin: 'right center',
          boxShadow: 'inset -8px 0 16px -12px rgba(31,27,22,0.18)',
          zIndex: 1
        }}>
          {/* Tape */}
          <div aria-hidden style={{
            position: 'absolute', top: -10, left: 24,
            width: 70, height: 22,
            background: 'rgba(255,255,255,0.55)',
            border: '1px solid rgba(31,27,22,0.08)',
            transform: 'rotate(-4deg)'
          }} />

          <div style={{
            fontFamily: 'var(--mono)', fontSize: 11, letterSpacing: '0.16em',
            textTransform: 'uppercase', color: '#B85450',
            marginBottom: 28
          }}>Hoy · sin wapido</div>

          <ul style={{ listStyle: 'none' }}>
            {rows.map((r, i) =>
            <li key={i} style={{
              padding: '14px 0',
              borderBottom: i < rows.length - 1 ? '1px dashed rgba(31,27,22,0.18)' : 'none',
              fontFamily: 'var(--hand)', fontSize: 22, lineHeight: 1.25,
              color: 'var(--ink)',
              display: 'flex', alignItems: 'flex-start', gap: 12
            }}>
                <span aria-hidden style={{
                flexShrink: 0,
                width: 14, height: 14,
                display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
                color: '#B85450',
                fontFamily: 'var(--hand)',
                fontSize: 16, lineHeight: 1,
                marginTop: 6,
                fontWeight: 700,
                transform: i % 2 === 0 ? 'rotate(-6deg)' : 'rotate(4deg)'
              }}>✗</span>
                <span>{r.antes}</span>
              </li>
            )}
          </ul>
        </div>

        {/* DESPUÉS — comanda impresa limpia */}
        <div style={{
          background: '#FFFCF6',
          padding: '40px 36px 56px',
          position: 'relative',
          zIndex: 1
        }}>
          {/* Esquina doblada */}
          <div aria-hidden style={{
            position: 'absolute', top: 0, right: 0,
            width: 0, height: 0,
            borderLeft: '24px solid transparent',
            borderTop: '24px solid var(--paper-shade)',
            opacity: 0.7
          }} />

          <div style={{
            fontFamily: 'var(--mono)', fontSize: 11, letterSpacing: '0.16em',
            textTransform: 'uppercase', color: 'var(--mint-deep)',
            marginBottom: 28,
            display: 'flex', alignItems: 'center', gap: 8
          }}>
            <span>Mañana · con wapido</span>
            <span style={{
              width: 14, height: 14, borderRadius: '50%',
              background: 'var(--mint)',
              display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
              fontSize: 9, color: '#FFF'
            }}>✓</span>
          </div>

          <ul style={{ listStyle: 'none' }}>
            {rows.map((r, i) =>
            <li key={i} style={{
              padding: '14px 0',
              borderBottom: i < rows.length - 1 ? '1px dashed var(--rule)' : 'none',
              fontSize: 16, lineHeight: 1.45,
              color: 'var(--ink)',
              display: 'flex', alignItems: 'flex-start', gap: 12,
              fontFamily: 'var(--sans)'
            }}>
                <span aria-hidden style={{
                color: 'var(--mint-deep)', fontSize: 14,
                marginTop: 3, flexShrink: 0,
                fontWeight: 600
              }}>✓</span>
                <span>{r.despues}</span>
              </li>
            )}
          </ul>
        </div>
      </div>

      {/* Pie de tabla — micro copy */}
      <div style={{
        textAlign: 'center', marginTop: 32,
        fontFamily: 'var(--hand)', fontSize: 22, color: 'var(--ink-faint)',
        transform: 'rotate(-0.5deg)'
      }}>
        — el mismo trabajo, sin la migraña —
      </div>
    </Section>);

}

// ─── 02 QUÉ ES WAPIDO ─────────────────────────────────
function QueEsWapido() {
  const messages = [
  { from: 'them', text: 'Hola! quiero ordenar para llevar', time: '2:14 p.m.' },
  { from: 'us', text: '¡Hola! 👋 Bienvenido a Sabor Casero. ¿Te paso el menú o ya sabes qué se te antoja?', time: '2:14 p.m.' },
  { from: 'them', text: '2 quesadillas de pastor y una agua de jamaica grande', time: '2:15 p.m.' },
  { from: 'us', text: 'Listo. ¿Las quesadillas con todo (cebolla, cilantro, salsa)?', time: '2:15 p.m.' },
  { from: 'them', text: 'sí porfa, sin cebolla una', time: '2:16 p.m.' },
  { from: 'us', text: 'Anotado. ¿Me confirmas la dirección de entrega?', time: '2:16 p.m.' },
  { from: 'them', text: 'Av. Reforma 234, depto 5', time: '2:17 p.m.' },
  { from: 'us', text: 'Perfecto. Tu total es $245. ¿Pagas en efectivo o transferencia?', time: '2:17 p.m.' },
  { from: 'them', text: 'transferencia', time: '2:18 p.m.' },
  { from: 'us', text: 'Te paso los datos. En cuanto confirmes te aviso el tiempo estimado 🛵', time: '2:18 p.m.' }];


  const bullets = [
  {
    icon: '◐',
    title: 'Conversaciones naturales y fluidas',
    body: 'Wapi recopila todos los datos del pedido de una manera eficiente y sin fricción para tu cliente.'
  },
  {
    icon: '✓',
    title: 'Domina la hora pico',
    body: '3, 5 o 10 conversaciones simultaneas, todas atendidas con el mismo nivel de atención y rapidez.'
  },
  {
    icon: '↗',
    title: 'Reconoce a tus clientes más fieles',
    body: 'Recuerda nombres, ubicaciones y preferencias de órdenes anteriores para ofrecer una experiencia personalizada.'
  }];


  return (
    <section id="que-es" style={{

      background: 'var(--paper)',
      position: 'relative', padding: "140px 0px"
    }}>
      <div className="stage">
        <div style={{
          display: 'grid',
          gridTemplateColumns: '1fr 1fr',
          gap: 96,
          alignItems: 'center'
        }}>
          {/* Columna izquierda — texto */}
          <div style={{ maxWidth: 520 }}>
            <Mono style={{ color: 'var(--mint-deep)', marginBottom: 24, display: 'block' }}>
              Qué es Wapido
            </Mono>
            <h2 style={{
              fontFamily: 'var(--garamond)',

              lineHeight: 1.04, fontWeight: 400, letterSpacing: '-0.025em',
              marginBottom: 28, textWrap: 'balance', color: 'var(--ink)', fontSize: "55px"
            }}>
              Tu nuevo especialista en pedidos pickup y domicilio <em style={{ color: 'var(--mint-deep)' }}></em>
            </h2>
            <p style={{
              fontSize: 18, lineHeight: 1.55, color: 'var(--ink-soft)',
              marginBottom: 40, maxWidth: 480
            }}>Ofrece un servicio extraordinario por WhatsApp totalmente especializado para restaurantes.

            </p>

            <ul style={{ listStyle: 'none', display: 'flex', flexDirection: 'column', gap: 24 }}>
              {bullets.map((b, i) =>
              <li key={i} style={{
                display: 'flex', gap: 16, alignItems: 'flex-start'
              }}>
                  <div style={{
                  width: 36, height: 36, flexShrink: 0,
                  borderRadius: '50%',
                  background: 'var(--mint-soft)',
                  color: 'var(--mint-deep)',
                  display: 'flex', alignItems: 'center', justifyContent: 'center',
                  fontSize: 16, fontWeight: 600,
                  marginTop: 2
                }}>
                    {b.icon}
                  </div>
                  <div>
                    <div style={{
                    fontSize: 16, fontWeight: 600, color: 'var(--ink)',
                    marginBottom: 4
                  }}>
                      {b.title}
                    </div>
                    <div style={{
                    fontSize: 15, lineHeight: 1.5, color: 'var(--ink-soft)'
                  }}>
                      {b.body}
                    </div>
                  </div>
                </li>
              )}
            </ul>
          </div>

          {/* Columna derecha — mockup WhatsApp */}
          <div style={{
            position: 'relative',
            display: 'flex', justifyContent: 'center', alignItems: 'center'
          }}>
            {/* Glow verde sutil detrás */}
            <div aria-hidden style={{
              position: 'absolute',
              width: '90%', height: '85%',
              background: 'radial-gradient(closest-side, rgba(67,201,138,0.28), transparent 70%)',
              filter: 'blur(40px)',
              top: '7%', left: '5%',
              pointerEvents: 'none'
            }} />

            <WhatsappMockup messages={messages} />
          </div>
        </div>
      </div>
    </section>);

}

function WhatsappMockup({ messages }) {
  return (
    <div style={{
      width: 360,
      background: '#E5DDD5',
      borderRadius: 22,
      overflow: 'hidden',
      boxShadow: '0 30px 60px -20px rgba(31,27,22,0.32), 0 8px 16px -8px rgba(31,27,22,0.18)',
      fontFamily: '-apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif',
      position: 'relative', zIndex: 2,
      border: '1px solid rgba(31,27,22,0.06)'
    }}>
      {/* Header WhatsApp Business */}
      <div style={{
        background: '#075E54',
        color: '#FFF',
        padding: '12px 14px',
        display: 'flex', alignItems: 'center', gap: 12
      }}>
        <div style={{ fontSize: 18, opacity: 0.9 }}>‹</div>
        <div style={{
          width: 38, height: 38, borderRadius: '50%',
          background: '#FFC9A8',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          fontSize: 18
        }}>🌮</div>
        <div style={{ flex: 1, minWidth: 0 }}>
          <div style={{
            fontSize: 15, fontWeight: 600, letterSpacing: '-0.005em',
            display: 'flex', alignItems: 'center', gap: 5
          }}>
            <span>Sabor Casero</span>
            {/* Verified check */}
            <svg width="14" height="14" viewBox="0 0 24 24" fill="#25D366" aria-hidden>
              <path d="M12 1l3.09 1.7L18.6 2.7l1 3.5 3.5 1-1 3.5 1 3.5-3.5 1-1 3.5-3.5-1-3.1 1.7-3.1-1.7-3.5 1-1-3.5-3.5-1 1-3.5-1-3.5 3.5-1 1-3.5 3.5 1z" />
              <path d="M9.5 12.5l2 2 4-4.5" stroke="#FFF" strokeWidth="2" fill="none" strokeLinecap="round" strokeLinejoin="round" />
            </svg>
          </div>
          <div style={{ fontSize: 12, opacity: 0.85 }}>en línea</div>
        </div>
        <div style={{ fontSize: 18, opacity: 0.9, letterSpacing: 2 }}>⋮</div>
      </div>

      {/* Chat area */}
      <div style={{
        padding: '14px 10px',
        background: '#E5DDD5',
        backgroundImage:
        'repeating-linear-gradient(45deg, rgba(255,255,255,0.04) 0 2px, transparent 2px 6px)',
        maxHeight: 540,
        overflow: 'hidden',
        display: 'flex', flexDirection: 'column', gap: 6
      }}>
        {/* Date pill */}
        <div style={{
          alignSelf: 'center',
          background: '#E1F2FB',
          color: '#5A6F7B',
          padding: '4px 10px',
          borderRadius: 8,
          fontSize: 11, fontWeight: 500,
          marginBottom: 4,
          boxShadow: '0 1px 1px rgba(0,0,0,0.06)'
        }}>HOY</div>

        {messages.map((m, i) =>
        <div key={i} style={{
          alignSelf: m.from === 'us' ? 'flex-end' : 'flex-start',
          maxWidth: '78%'
        }}>
            <div style={{
            background: m.from === 'us' ? '#DCF8C6' : '#FFFFFF',
            color: '#1F2937',
            padding: '6px 9px 4px',
            borderRadius: 7,
            fontSize: 13.5, lineHeight: 1.35,
            boxShadow: '0 1px 0.5px rgba(0,0,0,0.13)',
            position: 'relative',
            borderTopLeftRadius: m.from === 'them' && (i === 0 || messages[i - 1]?.from !== 'them') ? 0 : 7,
            borderTopRightRadius: m.from === 'us' && (i === 0 || messages[i - 1]?.from !== 'us') ? 0 : 7
          }}>
              {m.text}
              <span style={{
              fontSize: 10, color: '#8696A0',
              marginLeft: 8, float: 'right',
              marginTop: 2, marginBottom: -2,
              display: 'inline-flex', alignItems: 'center', gap: 3
            }}>
                {m.time}
                {m.from === 'us' &&
              <svg width="14" height="10" viewBox="0 0 16 11" fill="#53BDEB" aria-hidden>
                    <path d="M11.07.21L6.34 5.7 4.62 4.21 3.45 5.4l3.04 2.62L12.43 1.4z" />
                    <path d="M15.07.21L10.34 5.7 9.5 4.97 8.34 6.16l1.42 1.24L15.7 1.4z" />
                  </svg>
              }
              </span>
            </div>
          </div>
        )}

        {/* Typing indicator */}
        <div style={{
          alignSelf: 'flex-start',
          background: '#FFFFFF',
          padding: '8px 12px',
          borderRadius: 7,
          marginTop: 2,
          display: 'flex', gap: 4, alignItems: 'center',
          boxShadow: '0 1px 0.5px rgba(0,0,0,0.13)'
        }}>
          {[0, 1, 2].map((i) =>
          <span key={i} style={{
            width: 6, height: 6, borderRadius: '50%',
            background: '#8696A0',
            animation: `wapTyping 1.2s ${i * 0.18}s ease-in-out infinite`
          }} />
          )}
        </div>
      </div>

      {/* Input bar */}
      <div style={{
        background: '#F0F0F0',
        padding: '8px 10px',
        display: 'flex', gap: 8, alignItems: 'center'
      }}>
        <div style={{
          flex: 1,
          background: '#FFF',
          borderRadius: 20,
          padding: '8px 14px',
          fontSize: 13,
          color: '#9AA0A6',
          display: 'flex', alignItems: 'center', gap: 8
        }}>
          <span style={{ fontSize: 16 }}>😊</span>
          Mensaje
        </div>
        <div style={{
          width: 36, height: 36, borderRadius: '50%',
          background: '#075E54',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          color: '#FFF', fontSize: 14
        }}>🎤</div>
      </div>

      <style>{`
        @keyframes wapTyping {
          0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
          30% { transform: translateY(-3px); opacity: 1; }
        }
      `}</style>
    </div>);

}

// ─── 02b PROCESO — scroll numerado estilo Fruitful ────
function ProcesoScroll() {
  const steps = [
  {
    n: '01',
    title: 'Reunión para conocer tu restaurante',
    body: 'Platicamos acerca de tu flujo de toma de pedidos actual: ¿Cuáles son tus desafíos y objetivos? Nos metemos a profundidad en el menú y todos los detalles necesarios para la atención de tus clientes.',
    links: [{ label: 'Ver requisitos', href: 'https://wa.me/message/YD77UWPNTWO2P1' }, { label: 'Cómo migramos tu número', href: 'https://wa.me/message/YD77UWPNTWO2P1' }],
    bg: 'var(--post-mint)',
    accent: 'var(--mint-deep)'
  },
  {
    n: '02',
    title: 'Subimos toda la información a tu cuenta ',
    body: 'Menú, horarios, zonas de entrega y costos, y cualquier instrucción personalizada que hayamos visto durante la reunión, para que Wapi tenga todas las herramientas listas antes de empezar.',
    links: [{ label: 'Formatos aceptados', href: 'https://wa.me/message/YD77UWPNTWO2P1' }, { label: 'Editar al vuelo', href: 'https://wa.me/message/YD77UWPNTWO2P1' }],
    bg: 'var(--post-peach)',
    accent: '#C8553D'
  },
  {
    n: '03',
    title: 'Realizamos pruebas',
    body: 'En una cuenta demo, realizamos pruebas de conversaciones normales que tendrían los clientes con tu restaurante.',
    links: [{ label: 'Ver una conversación real', href: 'https://wa.me/message/YD77UWPNTWO2P1' }, { label: 'Cuándo te interrumpe', href: 'https://wa.me/message/YD77UWPNTWO2P1' }],
    bg: 'var(--post-cyan)',
    accent: '#1F6F7A'
  },
  {
    n: '04',
    title: 'Conectamos tu WhatsApp Business',
    body: 'A través de nuestro proceso verificado con Meta, tu número siempre estará seguro y nunca será necesario que nos compartas las credenciales de tu cuenta.',
    links: [{ label: 'Integraciones', href: 'https://wa.me/message/YD77UWPNTWO2P1' }, { label: 'Panel de cocina', href: 'https://wa.me/message/YD77UWPNTWO2P1' }],
    bg: 'var(--post-lilac)',
    accent: '#5B3FA8'
  }];


  return (
    <section id="proceso" style={{
      background: 'var(--paper)',

      position: 'relative', padding: "140px 0px"
    }}>
      <div className="stage">
        {/* Header — estilo Fruitful (label arriba, título grande) */}
        <div style={{ marginBottom: 96, maxWidth: 720 }}>
          <Mono style={{ color: 'var(--mint-deep)', marginBottom: 24, display: 'block' }}>Cómo iniciar</Mono>
          <h2 style={{
            fontFamily: 'var(--garamond)',
            fontSize: 'clamp(40px, 5.6vw, 72px)',
            lineHeight: 1.02, fontWeight: 400, letterSpacing: '-0.025em',
            textWrap: 'balance', color: 'var(--ink)', width: "720px"
          }}>
            Implementamos en 1 día <em style={{ color: 'var(--mint-deep)' }}></em>
          </h2>
          <p style={{
            fontFamily: 'var(--sans)',
            fontSize: 17, lineHeight: 1.55,
            color: 'var(--ink-faint)', marginTop: 28,
            maxWidth: 560, textWrap: 'pretty'
          }}>
            El servicio es completamente personalizado: te acompañamos durante todo el proceso hasta asegurarnos de que todo está funcionando correctamente.
          </p>
        </div>

        {/* Layout: pasos a la izquierda (scroll), visual sticky a la derecha */}
        <div style={{
          display: 'grid',
          gridTemplateColumns: 'minmax(0, 1fr) minmax(0, 1fr)',
          gap: 80,
          alignItems: 'flex-start'
        }}>
          {/* Columna izq: pasos numerados */}
          <div style={{ display: 'flex', flexDirection: 'column' }}>
            {steps.map((s, i) =>
            <div key={s.n} style={{
              padding: '64px 0',
              borderTop: '1px solid var(--rule)',
              borderBottom: i === steps.length - 1 ? '1px solid var(--rule)' : 'none'
            }}>
                <div style={{
                fontFamily: 'var(--garamond)',
                fontSize: 'clamp(56px, 7vw, 96px)',
                lineHeight: 1, fontWeight: 300, letterSpacing: '-0.02em',
                color: s.accent,
                marginBottom: 24,
                fontStyle: 'italic'
              }}>{s.n}</div>
                <h3 style={{
                fontFamily: 'var(--garamond)',
                fontSize: 'clamp(28px, 3.4vw, 40px)',
                lineHeight: 1.08, fontWeight: 400, letterSpacing: '-0.015em',
                marginBottom: 20, textWrap: 'balance', color: 'var(--ink)'
              }}>{s.title}</h3>
                <p style={{
                fontSize: 17, lineHeight: 1.55, color: 'var(--ink-soft)',
                marginBottom: 28, maxWidth: 460
              }}>{s.body}</p>
              </div>
            )}
          </div>

          {/* Columna der: visual sticky que cambia de color según el paso visible */}
          <div style={{
            position: 'sticky',
            top: 96,
            height: 'calc(100vh - 160px)',
            maxHeight: 720,
            display: 'flex', alignItems: 'center', justifyContent: 'center'
          }}>
            <ProcesoStickyVisual steps={steps} />
          </div>
        </div>
      </div>
    </section>);

}

function ProcesoStickyVisual({ steps }) {
  const [active, setActive] = useState(0);
  const containerRef = useRef(null);

  useEffect(() => {
    const onScroll = () => {
      const sec = document.getElementById('proceso');
      if (!sec) return;
      const rect = sec.getBoundingClientRect();
      const total = rect.height - window.innerHeight;
      const scrolled = -rect.top;
      const progress = Math.max(0, Math.min(1, scrolled / total));
      const idx = Math.min(steps.length - 1, Math.floor(progress * steps.length));
      setActive(idx);
    };
    window.addEventListener('scroll', onScroll, { passive: true });
    onScroll();
    return () => window.removeEventListener('scroll', onScroll);
  }, [steps.length]);

  const s = steps[active];
  return (
    <div ref={containerRef} style={{
      width: '100%', height: '100%',
      background: s.bg,
      borderRadius: 16,
      transition: 'background 0.5s ease',
      position: 'relative', overflow: 'hidden',
      display: 'flex', flexDirection: 'column',
      padding: 40,
      boxShadow: '0 24px 60px -24px rgba(31,27,22,0.22)'
    }}>
      {/* Líneas tipo cuaderno */}
      <div aria-hidden style={{
        position: 'absolute', inset: 0,
        backgroundImage: 'repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(31,27,22,0.06) 31px, rgba(31,27,22,0.06) 32px)',
        pointerEvents: 'none'
      }} />
      {/* Step indicator */}
      <div style={{
        display: 'flex', gap: 6,
        position: 'relative', zIndex: 1, marginBottom: 'auto'
      }}>
        {steps.map((_, i) =>
        <div key={i} style={{
          width: i === active ? 32 : 8,
          height: 4,
          borderRadius: 2,
          background: i === active ? 'var(--ink)' : 'rgba(31,27,22,0.25)',
          transition: 'all 0.3s ease'
        }} />
        )}
      </div>
      {/* Numeral grande */}
      <div style={{ position: 'relative', zIndex: 1 }}>
        <div style={{
          fontFamily: 'var(--garamond)',
          fontSize: 'clamp(120px, 16vw, 200px)',
          lineHeight: 0.9, fontWeight: 300, letterSpacing: '-0.04em',
          color: s.accent,
          fontStyle: 'italic',
          marginBottom: 16
        }}>{s.n}</div>
        <div style={{
          fontFamily: 'var(--hand)',
          fontSize: 'clamp(28px, 3vw, 36px)',
          lineHeight: 1.2,
          color: 'var(--ink)',
          maxWidth: '85%'
        }}>
          {s.title}
        </div>
      </div>
    </div>);

}

// ─── 03 CAPACIDADES — tabs estilo Opennote ────────────
function Capacidades() {
  const tabs = [
  {
    key: 'carta',
    label: 'Aprende tu operación',
    title: 'Le enseñas una vez y siempre resolverá',
    body: 'Wapi aprende tu menú, horarios, zonas y costos de entrega ¡Y más! ',
    bullets: ['Resuelve cualquier duda relacionada a tu restaurante', 'Escribe con tu voz ', 'Consistencia del servicio sin importar la rotación de personal']
  },
  {
    key: 'pedido',
    label: 'Toma la orden',
    title: 'Desde el saludo hasta la confirmación',
    body: 'Wapi conversa de forma natural con tus clientes mientras recopila todos los datos del pedido.',
    bullets: ['Guarda notas del pedido', 'Sugiere combos y maneja personalizaciones de platillos', 'Calcula costo de envío según ubicación']
  },
  {
    key: 'entrega',
    label: 'Prepara comanda y entrega',
    title: 'Manda la comanda a cocina y coordina el envío.',
    body: 'En cuanto Wapi cierra el pedido por WhatsApp, tu equipo recibe el pedido con todos los detalles, y la información del cliente organizada para su entrega.',
    bullets: ['Comanda lista para cocina', 'Panel de pedidos para organizarlos y prepararlos fácilmente', 'Comparte todos los datos de entrega a tu repartidor con un clic']
  }];

  const [active, setActive] = useState(0);
  const tab = tabs[active];

  // Each tab gets its own background color for the band below (post-it palette)
  const bandColors = ['var(--post-mint)', 'var(--post-peach)', 'var(--post-cyan)', 'var(--post-lilac)'];
  const cardColors = ['var(--mint)', '#FF7A8A', '#5BB8C2', '#9B7FE8'];
  const band = bandColors[active];
  const card = cardColors[active];

  return (
    <section id="capacidades" style={{ position: 'relative', background: 'var(--paper)' }}>
      {/* Title + tabs sit on paper */}
      <div style={{ position: 'relative', zIndex: 2, padding: "140px 0px 0px" }}>
        <div className="stage">
          <div style={{
            display: 'flex', flexDirection: 'column', alignItems: 'center',
            textAlign: 'center'
          }}>
          <h2 style={{
              fontFamily: 'var(--garamond)',
              fontSize: 'clamp(32px, 4.6vw, 56px)',
              lineHeight: 1.05, fontWeight: 400, letterSpacing: '-0.02em',
              textWrap: 'balance', textAlign: 'center',
              margin: '0 auto 48px', maxWidth: 820
            }}>
            Wapido resuelve la toma de pedidos por WhatsApp <em style={{ color: 'var(--mint-deep)' }}></em>
          </h2>

          {/* Underlined-text tabs */}
          <div style={{
              display: 'flex', justifyContent: 'center', gap: 48,
              flexWrap: 'wrap', marginBottom: 0,
              paddingBottom: 0
            }}>
            {tabs.map((t, i) =>
              <button key={t.key} onClick={() => setActive(i)} style={{
                padding: '8px 0',
                background: 'transparent',
                border: 'none',
                borderBottom: i === active ? '1.5px solid var(--ink)' : '1.5px solid transparent',
                fontSize: 15, fontWeight: i === active ? 600 : 400,
                fontFamily: 'var(--sans)',
                color: i === active ? 'var(--ink)' : 'var(--ink-faint)',
                cursor: 'pointer',
                transition: 'color 0.18s ease, border-color 0.18s ease',
                letterSpacing: '-0.005em'
              }}>{t.label}</button>
              )}
          </div>
          </div>
        </div>
      </div>

      {/* Colored band — content lives here */}
      <div style={{
        background: band,
        padding: '80px 0 140px',
        marginTop: 56,
        transition: 'background 0.4s ease',
        position: 'relative'
      }}>
        {/* Subtle horizontal rule lines like notebook paper */}
        <div aria-hidden style={{
          position: 'absolute', inset: 0,
          backgroundImage: 'repeating-linear-gradient(to bottom, transparent 0, transparent 31px, rgba(31,27,22,0.06) 31px, rgba(31,27,22,0.06) 32px)',
          pointerEvents: 'none'
        }} />
        <div className="stage" style={{ position: 'relative' }}>
          <div style={{
            display: 'grid', gridTemplateColumns: 'minmax(0, 1fr) 640px', gap: 0,
            alignItems: 'stretch', maxWidth: 1100, margin: '0 auto',
            borderRadius: 8, overflow: 'hidden',
            boxShadow: '0 18px 40px -20px rgba(31,27,22,0.18)'
          }}>
            {/* Left: colored info card */}
            <div style={{
              background: card,
              padding: '48px 44px',
              display: 'flex', flexDirection: 'column', justifyContent: 'space-between',
              minHeight: 480,
              color: 'var(--ink)',
              transition: 'background 0.4s ease'
            }}>
              <div>
                <h3 style={{
                  fontFamily: 'var(--garamond)',
                  fontSize: 'clamp(26px, 3vw, 34px)',
                  lineHeight: 1.1, fontWeight: 400, letterSpacing: '-0.015em',
                  marginBottom: 20, textWrap: 'balance', color: 'var(--ink)'
                }}>{tab.title}</h3>
                <p style={{
                  fontSize: 16, lineHeight: 1.55, color: 'rgba(31,27,22,0.78)',
                  marginBottom: 24
                }}>{tab.body}</p>
                <ul style={{ listStyle: 'none' }}>
                  {tab.bullets.map((b, i) =>
                  <li key={i} style={{
                    padding: '8px 0',
                    fontSize: 14, color: 'var(--ink)',
                    display: 'flex', alignItems: 'center', gap: 10
                  }}>
                      <span style={{
                      width: 5, height: 5, borderRadius: '50%',
                      background: 'var(--ink)'
                    }} />
                      {b}
                    </li>
                  )}
                </ul>
              </div>
              <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer" style={{
                alignSelf: 'flex-start',
                marginTop: 32,
                background: 'rgba(255,255,255,0.55)',
                color: 'var(--ink)',
                padding: '10px 18px', fontSize: 14, fontWeight: 500,
                borderRadius: 8,
                border: '1px solid rgba(31,27,22,0.12)'
              }}>Inicia ahora</a>
            </div>

            {/* Right: live mini-product demo on white */}
            <div style={{
              background: '#FFFFFF',
              padding: 20,
              display: 'flex',
              flexDirection: 'column',
              alignItems: 'stretch', justifyContent: 'stretch'
            }}>
              {active === 0 ? (
                <window.AprendeNegocioDemo />
              ) : active === 1 ? (
                <window.TomaLaOrdenDemo />
              ) : active === 2 ? (
                <window.PreparaEntregaDemo />
              ) : (
                <Box height={460} label={'◆ dlega emo: ' + tab.label.toLowerCase()} style={{ flex: 1, border: '1.5px dashed #D6CFC0' }} />
              )}
            </div>
          </div>
        </div>
      </div>
    </section>);

}

// ─── 04 PRICING ───────────────────────────────────────
function Pricing() {
  const plans = [
  {
    name: 'Básico',
    price: '$900',
    currency: 'MXN',
    rate: '100 pedidos · $9.00/pedido',
    features: ['100 pedidos incluidos', 'Menú ilimitado', 'Miembros ilimitados', 'Agente de WhatsApp con IA'],
    cta: 'Inicia ahora'
  },
  {
    name: 'Popular',
    price: '$2,000',
    currency: 'MXN',
    rate: '250 pedidos · $8.00/pedido',
    features: ['250 pedidos incluidos', 'Menú ilimitado', 'Miembros ilimitados', 'Agente de WhatsApp con IA'],
    cta: 'Inicia ahora',
    featured: true
  },
  {
    name: 'Pro',
    price: '$3,500',
    currency: 'MXN',
    rate: '500 pedidos · $7.00/pedido',
    features: ['500 pedidos incluidos', 'Menú ilimitado', 'Miembros ilimitados', 'Agente de WhatsApp con IA'],
    cta: 'Inicia ahora'
  }];

  // íconos minimalistas para las features (en orden)
  const featureIcons = [
  // bowl / pedidos
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"><path d="M3 11h18a9 9 0 0 1-18 0Z" /><path d="M12 3v3" /><path d="M9 5l3 -1 3 1" /></svg>,
  // menu
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"><path d="M6 3v18" /><path d="M6 8a3 3 0 0 0 0 -5" /><path d="M14 3l-1 8h5l-1 -8" /><path d="M16 11v10" /></svg>,
  // members
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"><circle cx="9" cy="8" r="3" /><path d="M3 20c0 -3 3 -5 6 -5s6 2 6 5" /><path d="M16 11a3 3 0 0 0 0 -6" /><path d="M21 20c0 -2.5 -2 -4.2 -4.5 -4.8" /></svg>,
  // bot / whatsapp ai
  <svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.6" strokeLinecap="round" strokeLinejoin="round"><rect x="4" y="7" width="16" height="12" rx="3" /><path d="M12 3v4" /><circle cx="9" cy="13" r="1" /><circle cx="15" cy="13" r="1" /><path d="M9 17h6" /></svg>];


  return (
    <Section id="pricing" num="04" label="precio">
      <h2 style={{
        fontFamily: 'var(--garamond)',
        fontSize: 'clamp(32px, 4.6vw, 56px)',
        lineHeight: 1.05, fontWeight: 400, letterSpacing: '-0.02em',
        maxWidth: 720, marginBottom: 24, textWrap: 'balance'
      }}>
        Pagas por lo que vendes. <em style={{ color: 'var(--mint-deep)' }}>Nada más.</em>
      </h2>
      <p style={{ fontSize: 18, color: 'var(--ink-soft)', maxWidth: 560, marginBottom: 64 }}>Sin contratos. Cancela cuando quieras.

      </p>

      <div style={{
        display: 'grid', gridTemplateColumns: 'repeat(3, 1fr)', gap: 20,
        maxWidth: 1080, margin: '0 auto', alignItems: 'stretch'
      }}>
        {plans.map((p, i) =>
        <div key={i} style={{
          position: 'relative',
          border: p.featured ? '1.5px solid var(--mint-deep)' : '1px solid var(--rule)',
          borderRadius: 14,
          padding: '36px 28px 28px',
          background: p.featured ? 'var(--post-mint, #E9F5EE)' : '#FFF',
          color: 'var(--ink)',
          display: 'flex', flexDirection: 'column',
          boxShadow: p.featured ? '0 18px 40px -18px rgba(46, 138, 90, 0.35)' : 'none',
          transform: p.featured ? 'translateY(-8px)' : 'none'
        }}>
          {p.featured &&
          <div style={{
            position: 'absolute', top: -14, left: '50%', transform: 'translateX(-50%)',
            background: 'var(--mint-deep)', color: '#FFF',
            fontFamily: 'var(--sans)', fontSize: 12, fontWeight: 600,
            padding: '6px 16px', borderRadius: 999,
            letterSpacing: '0.02em'
          }}>Popular</div>}

          <div style={{
            textAlign: 'center',
            fontFamily: 'var(--sans)', fontSize: 18, fontWeight: 600,
            marginBottom: 16, color: 'var(--ink)'
          }}>{p.name}</div>

          <div style={{ textAlign: 'center', marginBottom: 8 }}>
            <span style={{
              fontFamily: 'var(--sans)', fontSize: 44, fontWeight: 700,
              lineHeight: 1, letterSpacing: '-0.02em', color: 'var(--ink)'
            }}>{p.price}</span>
            <span style={{
              fontFamily: 'var(--sans)', fontSize: 14, fontWeight: 500,
              color: 'var(--ink-faint)', marginLeft: 6
            }}>{p.currency}</span>
          </div>

          <div style={{
            textAlign: 'center', fontSize: 14, color: 'var(--ink-faint)',
            marginBottom: 24
          }}>{p.rate}</div>

          <ul style={{ listStyle: 'none', padding: 0, margin: '0 0 28px', flex: 1 }}>
            {p.features.map((f, j) =>
            <li key={j} style={{
              display: 'flex', alignItems: 'center', gap: 12,
              fontSize: 14, color: 'var(--ink-soft)',
              padding: '8px 0'
            }}>
              <span style={{
                color: 'var(--mint-deep)',
                display: 'inline-flex', alignItems: 'center', justifyContent: 'center',
                flexShrink: 0
              }}>{featureIcons[j]}</span>
              {f}
            </li>
            )}
          </ul>

          <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer" style={{
            display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8,
            padding: '14px 16px', borderRadius: 10,
            background: 'var(--mint-deep)',
            color: '#FFF',
            fontSize: 14, fontWeight: 600,
            fontFamily: 'var(--sans)',
            textDecoration: 'none',
            transition: 'filter 0.18s ease'
          }}
          onMouseEnter={(e) => e.currentTarget.style.filter = 'brightness(0.94)'}
          onMouseLeave={(e) => e.currentTarget.style.filter = 'none'}>
            <svg width="14" height="14" viewBox="0 0 24 24" fill="currentColor" aria-hidden>
              <path d="M13 2L3 14h7l-1 8 10-12h-7l1-8z" />
            </svg>
            {p.cta}
          </a>
        </div>
        )}
      </div>
    </Section>);

}

// ─── 05 FAQ ───────────────────────────────────────────
function FAQ() {
  const items = [
  { q: '¿Wapido es un chatbot?', a: '¡No lo es! Los chatbots son cosa del pasado, Wapido fue creado para ofrecer conversaciones fluidas e inteligentes con tus clientes. Usamos IA como cerebro de las conversaciones para lograr este resultado.' },
  { q: '¿Necesito cambiar mi número de WhatsApp?', a: 'No. Wapido se conecta a tu WhatsApp Business actual mediante conexión directa y oficial con Meta. Puedes seguir usando la aplicación en tu celular sin interrupciones.' },
  { q: '¿La implementación tiene costo?', a: '¡Para los primeros 10 restaurantes en Cancún la implementación será gratis! De ahí se cobrará un fee de $2,500+IVA' },
  { q: '¿Cuánto tarda en estar listo Wapido en mi restaurante?', a: 'Uno a dos días más tardar. ¡Te acompañamos personalmente en toda la configuración hasta que quede al 100!' },
  { q: '¿Y si Wapido se equivoca con un pedido?', a: 'Puedes intervenir cualquier conversación en tiempo real si se detecta un error en la toma de pedido. Háznoslo saber y te regalaremos 1 crédito de cortesía por el error.' },
  { q: '¿Cómo funcionan los paquetes?', a: 'Los paquetes son prepagados y se manejan por créditos, donde 1 crédito = 1 pedido. Cada vez que el agente recibe un pedido, se descuenta automáticamente un crédito de tu saldo. Compras el paquete que mejor se ajuste al volumen de tu restaurante y, mientras más grande el paquete, menor el costo por pedido.' },
  { q: '¿Cuáles son los métodos de pago para los paquetes?', a: 'Podrás adquirir los paquetes directamente desde tu cuenta de Wapido con cualquier tarjeta de débito o crédito a través de un link de pago, o si lo prefieres lo puedes abonar mediante depósito o transferencia bancaria a la cuenta correspondiente.' }];

  return (
    <Section id="faq" num="05" label="preguntas">
      <h2 style={{
        fontFamily: 'var(--garamond)',
        fontSize: 'clamp(32px, 4.6vw, 56px)',
        lineHeight: 1.05, fontWeight: 400, letterSpacing: '-0.02em',
        maxWidth: 720, marginBottom: 64, textWrap: 'balance'
      }}>Preguntas frecuentes

      </h2>

      <div style={{ borderTop: '1px solid var(--rule)' }}>
        {items.map((it, i) => <FAQItem key={i} {...it} />)}
      </div>
    </Section>);

}

function FAQItem({ q, a }) {
  const [open, setOpen] = useState(false);
  return (
    <div style={{ borderBottom: '1px solid var(--rule)' }}>
      <button onClick={() => setOpen(!open)} style={{
        width: '100%', textAlign: 'left',
        padding: '24px 0',
        display: 'flex', alignItems: 'center', justifyContent: 'space-between',
        gap: 24
      }}>
        <span style={{
          fontFamily: 'var(--garamond)', fontSize: 22, fontWeight: 400,
          lineHeight: 1.3
        }}>{q}</span>
        <span style={{ fontSize: 24, color: 'var(--ink-faint)' }}>{open ? '−' : '+'}</span>
      </button>
      {open &&
      <p style={{
        paddingBottom: 24, paddingRight: 48,
        fontSize: 17, lineHeight: 1.6, color: 'var(--ink-soft)',
        maxWidth: 720
      }}>{a}</p>
      }
    </div>);

}

// ─── 06 CTA FINAL ─────────────────────────────────────
function CTA() {
  return (
    <section id="cta" style={{

      background: 'var(--paper)', padding: "140px 0px"
    }}>
      <div className="stage">
        <div style={{
          background: 'var(--mint)',
          borderRadius: 8,
          padding: '64px 64px',
          display: 'grid',
          gridTemplateColumns: '1fr 1fr',
          gap: 48,
          alignItems: 'center',
          maxWidth: 1080, margin: '0 auto',
          position: 'relative', overflow: 'hidden'
        }}>
          {/* Izquierda — texto + botón */}
          <div>
            <h2 style={{
              fontFamily: 'var(--garamond)',
              fontSize: 'clamp(32px, 4vw, 48px)',
              lineHeight: 1.05, fontWeight: 400, letterSpacing: '-0.02em',
              marginBottom: 16, textWrap: 'balance', color: 'var(--ink)'
            }}>
              Tus pedidos merecen<br />una mejor herramienta
            </h2>
            <p style={{
              fontSize: 16, lineHeight: 1.55, color: 'rgba(31,27,22,0.78)',
              marginBottom: 32, maxWidth: 380
            }}>
              No importa qué tan grande sea tu restaurante, Wapido es donde todo se arma solo.
            </p>
            <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer" style={{
              display: 'inline-block',
              background: 'var(--ink)',
              color: '#FFF',
              padding: '14px 28px',
              fontSize: 15, fontWeight: 500,
              borderRadius: 8,
              fontFamily: 'var(--sans)'
            }}>Inicia ahora</a>
          </div>

          {/* Derecha — ilustración a mano */}
          <div style={{
            display: 'flex', justifyContent: 'center', alignItems: 'center'
          }}>
            <svg width="320" height="200" viewBox="0 0 320 200" fill="none"
            stroke="var(--ink)" strokeWidth="1.6"
            strokeLinecap="round" strokeLinejoin="round">
              {/* Tres personajes sonrientes */}
              {/* Persona 1 */}
              <path d="M50 110 Q50 80 80 80 Q110 80 110 110" />
              <circle cx="80" cy="68" r="22" />
              <path d="M62 60 Q66 52 74 52 M86 52 Q94 52 98 60" />
              <circle cx="72" cy="70" r="1.5" fill="var(--ink)" />
              <circle cx="88" cy="70" r="1.5" fill="var(--ink)" />
              <path d="M72 78 Q80 84 88 78" />
              {/* Pelo rizado */}
              <path d="M62 50 Q60 42 68 40 M70 38 Q76 34 82 38 M84 38 Q92 36 96 44" />

              {/* Persona 2 (centro) */}
              <path d="M120 110 Q120 80 150 80 Q180 80 180 110" />
              <circle cx="150" cy="68" r="22" />
              <path d="M132 60 Q136 52 144 52 M156 52 Q164 52 168 60" />
              <circle cx="142" cy="70" r="1.5" fill="var(--ink)" />
              <circle cx="158" cy="70" r="1.5" fill="var(--ink)" />
              <path d="M142 78 Q150 84 158 78" />
              <path d="M132 52 L168 52 L166 44 L134 44 Z" />

              {/* Persona 3 */}
              <path d="M190 110 Q190 80 220 80 Q250 80 250 110" />
              <circle cx="220" cy="68" r="22" />
              <path d="M202 60 Q206 52 214 52 M226 52 Q234 52 238 60" />
              <circle cx="212" cy="70" r="1.5" fill="var(--ink)" />
              <circle cx="228" cy="70" r="1.5" fill="var(--ink)" />
              <path d="M212 78 Q220 84 228 78" />
              <path d="M202 50 Q210 42 220 44 Q230 42 238 50" />

              {/* Ornamentos */}
              <text x="270" y="70" style={{ fontFamily: 'var(--garamond)', fontSize: 22, fill: 'var(--ink)', stroke: 'none', fontStyle: 'italic' }}>ε</text>
              <path d="M30 50 L34 54 L30 58 L26 54 Z" />
              <circle cx="280" cy="40" r="2" fill="var(--ink)" />
              <path d="M40 130 L44 136" />
            </svg>
          </div>
        </div>
      </div>
    </section>);

}

// ─── FOOTER ───────────────────────────────────────────
function Footer() {
  return (
    <footer style={{
      padding: '48px 0'
    }}>
      <div className="stage" style={{
        display: 'flex', justifyContent: 'space-between', alignItems: 'center',
        flexWrap: 'wrap', gap: 24
      }}>
        <img src="assets/wapido-logo.svg" alt="wapido" style={{ height: 24 }} />
        <div style={{ display: 'flex', gap: 24, fontSize: 13, color: 'var(--ink-faint)' }}>
          <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer">privacidad</a>
          <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer">términos</a>
          <a href="https://wa.me/message/YD77UWPNTWO2P1" target="_blank" rel="noopener noreferrer">contacto</a>
        </div>
        <div style={{ fontSize: 13, color: 'var(--ink-faint)' }}>© 2026 Wapido</div>
      </div>
    </footer>);

}

// ─── APP ──────────────────────────────────────────────
function App() {
  const [tweaks, setTweak] = useTweaks(window.__WAPIDO_TWEAK_DEFAULTS);
  useEffect(() => {
    const p = PALETTES[tweaks.palette] || PALETTES.paper;
    Object.entries(p).forEach(([k, v]) => document.documentElement.style.setProperty(k, v));
  }, [tweaks.palette]);
  return (
    <>
      <Nav />
      <Hero />
      <QueEsWapido />
      <Capacidades />
      <ParaQuien titleKey={tweaks.paraQuienTitle} />
      <ProcesoScroll />
      {/* <Beneficios /> — Sección guardada. Para mostrarla de nuevo, descomenta esta línea. El componente vive en src/v4/V4App.jsx (función Beneficios). */}
      <Pricing />
      <FAQ />
      <Footer />
      <TweaksPanel title="Tweaks">
        <TweakSection label="Paleta">
          <TweakSelect label="Tono de papel" value={tweaks.palette} onChange={(v) => setTweak('palette', v)}
          options={[
          { value: 'paper', label: 'Papel cálido' },
          { value: 'white', label: 'Blanco limpio' },
          { value: 'cream', label: 'Crema' },
          { value: 'bone', label: 'Hueso' },
          { value: 'sage', label: 'Verde sutil' }]
          } />
        </TweakSection>
        <TweakSection label="Sección ‘Para quién’">
          <TweakSelect label="Título" value={tweaks.paraQuienTitle} onChange={(v) => setTweak('paraQuienTitle', v)}
          options={[
          { value: 'ideal',  label: '¿Wápido es para tu restaurante?' },
          { value: 'paraTi', label: '¿Wapido es para tu restaurante?' },
          { value: 'hecho',  label: 'Hecho para restaurantes ocupados' },
          { value: 'suena',  label: 'Si esto te suena, Wapido es para ti' },
          { value: 'pegado', label: 'Pensado para quien vive pegado al WhatsApp' },
          { value: 'comoEl', label: 'Para restaurantes como el tuyo' }]
          } />
        </TweakSection>
      </TweaksPanel>
    </>);

}

ReactDOM.createRoot(document.getElementById('root')).render(<App />);