// Main page sections — layout from the Figma "lp-ac" frame, copy from
// shoptimize_website_copywriting_v2.md (via components/copy.jsx).
const Eyebrow = ({ children, onDark }) => (
  <div className="mono" style={{ color: onDark ? "var(--on-dark-muted)" : "var(--muted)", marginBottom: 16 }}>{children}</div>
);

// Section header: title on the left (2 lines, accent on the second), lead on the right.
const SectionHead = ({ eyebrow, title, titleEm, sub, br = true, onDark }) => (
  <>
    {eyebrow && <Eyebrow onDark={onDark}>{eyebrow}</Eyebrow>}
    <div className="grid-2" style={{ display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: "24px 60px", alignItems: "end", marginBottom: 44 }}>
      <h2 style={{ fontSize: "clamp(32px, 3.6vw, 48px)", color: onDark ? "#fff" : "var(--fg)" }}>
        {title}{br ? <br/> : " "}<em className="h-italic" style={{ fontStyle: "italic", color: "var(--accent)" }}>{titleEm}</em>
      </h2>
      {sub && <p style={{ color: onDark ? "var(--on-dark-muted)" : "var(--muted)", fontSize: 15, lineHeight: 1.6, margin: 0, maxWidth: 460, justifySelf: "end" }}>{sub}</p>}
    </div>
  </>
);

const Btn = ({ href = "#contact", variant = "primary", arrow = variant === "primary", children, style }) => (
  <a href={href} className={`btn btn-${variant}`} style={style}>{children}{arrow && <IconArrow size={14}/>}</a>
);

// Bottom-left relief for dark blocks: orange glow + dotted grid fading toward
// the centre, plus a hairline corner frame. `scale` shrinks it for short bands.
const Relief = ({ scale = 1 }) => (
  <>
    <div aria-hidden style={{ position: "absolute", left: -140 * scale, bottom: -200 * scale, width: 820 * scale, height: 820 * scale, pointerEvents: "none",
      background: "radial-gradient(circle at 30% 70%, rgba(242,87,43,0.32) 0%, rgba(242,87,43,0.10) 35%, rgba(242,87,43,0) 65%)" }} />
    <div aria-hidden style={{ position: "absolute", left: 0, bottom: 0, width: 720 * scale, height: 480 * scale, pointerEvents: "none",
      backgroundImage: "radial-gradient(rgba(255,255,255,0.24) 1px, transparent 1.5px)", backgroundSize: "22px 22px",
      WebkitMaskImage: "linear-gradient(45deg, #000 0%, rgba(0,0,0,0.5) 40%, transparent 75%)", maskImage: "linear-gradient(45deg, #000 0%, rgba(0,0,0,0.5) 40%, transparent 75%)" }} />
    <div aria-hidden style={{ position: "absolute", left: 40 * scale, bottom: 40 * scale, width: 180 * scale, height: 180 * scale, pointerEvents: "none",
      borderLeft: "1px solid rgba(242,87,43,0.7)", borderBottom: "1px solid rgba(242,87,43,0.7)" }} />
  </>
);

// HERO — warehouse photo washed to white on the left, left-aligned copy,
// inline stats with orange markers, then the dark "built for" band.
const Hero = ({ t }) => (
  <>
    <section style={{ position: "relative", overflow: "hidden", background: "var(--bg)" }}>
      <video autoPlay loop muted playsInline preload="auto" poster="assets/hero-warehouse.jpg" style={{
        position: "absolute", inset: 0, width: "100%", height: "100%", objectFit: "cover", objectPosition: "center 40%",
      }}>
        <source src="assets/hero-bg.mp4" type="video/mp4" />
      </video>
      <div style={{
        position: "absolute", inset: 0, pointerEvents: "none",
        background: "linear-gradient(90deg, rgba(255,255,255,0.94) 0%, rgba(255,255,255,0.82) 42%, rgba(255,255,255,0.45) 72%, rgba(255,255,255,0.25) 100%)",
      }}/>
      <div className="wrap" style={{ position: "relative", padding: "88px 0 96px" }}>
        <div className="mono" style={{ display: "inline-flex", alignItems: "center", gap: 10, padding: "7px 12px 7px 8px", border: "1px solid var(--line)", borderRadius: 999, background: "var(--bg-2)", color: "var(--fg)", marginBottom: 22 }}>
          <EUFlag width={22}/>{t.hero.euTag}
        </div>
        <h1 style={{ fontSize: "clamp(42px, 5.4vw, 78px)", maxWidth: 820, marginBottom: 26, lineHeight: 1.02 }}>
          {t.hero.title1}<br/>
          <em className="h-italic" style={{ fontStyle: "italic", color: "var(--accent)" }}>{t.hero.titleEm}</em>
        </h1>
        <p style={{ maxWidth: 660, fontSize: 16, color: "var(--muted)", lineHeight: 1.6, margin: "0 0 22px" }}>{t.hero.sub}</p>
        <div style={{ display: "flex", gap: 28, flexWrap: "wrap", marginBottom: 32 }}>
          {t.hero.stats.map(s => (
            <div key={s.label} style={{ display: "inline-flex", alignItems: "center", gap: 8 }}>
              <span style={{ width: 6, height: 6, background: "var(--accent)", display: "inline-block" }}/>
              <span style={{ fontFamily: "Geist", fontWeight: 700, fontSize: 14 }}>{s.kpi}</span>
              <span className="mono" style={{ color: "var(--muted)" }}>{s.label}</span>
            </div>
          ))}
        </div>
        <div style={{ display: "flex", gap: 12, flexWrap: "wrap" }}>
          <Btn>{t.hero.cta1}</Btn>
          <Btn href="#process" variant="outline">{t.hero.cta2}</Btn>
        </div>
      </div>
    </section>
    {/* Dark band */}
    <div style={{ background: "var(--black)", color: "#fff", padding: "30px 0", position: "relative", overflow: "hidden" }}>
      {/* White sheen: soft light from the bottom-left corner + a faint horizontal streak */}
      <div aria-hidden style={{ position: "absolute", inset: 0, pointerEvents: "none",
        background: "radial-gradient(ellipse 38% 140% at 0% 100%, rgba(255,255,255,0.16) 0%, rgba(255,255,255,0.05) 45%, rgba(255,255,255,0) 70%)" }} />
      <div aria-hidden style={{ position: "absolute", left: 0, right: 0, bottom: 0, height: 1, pointerEvents: "none",
        background: "linear-gradient(90deg, rgba(255,255,255,0.45) 0%, rgba(255,255,255,0.12) 35%, rgba(255,255,255,0) 70%)" }} />
      <div className="wrap" style={{ position: "relative", display: "flex", alignItems: "center", justifyContent: "space-between", flexWrap: "wrap", gap: "14px 32px" }}>
        <span className="mono" style={{ color: "#fff" }}>{t.hero.runStrip}</span>
        <div style={{ display: "flex", gap: 32, flexWrap: "wrap" }}>
          {t.hero.brands.map((b, i) => (
            <span key={b} style={{ fontFamily: "Geist", fontWeight: 700, fontSize: 15, letterSpacing: "0.04em", textTransform: "uppercase", color: "#fff", display: "inline-flex", alignItems: "center", gap: 8 }}>
              {i === 0 ? <EUFlag width={21}/> : <span style={{ color: "var(--accent)" }}>◆</span>}{b}
            </span>
          ))}
        </div>
      </div>
    </div>
  </>
);

// SERVICES — three bordered cards, orange icon square, tag top-right
const Services = ({ t }) => (
  <section id="services" className="section">
    <div className="wrap">
      <SectionHead eyebrow={t.services.eyebrow} title={t.services.title} titleEm={t.services.titleEm} sub={t.services.sub} br={false}/>
      <div className="grid-3" style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 16 }}>
        {t.services.list.map((s, i) => {
          const Ic = [IconBox, IconTruck, IconReturn][i];
          return (
            <article key={s.title} className="card" style={{ padding: 24, display: "flex", flexDirection: "column", gap: 14, minHeight: 300 }}>
              <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center" }}>
                <div style={{ width: 30, height: 30, borderRadius: 3, background: "var(--accent)", color: "white", display: "flex", alignItems: "center", justifyContent: "center" }}><Ic size={16}/></div>
                <span className="mono" style={{ color: "var(--muted)" }}>{s.tag}</span>
              </div>
              <h3 style={{ fontSize: 20, marginTop: 8 }}>{s.title}</h3>
              {s.body && <p style={{ color: "var(--muted)", fontSize: 14, lineHeight: 1.6, margin: 0 }}>{s.body}</p>}
              {s.bullets.length > 0 && (
                <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 8, marginTop: s.body ? "auto" : 4, paddingTop: 14, borderTop: "1px dashed var(--line-2)" }}>
                  {s.bullets.map(b => (
                    <li key={b} style={{ display: "flex", gap: 8, alignItems: "flex-start", fontSize: 13, color: "var(--fg-2)" }}>
                      <IconArrow size={12} style={{ marginTop: 4, color: "var(--accent)", flexShrink: 0 }}/>{b}
                    </li>
                  ))}
                </ul>
              )}
            </article>
          );
        })}
      </div>
    </div>
  </section>
);

// WHY US — dark block, heading left, 2-column list of numbered reasons right
const WhyUs = ({ t }) => (
  <section style={{ background: "var(--black)", color: "#fff", position: "relative", overflow: "hidden" }}>
    <Relief />
    <div className="wrap" style={{ position: "relative" }}>
      <div className="grid-why" style={{ display: "grid", gridTemplateColumns: "1fr 1.2fr", gap: "40px 80px", padding: "64px 0" }}>
        <div>
          <Eyebrow onDark>{t.why.eyebrow}</Eyebrow>
          <h2 style={{ fontSize: "clamp(34px, 3.8vw, 52px)", color: "#fff" }}>
            {t.why.title}<br/><em className="h-italic" style={{ fontStyle: "italic", color: "var(--accent)" }}>{t.why.titleEm}</em>
          </h2>
          <p style={{ color: "var(--on-dark-muted)", fontSize: 15, lineHeight: 1.65, marginTop: 24, maxWidth: 380 }}>{t.why.sub}</p>
        </div>
        <div className="grid-2" style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: "40px 40px" }}>
          {t.why.points.map(p => (
            <div key={p.n}>
              <div className="mono" style={{ color: "var(--accent)", marginBottom: 10 }}>{p.n}</div>
              <h3 style={{ color: "#fff", fontSize: 18, marginBottom: 8, lineHeight: 1.2 }}>{p.title}</h3>
              <p style={{ color: "var(--on-dark-muted)", fontSize: 14, lineHeight: 1.6, margin: 0 }}>{p.body}</p>
            </div>
          ))}
        </div>
      </div>
    </div>
  </section>
);

// COMPARE — China dropshipping vs Shoptimize, one table with a highlighted
// Shoptimize column, numbered source refs and the links listed underneath.
const Compare = ({ t }) => {
  const c = t.compare;
  const th = { textAlign: "left", padding: "16px 20px", fontSize: 12, letterSpacing: "0.08em", textTransform: "uppercase", fontFamily: "Geist Mono, monospace", fontWeight: 500, color: "var(--muted)", borderBottom: "1px solid var(--line)", verticalAlign: "bottom" };
  const td = { padding: "16px 20px", fontSize: 14, lineHeight: 1.5, verticalAlign: "top", borderBottom: "1px solid var(--line)" };
  const usCol = { background: "var(--accent-soft)" };
  const Ref = ({ n }) => n ? <sup style={{ color: "var(--accent)", fontFamily: "Geist Mono, monospace", fontSize: 10, marginLeft: 3 }}>{n}</sup> : null;
  return (
    <section id="compare" className="section">
      <div className="wrap">
        <SectionHead eyebrow={c.eyebrow} title={c.title} titleEm={c.titleEm} sub={c.sub} />
        <div style={{ display: "inline-flex", alignItems: "center", gap: 12, background: "var(--accent-soft)", borderLeft: "3px solid var(--accent)", borderRadius: "var(--radius)", padding: "12px 18px", marginBottom: 20, fontFamily: "Geist", fontWeight: 700, fontSize: 17, letterSpacing: "-0.01em", color: "var(--fg)", maxWidth: "100%" }}>
          <span style={{ color: "var(--accent)", fontSize: 12 }}>◆</span>{c.scope}
        </div>
        <div className="card" style={{ overflow: "hidden" }}>
          <div style={{ overflowX: "auto" }}>
            <table className="compare" style={{ width: "100%", borderCollapse: "separate", borderSpacing: 0, minWidth: 640 }}>
              <thead>
                <tr>
                  <th style={{ ...th, width: "28%" }}></th>
                  <th style={{ ...th, width: "36%" }}>{c.cols[0]}</th>
                  <th style={{ ...th, ...usCol, width: "36%", color: "var(--accent-2)", borderTop: "3px solid var(--accent)" }}>
                    {c.cols[1]}
                  </th>
                </tr>
              </thead>
              <tbody>
                {c.rows.map(r => (
                  <tr key={r.label}>
                    <td style={{ ...td, fontFamily: "Geist", fontWeight: 700, whiteSpace: "nowrap" }}>
                      {r.eu && <EUFlag width={18} style={{ marginRight: 8 }}/>}{r.label}<Ref n={r.ref}/>
                      {r.sub && <div style={{ fontWeight: 500, fontSize: 12, color: "var(--muted)", marginTop: 2 }}>{r.sub}</div>}
                    </td>
                    <td style={{ ...td, color: "var(--fg-2)" }}>{r.china}</td>
                    <td style={{ ...td, ...usCol, fontWeight: 600 }}>
                      <span style={{ display: "inline-flex", gap: 8, alignItems: "flex-start" }}>
                        {r.good && <span style={{ color: "var(--accent)", fontSize: 12, marginTop: 3 }}>◆</span>}
                        <span>{r.us}</span>
                      </span>
                    </td>
                  </tr>
                ))}
                {c.totals.china.map(([cat, price], i) => (
                  <tr key={cat}>
                    <td style={{ ...td, fontFamily: "Geist", fontWeight: 700, borderBottom: i === 2 ? 0 : "1px dashed var(--line-2)" }}>
                      {c.totals.label} <span style={{ color: "var(--muted)", fontWeight: 500 }}>· {cat}</span>
                    </td>
                    <td style={{ ...td, fontFamily: "Geist", fontWeight: 800, fontSize: 20, letterSpacing: "-0.02em", borderBottom: i === 2 ? 0 : "1px dashed var(--line-2)" }}>{price}</td>
                    {i === 0 && (
                      <td rowSpan={3} style={{ ...td, ...usCol, borderBottom: 0, verticalAlign: "middle", textAlign: "center" }}>
                        <div style={{ fontFamily: "Geist", fontWeight: 800, fontSize: 40, letterSpacing: "-0.03em", color: "var(--accent-2)", lineHeight: 1 }}>{c.totals.us}</div>
                        {c.totals.usNote && <div className="mono" style={{ color: "var(--muted)", marginTop: 8 }}>{c.totals.usNote}</div>}
                      </td>
                    )}
                  </tr>
                ))}
              </tbody>
            </table>
          </div>
        </div>
        <div style={{ marginTop: 18 }}>
          <div style={{ display: "grid", gap: 6, marginBottom: 16 }}>
            {c.notes.map(n => <div key={n} className="mono" style={{ color: "var(--muted)" }}>{n}</div>)}
          </div>
          <div>
            <div className="mono" style={{ color: "var(--fg)", marginBottom: 6 }}>{c.sourcesTitle}</div>
            {c.sources.map(src => (
              <div key={src.n} className="mono" style={{ color: "var(--muted)", display: "flex", gap: 10, marginBottom: 4 }}>
                <span style={{ color: "var(--accent)", minWidth: 12 }}>{src.n}</span>
                <span>
                  {src.links.map(([label, href], i) => (
                    <React.Fragment key={href}>
                      {i > 0 && " · "}
                      <a href={href} target="_blank" rel="noopener" style={{ color: "inherit", textDecoration: "underline", textUnderlineOffset: 3 }}>{label}</a>
                    </React.Fragment>
                  ))}
                </span>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
};

// PROCESS — three joined step cards with photos and chevron notches
const PROCESS_IMAGES = [
  "assets/img-businessmen-meeting.jpg",
  "assets/hero-warehouse.jpg",
  "assets/img-packing-worker.jpg",
];
const Process = ({ t }) => (
  <section id="process" className="section">
    <div className="wrap">
      <SectionHead eyebrow={t.process.eyebrow} title={t.process.title} titleEm={t.process.titleEm} sub={t.process.sub}/>
      <div className="steps">
        {t.process.steps.map((s, i) => (
          <article key={s.n} className="step">
            <div style={{ aspectRatio: "16/10", backgroundImage: `url(${PROCESS_IMAGES[i]})`, backgroundSize: "cover", backgroundPosition: "center", borderBottom: "1px solid var(--line)" }}/>
            <div className="step-body" style={{ padding: "22px 22px 26px" }}>
              <div className="mono" style={{ color: "var(--accent)", marginBottom: 12 }}>{s.n}</div>
              <h3 style={{ fontSize: 19, marginBottom: 10 }}>{s.title}</h3>
              <p style={{ color: "var(--muted)", fontSize: 14, lineHeight: 1.6, margin: 0 }}>{s.body}</p>
            </div>
          </article>
        ))}
      </div>
    </div>
  </section>
);

// PLATFORM — Tempo mock on the left, copy + 7 bullets + 2 CTAs on the right
const Platform = ({ t }) => (
  <section id="platform" className="section">
    <div className="wrap">
      <div className="grid-2" style={{ display: "grid", gridTemplateColumns: "1.05fr 1fr", gap: 60, alignItems: "center" }}>
        <Dashboard t={t} />
        <div>
          <Eyebrow>{t.dashboard.eyebrow}</Eyebrow>
          <div style={{ display: "flex", alignItems: "stretch", gap: 10, marginBottom: 18 }}>
            <TempoMark size={44}/>
            <div style={{ display: "flex", flexDirection: "column", justifyContent: "center", gap: 5, height: 44 }}>
              <span style={{ fontFamily: "'Afacad', 'Geist', sans-serif", fontWeight: 600, fontSize: 28, letterSpacing: "-0.01em", lineHeight: 0.85, color: "var(--fg)", marginLeft: -2 }}>Tempo</span>
              <span className="mono" style={{ color: "var(--muted)", lineHeight: 1 }}>{t.dashboard.brandTag}</span>
            </div>
          </div>
          <h2 style={{ fontSize: "clamp(30px, 3.4vw, 46px)", marginBottom: 18 }}>
            {t.dashboard.title}<br/><em className="h-italic" style={{ fontStyle: "italic", color: "var(--accent)" }}>{t.dashboard.titleEm}</em>
          </h2>
          <p style={{ color: "var(--muted)", fontSize: 15, lineHeight: 1.65, marginBottom: 22 }}>{t.dashboard.sub}</p>
          <ul style={{ listStyle: "none", padding: 0, margin: 0, marginBottom: 28, display: "flex", flexDirection: "column", gap: 10 }}>
            {t.dashboard.bullets.map(b => (
              <li key={b} style={{ display: "flex", gap: 8, fontSize: 13.5, alignItems: "flex-start" }}>
                <IconCheckCircle size={16} style={{ color: "var(--accent)", flexShrink: 0, marginTop: 2 }}/>
                {b}
              </li>
            ))}
          </ul>
          <p style={{ color: "var(--muted)", fontSize: 13.5, fontStyle: "italic", margin: "-14px 0 28px 24px" }}>{t.dashboard.more}</p>
          <div style={{ display: "flex", gap: 10, flexWrap: "wrap" }}>
            <Btn>{t.dashboard.cta1}</Btn>
            {window.SHOW_PRICING && <Btn href="#/tarifs" variant="outline">{t.dashboard.cta2}</Btn>}
          </div>
        </div>
      </div>
    </div>
  </section>
);

// PRICING — public rate card (standalone #/tarifs page)
const Pricing = ({ t }) => (
  <section id="pricing" className="section">
    <div className="wrap">
      <Eyebrow>{t.pricing.eyebrow}</Eyebrow>
      <div className="grid-2" style={{ display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: "24px 60px", alignItems: "end", marginBottom: 44 }}>
        <h2 style={{ fontSize: "clamp(32px, 3.6vw, 48px)" }}>{t.pricing.title}</h2>
        <p style={{ color: "var(--muted)", fontSize: 15, lineHeight: 1.6, margin: 0 }}>{t.pricing.sub}</p>
      </div>

      <div className="grid-2" style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 16, marginBottom: 16 }}>
        {t.pricing.groups.map(g => (
          <article key={g.title} className="card" style={{ padding: 22 }}>
            <h3 style={{ fontSize: 17, marginBottom: g.note ? 4 : 10 }}>{g.title}</h3>
            {g.note && <div className="mono" style={{ color: "var(--muted)", marginBottom: 10 }}>{g.note}</div>}
            <ul style={{ listStyle: "none", padding: 0, margin: 0 }}>
              {g.rows.map(([label, price], i) => (
                <li key={label} style={{ display: "flex", justifyContent: "space-between", gap: 16, alignItems: "baseline", padding: "9px 0", borderTop: i ? "1px dashed var(--line-2)" : 0, fontSize: 13.5 }}>
                  <span style={{ color: "var(--fg-2)" }}>{label}</span>
                  <span style={{ fontFamily: "Geist", fontWeight: 700, whiteSpace: "nowrap" }}>{price}</span>
                </li>
              ))}
            </ul>
          </article>
        ))}
      </div>

      <div style={{ background: "var(--black)", color: "#fff", borderRadius: "var(--radius)", padding: "22px 26px", marginBottom: 44, display: "flex", flexWrap: "wrap", gap: "14px 28px", alignItems: "center" }}>
        <div style={{ display: "flex", alignItems: "center", gap: 10 }}>
          <TempoMark size={30} color="#fff"/>
          <h3 style={{ color: "#fff", fontSize: 18 }}>{t.pricing.includedTitle}</h3>
        </div>
        <div style={{ display: "flex", flexWrap: "wrap", gap: "8px 20px", flex: 1 }}>
          {t.pricing.included.map(item => (
            <span key={item} style={{ fontSize: 13, color: "#ccc", display: "inline-flex", gap: 6 }}>
              <span style={{ color: "#E0913B" }}>◆</span>{item}
            </span>
          ))}
        </div>
      </div>

      <div style={{ marginBottom: 44 }}>
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline", flexWrap: "wrap", gap: 10, marginBottom: 16 }}>
          <h3 style={{ fontSize: 22 }}>{t.pricing.profilesTitle}</h3>
          <span className="mono" style={{ color: "var(--muted)" }}>{t.pricing.profilesNote}</span>
        </div>
        <div className="grid-3" style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 16 }}>
          {t.pricing.profiles.map(p => (
            <article key={p.name} className="card" style={{ padding: 22 }}>
              <div className="mono" style={{ color: "var(--accent)", marginBottom: 10 }}>{p.name}</div>
              <div style={{ fontFamily: "Geist", fontWeight: 800, fontSize: 34, letterSpacing: "-0.02em" }}>
                {p.price}<span style={{ fontSize: 14, fontWeight: 500, color: "var(--muted)" }}> {t.pricing.perMonth}</span>
              </div>
              <div style={{ fontSize: 13.5, color: "var(--fg-2)", marginTop: 8 }}>{p.desc}</div>
              <div className="mono" style={{ color: "var(--muted)", marginTop: 6 }}>{p.note}</div>
            </article>
          ))}
        </div>
      </div>

      <div style={{ background: "var(--bg-soft)", border: "1px solid var(--line)", borderRadius: "var(--radius)", padding: 28, display: "flex", flexWrap: "wrap", gap: 24, alignItems: "center", justifyContent: "space-between" }}>
        <div style={{ maxWidth: 560 }}>
          <h3 style={{ fontSize: 22, marginBottom: 8 }}>{t.pricing.ctaTitle}</h3>
          <p style={{ color: "var(--muted)", fontSize: 14.5, lineHeight: 1.6, margin: 0 }}>{t.pricing.ctaText}</p>
        </div>
        <div style={{ display: "flex", gap: 10, flexWrap: "wrap" }}>
          <Btn>{t.pricing.cta1}</Btn>
          <Btn variant="outline">{t.pricing.cta2}</Btn>
        </div>
      </div>
      <div className="mono" style={{ color: "var(--muted)", marginTop: 14 }}>{t.pricing.footnote}</div>
    </div>
  </section>
);

// CONTACT — cream background, white form card + dark card with orange glow
const CONTACT_ICONS = { mail: IconMail, phone: IconPhone, clock: IconClock };

const Contact = ({ t }) => {
  const [sent, setSent] = React.useState(false);
  const f = t.contact.fields;
  const Field = ({ k, span = 1, textarea }) => (
    <label style={{ gridColumn: `span ${span}`, display: "flex", flexDirection: "column", gap: 6 }}>
      <span style={{ fontSize: 13, color: "var(--fg)" }}>{f[k]}</span>
      {textarea
        ? <textarea placeholder={f[k + "Ph"]} rows={4} style={inputStyle}/>
        : <input placeholder={f[k + "Ph"]} style={inputStyle}/>}
    </label>
  );
  return (
    <section id="contact" className="section" style={{ background: "var(--bg-soft)" }}>
      <div className="wrap">
        <SectionHead eyebrow={t.contact.eyebrow} title={t.contact.title} titleEm={t.contact.titleEm}/>
        <div className="grid-2" style={{ display: "grid", gridTemplateColumns: "1.2fr 1fr", gap: 0 }}>
          <form onSubmit={(e) => { e.preventDefault(); setSent(true); }} style={{ background: "var(--bg-2)", padding: 28, borderRadius: "var(--radius) 0 0 var(--radius)" }}>
            <div style={{ display: "flex", justifyContent: "space-between", alignItems: "baseline", marginBottom: 18, flexWrap: "wrap", gap: 8 }}>
              <h3 style={{ fontSize: 20 }}>{t.contact.formTitle}</h3>
              <span className="mono" style={{ color: "var(--muted)" }}>{t.contact.required}</span>
            </div>
            <div className="grid-2" style={{ display: "grid", gridTemplateColumns: "1fr 1fr", gap: 14 }}>
              <Field k="name"/>
              <Field k="email"/>
              <Field k="country" span={2}/>
              <Field k="msg" span={2} textarea/>
            </div>
            <button type="submit" className="btn btn-primary" style={{ marginTop: 18, width: "100%" }}>
              {sent ? t.contact.sent : t.contact.submit}
            </button>
          </form>
          <aside style={{
            position: "relative", overflow: "hidden",
            background: "var(--black)", color: "#fff", padding: 28,
            borderRadius: "0 var(--radius) var(--radius) 0",
            display: "flex", flexDirection: "column", gap: 18,
          }}>
            <div aria-hidden="true" style={{
              position: "absolute", right: -160, bottom: -200, width: 480, height: 480, pointerEvents: "none",
              background: "radial-gradient(circle, var(--accent) 0%, rgba(242,87,43,0.5) 28%, rgba(242,87,43,0.15) 52%, transparent 70%)",
              filter: "blur(28px)",
            }}/>
            <h3 style={{ color: "#fff", fontSize: 20, position: "relative" }}>{t.contact.sideTitle}</h3>
            <p style={{ color: "var(--on-dark-muted)", fontSize: 14, lineHeight: 1.6, margin: 0, position: "relative" }}>{t.contact.sideText}</p>
            <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 14, marginTop: "auto", position: "relative" }}>
              {t.contact.sideAddress.map(a => {
                const Ic = CONTACT_ICONS[a.icon];
                return (
                  <li key={a.label} style={{ display: "flex", gap: 12, alignItems: "center" }}>
                    <span style={{ width: 28, height: 28, borderRadius: 3, background: "#fff", color: "var(--black)", display: "inline-flex", alignItems: "center", justifyContent: "center", flexShrink: 0 }}><Ic size={14}/></span>
                    <span>
                      <span className="mono" style={{ display: "block", fontSize: 9, color: "var(--on-dark-muted)" }}>{a.label}</span>
                      <span style={{ fontSize: 14 }}>{a.value}</span>
                    </span>
                  </li>
                );
              })}
            </ul>
            <div className="mono" style={{ color: "#777", fontSize: 9, paddingTop: 14, borderTop: "1px solid #2a2a30", position: "relative" }}>{t.contact.footnote}</div>
          </aside>
        </div>
      </div>
    </section>
  );
};

const inputStyle = {
  background: "var(--bg-2)",
  border: "1px solid var(--line-2)",
  borderRadius: "var(--radius)",
  padding: "11px 12px",
  fontFamily: "Roboto, sans-serif",
  fontSize: 14,
  color: "var(--fg)",
  outline: "none",
  resize: "vertical",
  width: "100%",
};

// FINAL CTA — centred, cream
const Final = ({ t }) => (
  <section className="section" style={{ textAlign: "center", background: "var(--bg-soft)" }}>
    <div className="wrap">
      <h2 style={{ fontSize: "clamp(34px, 4.2vw, 56px)", maxWidth: 820, margin: "0 auto 28px" }}>
        {t.final.title} <em className="h-italic" style={{ fontStyle: "italic", color: "var(--accent)" }}>{t.final.titleEm}</em>
      </h2>
      <div style={{ display: "flex", justifyContent: "center", gap: 12, flexWrap: "wrap" }}>
        <Btn>{t.final.cta1}</Btn>
        <Btn href="#process" variant="outline">{t.final.cta2}</Btn>
      </div>
    </div>
  </section>
);

// FOOTER — logo + tagline, company links, legal line
const Footer = ({ t }) => (
  <footer style={{ borderTop: "1px solid var(--line)", padding: "56px 0 28px", background: "var(--bg)" }}>
    <div className="wrap">
      <div className="grid-2" style={{ display: "grid", gridTemplateColumns: "1.5fr 1fr", gap: 30, marginBottom: 44 }}>
        <div>
          <img src="assets/logo-type-black.png" alt="Shoptimize" style={{ height: 18, width: "auto", display: "block", marginBottom: 14 }} />
          <p style={{ color: "var(--muted)", fontSize: 13.5, lineHeight: 1.55, margin: 0, maxWidth: 320 }}>{t.footer.tag}</p>
        </div>
        {t.footer.cols.map(c => (
          <div key={c.title}>
            <div className="mono" style={{ color: "var(--muted)", marginBottom: 12 }}>{c.title}</div>
            <ul style={{ listStyle: "none", padding: 0, margin: 0, display: "flex", flexDirection: "column", gap: 8 }}>
              {c.items.map(i => <li key={i.label} style={{ fontSize: 13.5 }}><a href={i.href}>{i.label}</a></li>)}
            </ul>
          </div>
        ))}
      </div>
      <div style={{ paddingTop: 18, borderTop: "1px solid var(--line)", display: "flex", justifyContent: "space-between", flexWrap: "wrap", gap: 12 }}>
        <span className="mono" style={{ color: "var(--muted)" }}>{t.footer.legal}</span>
        <span className="mono" style={{ color: "var(--fg)" }}>{t.footer.signature}</span>
      </div>
    </div>
  </footer>
);

Object.assign(window, { Hero, Services, WhyUs, Process, Platform, Pricing, Contact, Final, Footer });
