// strips-app.jsx — Hey Strips mobile redesign

const BRAND = {
  deep: '#0F3D2E',     // deep forest
  green: '#2C7A53',    // primary
  mint: '#C9E8D4',     // soft mint
  cream: '#F6F2E8',    // warm cream
  ink: '#0E1A13',
  muted: '#5A6B61',
  line: '#E4E8E3',
  pop: '#E8F5EC',
  gold: '#C8A24B',
};

// ─────────────────────────────────────────────────────────
// Responsive
// ─────────────────────────────────────────────────────────
function useIsMobile(breakpoint = 768) {
  const [mobile, setMobile] = React.useState(window.innerWidth < breakpoint);
  React.useEffect(() => {
    const mq = window.matchMedia(`(max-width: ${breakpoint - 1}px)`);
    const handler = (e) => setMobile(e.matches);
    mq.addEventListener('change', handler);
    return () => mq.removeEventListener('change', handler);
  }, [breakpoint]);
  return mobile;
}

// ─────────────────────────────────────────────────────────
// Shopify Headless Checkout
// ─────────────────────────────────────────────────────────
const SHOPIFY = {
  domain: 'hey-strips.myshopify.com',
  variantId: 48208725213416, // Appetite Balance & Weight Support Strips
};

const TWEAK_DEFAULTS = /*EDITMODE-BEGIN*/{
  "heroVariant": "A",
  "ctaStyle": "pill",
  "stickyCTA": true,
  "countdown": true,
  "scarcity": true,
  "urgencyBar": true,
  "socialProofCount": "23,481",
  "theme": "mint"
}/*EDITMODE-END*/;

// ─────────────────────────────────────────────────────────
// Primitives
// ─────────────────────────────────────────────────────────
const Stars = ({ n = 5, size = 12, color = BRAND.gold }) => (
  <span style={{ display: 'inline-flex', gap: 1 }}>
    {Array.from({ length: n }).map((_, i) => (
      <svg key={i} width={size} height={size} viewBox="0 0 24 24" fill={color}>
        <path d="M12 2l3.1 6.3 6.9 1-5 4.9 1.2 6.8L12 17.8 5.8 21l1.2-6.8-5-4.9 6.9-1z"/>
      </svg>
    ))}
  </span>
);

const Check = ({ color = BRAND.green, size = 14 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none">
    <path d="M5 13l4 4L19 7" stroke={color} strokeWidth="3" strokeLinecap="round" strokeLinejoin="round"/>
  </svg>
);

const XMark = ({ color = '#C74F4F', size = 14 }) => (
  <svg width={size} height={size} viewBox="0 0 24 24" fill="none">
    <path d="M6 6l12 12M18 6L6 18" stroke={color} strokeWidth="3" strokeLinecap="round"/>
  </svg>
);

// Product placeholder — stripe pattern pouch
const ProductShot = ({ size = 180, tilt = -6, label = "product shot" }) => (
  <div style={{
    width: size, height: size * 1.15, position: 'relative',
    transform: `rotate(${tilt}deg)`,
    filter: 'drop-shadow(0 30px 40px rgba(15,61,46,0.25))',
  }}>
    <svg width="100%" height="100%" viewBox="0 0 180 210">
      <defs>
        <linearGradient id="pouch" x1="0" y1="0" x2="1" y2="1">
          <stop offset="0" stopColor="#F8F4E9"/>
          <stop offset="1" stopColor="#E8DFC5"/>
        </linearGradient>
        <pattern id="stripes" width="8" height="8" patternUnits="userSpaceOnUse" patternTransform="rotate(-30)">
          <rect width="8" height="8" fill="transparent"/>
          <rect width="3" height="8" fill={BRAND.green} opacity=".12"/>
        </pattern>
      </defs>
      <rect x="12" y="20" width="156" height="178" rx="18" fill="url(#pouch)" stroke={BRAND.deep} strokeOpacity=".15"/>
      <rect x="12" y="20" width="156" height="178" rx="18" fill="url(#stripes)"/>
      <rect x="40" y="6" width="100" height="22" rx="4" fill={BRAND.deep}/>
      <rect x="48" y="12" width="16" height="10" rx="2" fill={BRAND.mint} opacity=".6"/>
      <rect x="68" y="12" width="16" height="10" rx="2" fill={BRAND.mint} opacity=".6"/>
      <rect x="88" y="12" width="16" height="10" rx="2" fill={BRAND.mint} opacity=".6"/>
      <rect x="108" y="12" width="16" height="10" rx="2" fill={BRAND.mint} opacity=".6"/>
      <text x="90" y="88" textAnchor="middle" fontFamily="Fraunces, serif" fontWeight="800" fontSize="28" fill={BRAND.deep}>hey</text>
      <text x="90" y="118" textAnchor="middle" fontFamily="Fraunces, serif" fontWeight="800" fontSize="28" fill={BRAND.deep}>strips</text>
      <rect x="40" y="138" width="100" height="1" fill={BRAND.deep} opacity=".3"/>
      <text x="90" y="156" textAnchor="middle" fontFamily="Inter, sans-serif" fontWeight="600" fontSize="8" fill={BRAND.deep} opacity=".7" letterSpacing="1">APPETITE SUPPORT</text>
      <text x="90" y="178" textAnchor="middle" fontFamily="Fraunces, serif" fontStyle="italic" fontSize="11" fill={BRAND.green}>mint · 30 strips</text>
    </svg>
  </div>
);

// Single strip visual
const StripVisual = ({ w = 60, h = 80 }) => (
  <svg width={w} height={h} viewBox="0 0 60 80">
    <defs>
      <linearGradient id="stripg" x1="0" y1="0" x2="1" y2="1">
        <stop offset="0" stopColor="#DCEFE2"/>
        <stop offset="1" stopColor="#A7D3B6"/>
      </linearGradient>
    </defs>
    <rect x="4" y="4" width="52" height="72" rx="6" fill="url(#stripg)" stroke={BRAND.green} strokeOpacity=".25"/>
    <rect x="4" y="4" width="52" height="72" rx="6" fill="url(#stripes)"/>
    <text x="30" y="38" textAnchor="middle" fontFamily="Fraunces, serif" fontWeight="700" fontSize="10" fill={BRAND.deep}>hey</text>
    <text x="30" y="52" textAnchor="middle" fontFamily="Fraunces, serif" fontWeight="700" fontSize="10" fill={BRAND.deep}>strips</text>
  </svg>
);

// ─────────────────────────────────────────────────────────
// Countdown hook
// ─────────────────────────────────────────────────────────
function useCountdown(minutes = 14) {
  const [s, setS] = React.useState(minutes * 60 + 37);
  React.useEffect(() => {
    const id = setInterval(() => setS(v => (v <= 1 ? minutes * 60 : v - 1)), 1000);
    return () => clearInterval(id);
  }, [minutes]);
  const m = Math.floor(s / 60);
  const sec = s % 60;
  return { m: String(m).padStart(2, '0'), s: String(sec).padStart(2, '0') };
}

// ─────────────────────────────────────────────────────────
// Sections
// ─────────────────────────────────────────────────────────
function UrgencyBar({ tweaks }) {
  const { m, s } = useCountdown(14);
  if (!tweaks.urgencyBar) return null;
  return (
    <div style={{
      background: BRAND.deep, color: '#F6F2E8',
      fontSize: 12, fontWeight: 600, letterSpacing: .2,
      display: 'flex', alignItems: 'center', justifyContent: 'center',
      gap: 8, padding: '10px 16px', textAlign: 'center',
      borderBottom: `1px solid rgba(255,255,255,0.08)`,
    }}>
      <span style={{ width: 6, height: 6, borderRadius: 99, background: '#FF6B6B', boxShadow: '0 0 0 3px rgba(255,107,107,.25)' }} />
      <span>SPRING SALE · 40% OFF ends in</span>
      {tweaks.countdown && (
        <span style={{ fontVariantNumeric: 'tabular-nums', fontWeight: 700, color: '#FFE58A' }}>
          {m}:{s}
        </span>
      )}
    </div>
  );
}

function TopNav() {
  return (
    <div style={{
      display: 'flex', alignItems: 'center', justifyContent: 'space-between',
      padding: '12px 20px', background: '#fff',
      borderBottom: `1px solid ${BRAND.line}`,
    }}>
      <svg width="20" height="14" viewBox="0 0 24 16">
        <rect y="1" width="24" height="2" rx="1" fill={BRAND.ink}/>
        <rect y="7" width="24" height="2" rx="1" fill={BRAND.ink}/>
        <rect y="13" width="16" height="2" rx="1" fill={BRAND.ink}/>
      </svg>
      <div style={{
        fontFamily: 'Fraunces', fontWeight: 800, fontSize: 20,
        letterSpacing: -0.5, color: BRAND.deep,
      }}>
        hey<span style={{ color: BRAND.green, fontStyle: 'italic' }}>strips</span>
      </div>
      <div style={{ display: 'flex', gap: 14 }}>
        <svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M6 7h12l-1.2 10a2 2 0 01-2 1.8H9.2a2 2 0 01-2-1.8L6 7zM9 7V5a3 3 0 016 0v2" stroke={BRAND.ink} strokeWidth="1.6"/></svg>
      </div>
    </div>
  );
}

// HERO — three variants
function HeroA({ tweaks, onBuy }) {
  // Copy-led bold
  return (
    <div style={{
      background: `linear-gradient(180deg, ${BRAND.cream} 0%, #EDE6D2 100%)`,
      padding: '28px 20px 36px', position: 'relative', overflow: 'hidden',
    }}>
      <div style={{ position: 'absolute', top: -60, right: -80, width: 260, height: 260, borderRadius: '50%', background: BRAND.mint, opacity: .5, filter: 'blur(2px)' }} />
      <div style={{ position: 'relative' }}>
        <div style={{
          display: 'inline-flex', alignItems: 'center', gap: 6,
          background: '#fff', padding: '5px 10px', borderRadius: 99,
          fontSize: 11, fontWeight: 600, color: BRAND.deep,
          border: `1px solid ${BRAND.line}`, marginBottom: 16,
        }}>
          <Stars size={10} />
          <span>4.9 · {tweaks.socialProofCount} happy customers</span>
        </div>
        <h1 style={{
          fontFamily: 'Fraunces', fontWeight: 800, fontSize: 40, lineHeight: 1.02,
          letterSpacing: -1.2, margin: '0 0 14px', color: BRAND.deep,
        }}>
          Cravings?<br/>
          <span style={{ fontStyle: 'italic', fontWeight: 500 }}>Gone in </span>
          <span style={{ position: 'relative', display: 'inline-block' }}>
            60s.
            <svg style={{ position: 'absolute', left: -4, bottom: -4, width: '110%' }} viewBox="0 0 100 12" preserveAspectRatio="none">
              <path d="M2 8 Q 50 0, 98 7" stroke={BRAND.green} strokeWidth="3" fill="none" strokeLinecap="round"/>
            </svg>
          </span>
        </h1>
        <p style={{
          fontSize: 15, lineHeight: 1.5, color: BRAND.muted, margin: '0 0 20px',
          maxWidth: 320,
        }}>
          Dissolve-on-tongue strips with saffron + chromium that crush appetite in under a minute. No pills. No jitters.
        </p>

        <div style={{ position: 'relative', display: 'flex', justifyContent: 'center', margin: '-4px 0 20px' }}>
          <ProductShot size={200} tilt={-8} />
          <div style={{ position: 'absolute', top: 30, right: 8, background: '#fff', borderRadius: 14, padding: '8px 12px', boxShadow: '0 10px 24px rgba(15,61,46,.12)', display: 'flex', alignItems: 'center', gap: 8 }}>
            <div style={{ width: 30, height: 30, borderRadius: '50%', background: BRAND.mint, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 14 }}>⚡</div>
            <div>
              <div style={{ fontSize: 11, fontWeight: 700, color: BRAND.deep }}>Works in 60s</div>
              <div style={{ fontSize: 9, color: BRAND.muted }}>Clinically-backed</div>
            </div>
          </div>
          <div style={{ position: 'absolute', bottom: 20, left: 0, background: '#fff', borderRadius: 14, padding: '8px 12px', boxShadow: '0 10px 24px rgba(15,61,46,.12)', display: 'flex', alignItems: 'center', gap: 8 }}>
            <div style={{ width: 30, height: 30, borderRadius: '50%', background: '#FFF1D8', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 14 }}>🌿</div>
            <div>
              <div style={{ fontSize: 11, fontWeight: 700, color: BRAND.deep }}>Saffron-based</div>
              <div style={{ fontSize: 9, color: BRAND.muted }}>Plant-powered</div>
            </div>
          </div>
        </div>

        <CTAButton onClick={onBuy} tweaks={tweaks}>Shop Hey Strips — 40% Off</CTAButton>
        <TrustRow />
      </div>
    </div>
  );
}

function HeroB({ tweaks, onBuy }) {
  // Image-led full bleed
  return (
    <div style={{ background: BRAND.deep, color: '#F6F2E8', padding: '24px 0 0', position: 'relative', overflow: 'hidden' }}>
      <div style={{ padding: '0 20px 20px' }}>
        <div style={{
          display: 'inline-flex', alignItems: 'center', gap: 6,
          background: 'rgba(255,255,255,0.1)', padding: '5px 10px', borderRadius: 99,
          fontSize: 10.5, fontWeight: 600, color: '#E8F5EC',
          border: '1px solid rgba(255,255,255,0.18)', marginBottom: 14,
          textTransform: 'uppercase', letterSpacing: 1,
        }}>
          <span style={{ width: 5, height: 5, borderRadius: 99, background: '#8BE4A8' }} />
          New · science-backed
        </div>
        <h1 style={{
          fontFamily: 'Fraunces', fontWeight: 700, fontSize: 46, lineHeight: .98,
          letterSpacing: -1.5, margin: '0 0 16px',
        }}>
          The pocket-sized<br/>
          <span style={{ fontStyle: 'italic', color: '#A8D9B9' }}>appetite killer.</span>
        </h1>
        <p style={{ fontSize: 14.5, lineHeight: 1.5, color: 'rgba(246,242,232,0.7)', margin: '0 0 20px' }}>
          One strip dissolves on your tongue and quiets cravings in under 60 seconds. No water. No pills. No guilt.
        </p>
      </div>
      <div style={{ background: `linear-gradient(180deg, ${BRAND.deep} 0%, ${BRAND.green} 100%)`, padding: '20px 20px 30px', position: 'relative' }}>
        <div style={{ display: 'flex', justifyContent: 'center', gap: -20 }}>
          <div style={{ transform: 'translateX(20px)' }}><ProductShot size={150} tilt={-12} /></div>
          <div style={{ transform: 'translateX(-20px) translateY(10px)' }}><ProductShot size={150} tilt={8} /></div>
        </div>
        <div style={{ display: 'flex', justifyContent: 'center', gap: 16, marginTop: 20, marginBottom: 16, flexWrap: 'wrap' }}>
          {['Saffron', 'Chromium', 'Glucomannan'].map(k => (
            <div key={k} style={{ fontSize: 11, color: '#A8D9B9', fontWeight: 600, letterSpacing: .5 }}>• {k}</div>
          ))}
        </div>
      </div>
      <div style={{ padding: '0 20px 24px', background: BRAND.green }}>
        <CTAButton onClick={onBuy} tweaks={tweaks} dark>Claim My Strips — 40% Off</CTAButton>
        <TrustRow dark />
      </div>
    </div>
  );
}

function HeroC({ tweaks, onBuy }) {
  // Video/demo-led
  return (
    <div style={{ background: BRAND.cream, padding: '20px 20px 28px' }}>
      <div style={{
        display: 'inline-flex', alignItems: 'center', gap: 6,
        background: '#fff', padding: '5px 10px', borderRadius: 99,
        fontSize: 11, fontWeight: 600, color: BRAND.deep,
        border: `1px solid ${BRAND.line}`, marginBottom: 14,
      }}>
        ⚡ Feel it in 60 seconds
      </div>
      <h1 style={{
        fontFamily: 'Fraunces', fontWeight: 800, fontSize: 38, lineHeight: 1.05,
        letterSpacing: -1.1, margin: '0 0 10px', color: BRAND.deep,
      }}>
        Watch cravings vanish — <span style={{ fontStyle: 'italic', color: BRAND.green }}>live.</span>
      </h1>
      <p style={{ fontSize: 14.5, color: BRAND.muted, lineHeight: 1.5, margin: '0 0 16px' }}>
        Pop one strip. It melts on your tongue. Your hunger signals quiet — without pills, powders, or willpower.
      </p>

      {/* Fake video card */}
      <div style={{
        position: 'relative', borderRadius: 22, overflow: 'hidden', aspectRatio: '4/5',
        background: `linear-gradient(135deg, ${BRAND.mint} 0%, ${BRAND.green} 100%)`,
        marginBottom: 18, boxShadow: '0 20px 40px rgba(15,61,46,.2)',
      }}>
        <div style={{ position: 'absolute', inset: 0, backgroundImage: 'repeating-linear-gradient(45deg, rgba(255,255,255,.08) 0 2px, transparent 2px 20px)' }} />
        <div style={{ position: 'absolute', top: 14, left: 14, background: 'rgba(0,0,0,.5)', color: '#fff', padding: '4px 9px', borderRadius: 99, fontSize: 10.5, fontWeight: 600, display: 'flex', alignItems: 'center', gap: 5 }}>
          <span style={{ width: 5, height: 5, borderRadius: 99, background: '#FF6B6B' }} />
          LIVE DEMO · 0:18
        </div>
        <div style={{ position: 'absolute', inset: 0, display: 'flex', alignItems: 'center', justifyContent: 'center' }}>
          <div style={{
            width: 64, height: 64, borderRadius: 99, background: 'rgba(255,255,255,.95)',
            display: 'flex', alignItems: 'center', justifyContent: 'center',
            boxShadow: '0 10px 30px rgba(0,0,0,.25)',
          }}>
            <svg width="22" height="22" viewBox="0 0 24 24" fill={BRAND.deep}><path d="M8 5v14l11-7z"/></svg>
          </div>
        </div>
        <div style={{ position: 'absolute', bottom: 14, left: 14, right: 14, display: 'flex', justifyContent: 'space-between', alignItems: 'flex-end' }}>
          <div style={{ color: '#fff', fontFamily: 'Fraunces', fontWeight: 700, fontSize: 22, lineHeight: 1, textShadow: '0 2px 12px rgba(0,0,0,.3)' }}>
            "Worked in 42 seconds."<br/>
            <span style={{ fontSize: 11, fontFamily: 'Inter', fontWeight: 500, fontStyle: 'italic' }}>— Jess, verified buyer</span>
          </div>
        </div>
      </div>

      <CTAButton onClick={onBuy} tweaks={tweaks}>Try Hey Strips — 40% Off</CTAButton>
      <TrustRow />
    </div>
  );
}

function CTAButton({ children, onClick, tweaks, dark = false }) {
  const style = tweaks.ctaStyle;
  const base = {
    width: '100%', padding: '16px 20px', border: 'none', cursor: 'pointer',
    fontFamily: 'Inter', fontWeight: 700, fontSize: 16, letterSpacing: .1,
    display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 8,
    transition: 'transform .1s',
  };
  const color = dark ? '#fff' : '#fff';
  const bg = dark ? '#0F3D2E' : BRAND.green;

  if (style === 'block') {
    return (
      <button onClick={onClick} style={{
        ...base, background: bg, color, borderRadius: 4,
        boxShadow: '0 6px 0 #0F3D2E', textTransform: 'uppercase',
      }}>
        {children} →
      </button>
    );
  }
  if (style === 'gradient') {
    return (
      <button onClick={onClick} style={{
        ...base, background: `linear-gradient(135deg, ${BRAND.green} 0%, ${BRAND.deep} 100%)`,
        color, borderRadius: 99, boxShadow: '0 10px 30px rgba(15,61,46,.35)',
      }}>
        {children}
        <svg width="18" height="18" viewBox="0 0 24 24" fill="none"><path d="M5 12h14m-6-6l6 6-6 6" stroke="#fff" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/></svg>
      </button>
    );
  }
  // pill (default)
  return (
    <button onClick={onClick} style={{
      ...base, background: bg, color, borderRadius: 99,
      boxShadow: '0 8px 22px rgba(15,61,46,.22)',
    }}
    onMouseDown={e => e.currentTarget.style.transform = 'scale(.98)'}
    onMouseUp={e => e.currentTarget.style.transform = 'scale(1)'}
    onMouseLeave={e => e.currentTarget.style.transform = 'scale(1)'}
    >
      {children}
      <svg width="16" height="16" viewBox="0 0 24 24" fill="none"><path d="M5 12h14m-6-6l6 6-6 6" stroke="#fff" strokeWidth="2.2" strokeLinecap="round" strokeLinejoin="round"/></svg>
    </button>
  );
}

function TrustRow({ dark = false }) {
  const c = dark ? 'rgba(246,242,232,.8)' : BRAND.muted;
  const items = [
    ['🚚', 'Free shipping'],
    ['↩', '30-day returns'],
    ['🌿', 'Plant-based'],
  ];
  return (
    <div style={{ display: 'flex', justifyContent: 'space-between', marginTop: 12, padding: '0 4px' }}>
      {items.map(([i, t]) => (
        <div key={t} style={{ display: 'flex', alignItems: 'center', gap: 5, fontSize: 10.5, color: c, fontWeight: 500 }}>
          <span>{i}</span>{t}
        </div>
      ))}
    </div>
  );
}

// PRESS BAR
function PressBar() {
  const names = ['VOGUE', 'FORBES', 'BUSTLE', 'COSMO', 'MINDBODY'];
  return (
    <div style={{ background: '#fff', padding: '16px 0', borderBottom: `1px solid ${BRAND.line}` }}>
      <div style={{ fontSize: 9.5, letterSpacing: 2, textAlign: 'center', color: BRAND.muted, marginBottom: 10, fontWeight: 600 }}>
        AS SEEN IN
      </div>
      <div style={{ display: 'flex', justifyContent: 'space-around', padding: '0 16px' }}>
        {names.map(n => (
          <div key={n} style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 13, color: BRAND.deep, letterSpacing: 1.5, opacity: .6 }}>{n}</div>
        ))}
      </div>
    </div>
  );
}

// BENEFITS
function Benefits() {
  const items = [
    { icon: '⚡', t: 'Crushes cravings in 60s', d: 'Dissolvable strip hits fast — no waiting.' },
    { icon: '🌿', t: 'Saffron + chromium', d: 'Clinically-studied ingredients, nothing else.' },
    { icon: '🧊', t: 'No jitters, no crash', d: 'Caffeine-free. Works with your body.' },
    { icon: '👝', t: 'Pocket-sized control', d: 'Pop one anywhere. No water, no pills.' },
  ];
  return (
    <div style={{ background: BRAND.cream, padding: '36px 20px' }}>
      <div style={{ textAlign: 'center', marginBottom: 24 }}>
        <div style={{ fontSize: 11, letterSpacing: 2, fontWeight: 600, color: BRAND.green, marginBottom: 8 }}>WHY IT WORKS</div>
        <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 30, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -.8 }}>
          Appetite support,<br/><span style={{ fontStyle: 'italic' }}>finally simplified.</span>
        </h2>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 10 }}>
        {items.map(b => (
          <div key={b.t} style={{ background: '#fff', borderRadius: 16, padding: 14, border: `1px solid ${BRAND.line}` }}>
            <div style={{ fontSize: 22, marginBottom: 8 }}>{b.icon}</div>
            <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 14, lineHeight: 1.15, color: BRAND.deep, marginBottom: 4 }}>{b.t}</div>
            <div style={{ fontSize: 11.5, color: BRAND.muted, lineHeight: 1.4 }}>{b.d}</div>
          </div>
        ))}
      </div>
    </div>
  );
}

// HOW IT WORKS
function HowItWorks() {
  const steps = [
    { n: '01', t: 'Pop a strip', d: 'Place it on your tongue. No water needed.' },
    { n: '02', t: 'Let it dissolve', d: 'Active ingredients release in 30 seconds.' },
    { n: '03', t: 'Cravings quiet', d: 'Feel calmer and in control within a minute.' },
  ];
  return (
    <div style={{ background: '#fff', padding: '36px 20px' }}>
      <div style={{ textAlign: 'center', marginBottom: 24 }}>
        <div style={{ fontSize: 11, letterSpacing: 2, fontWeight: 600, color: BRAND.green, marginBottom: 8 }}>HOW IT WORKS</div>
        <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 30, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -.8 }}>
          Three steps. <span style={{ fontStyle: 'italic' }}>One minute.</span>
        </h2>
      </div>
      <div style={{ display: 'flex', flexDirection: 'column', gap: 12 }}>
        {steps.map((s, i) => (
          <div key={s.n} style={{
            display: 'flex', gap: 14, alignItems: 'center', padding: 16,
            background: BRAND.cream, borderRadius: 18, position: 'relative',
          }}>
            <div style={{
              width: 48, height: 48, borderRadius: 99, background: BRAND.deep, color: '#fff',
              display: 'flex', alignItems: 'center', justifyContent: 'center',
              fontFamily: 'Fraunces', fontWeight: 700, fontSize: 16, flexShrink: 0,
            }}>{s.n}</div>
            <div>
              <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 17, color: BRAND.deep, marginBottom: 2 }}>{s.t}</div>
              <div style={{ fontSize: 12.5, color: BRAND.muted, lineHeight: 1.4 }}>{s.d}</div>
            </div>
            {i < 2 && <StripVisual w={36} h={48} />}
          </div>
        ))}
      </div>
    </div>
  );
}

// INGREDIENTS
function Ingredients() {
  const ings = [
    { t: 'Saffron Extract', d: 'Mood + appetite regulation', n: '88mg', c: '#FFD9A8' },
    { t: 'Chromium Picolinate', d: 'Steady blood sugar', n: '200mcg', c: '#C9E8D4' },
    { t: 'Glucomannan', d: 'Fiber that fills you up', n: '500mg', c: '#E3DEF0' },
  ];
  return (
    <div style={{ background: BRAND.cream, padding: '36px 20px' }}>
      <div style={{ textAlign: 'center', marginBottom: 24 }}>
        <div style={{ fontSize: 11, letterSpacing: 2, fontWeight: 600, color: BRAND.green, marginBottom: 8 }}>WHAT'S INSIDE</div>
        <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 30, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -.8 }}>
          Three actives. <span style={{ fontStyle: 'italic' }}>Zero filler.</span>
        </h2>
      </div>
      <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
        {ings.map(i => (
          <div key={i.t} style={{
            background: '#fff', borderRadius: 18, padding: '14px 16px',
            display: 'flex', alignItems: 'center', gap: 14, border: `1px solid ${BRAND.line}`,
          }}>
            <div style={{ width: 48, height: 48, borderRadius: 14, background: i.c, flexShrink: 0, display: 'flex', alignItems: 'center', justifyContent: 'center', fontFamily: 'Fraunces', fontWeight: 700, fontSize: 13, color: BRAND.deep }}>
              {i.t.split(' ')[0].slice(0, 2)}
            </div>
            <div style={{ flex: 1 }}>
              <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 16, color: BRAND.deep, display: 'flex', justifyContent: 'space-between', alignItems: 'baseline' }}>
                <span>{i.t}</span>
                <span style={{ fontSize: 11, color: BRAND.green, fontFamily: 'Inter', fontWeight: 700 }}>{i.n}</span>
              </div>
              <div style={{ fontSize: 12, color: BRAND.muted }}>{i.d}</div>
            </div>
          </div>
        ))}
      </div>
      <div style={{ marginTop: 14, display: 'flex', flexWrap: 'wrap', gap: 6, justifyContent: 'center' }}>
        {['Vegan', 'Gluten-free', 'Non-GMO', 'Sugar-free', '3rd-party tested'].map(t => (
          <div key={t} style={{ fontSize: 10.5, padding: '5px 10px', background: '#fff', borderRadius: 99, border: `1px solid ${BRAND.line}`, color: BRAND.deep, fontWeight: 600 }}>✓ {t}</div>
        ))}
      </div>
    </div>
  );
}

// BEFORE / AFTER
function BeforeAfter() {
  return (
    <div style={{ background: BRAND.deep, padding: '36px 20px', color: '#F6F2E8' }}>
      <div style={{ textAlign: 'center', marginBottom: 20 }}>
        <div style={{ fontSize: 11, letterSpacing: 2, fontWeight: 600, color: '#8BE4A8', marginBottom: 8 }}>REAL RESULTS</div>
        <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 30, lineHeight: 1.05, margin: 0, letterSpacing: -.8 }}>
          Before vs. <span style={{ fontStyle: 'italic', color: '#8BE4A8' }}>after.</span>
        </h2>
      </div>
      <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 10 }}>
        {[
          { label: 'BEFORE', head: 'Snacking at 3pm', body: 'Afternoon crashes. Candy drawer raids. Zero willpower left.', color: 'rgba(255,107,107,.15)', border: 'rgba(255,107,107,.3)' },
          { label: 'AFTER', head: 'One strip, calm', body: 'Cravings fade in 60s. Energy steady. You stay in control.', color: 'rgba(139,228,168,.12)', border: 'rgba(139,228,168,.3)' },
        ].map(c => (
          <div key={c.label} style={{
            background: c.color, borderRadius: 18, padding: 16,
            border: `1px solid ${c.border}`,
          }}>
            <div style={{ fontSize: 10, letterSpacing: 2, fontWeight: 700, color: '#A8D9B9', marginBottom: 10 }}>{c.label}</div>
            <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 17, lineHeight: 1.1, marginBottom: 6 }}>{c.head}</div>
            <div style={{ fontSize: 11.5, lineHeight: 1.45, color: 'rgba(246,242,232,.7)' }}>{c.body}</div>
          </div>
        ))}
      </div>
      <div style={{
        marginTop: 16, background: 'rgba(255,255,255,.06)', borderRadius: 16, padding: '14px 16px',
        display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 8, textAlign: 'center',
      }}>
        {[['92%', 'feel fewer cravings'], ['4.2×', 'faster than pills'], ['60s', 'avg time to effect']].map(([n, t]) => (
          <div key={t}>
            <div style={{ fontFamily: 'Fraunces', fontWeight: 800, fontSize: 24, color: '#8BE4A8', lineHeight: 1 }}>{n}</div>
            <div style={{ fontSize: 10, color: 'rgba(246,242,232,.7)', marginTop: 4 }}>{t}</div>
          </div>
        ))}
      </div>
      <div style={{ fontSize: 9, textAlign: 'center', color: 'rgba(246,242,232,.4)', marginTop: 10 }}>
        Based on 2,146 verified customer responses, Jan–Mar 2026.
      </div>
    </div>
  );
}

// COMPARISON
function Comparison() {
  const rows = [
    ['Works in under 60s', true, false],
    ['No pills to swallow', true, false],
    ['Saffron + chromium', true, 'sometimes'],
    ['Caffeine-free', true, false],
    ['No sugar', true, false],
    ['30-day guarantee', true, false],
  ];
  return (
    <div style={{ background: '#fff', padding: '36px 20px' }}>
      <div style={{ textAlign: 'center', marginBottom: 20 }}>
        <div style={{ fontSize: 11, letterSpacing: 2, fontWeight: 600, color: BRAND.green, marginBottom: 8 }}>THE DIFFERENCE</div>
        <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 30, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -.8 }}>
          Hey Strips vs. <span style={{ fontStyle: 'italic' }}>typical supplements.</span>
        </h2>
      </div>
      <div style={{ border: `1px solid ${BRAND.line}`, borderRadius: 18, overflow: 'hidden' }}>
        <div style={{ display: 'grid', gridTemplateColumns: '1.3fr 1fr 1fr', background: BRAND.cream, padding: '12px 14px', fontSize: 12, fontWeight: 700, color: BRAND.deep }}>
          <div>Feature</div>
          <div style={{ textAlign: 'center' }}>Hey Strips</div>
          <div style={{ textAlign: 'center', color: BRAND.muted }}>Others</div>
        </div>
        {rows.map(([feat, hs, other], i) => (
          <div key={feat} style={{
            display: 'grid', gridTemplateColumns: '1.3fr 1fr 1fr',
            padding: '12px 14px', fontSize: 12.5, alignItems: 'center',
            borderTop: i === 0 ? 'none' : `1px solid ${BRAND.line}`, color: BRAND.deep,
          }}>
            <div>{feat}</div>
            <div style={{ textAlign: 'center' }}>{hs ? <Check /> : <XMark />}</div>
            <div style={{ textAlign: 'center' }}>
              {other === 'sometimes' ? <span style={{ fontSize: 10, fontWeight: 600, color: BRAND.muted }}>sometimes</span> : other ? <Check /> : <XMark />}
            </div>
          </div>
        ))}
      </div>
    </div>
  );
}

// PRICING
const BUNDLES = [
  { id: 0, qty: 1, packs: '1 pack', per: 35.99, total: 35.99, save: 0 },
  { id: 1, qty: 3, packs: '3 packs', per: 27.99, total: 83.97, save: 24, badge: 'MOST POPULAR' },
  { id: 2, qty: 6, packs: '6 packs', per: 19.99, total: 119.94, save: 44, badge: 'BEST VALUE' },
];

function Pricing({ onBuy, tweaks, selectedBundle, setSelectedBundle }) {
  const sel = selectedBundle;
  const setSel = setSelectedBundle;
  const plans = BUNDLES;
  return (
    <div id="pricing" style={{ background: BRAND.cream, padding: '36px 20px 30px' }}>
      <div style={{ textAlign: 'center', marginBottom: 20 }}>
        <div style={{ fontSize: 11, letterSpacing: 2, fontWeight: 600, color: BRAND.green, marginBottom: 8 }}>BUILD YOUR BUNDLE</div>
        <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 30, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -.8 }}>
          Stock up and <span style={{ fontStyle: 'italic' }}>save up to 44%.</span>
        </h2>
      </div>

      {tweaks.scarcity && (
        <div style={{ background: 'rgba(232,89,89,.08)', border: '1px solid rgba(232,89,89,.25)', borderRadius: 12, padding: '10px 12px', marginBottom: 14, display: 'flex', alignItems: 'center', gap: 10, fontSize: 12, color: '#A13535' }}>
          <span>🔥</span>
          <div style={{ flex: 1 }}>
            <b>Only 147 packs left</b> at 40% off. Restocks in 2 weeks.
          </div>
        </div>
      )}

      <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
        {plans.map(p => {
          const active = sel === p.id;
          return (
            <button key={p.id} onClick={() => setSel(p.id)} style={{
              position: 'relative', border: `2px solid ${active ? BRAND.green : BRAND.line}`,
              borderRadius: 18, padding: '16px 14px', background: active ? '#fff' : '#FDFCF7',
              display: 'flex', alignItems: 'center', gap: 14, cursor: 'pointer', textAlign: 'left',
              boxShadow: active ? `0 8px 24px rgba(44,122,83,.15)` : 'none',
              transition: 'all .15s',
            }}>
              {p.badge && (
                <div style={{
                  position: 'absolute', top: -9, left: 14, fontSize: 9.5, fontWeight: 700,
                  background: p.id === 2 ? BRAND.gold : BRAND.deep, color: '#fff',
                  padding: '3px 8px', borderRadius: 6, letterSpacing: 1,
                }}>{p.badge}</div>
              )}
              <div style={{
                width: 22, height: 22, borderRadius: 99, border: `2px solid ${active ? BRAND.green : '#C8CEC7'}`,
                display: 'flex', alignItems: 'center', justifyContent: 'center', flexShrink: 0,
              }}>
                {active && <div style={{ width: 10, height: 10, background: BRAND.green, borderRadius: 99 }} />}
              </div>
              <div style={{ display: 'flex', gap: 4 }}>
                {Array.from({ length: Math.min(p.qty, 3) }).map((_, i) => (
                  <div key={i} style={{ transform: `rotate(${(i - 1) * 5}deg)`, marginLeft: i === 0 ? 0 : -14 }}>
                    <StripVisual w={28} h={38} />
                  </div>
                ))}
              </div>
              <div style={{ flex: 1 }}>
                <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 17, color: BRAND.deep, lineHeight: 1 }}>{p.packs}</div>
                <div style={{ fontSize: 11.5, color: BRAND.muted, marginTop: 2 }}>${p.per.toFixed(2)} / pack</div>
              </div>
              <div style={{ textAlign: 'right' }}>
                {p.save > 0 && (
                  <div style={{ fontSize: 10, fontWeight: 700, color: BRAND.green, background: BRAND.pop, padding: '3px 6px', borderRadius: 5, marginBottom: 4, display: 'inline-block' }}>
                    SAVE {p.save}%
                  </div>
                )}
                <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 18, color: BRAND.deep, lineHeight: 1 }}>${p.total.toFixed(2)}</div>
              </div>
            </button>
          );
        })}
      </div>
      <div style={{ marginTop: 16 }}>
        <CTAButton onClick={onBuy} tweaks={tweaks}>Checkout — ${plans[sel].total.toFixed(2)}</CTAButton>
        <div style={{ display: 'flex', justifyContent: 'center', gap: 14, marginTop: 12, fontSize: 10.5, color: BRAND.muted }}>
          <span>🔒 Secure checkout</span>
          <span>🚚 Free US shipping</span>
          <span>↩ 30-day returns</span>
        </div>
      </div>
    </div>
  );
}

// REVIEWS
function Reviews() {
  const reviews = [
    { n: 'Dianna', r: 5, h: 'Saved my 3pm slumps', b: 'I used to snack mindlessly at work. One strip after lunch and the urge is just… gone. I\'ve gone through 4 packs.', v: true },
    { n: 'Henry', r: 5, h: 'Actually works in 60 seconds', b: 'Skeptical at first. Tried it at a restaurant before ordering dessert and genuinely didn\'t want it. Wild.', v: true },
    { n: 'Amanda', r: 5, h: 'Better than gummies', b: 'Way easier than swallowing pills every day. Tastes mint, dissolves fast, no weird aftertaste.', v: true },
  ];
  return (
    <div style={{ background: '#fff', padding: '36px 20px' }}>
      <div style={{ textAlign: 'center', marginBottom: 20 }}>
        <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 8, marginBottom: 8 }}>
          <Stars size={16} />
          <span style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 18, color: BRAND.deep }}>4.9</span>
        </div>
        <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 28, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -.8 }}>
          Based on <span style={{ fontStyle: 'italic' }}>23,481</span> verified reviews
        </h2>
      </div>
      <div style={{ display: 'flex', flexDirection: 'column', gap: 10 }}>
        {reviews.map(r => (
          <div key={r.n} style={{ background: BRAND.cream, borderRadius: 16, padding: 14 }}>
            <div style={{ display: 'flex', alignItems: 'center', gap: 10, marginBottom: 8 }}>
              <div style={{ width: 34, height: 34, borderRadius: 99, background: BRAND.mint, display: 'flex', alignItems: 'center', justifyContent: 'center', fontFamily: 'Fraunces', fontWeight: 700, color: BRAND.deep }}>
                {r.n[0]}
              </div>
              <div style={{ flex: 1 }}>
                <div style={{ fontSize: 13, fontWeight: 700, color: BRAND.deep, display: 'flex', alignItems: 'center', gap: 6 }}>
                  {r.n}
                  {r.v && <span style={{ fontSize: 9, color: BRAND.green, background: BRAND.pop, padding: '2px 6px', borderRadius: 4, fontWeight: 700 }}>✓ VERIFIED</span>}
                </div>
                <Stars size={10} />
              </div>
            </div>
            <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 15, color: BRAND.deep, marginBottom: 4 }}>"{r.h}"</div>
            <div style={{ fontSize: 12.5, color: BRAND.muted, lineHeight: 1.5 }}>{r.b}</div>
          </div>
        ))}
      </div>
    </div>
  );
}

// GUARANTEE
function Guarantee() {
  return (
    <div style={{ background: BRAND.cream, padding: '36px 20px', textAlign: 'center' }}>
      <div style={{
        width: 96, height: 96, borderRadius: 99, background: '#fff', margin: '0 auto 14px',
        display: 'flex', alignItems: 'center', justifyContent: 'center',
        border: `2px dashed ${BRAND.green}`, position: 'relative',
      }}>
        <div style={{ fontFamily: 'Fraunces', fontWeight: 800, fontSize: 20, color: BRAND.deep, lineHeight: .95, letterSpacing: -.5 }}>
          30<br/><span style={{ fontSize: 10, fontStyle: 'italic', fontWeight: 500 }}>day</span>
        </div>
      </div>
      <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 26, lineHeight: 1.05, margin: '0 0 10px', color: BRAND.deep, letterSpacing: -.6 }}>
        Love it or <span style={{ fontStyle: 'italic' }}>your money back.</span>
      </h2>
      <p style={{ fontSize: 13.5, color: BRAND.muted, lineHeight: 1.5, margin: '0 auto', maxWidth: 320 }}>
        Try Hey Strips for 30 days. Don't feel the difference? Email us at hello@heystrips.com — full refund, no questions asked.
      </p>
    </div>
  );
}

// FAQ
function FAQ() {
  const items = [
    ['How do I use the strips?', 'Place one strip on your tongue before or during a meal. It dissolves in about 30 seconds. Most people feel the effect within a minute.'],
    ['What are the ingredients?', 'Each strip contains 88mg saffron extract, 200mcg chromium picolinate, and 500mg glucomannan — plus natural mint flavor. No sugar, no caffeine.'],
    ['How long does one pack last?', 'A pack contains 30 strips, which is enough for about one month if used once daily. Most customers use 1–2 per day.'],
    ['Are there side effects?', 'Hey Strips uses clinically-studied, well-tolerated ingredients. Some people notice mild digestive changes in the first few days as fiber intake increases.'],
    ['How long until I see results?', 'Most customers feel appetite calming within 60 seconds. Sustained results (fewer cravings overall) typically show in 2–4 weeks.'],
    ['Where do you ship?', 'Free shipping in the US (2–5 days). We also ship to Canada, UK, and Australia for a flat fee.'],
  ];
  const [open, setOpen] = React.useState(0);
  return (
    <div style={{ background: '#fff', padding: '36px 20px' }}>
      <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 28, lineHeight: 1.05, margin: '0 0 20px', color: BRAND.deep, letterSpacing: -.8, textAlign: 'center' }}>
        Questions, <span style={{ fontStyle: 'italic' }}>answered.</span>
      </h2>
      <div style={{ display: 'flex', flexDirection: 'column' }}>
        {items.map(([q, a], i) => (
          <div key={q} style={{ borderTop: i === 0 ? `1px solid ${BRAND.line}` : 'none', borderBottom: `1px solid ${BRAND.line}` }}>
            <button onClick={() => setOpen(open === i ? -1 : i)} style={{
              width: '100%', padding: '14px 0', background: 'none', border: 'none',
              display: 'flex', alignItems: 'center', justifyContent: 'space-between',
              fontFamily: 'Inter', fontWeight: 600, fontSize: 14, color: BRAND.deep,
              cursor: 'pointer', textAlign: 'left',
            }}>
              <span>{q}</span>
              <span style={{
                width: 24, height: 24, borderRadius: 99, background: BRAND.cream,
                display: 'flex', alignItems: 'center', justifyContent: 'center',
                transform: open === i ? 'rotate(45deg)' : 'none', transition: 'transform .2s',
                fontSize: 16, color: BRAND.green, fontWeight: 400,
              }}>+</span>
            </button>
            {open === i && (
              <div style={{ fontSize: 13, color: BRAND.muted, lineHeight: 1.55, paddingBottom: 14 }}>
                {a}
              </div>
            )}
          </div>
        ))}
      </div>
    </div>
  );
}

// FOOTER
function Footer() {
  return (
    <div style={{ background: BRAND.deep, color: 'rgba(246,242,232,.7)', padding: '30px 20px 24px', textAlign: 'center' }}>
      <div style={{ fontFamily: 'Fraunces', fontWeight: 800, fontSize: 26, color: '#F6F2E8', letterSpacing: -.5, marginBottom: 14 }}>
        hey<span style={{ color: '#8BE4A8', fontStyle: 'italic' }}>strips</span>
      </div>
      <div style={{ display: 'flex', justifyContent: 'center', gap: 14, fontSize: 11.5, marginBottom: 16 }}>
        <a style={{ color: 'inherit' }}>Shop</a>
        <a style={{ color: 'inherit' }}>Science</a>
        <a style={{ color: 'inherit' }}>Reviews</a>
        <a style={{ color: 'inherit' }}>FAQ</a>
      </div>
      <div style={{ fontSize: 9.5, color: 'rgba(246,242,232,.4)', lineHeight: 1.5 }}>
        © 2026 Hey Strips. These statements have not been evaluated by the FDA.<br/>This product is not intended to diagnose, treat, cure, or prevent any disease.
      </div>
    </div>
  );
}

// STICKY ATC
function StickyATC({ tweaks, onBuy, visible, selectedBundle }) {
  if (!tweaks.stickyCTA || !visible) return null;
  const bundle = BUNDLES[selectedBundle];
  const originalPerPack = BUNDLES[0].per;
  return (
    <div style={{
      position: 'fixed', left: 0, right: 0, bottom: 0, zIndex: 100,
      padding: '12px 16px', paddingBottom: 'max(12px, env(safe-area-inset-bottom))',
      background: 'rgba(255,255,255,0.92)',
      backdropFilter: 'blur(12px)',
      WebkitBackdropFilter: 'blur(12px)',
      borderTop: `1px solid ${BRAND.line}`,
    }}>
      <div style={{
        maxWidth: 640, margin: '0 auto',
        display: 'flex', alignItems: 'center', gap: 12,
      }}>
        <div>
          {bundle.save > 0 && <div style={{ fontSize: 10, color: BRAND.muted, textDecoration: 'line-through', lineHeight: 1 }}>${(originalPerPack * bundle.qty).toFixed(2)}</div>}
          <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 20, color: BRAND.deep, lineHeight: 1, whiteSpace: 'nowrap' }}>${bundle.total.toFixed(2)} {bundle.save > 0 && <span style={{ fontSize: 10, color: BRAND.green, fontFamily: 'Inter', fontWeight: 700 }}>-{bundle.save}%</span>}</div>
        </div>
        <button onClick={onBuy} style={{
          flex: 1, background: BRAND.green, color: '#fff', border: 'none',
          padding: '14px 20px', borderRadius: 99, fontWeight: 700, fontSize: 15,
          cursor: 'pointer', display: 'flex', alignItems: 'center', justifyContent: 'center', gap: 6,
          boxShadow: '0 6px 16px rgba(44,122,83,.3)',
        }}>
          Add to Cart
          <svg width="14" height="14" viewBox="0 0 24 24" fill="none"><path d="M5 12h14m-6-6l6 6-6 6" stroke="#fff" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round"/></svg>
        </button>
      </div>
    </div>
  );
}

// Social proof floater
function ProofFloater() {
  const items = [
    'Megan in Austin just bought 6 packs',
    'Chris in Brooklyn just bought 3 packs',
    'Jasmine in LA just bought 3 packs',
    'Taylor in Dallas just bought 1 pack',
  ];
  const [i, setI] = React.useState(0);
  const [show, setShow] = React.useState(false);
  React.useEffect(() => {
    const t1 = setTimeout(() => setShow(true), 3000);
    const t2 = setInterval(() => {
      setShow(false);
      setTimeout(() => { setI(v => (v + 1) % items.length); setShow(true); }, 300);
    }, 6000);
    return () => { clearTimeout(t1); clearInterval(t2); };
  }, []);
  return (
    <div style={{
      position: 'fixed', left: 12, bottom: 90, zIndex: 90,
      background: '#fff', border: `1px solid ${BRAND.line}`,
      borderRadius: 14, padding: '8px 12px 8px 8px',
      display: 'flex', alignItems: 'center', gap: 10,
      boxShadow: '0 10px 24px rgba(15,61,46,.15)',
      opacity: show ? 1 : 0, transform: show ? 'translateY(0)' : 'translateY(20px)',
      transition: 'all .4s', maxWidth: 260, pointerEvents: 'none',
    }}>
      <div style={{ width: 30, height: 30, borderRadius: 99, background: BRAND.mint, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 14 }}>🛒</div>
      <div>
        <div style={{ fontSize: 11.5, color: BRAND.deep, fontWeight: 600, lineHeight: 1.2 }}>{items[i]}</div>
        <div style={{ fontSize: 9.5, color: BRAND.muted, marginTop: 1 }}>2 min ago · verified</div>
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────
// TWEAKS panel
// ─────────────────────────────────────────────────────────
function TweaksPanel({ tweaks, setTweaks, onClose }) {
  const up = (k, v) => {
    const next = { ...tweaks, [k]: v };
    setTweaks(next);
    window.parent.postMessage({ type: '__edit_mode_set_keys', edits: { [k]: v } }, '*');
  };
  const Row = ({ label, children }) => (
    <div style={{ display: 'flex', alignItems: 'center', justifyContent: 'space-between', padding: '10px 0', borderBottom: '1px solid rgba(255,255,255,0.08)' }}>
      <div style={{ fontSize: 12, color: '#E4E8E3', fontWeight: 500 }}>{label}</div>
      <div>{children}</div>
    </div>
  );
  const Pill = ({ active, onClick, children }) => (
    <button onClick={onClick} style={{
      background: active ? '#8BE4A8' : 'rgba(255,255,255,0.08)',
      color: active ? '#0F3D2E' : '#F6F2E8',
      border: 'none', padding: '5px 10px', borderRadius: 99,
      fontSize: 11, fontWeight: 600, cursor: 'pointer', marginLeft: 4,
    }}>{children}</button>
  );
  const Toggle = ({ on, onClick }) => (
    <button onClick={onClick} style={{
      width: 34, height: 20, borderRadius: 99, border: 'none', position: 'relative',
      background: on ? '#8BE4A8' : 'rgba(255,255,255,0.18)', cursor: 'pointer',
      transition: 'background .15s',
    }}>
      <div style={{
        position: 'absolute', top: 2, left: on ? 16 : 2, width: 16, height: 16,
        borderRadius: 99, background: '#fff', transition: 'left .15s',
      }} />
    </button>
  );
  return (
    <div style={{
      position: 'fixed', right: 20, bottom: 20, zIndex: 1000,
      width: 280, padding: '14px 16px 12px',
      background: 'rgba(15,26,20,0.96)', backdropFilter: 'blur(12px)',
      borderRadius: 16, border: '1px solid rgba(255,255,255,0.1)',
      color: '#F6F2E8', fontFamily: 'Inter, sans-serif',
      boxShadow: '0 30px 60px rgba(0,0,0,.4)',
    }}>
      <div style={{ display: 'flex', justifyContent: 'space-between', alignItems: 'center', marginBottom: 6 }}>
        <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 16 }}>Tweaks</div>
        <button onClick={onClose} style={{ background: 'none', border: 'none', color: 'rgba(255,255,255,0.5)', cursor: 'pointer', fontSize: 16 }}>×</button>
      </div>
      <Row label="Hero variant">
        {['A', 'B', 'C'].map(v => <Pill key={v} active={tweaks.heroVariant === v} onClick={() => up('heroVariant', v)}>{v}</Pill>)}
      </Row>
      <Row label="CTA style">
        {[['pill', 'Pill'], ['block', 'Block'], ['gradient', 'Grad']].map(([k, l]) => (
          <Pill key={k} active={tweaks.ctaStyle === k} onClick={() => up('ctaStyle', k)}>{l}</Pill>
        ))}
      </Row>
      <Row label="Sticky ATC"><Toggle on={tweaks.stickyCTA} onClick={() => up('stickyCTA', !tweaks.stickyCTA)} /></Row>
      <Row label="Urgency bar"><Toggle on={tweaks.urgencyBar} onClick={() => up('urgencyBar', !tweaks.urgencyBar)} /></Row>
      <Row label="Countdown"><Toggle on={tweaks.countdown} onClick={() => up('countdown', !tweaks.countdown)} /></Row>
      <Row label="Scarcity"><Toggle on={tweaks.scarcity} onClick={() => up('scarcity', !tweaks.scarcity)} /></Row>
      <div style={{ fontSize: 10, color: 'rgba(255,255,255,0.4)', marginTop: 10, lineHeight: 1.4 }}>
        Toggle <b>Tweaks</b> in the toolbar to hide this panel.
      </div>
    </div>
  );
}

// ─────────────────────────────────────────────────────────
// App root
// ─────────────────────────────────────────────────────────
// Desktop-specific section wrappers
// ─────────────────────────────────────────────────────────
const Wrap = ({ children, style = {} }) => (
  <div style={{ maxWidth: 1100, margin: '0 auto', padding: '0 40px', ...style }}>{children}</div>
);

function DesktopNav({ onBuy }) {
  return (
    <div style={{ background: '#fff', borderBottom: `1px solid ${BRAND.line}` }}>
      <div style={{
        maxWidth: 1100, margin: '0 auto', padding: '16px 40px',
        display: 'flex', alignItems: 'center', justifyContent: 'space-between',
      }}>
        <div style={{ fontFamily: 'Fraunces', fontWeight: 800, fontSize: 24, letterSpacing: -0.5, color: BRAND.deep }}>
          hey<span style={{ color: BRAND.green, fontStyle: 'italic' }}>strips</span>
        </div>
        <div style={{ display: 'flex', alignItems: 'center', gap: 32, fontSize: 14, fontWeight: 500, color: BRAND.muted }}>
          <a href="#benefits" style={{ color: 'inherit', textDecoration: 'none' }}>Benefits</a>
          <a href="#how" style={{ color: 'inherit', textDecoration: 'none' }}>How It Works</a>
          <a href="#reviews" style={{ color: 'inherit', textDecoration: 'none' }}>Reviews</a>
          <a href="#faq" style={{ color: 'inherit', textDecoration: 'none' }}>FAQ</a>
          <button onClick={onBuy} style={{
            background: BRAND.green, color: '#fff', border: 'none',
            padding: '10px 24px', borderRadius: 99, fontWeight: 700, fontSize: 14,
            cursor: 'pointer',
          }}>Shop Now</button>
        </div>
      </div>
    </div>
  );
}

function DesktopHero({ tweaks, onBuy }) {
  return (
    <div style={{ background: `linear-gradient(180deg, ${BRAND.cream} 0%, #EDE6D2 100%)`, position: 'relative', overflow: 'hidden' }}>
      <div style={{ position: 'absolute', top: -120, right: -160, width: 500, height: 500, borderRadius: '50%', background: BRAND.mint, opacity: .4, filter: 'blur(4px)' }} />
      <Wrap style={{ padding: '60px 40px 70px', display: 'flex', alignItems: 'center', gap: 60, position: 'relative' }}>
        <div style={{ flex: 1 }}>
          <div style={{
            display: 'inline-flex', alignItems: 'center', gap: 6,
            background: '#fff', padding: '6px 12px', borderRadius: 99,
            fontSize: 13, fontWeight: 600, color: BRAND.deep,
            border: `1px solid ${BRAND.line}`, marginBottom: 20,
          }}>
            <Stars size={12} />
            <span>4.9 · {tweaks.socialProofCount} happy customers</span>
          </div>
          <h1 style={{
            fontFamily: 'Fraunces', fontWeight: 800, fontSize: 56, lineHeight: 1.02,
            letterSpacing: -1.8, margin: '0 0 20px', color: BRAND.deep,
          }}>
            Cravings?<br/>
            <span style={{ fontStyle: 'italic', fontWeight: 500 }}>Gone in </span>
            <span style={{ position: 'relative', display: 'inline-block' }}>
              60s.
              <svg style={{ position: 'absolute', left: -4, bottom: -4, width: '110%' }} viewBox="0 0 100 12" preserveAspectRatio="none">
                <path d="M2 8 Q 50 0, 98 7" stroke={BRAND.green} strokeWidth="3" fill="none" strokeLinecap="round"/>
              </svg>
            </span>
          </h1>
          <p style={{ fontSize: 17, lineHeight: 1.6, color: BRAND.muted, margin: '0 0 28px', maxWidth: 420 }}>
            Dissolve-on-tongue strips with saffron + chromium that crush appetite in under a minute. No pills. No jitters.
          </p>
          <div style={{ maxWidth: 320 }}>
            <CTAButton onClick={onBuy} tweaks={tweaks}>Shop Hey Strips — 40% Off</CTAButton>
          </div>
          <TrustRow />
        </div>
        <div style={{ flex: '0 0 auto', position: 'relative' }}>
          <ProductShot size={280} tilt={-6} />
          <div style={{ position: 'absolute', top: 40, right: -30, background: '#fff', borderRadius: 16, padding: '10px 14px', boxShadow: '0 12px 30px rgba(15,61,46,.12)', display: 'flex', alignItems: 'center', gap: 10 }}>
            <div style={{ width: 36, height: 36, borderRadius: '50%', background: BRAND.mint, display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 16 }}>⚡</div>
            <div>
              <div style={{ fontSize: 13, fontWeight: 700, color: BRAND.deep }}>Works in 60s</div>
              <div style={{ fontSize: 10, color: BRAND.muted }}>Clinically-backed</div>
            </div>
          </div>
          <div style={{ position: 'absolute', bottom: 30, left: -40, background: '#fff', borderRadius: 16, padding: '10px 14px', boxShadow: '0 12px 30px rgba(15,61,46,.12)', display: 'flex', alignItems: 'center', gap: 10 }}>
            <div style={{ width: 36, height: 36, borderRadius: '50%', background: '#FFF1D8', display: 'flex', alignItems: 'center', justifyContent: 'center', fontSize: 16 }}>🌿</div>
            <div>
              <div style={{ fontSize: 13, fontWeight: 700, color: BRAND.deep }}>Saffron-based</div>
              <div style={{ fontSize: 10, color: BRAND.muted }}>Plant-powered</div>
            </div>
          </div>
        </div>
      </Wrap>
    </div>
  );
}

function DesktopBenefits() {
  const items = [
    { icon: '⚡', t: 'Crushes cravings in 60s', d: 'Dissolvable strip hits fast — no waiting.' },
    { icon: '🌿', t: 'Saffron + chromium', d: 'Clinically-studied ingredients, nothing else.' },
    { icon: '🧊', t: 'No jitters, no crash', d: 'Caffeine-free. Works with your body.' },
    { icon: '👝', t: 'Pocket-sized control', d: 'Pop one anywhere. No water, no pills.' },
  ];
  return (
    <div id="benefits" style={{ background: BRAND.cream, padding: '70px 0' }}>
      <Wrap>
        <div style={{ textAlign: 'center', marginBottom: 40 }}>
          <div style={{ fontSize: 12, letterSpacing: 2, fontWeight: 600, color: BRAND.green, marginBottom: 10 }}>WHY IT WORKS</div>
          <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 40, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -1 }}>
            Appetite support, <span style={{ fontStyle: 'italic' }}>finally simplified.</span>
          </h2>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr 1fr', gap: 16 }}>
          {items.map(b => (
            <div key={b.t} style={{ background: '#fff', borderRadius: 20, padding: 24, border: `1px solid ${BRAND.line}` }}>
              <div style={{ fontSize: 28, marginBottom: 12 }}>{b.icon}</div>
              <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 18, lineHeight: 1.2, color: BRAND.deep, marginBottom: 6 }}>{b.t}</div>
              <div style={{ fontSize: 14, color: BRAND.muted, lineHeight: 1.5 }}>{b.d}</div>
            </div>
          ))}
        </div>
      </Wrap>
    </div>
  );
}

function DesktopHowItWorks() {
  const steps = [
    { n: '01', t: 'Pop a strip', d: 'Place it on your tongue. No water needed.' },
    { n: '02', t: 'Let it dissolve', d: 'Active ingredients release in 30 seconds.' },
    { n: '03', t: 'Cravings quiet', d: 'Feel calmer and in control within a minute.' },
  ];
  return (
    <div id="how" style={{ background: '#fff', padding: '70px 0' }}>
      <Wrap>
        <div style={{ textAlign: 'center', marginBottom: 40 }}>
          <div style={{ fontSize: 12, letterSpacing: 2, fontWeight: 600, color: BRAND.green, marginBottom: 10 }}>HOW IT WORKS</div>
          <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 40, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -1 }}>
            Three steps. <span style={{ fontStyle: 'italic' }}>One minute.</span>
          </h2>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 20 }}>
          {steps.map((s, i) => (
            <div key={s.n} style={{
              display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center',
              padding: 30, background: BRAND.cream, borderRadius: 24,
            }}>
              <div style={{
                width: 60, height: 60, borderRadius: 99, background: BRAND.deep, color: '#fff',
                display: 'flex', alignItems: 'center', justifyContent: 'center',
                fontFamily: 'Fraunces', fontWeight: 700, fontSize: 20, marginBottom: 16,
              }}>{s.n}</div>
              <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 22, color: BRAND.deep, marginBottom: 6 }}>{s.t}</div>
              <div style={{ fontSize: 14, color: BRAND.muted, lineHeight: 1.5 }}>{s.d}</div>
            </div>
          ))}
        </div>
      </Wrap>
    </div>
  );
}

function DesktopIngredients() {
  const ings = [
    { t: 'Saffron Extract', d: 'Mood + appetite regulation', n: '88mg', c: '#FFD9A8' },
    { t: 'Chromium Picolinate', d: 'Steady blood sugar', n: '200mcg', c: '#C9E8D4' },
    { t: 'Glucomannan', d: 'Fiber that fills you up', n: '500mg', c: '#E3DEF0' },
  ];
  return (
    <div style={{ background: BRAND.cream, padding: '70px 0' }}>
      <Wrap>
        <div style={{ textAlign: 'center', marginBottom: 40 }}>
          <div style={{ fontSize: 12, letterSpacing: 2, fontWeight: 600, color: BRAND.green, marginBottom: 10 }}>WHAT'S INSIDE</div>
          <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 40, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -1 }}>
            Three actives. <span style={{ fontStyle: 'italic' }}>Zero filler.</span>
          </h2>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 16 }}>
          {ings.map(i => (
            <div key={i.t} style={{
              background: '#fff', borderRadius: 22, padding: 28,
              border: `1px solid ${BRAND.line}`, textAlign: 'center',
            }}>
              <div style={{ width: 64, height: 64, borderRadius: 18, background: i.c, margin: '0 auto 16px', display: 'flex', alignItems: 'center', justifyContent: 'center', fontFamily: 'Fraunces', fontWeight: 700, fontSize: 18, color: BRAND.deep }}>
                {i.t.split(' ')[0].slice(0, 2)}
              </div>
              <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 20, color: BRAND.deep, marginBottom: 4 }}>{i.t}</div>
              <div style={{ fontSize: 14, color: BRAND.muted, marginBottom: 8 }}>{i.d}</div>
              <div style={{ fontSize: 13, color: BRAND.green, fontWeight: 700 }}>{i.n}</div>
            </div>
          ))}
        </div>
        <div style={{ marginTop: 24, display: 'flex', flexWrap: 'wrap', gap: 8, justifyContent: 'center' }}>
          {['Vegan', 'Gluten-free', 'Non-GMO', 'Sugar-free', '3rd-party tested'].map(t => (
            <div key={t} style={{ fontSize: 12, padding: '6px 14px', background: '#fff', borderRadius: 99, border: `1px solid ${BRAND.line}`, color: BRAND.deep, fontWeight: 600 }}>✓ {t}</div>
          ))}
        </div>
      </Wrap>
    </div>
  );
}

function DesktopBeforeAfter() {
  return (
    <div style={{ background: BRAND.deep, padding: '70px 0', color: '#F6F2E8' }}>
      <Wrap>
        <div style={{ textAlign: 'center', marginBottom: 40 }}>
          <div style={{ fontSize: 12, letterSpacing: 2, fontWeight: 600, color: '#8BE4A8', marginBottom: 10 }}>REAL RESULTS</div>
          <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 40, lineHeight: 1.05, margin: 0, letterSpacing: -1 }}>
            Before vs. <span style={{ fontStyle: 'italic', color: '#8BE4A8' }}>after.</span>
          </h2>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr', gap: 20, maxWidth: 700, margin: '0 auto' }}>
          {[
            { label: 'BEFORE', head: 'Snacking at 3pm', body: 'Afternoon crashes. Candy drawer raids. Zero willpower left.', color: 'rgba(255,107,107,.15)', border: 'rgba(255,107,107,.3)' },
            { label: 'AFTER', head: 'One strip, calm', body: 'Cravings fade in 60s. Energy steady. You stay in control.', color: 'rgba(139,228,168,.12)', border: 'rgba(139,228,168,.3)' },
          ].map(c => (
            <div key={c.label} style={{ background: c.color, borderRadius: 24, padding: 28, border: `1px solid ${c.border}` }}>
              <div style={{ fontSize: 11, letterSpacing: 2, fontWeight: 700, color: '#A8D9B9', marginBottom: 14 }}>{c.label}</div>
              <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 24, lineHeight: 1.1, marginBottom: 8 }}>{c.head}</div>
              <div style={{ fontSize: 15, lineHeight: 1.5, color: 'rgba(246,242,232,.7)' }}>{c.body}</div>
            </div>
          ))}
        </div>
        <div style={{
          marginTop: 30, background: 'rgba(255,255,255,.06)', borderRadius: 20, padding: '20px 24px',
          display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 16, textAlign: 'center',
          maxWidth: 600, margin: '30px auto 0',
        }}>
          {[['92%', 'feel fewer cravings'], ['4.2×', 'faster than pills'], ['60s', 'avg time to effect']].map(([n, t]) => (
            <div key={t}>
              <div style={{ fontFamily: 'Fraunces', fontWeight: 800, fontSize: 32, color: '#8BE4A8', lineHeight: 1 }}>{n}</div>
              <div style={{ fontSize: 12, color: 'rgba(246,242,232,.7)', marginTop: 6 }}>{t}</div>
            </div>
          ))}
        </div>
        <div style={{ fontSize: 10, textAlign: 'center', color: 'rgba(246,242,232,.4)', marginTop: 14 }}>
          Based on 2,146 verified customer responses, Jan–Mar 2026.
        </div>
      </Wrap>
    </div>
  );
}

function DesktopComparison() {
  const rows = [
    ['Works in under 60s', true, false],
    ['No pills to swallow', true, false],
    ['Saffron + chromium', true, 'sometimes'],
    ['Caffeine-free', true, false],
    ['No sugar', true, false],
    ['30-day guarantee', true, false],
  ];
  return (
    <div style={{ background: '#fff', padding: '70px 0' }}>
      <Wrap>
        <div style={{ textAlign: 'center', marginBottom: 40 }}>
          <div style={{ fontSize: 12, letterSpacing: 2, fontWeight: 600, color: BRAND.green, marginBottom: 10 }}>THE DIFFERENCE</div>
          <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 40, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -1 }}>
            Hey Strips vs. <span style={{ fontStyle: 'italic' }}>typical supplements.</span>
          </h2>
        </div>
        <div style={{ border: `1px solid ${BRAND.line}`, borderRadius: 22, overflow: 'hidden', maxWidth: 700, margin: '0 auto' }}>
          <div style={{ display: 'grid', gridTemplateColumns: '1.3fr 1fr 1fr', background: BRAND.cream, padding: '14px 20px', fontSize: 14, fontWeight: 700, color: BRAND.deep }}>
            <div>Feature</div>
            <div style={{ textAlign: 'center' }}>Hey Strips</div>
            <div style={{ textAlign: 'center', color: BRAND.muted }}>Others</div>
          </div>
          {rows.map(([feat, hs, other], i) => (
            <div key={feat} style={{
              display: 'grid', gridTemplateColumns: '1.3fr 1fr 1fr',
              padding: '14px 20px', fontSize: 14, alignItems: 'center',
              borderTop: i === 0 ? 'none' : `1px solid ${BRAND.line}`, color: BRAND.deep,
            }}>
              <div>{feat}</div>
              <div style={{ textAlign: 'center' }}>{hs ? <Check size={16} /> : <XMark size={16} />}</div>
              <div style={{ textAlign: 'center' }}>
                {other === 'sometimes' ? <span style={{ fontSize: 12, fontWeight: 600, color: BRAND.muted }}>sometimes</span> : other ? <Check size={16} /> : <XMark size={16} />}
              </div>
            </div>
          ))}
        </div>
      </Wrap>
    </div>
  );
}

function DesktopReviews() {
  const reviews = [
    { n: 'Dianna', r: 5, h: 'Saved my 3pm slumps', b: 'I used to snack mindlessly at work. One strip after lunch and the urge is just… gone. I\'ve gone through 4 packs.', v: true },
    { n: 'Henry', r: 5, h: 'Actually works in 60 seconds', b: 'Skeptical at first. Tried it at a restaurant before ordering dessert and genuinely didn\'t want it. Wild.', v: true },
    { n: 'Amanda', r: 5, h: 'Better than gummies', b: 'Way easier than swallowing pills every day. Tastes mint, dissolves fast, no weird aftertaste.', v: true },
  ];
  return (
    <div id="reviews" style={{ background: '#fff', padding: '70px 0' }}>
      <Wrap>
        <div style={{ textAlign: 'center', marginBottom: 40 }}>
          <div style={{ display: 'flex', justifyContent: 'center', alignItems: 'center', gap: 10, marginBottom: 10 }}>
            <Stars size={18} />
            <span style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 22, color: BRAND.deep }}>4.9</span>
          </div>
          <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 38, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -1 }}>
            Based on <span style={{ fontStyle: 'italic' }}>23,481</span> verified reviews
          </h2>
        </div>
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 16 }}>
          {reviews.map(r => (
            <div key={r.n} style={{ background: BRAND.cream, borderRadius: 20, padding: 24 }}>
              <div style={{ display: 'flex', alignItems: 'center', gap: 12, marginBottom: 12 }}>
                <div style={{ width: 42, height: 42, borderRadius: 99, background: BRAND.mint, display: 'flex', alignItems: 'center', justifyContent: 'center', fontFamily: 'Fraunces', fontWeight: 700, fontSize: 16, color: BRAND.deep }}>
                  {r.n[0]}
                </div>
                <div style={{ flex: 1 }}>
                  <div style={{ fontSize: 15, fontWeight: 700, color: BRAND.deep, display: 'flex', alignItems: 'center', gap: 8 }}>
                    {r.n}
                    {r.v && <span style={{ fontSize: 10, color: BRAND.green, background: BRAND.pop, padding: '2px 8px', borderRadius: 4, fontWeight: 700 }}>✓ VERIFIED</span>}
                  </div>
                  <Stars size={11} />
                </div>
              </div>
              <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 18, color: BRAND.deep, marginBottom: 6 }}>"{r.h}"</div>
              <div style={{ fontSize: 14, color: BRAND.muted, lineHeight: 1.6 }}>{r.b}</div>
            </div>
          ))}
        </div>
      </Wrap>
    </div>
  );
}

function DesktopPricing({ onBuy, tweaks, selectedBundle, setSelectedBundle }) {
  const sel = selectedBundle;
  const setSel = setSelectedBundle;
  const plans = BUNDLES;
  return (
    <div id="pricing" style={{ background: BRAND.cream, padding: '70px 0' }}>
      <Wrap>
        <div style={{ textAlign: 'center', marginBottom: 40 }}>
          <div style={{ fontSize: 12, letterSpacing: 2, fontWeight: 600, color: BRAND.green, marginBottom: 10 }}>BUILD YOUR BUNDLE</div>
          <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 40, lineHeight: 1.05, margin: 0, color: BRAND.deep, letterSpacing: -1 }}>
            Stock up and <span style={{ fontStyle: 'italic' }}>save up to 44%.</span>
          </h2>
        </div>
        {tweaks.scarcity && (
          <div style={{ background: 'rgba(232,89,89,.08)', border: '1px solid rgba(232,89,89,.25)', borderRadius: 14, padding: '12px 16px', marginBottom: 20, display: 'flex', alignItems: 'center', gap: 10, fontSize: 14, color: '#A13535', maxWidth: 500, margin: '0 auto 20px' }}>
            <span>🔥</span>
            <div style={{ flex: 1 }}><b>Only 147 packs left</b> at 40% off. Restocks in 2 weeks.</div>
          </div>
        )}
        <div style={{ display: 'grid', gridTemplateColumns: '1fr 1fr 1fr', gap: 16 }}>
          {plans.map(p => {
            const active = sel === p.id;
            return (
              <button key={p.id} onClick={() => setSel(p.id)} style={{
                position: 'relative', border: `2px solid ${active ? BRAND.green : BRAND.line}`,
                borderRadius: 22, padding: '28px 20px', background: active ? '#fff' : '#FDFCF7',
                cursor: 'pointer', textAlign: 'center',
                boxShadow: active ? '0 12px 30px rgba(44,122,83,.15)' : 'none',
                transition: 'all .15s', display: 'flex', flexDirection: 'column', alignItems: 'center', gap: 12,
              }}>
                {p.badge && (
                  <div style={{
                    position: 'absolute', top: -10, left: '50%', transform: 'translateX(-50%)',
                    fontSize: 10, fontWeight: 700,
                    background: p.id === 2 ? BRAND.gold : BRAND.deep, color: '#fff',
                    padding: '4px 10px', borderRadius: 6, letterSpacing: 1, whiteSpace: 'nowrap',
                  }}>{p.badge}</div>
                )}
                <div style={{ display: 'flex', justifyContent: 'center', gap: 4 }}>
                  {Array.from({ length: Math.min(p.qty, 3) }).map((_, i) => (
                    <div key={i} style={{ transform: `rotate(${(i - 1) * 5}deg)`, marginLeft: i === 0 ? 0 : -14 }}>
                      <StripVisual w={36} h={48} />
                    </div>
                  ))}
                </div>
                <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 22, color: BRAND.deep }}>{p.packs}</div>
                <div style={{ fontSize: 13, color: BRAND.muted }}>${p.per.toFixed(2)} / pack</div>
                {p.save > 0 && (
                  <div style={{ fontSize: 11, fontWeight: 700, color: BRAND.green, background: BRAND.pop, padding: '4px 10px', borderRadius: 6 }}>
                    SAVE {p.save}%
                  </div>
                )}
                <div style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 26, color: BRAND.deep }}>${p.total.toFixed(2)}</div>
                <div style={{
                  width: 24, height: 24, borderRadius: 99, border: `2px solid ${active ? BRAND.green : '#C8CEC7'}`,
                  display: 'flex', alignItems: 'center', justifyContent: 'center',
                }}>
                  {active && <div style={{ width: 12, height: 12, background: BRAND.green, borderRadius: 99 }} />}
                </div>
              </button>
            );
          })}
        </div>
        <div style={{ marginTop: 28, maxWidth: 400, margin: '28px auto 0' }}>
          <CTAButton onClick={onBuy} tweaks={tweaks}>Checkout — ${plans[sel].total.toFixed(2)}</CTAButton>
          <div style={{ display: 'flex', justifyContent: 'center', gap: 20, marginTop: 14, fontSize: 12, color: BRAND.muted }}>
            <span>🔒 Secure checkout</span>
            <span>🚚 Free US shipping</span>
            <span>↩ 30-day returns</span>
          </div>
        </div>
      </Wrap>
    </div>
  );
}

function DesktopGuarantee() {
  return (
    <div style={{ background: BRAND.cream, padding: '70px 0', textAlign: 'center' }}>
      <Wrap>
        <div style={{
          width: 110, height: 110, borderRadius: 99, background: '#fff', margin: '0 auto 20px',
          display: 'flex', alignItems: 'center', justifyContent: 'center',
          border: `2px dashed ${BRAND.green}`,
        }}>
          <div style={{ fontFamily: 'Fraunces', fontWeight: 800, fontSize: 24, color: BRAND.deep, lineHeight: .95, letterSpacing: -.5 }}>
            30<br/><span style={{ fontSize: 12, fontStyle: 'italic', fontWeight: 500 }}>day</span>
          </div>
        </div>
        <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 34, lineHeight: 1.05, margin: '0 0 14px', color: BRAND.deep, letterSpacing: -.6 }}>
          Love it or <span style={{ fontStyle: 'italic' }}>your money back.</span>
        </h2>
        <p style={{ fontSize: 16, color: BRAND.muted, lineHeight: 1.6, margin: '0 auto', maxWidth: 440 }}>
          Try Hey Strips for 30 days. Don't feel the difference? Email us at hello@heystrips.com — full refund, no questions asked.
        </p>
      </Wrap>
    </div>
  );
}

function DesktopFAQ() {
  const items = [
    ['How do I use the strips?', 'Place one strip on your tongue before or during a meal. It dissolves in about 30 seconds. Most people feel the effect within a minute.'],
    ['What are the ingredients?', 'Each strip contains 88mg saffron extract, 200mcg chromium picolinate, and 500mg glucomannan — plus natural mint flavor. No sugar, no caffeine.'],
    ['How long does one pack last?', 'A pack contains 30 strips, which is enough for about one month if used once daily. Most customers use 1–2 per day.'],
    ['Are there side effects?', 'Hey Strips uses clinically-studied, well-tolerated ingredients. Some people notice mild digestive changes in the first few days as fiber intake increases.'],
    ['How long until I see results?', 'Most customers feel appetite calming within 60 seconds. Sustained results (fewer cravings overall) typically show in 2–4 weeks.'],
    ['Where do you ship?', 'Free shipping in the US (2–5 days). We also ship to Canada, UK, and Australia for a flat fee.'],
  ];
  const [open, setOpen] = React.useState(0);
  return (
    <div id="faq" style={{ background: '#fff', padding: '70px 0' }}>
      <Wrap>
        <h2 style={{ fontFamily: 'Fraunces', fontWeight: 700, fontSize: 38, lineHeight: 1.05, margin: '0 0 30px', color: BRAND.deep, letterSpacing: -1, textAlign: 'center' }}>
          Questions, <span style={{ fontStyle: 'italic' }}>answered.</span>
        </h2>
        <div style={{ maxWidth: 700, margin: '0 auto', display: 'flex', flexDirection: 'column' }}>
          {items.map(([q, a], i) => (
            <div key={q} style={{ borderTop: i === 0 ? `1px solid ${BRAND.line}` : 'none', borderBottom: `1px solid ${BRAND.line}` }}>
              <button onClick={() => setOpen(open === i ? -1 : i)} style={{
                width: '100%', padding: '18px 0', background: 'none', border: 'none',
                display: 'flex', alignItems: 'center', justifyContent: 'space-between',
                fontFamily: 'Inter', fontWeight: 600, fontSize: 16, color: BRAND.deep,
                cursor: 'pointer', textAlign: 'left',
              }}>
                <span>{q}</span>
                <span style={{
                  width: 28, height: 28, borderRadius: 99, background: BRAND.cream,
                  display: 'flex', alignItems: 'center', justifyContent: 'center',
                  transform: open === i ? 'rotate(45deg)' : 'none', transition: 'transform .2s',
                  fontSize: 18, color: BRAND.green, fontWeight: 400, flexShrink: 0, marginLeft: 12,
                }}>+</span>
              </button>
              {open === i && (
                <div style={{ fontSize: 15, color: BRAND.muted, lineHeight: 1.6, paddingBottom: 18 }}>
                  {a}
                </div>
              )}
            </div>
          ))}
        </div>
      </Wrap>
    </div>
  );
}

function DesktopFooter() {
  return (
    <div style={{ background: BRAND.deep, color: 'rgba(246,242,232,.7)', padding: '40px 0 30px', textAlign: 'center' }}>
      <Wrap>
        <div style={{ fontFamily: 'Fraunces', fontWeight: 800, fontSize: 30, color: '#F6F2E8', letterSpacing: -.5, marginBottom: 16 }}>
          hey<span style={{ color: '#8BE4A8', fontStyle: 'italic' }}>strips</span>
        </div>
        <div style={{ display: 'flex', justifyContent: 'center', gap: 24, fontSize: 14, marginBottom: 20 }}>
          <a style={{ color: 'inherit', textDecoration: 'none' }}>Shop</a>
          <a style={{ color: 'inherit', textDecoration: 'none' }}>Science</a>
          <a style={{ color: 'inherit', textDecoration: 'none' }}>Reviews</a>
          <a style={{ color: 'inherit', textDecoration: 'none' }}>FAQ</a>
        </div>
        <div style={{ fontSize: 11, color: 'rgba(246,242,232,.4)', lineHeight: 1.6 }}>
          © 2026 Hey Strips. These statements have not been evaluated by the FDA.<br/>This product is not intended to diagnose, treat, cure, or prevent any disease.
        </div>
      </Wrap>
    </div>
  );
}

// ─────────────────────────────────────────────────────────
function HeyStripsApp() {
  const [tweaks, setTweaks] = React.useState(TWEAK_DEFAULTS);
  const [editMode, setEditMode] = React.useState(false);
  const [scrolled, setScrolled] = React.useState(false);
  const [selectedBundle, setSelectedBundle] = React.useState(1);
  const [flash, setFlash] = React.useState(false);
  const isMobile = useIsMobile();

  React.useEffect(() => {
    const onMsg = (e) => {
      if (e.data?.type === '__activate_edit_mode') setEditMode(true);
      if (e.data?.type === '__deactivate_edit_mode') setEditMode(false);
    };
    window.addEventListener('message', onMsg);
    window.parent.postMessage({ type: '__edit_mode_available' }, '*');
    return () => window.removeEventListener('message', onMsg);
  }, []);

  React.useEffect(() => {
    const onWindowScroll = () => {
      setScrolled(window.scrollY > 400);
    };
    window.addEventListener('scroll', onWindowScroll, { passive: true });
    return () => window.removeEventListener('scroll', onWindowScroll);
  }, []);

  const goToCheckout = () => {
    const bundle = BUNDLES[selectedBundle];
    const url = `https://${SHOPIFY.domain}/cart/${SHOPIFY.variantId}:${bundle.qty}`;
    window.open(url, '_blank');
  };

  const onBuy = () => {
    setFlash(true);
    setTimeout(() => setFlash(false), 1200);
    const el = document.getElementById('pricing');
    if (el) el.scrollIntoView({ behavior: 'smooth', block: 'center' });
  };

  if (!isMobile) {
    // ── DESKTOP ──
    return (
      <div style={{ width: '100%', minHeight: '100vh', background: '#fff' }}>
        <UrgencyBar tweaks={tweaks} />
        <DesktopNav onBuy={onBuy} />
        <DesktopHero tweaks={tweaks} onBuy={onBuy} />
        <PressBar />
        <DesktopBenefits />
        <DesktopHowItWorks />
        <DesktopIngredients />
        <DesktopBeforeAfter />
        <DesktopComparison />
        <DesktopReviews />
        <DesktopPricing onBuy={goToCheckout} tweaks={tweaks} selectedBundle={selectedBundle} setSelectedBundle={setSelectedBundle} />
        <DesktopGuarantee />
        <DesktopFAQ />
        <DesktopFooter />
        {flash && (
          <div style={{
            position: 'fixed', top: 100, left: '50%', transform: 'translateX(-50%)',
            background: BRAND.deep, color: '#fff', padding: '14px 24px', borderRadius: 14,
            fontSize: 15, fontWeight: 600, zIndex: 200,
            boxShadow: '0 20px 40px rgba(0,0,0,.3)',
          }}>
            ↓ Choose your bundle below
          </div>
        )}
        {editMode && <TweaksPanel tweaks={tweaks} setTweaks={setTweaks} onClose={() => {
          setEditMode(false);
          window.parent.postMessage({ type: '__deactivate_edit_mode' }, '*');
        }} />}
      </div>
    );
  }

  // ── MOBILE ──
  const Hero = { A: HeroA, B: HeroB, C: HeroC }[tweaks.heroVariant] || HeroA;

  return (
    <div style={{ width: '100%', minHeight: '100vh', background: '#F0EDE6' }}>
      <div style={{
        maxWidth: 640, margin: '0 auto', background: '#fff',
        minHeight: '100vh', position: 'relative',
      }}>
        <UrgencyBar tweaks={tweaks} />
        <TopNav />
        <Hero tweaks={tweaks} onBuy={onBuy} />
        <PressBar />
        <Benefits />
        <HowItWorks />
        <Ingredients />
        <BeforeAfter />
        <Comparison />
        <Reviews />
        <Pricing onBuy={goToCheckout} tweaks={tweaks} selectedBundle={selectedBundle} setSelectedBundle={setSelectedBundle} />
        <Guarantee />
        <FAQ />
        <Footer />
        <div style={{ height: 80 }} />
      </div>
      <StickyATC tweaks={tweaks} onBuy={goToCheckout} visible={scrolled} selectedBundle={selectedBundle} />
      {scrolled && <ProofFloater />}
      {flash && (
        <div style={{
          position: 'fixed', top: 100, left: '50%', transform: 'translateX(-50%)',
          background: BRAND.deep, color: '#fff', padding: '12px 20px', borderRadius: 12,
          fontSize: 14, fontWeight: 600, zIndex: 200,
          boxShadow: '0 20px 40px rgba(0,0,0,.3)',
        }}>
          ↓ Choose your bundle below
        </div>
      )}
      {editMode && <TweaksPanel tweaks={tweaks} setTweaks={setTweaks} onClose={() => {
        setEditMode(false);
        window.parent.postMessage({ type: '__deactivate_edit_mode' }, '*');
      }} />}
    </div>
  );
}

Object.assign(window, { HeyStripsApp });
