/* Featured piece detail + Gift guide + Visit atelier + Press + Map + FAQ */

// ——— Shared, locale-aware price formatter ———
// Prices across SANAA are quoted in Egyptian pounds. Prefix the unit so a bare
// number ("1,240") never renders without its currency. Arabic shows
// Arabic-Indic digits (ar-EG) followed by "ج.م"; English shows "EGP 1,240".
// Accepts a number or a numeric string ("1,240"); non-numeric input is passed
// through unchanged so editorial/placeholder copy stays intact.
function fmtPrice(amount, lang) {
  const ar = lang === "ar";
  let n = amount;
  if (typeof n === "string") {
    const cleaned = n.replace(/[^0-9.\-]/g, "");
    n = cleaned === "" ? NaN : Number(cleaned);
  }
  if (n == null || !Number.isFinite(n)) {
    // Not a parseable number — return as-is (e.g. "On request").
    return amount == null ? "" : String(amount);
  }
  const num = Number(n).toLocaleString(ar ? "ar-EG" : "en-US");
  return ar ? `${num} ج.م` : `EGP ${num}`;
}
window.fmtPrice = fmtPrice;

// ——— Featured piece: editorial product view ———
function FeaturedPiece({ t, lang }) {
  const [variant, setVariant] = React.useState(0);
  const [qty, setQty] = React.useState(1);
  const variants = ["Natural", "Saffron", "Ink"];
  const variantsAr = ["طبيعي", "زعفران", "حِبر"];
  const tones = ["sand", "terracotta", "olive"];

  const _live = usePieces();
  const featured = _live.find(p => p.is_featured) || _live[0];
  const pieceName = featured ? (lang === "en" ? featured.name : (featured.ar || featured.name)) : (lang === "en" ? "Oasis Knot" : "عقدة الواحة");
  const pieceNum = featured ? featured.num : "№ 017";
  const piecePrice = featured
    ? (typeof featured.price === "number" ? featured.price.toLocaleString(lang === "ar" ? "ar-EG" : "en-US") : featured.price)
    : (1240).toLocaleString(lang === "ar" ? "ar-EG" : "en-US");
  const pieceSlug = featured ? `#/shop/${featured.cat}/${featured.slug}` : "#/shop/macrame/oasis-knot";

  return (
    <section style={{ padding: "140px 0", background: "var(--paper-2)", borderTop: "1px solid var(--line-2)", borderBottom: "1px solid var(--line-2)" }}>
      <div className="container-wide">
        <div style={{ display: "flex", justifyContent: "space-between", alignItems: "end", marginBottom: 56, flexWrap: "wrap", gap: 20 }}>
          <div>
            <div className="eyebrow" style={{ marginBottom: 20 }}>
              <span className="dot"></span>{lang === "en" ? "Piece of the month · April" : "قطعة الشهر · أبريل"}
            </div>
            <h2 style={{ fontFamily: "var(--ff-display)", fontSize: "clamp(44px, 5vw, 84px)", lineHeight: 1.0, letterSpacing: "-0.02em" }}>
              {lang === "en" ? <>In focus: <span style={{ fontStyle: "italic", color: "var(--terracotta)" }}>{lang === "en" ? (featured?.name || "Oasis Knot") : (featured?.ar || "عقدة الواحة")}</span></> : <>قيد النظر: <span style={{ fontStyle: "italic", color: "var(--terracotta)" }}>{featured?.ar || "عقدة الواحة"}</span></>}
            </h2>
          </div>
          <div style={{ fontFamily: "var(--ff-mono)", fontSize: 10, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--muted)" }}>
            {pieceNum} / {lang === "en" ? "1 of 6 in this edition" : "١ من ٦ في هذا الإصدار"}
          </div>
        </div>

        <div className="pdp-layout">
          {/* Gallery */}
          <div>
            <div style={{ aspectRatio: "0.9", borderRadius: "999px 999px 12px 12px / 600px 600px 12px 12px", overflow: "hidden", marginBottom: 14 }}>
              <Placeholder tone={tones[variant]} topLabel={`Hero · ${variants[variant]}`} label="oasis knot · wall hanging · detail" meta="1of6" />
            </div>
            <div className="pdp-thumbs">
              {["detail · knots", "in situ · living room", "hands shot · making", "scale reference"].map((l, i) => (
                <div key={i} style={{ aspectRatio: "1", borderRadius: 10, overflow: "hidden", cursor: "pointer" }}>
                  <Placeholder tone={["sand", "olive", "terracotta", "gold"][i]} label={l} meta={`0${i + 2}`} />
                </div>
              ))}
            </div>
          </div>

          {/* Details */}
          <div>
            <div style={{ display: "flex", alignItems: "baseline", gap: 14, marginBottom: 8 }}>
              <h3 style={{ fontFamily: "var(--ff-display)", fontSize: "clamp(40px, 6vw, 64px)", letterSpacing: "-0.01em" }}>{featured?.name || "Oasis Knot"}</h3>
              <span className="ar" style={{ fontSize: 28, color: "var(--terracotta)" }}>{featured?.ar || "عقدة الواحة"}</span>
            </div>
            <div style={{ fontFamily: "var(--ff-mono)", fontSize: 10, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--muted)" }}>
              Macramé wall hanging · Nour Ibrahim · Cairo
            </div>

            <p style={{ marginTop: 24, fontSize: 16, color: "var(--olive)", lineHeight: 1.65, maxWidth: 520 }}>
              {lang === "en"
                ? "Knotted over eleven days in undyed Egyptian cotton and palm fibre. Nour traces the pattern to her grandmother's ceiling in Siwa — a map of shade cast by date palms at noon."
                : "معقودةٌ على مدى أحد عشر يومًا من قطن مصريّ وليف نخيل. تُرجع نور النقش إلى سقف جدّتها في سيوة — خريطة ظلٍّ يرسمه النخيل عند الظهيرة."}
            </p>

            {/* Variant */}
            <div style={{ marginTop: 36 }}>
              <div style={{ fontFamily: "var(--ff-mono)", fontSize: 10, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--muted)", marginBottom: 12 }}>
                {lang === "en" ? "Colourway" : "اللون"} · <span style={{ color: "var(--ink)" }}>{lang === "en" ? variants[variant] : variantsAr[variant]}</span>
              </div>
              <div style={{ display: "flex", gap: 10 }}>
                {variants.map((v, i) => (
                  <button key={i} onClick={() => setVariant(i)} style={{
                    padding: "10px 18px", borderRadius: 999, cursor: "pointer",
                    border: variant === i ? "1px solid var(--ink)" : "1px solid var(--line)",
                    background: variant === i ? "var(--ink)" : "transparent",
                    color: variant === i ? "var(--paper)" : "var(--ink)",
                    fontFamily: "var(--ff-sans)", fontSize: 13,
                  }}>{lang === "en" ? v : variantsAr[i]}</button>
                ))}
              </div>
            </div>

            {/* Specs grid */}
            <div className="form-row-2" style={{ marginTop: 40, gap: 0, border: "1px solid var(--line)", borderRadius: 10, overflow: "hidden" }}>
              {[
                { k: "Dimensions", v: "92 × 64 cm", ar: "المقاس" },
                { k: "Fibre", v: "Egyptian cotton · palm", ar: "الخامة" },
                { k: "Made over", v: "11 days", ar: "مدة الصنع" },
                { k: "Weight", v: "680 g", ar: "الوزن" },
                { k: "Care", v: "Shake, do not wash", ar: "العناية" },
                { k: "Edition", v: "1 of 6", ar: "الإصدار" },
              ].map((s, i) => (
                <div key={i} style={{
                  padding: "16px 20px",
                  borderRight: i % 2 === 0 ? "1px solid var(--line-2)" : "none",
                  borderBottom: i < 4 ? "1px solid var(--line-2)" : "none",
                }}>
                  <div style={{ fontFamily: "var(--ff-mono)", fontSize: 9, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--muted)" }}>
                    {lang === "en" ? s.k : s.ar}
                  </div>
                  <div style={{ fontFamily: "var(--ff-display)", fontSize: 18, marginTop: 4 }}>{s.v}</div>
                </div>
              ))}
            </div>

            {/* Price + CTA */}
            <div style={{ marginTop: 40, display: "flex", alignItems: "center", justifyContent: "space-between", padding: "22px 0", borderTop: "1px solid var(--ink)", borderBottom: "1px solid var(--ink)", flexWrap: "wrap", gap: 16 }}>
              <div>
                <div style={{ fontFamily: "var(--ff-mono)", fontSize: 9, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--muted)" }}>{lang === "en" ? "Price · EGP" : "السعر · ج.م"}</div>
                <div style={{ fontFamily: "var(--ff-display)", fontSize: 44, letterSpacing: "-0.01em" }}>{piecePrice}</div>
              </div>
              <div style={{ display: "flex", alignItems: "center", gap: 14 }}>
                <div style={{ display: "flex", alignItems: "center", gap: 8, border: "1px solid var(--line)", borderRadius: 999, padding: "6px 8px" }}>
                  <button onClick={() => setQty(Math.max(1, qty - 1))} style={{ width: 28, height: 28, borderRadius: "50%", border: 0, background: "transparent", cursor: "pointer", fontSize: 14 }}>−</button>
                  <span style={{ fontFamily: "var(--ff-mono)", fontSize: 13, minWidth: 20, textAlign: "center" }}>{qty}</span>
                  <button onClick={() => setQty(qty + 1)} style={{ width: 28, height: 28, borderRadius: "50%", border: 0, background: "transparent", cursor: "pointer", fontSize: 14 }}>+</button>
                </div>
                <a href={pieceSlug} className="btn" onClick={() => { window.location.hash = pieceSlug.replace(/^#/, ""); }}>{lang === "en" ? "View piece" : "عرض القطعة"} <span className="arrow">→</span></a>
              </div>
            </div>

            {/* Small assurance row */}
            <div className="col-3" style={{ marginTop: 22, gap: 14, fontFamily: "var(--ff-mono)", fontSize: 9, letterSpacing: "0.18em", textTransform: "uppercase", color: "var(--muted)" }}>
              <div>◆ {lang === "en" ? "Wax-sealed" : "ختم شمع"}</div>
              <div>◆ {lang === "en" ? "Bosta next-day" : "بوسطة · اليوم التالي"}</div>
              <div>◆ {lang === "en" ? "14-day returns" : "إرجاع ١٤ يومًا"}</div>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

// ——— Craft Trail: Egypt map with governorate dots ———
function CraftTrail({ t, lang }) {
  const [active, setActive] = React.useState(1);
  const points = [
    { x: 44, y: 16, name: "Alexandria", ar: "الإسكندرية", craft: "Candle & Scent", count: 2 },
    { x: 50, y: 26, name: "Cairo", ar: "القاهرة", craft: "Macramé · Atelier", count: 4 },
    { x: 52, y: 30, name: "Fustat", ar: "الفسطاط", craft: "Ceramics", count: 2 },
    { x: 48, y: 44, name: "Minya", ar: "المنيا", craft: "Palm Fibre", count: 1 },
    { x: 60, y: 66, name: "Luxor", ar: "الأقصر", craft: "Resin", count: 2 },
    { x: 64, y: 80, name: "Aswan", ar: "أسوان", craft: "Alabaster Resin", count: 1 },
  ];
  return (
    <section style={{ padding: "140px 0", background: "var(--paper)", borderTop: "1px solid var(--line-2)" }}>
      <div className="container-wide">
        <div className="split-2">
          <div>
            <div className="eyebrow" style={{ marginBottom: 24 }}>
              <span className="dot"></span>{lang === "en" ? "The craft trail" : "درب الحرفة"}
            </div>
            <h2 style={{ fontFamily: "var(--ff-display)", fontSize: "clamp(44px, 5vw, 84px)", lineHeight: 1.02, letterSpacing: "-0.02em" }}>
              {lang === "en" ? <>From the Delta<br /><span style={{ fontStyle: "italic", color: "var(--terracotta)" }}>to the first cataract.</span></> : <>من الدلتا<br /><span style={{ fontStyle: "italic", color: "var(--terracotta)" }}>إلى أوّل الشلّالات.</span></>}
            </h2>
            <p style={{ marginTop: 28, fontSize: 16, color: "var(--olive)", lineHeight: 1.6, maxWidth: 440 }}>
              {lang === "en"
                ? "Our twelve makers work across thirteen governorates. Hover a dot to see who is working where — and what their hands are doing this month."
                : "يعمل صنّاعنا الاثنا عشر في ثلاث عشرة محافظة. مرّر على النقطة لترى من يعمل أين — وماذا تصنع يداه هذا الشهر."}
            </p>

            <div style={{ marginTop: 40, padding: 24, border: "1px solid var(--line)", borderRadius: 12, background: "var(--paper-2)" }}>
              <div style={{ fontFamily: "var(--ff-mono)", fontSize: 9, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--muted)", marginBottom: 10 }}>
                {lang === "en" ? "Now viewing" : "العرض الآن"}
              </div>
              <div style={{ display: "flex", alignItems: "baseline", gap: 14 }}>
                <div style={{ fontFamily: "var(--ff-display)", fontSize: 42, color: "var(--ink)" }}>{points[active].name}</div>
                <div className="ar" style={{ fontSize: 22, color: "var(--terracotta)" }}>{points[active].ar}</div>
              </div>
              <div style={{ marginTop: 10, fontFamily: "var(--ff-mono)", fontSize: 11, letterSpacing: "0.2em", textTransform: "uppercase", color: "var(--olive)" }}>
                {points[active].craft} · {points[active].count} {lang === "en" ? "maker(s)" : "صانع"}
              </div>
            </div>
          </div>

          <div style={{ position: "relative", aspectRatio: "0.75", borderRadius: 14, overflow: "hidden", background: "var(--paper-2)", border: "1px solid var(--line-2)" }}>
            {/* Stylized Egypt silhouette (simplified, not tracing any copyrighted map) */}
            <svg viewBox="0 0 100 120" style={{ position: "absolute", inset: 0, width: "100%", height: "100%" }}>
              <defs>
                <pattern id="trail-grid" width="8" height="8" patternUnits="userSpaceOnUse">
                  <circle cx="1" cy="1" r="0.4" fill="var(--line)" opacity="0.5" />
                </pattern>
              </defs>
              <rect width="100" height="120" fill="url(#trail-grid)" />
              {/* Simplified silhouette */}
              <path d="M30 6 L74 6 L82 28 L70 42 L74 60 L68 78 L76 96 L84 114 L34 114 L28 96 L22 78 L28 60 L22 42 L26 22 Z" fill="var(--sand)" opacity="0.25" stroke="var(--terracotta)" strokeWidth="0.3" strokeDasharray="1 1" />
              {/* Nile line */}
              <path d="M50 8 Q52 30 54 50 Q58 70 62 100" fill="none" stroke="var(--terracotta)" strokeWidth="0.6" opacity="0.8" />
              {points.map((p, i) => (
                <g key={i} onMouseEnter={() => setActive(i)} style={{ cursor: "pointer" }}>
                  <circle cx={p.x} cy={p.y} r={active === i ? 4 : 2} fill={active === i ? "var(--terracotta)" : "var(--olive)"} style={{ transition: "all .25s" }} />
                  {active === i && <circle cx={p.x} cy={p.y} r="7" fill="none" stroke="var(--terracotta)" strokeWidth="0.4" opacity="0.6" />}
                  <text x={p.x + 4} y={p.y + 1} fontSize="2.4" fill="var(--ink)" fontFamily="var(--ff-mono)" style={{ letterSpacing: "0.1em" }}>{p.name}</text>
                </g>
              ))}
              {/* Compass */}
              <g transform="translate(88, 12)">
                <circle r="6" fill="none" stroke="var(--muted)" strokeWidth="0.3" />
                <polygon points="0,-5 1,0 0,5 -1,0" fill="var(--terracotta)" />
                <text y="-7" fontSize="2" textAnchor="middle" fill="var(--muted)" fontFamily="var(--ff-mono)">N</text>
              </g>
              {/* Title */}
              <text x="6" y="116" fontSize="2.4" fill="var(--muted)" fontFamily="var(--ff-mono)" style={{ letterSpacing: "0.2em" }}>EGYPT · 2026 · 13 GOVERNORATES</text>
            </svg>
          </div>
        </div>
      </div>
    </section>
  );
}

// ——— Gift Guide ———
function GiftGuide({ t, lang }) {
  const guides = [
    { tag: "For the host", ar: "للمضيفة", price: "under 800 EGP", ar_price: "أقل من ٨٠٠", count: 6, tone: "sand" },
    { tag: "For a new home", ar: "لبيتٍ جديد", price: "1,200–2,400", ar_price: "١٢٠٠–٢٤٠٠", count: 8, tone: "olive" },
    { tag: "For the collector", ar: "للجامع", price: "numbered editions", ar_price: "إصدارات مرقّمة", count: 5, tone: "gold" },
    { tag: "For yourself", ar: "لنفسك", price: "small rituals", ar_price: "طقوس صغيرة", count: 12, tone: "terracotta" },
  ];
  return (
    <section style={{ padding: "140px 0", background: "var(--paper-2)" }}>
      <div className="container-wide">
        {/* Headline lives in the page header (PageHeader). Keep only the
            descriptive lead here so the title isn't duplicated as an h2. */}
        <div style={{ marginBottom: 60 }}>
          <p style={{ fontSize: 17, color: "var(--olive)", lineHeight: 1.65, maxWidth: 560 }}>
            {lang === "en"
              ? "Every gift leaves the atelier wax-sealed in a two-tone paper wrap with a handwritten note card, in Arabic or English, from the maker themselves."
              : "كل هدية تخرج من المحترف مختومةً بشمعٍ في ورق ثنائي اللون مع بطاقةٍ بخطّ اليد — عربي أو إنجليزي — من الصانع نفسه."}
          </p>
        </div>

        <div className="stat-grid-4">
          {guides.map((g, i) => (
            <div key={i} style={{ cursor: "pointer" }}>
              <div style={{ aspectRatio: "0.8", borderRadius: "999px 999px 10px 10px / 600px 600px 10px 10px", overflow: "hidden", marginBottom: 18 }}>
                <Placeholder tone={g.tone} topLabel={`Guide ${i + 1}`} label={g.tag.toLowerCase()} meta={`${g.count} pieces`} />
              </div>
              <div style={{ fontFamily: "var(--ff-display)", fontSize: 28, color: "var(--ink)" }}>{lang === "en" ? g.tag : g.ar}</div>
              <div style={{ fontFamily: "var(--ff-mono)", fontSize: 10, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--muted)", marginTop: 6 }}>
                {lang === "en" ? g.price : g.ar_price} · {g.count} {lang === "en" ? "pieces" : "قطع"}
              </div>
              <div style={{ marginTop: 16, display: "flex", alignItems: "center", gap: 8, fontSize: 13, color: "var(--terracotta)" }}>
                {lang === "en" ? "Open the guide" : "افتح الدليل"} →
              </div>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ——— Visit the Atelier (hours, map, booking) ———
function Visit({ t, lang }) {
  return (
    <section style={{ padding: "140px 0", background: "var(--ink)", color: "var(--paper)" }}>
      <div className="container-wide">
        <div className="split-2">
          <div style={{ aspectRatio: "1", borderRadius: 16, overflow: "hidden" }}>
            <Placeholder tone="olive" topLabel="Atelier · Zamalek" label="door & brass plate · shar'a abou el-feda" meta="Cairo 11211" />
          </div>
          <div>
            <div className="eyebrow" style={{ marginBottom: 24, color: "var(--gold-soft)" }}>
              <span className="dot" style={{ background: "var(--gold-soft)" }}></span>{lang === "en" ? "Visit" : "الزيارة"}
            </div>
            <h2 style={{ fontFamily: "var(--ff-display)", fontSize: "clamp(44px, 5vw, 84px)", lineHeight: 1.02, letterSpacing: "-0.02em", color: "var(--paper)" }}>
              {lang === "en" ? <>A small room<br /><span style={{ fontStyle: "italic", color: "var(--gold-soft)" }}>above the river.</span></> : <>غرفةٌ صغيرة<br /><span style={{ fontStyle: "italic", color: "var(--gold-soft)" }}>فوق النهر.</span></>}
            </h2>
            <p style={{ marginTop: 24, fontSize: 16, color: "rgba(244,237,226,0.8)", lineHeight: 1.65, maxWidth: 480 }}>
              {lang === "en"
                ? "Two flights up in an old Zamalek building, our atelier doubles as showroom on Tuesdays and Saturdays. Tea is on the stove. Bring a friend and a slow afternoon."
                : "طابقان فوق عمارةٍ قديمة في الزمالك، محترفنا يفتح كمعرضٍ يومَي الثلاثاء والسبت. الشاي على النار. احضر مع صديق وبعد ظهرٍ هادئ."}
            </p>

            <div className="form-row-2" style={{ marginTop: 40, gap: 0, border: "1px solid rgba(244,237,226,0.18)", borderRadius: 12, overflow: "hidden" }}>
              {[
                { k: "Address", v: "14 Abou el-Feda · Zamalek", ar: "العنوان", arV: "١٤ أبو الفداء · الزمالك" },
                { k: "Hours", v: "Tue–Sat · 11h–19h", ar: "المواعيد", arV: "الثلاثاء–السبت · ١١–١٩" },
                { k: "Nearest metro", v: "Opera · 14 min walk", ar: "أقرب مترو", arV: "الأوبرا · ١٤ د مشيًا" },
                { k: "Book a slot", v: "visits@sanaa.eg", ar: "الحجز", arV: "visits@sanaa.eg" },
              ].map((s, i) => (
                <div key={i} style={{
                  padding: "20px 22px",
                  borderRight: i % 2 === 0 ? "1px solid rgba(244,237,226,0.14)" : "none",
                  borderBottom: i < 2 ? "1px solid rgba(244,237,226,0.14)" : "none",
                }}>
                  <div style={{ fontFamily: "var(--ff-mono)", fontSize: 9, letterSpacing: "0.22em", textTransform: "uppercase", color: "var(--gold-soft)" }}>
                    {lang === "en" ? s.k : s.ar}
                  </div>
                  <div style={{ fontFamily: "var(--ff-display)", fontSize: 20, marginTop: 6 }}>{lang === "en" ? s.v : s.arV}</div>
                </div>
              ))}
            </div>

            <div style={{ marginTop: 32, display: "flex", gap: 14, flexWrap: "wrap" }}>
              <button className="btn" style={{ background: "var(--paper)", color: "var(--ink)", borderColor: "var(--paper)" }}>
                {lang === "en" ? "Book a private visit" : "احجز زيارة"} <span className="arrow">→</span>
              </button>
              <button className="btn ghost" style={{ color: "var(--paper)", borderColor: "var(--paper)" }}>
                {lang === "en" ? "Open in maps" : "افتح في الخرائط"}
              </button>
            </div>
          </div>
        </div>
      </div>
    </section>
  );
}

// ——— Press ———
function Press({ t, lang }) {
  const logos = [
    { name: "VOGUE ARABIA", quote: "A long-overdue home for the Cairene hand." },
    { name: "MONOCLE", quote: "Curation with teeth. Refreshingly few pieces." },
    { name: "KINFOLK", quote: "Slow commerce done with the right kind of care." },
    { name: "CAIRO SCENE", quote: "The most considered local launch of the year." },
    { name: "AD MIDDLE EAST", quote: "A whole category just got a standard." },
  ];
  const logosAr = [
    { name: "فوغ العربيّة", quote: "بيتٌ طال انتظاره لليد القاهريّة." },
    { name: "مونوكل", quote: "انتقاءٌ له حدّة. وقطعٌ قليلةٌ منعشة." },
    { name: "كينفولك", quote: "تجارةٌ بطيئة بنوع العناية الصحيح." },
    { name: "كايرو سين", quote: "الإطلاق المحلّي الأكثر تأمّلًا هذا العام." },
    { name: "إيه دي الشرق الأوسط", quote: "فئةٌ كاملة حصلت للتوّ على معيار." },
  ];
  const arr = lang === "en" ? logos : logosAr;
  return (
    <section style={{ padding: "120px 0", background: "var(--paper)" }}>
      <div className="container-wide">
        <div className="press-head" style={{ display: "grid", gridTemplateColumns: "0.6fr 1.4fr", gap: 60, alignItems: "center", marginBottom: 50 }}>
          <div className="eyebrow">
            <span className="dot"></span>{lang === "en" ? "Press · selected" : "صحافة · مختارة"}
          </div>
          <div style={{ height: 1, background: "var(--line)" }} />
        </div>
        <div className="press-grid">
          {arr.map((p, i) => (
            <div key={i} className="press-cell" style={{
              padding: "30px 24px",
              borderRight: i < arr.length - 1 ? "1px solid var(--line-2)" : "none",
            }}>
              <div style={{ fontFamily: "var(--ff-display)", fontStyle: "italic", fontSize: 18, color: "var(--ink)", letterSpacing: "0.06em", marginBottom: 16 }}>
                {p.name}
              </div>
              <p style={{ fontFamily: "var(--ff-display)", fontSize: 18, lineHeight: 1.4, color: "var(--olive)" }}>
                “{p.quote}”
              </p>
            </div>
          ))}
        </div>
      </div>
    </section>
  );
}

// ——— FAQ ———
function FAQ({ t, lang }) {
  const [open, setOpen] = React.useState(0);
  const qs = lang === "en" ? [
    { q: "Where do you ship, and how fast?", a: "Egypt nationwide via Bosta (next-day in greater Cairo, 2–4 days elsewhere). Regional Arab shipping via Aramex (3–7 days). Worldwide on request." },
    { q: "What about returns?", a: "14 days from receipt, excluding custom-made pieces (in line with Egyptian Consumer Protection Agency rules). Return shipping is free if we were at fault, otherwise covered by the customer." },
    { q: "Are your candles and ceramics safe?", a: "Wicks are cotton-cored, never metal. Ceramic glazes are tested for lead and cadmium by a Cairo-based independent lab, per FDA guidance. Results are filed with every SKU." },
    { q: "Can I commission a piece?", a: "Yes, for macramé, resin and ceramics. Lead times are 4–10 weeks. A 30% deposit holds the slot. We only accept commissions we can genuinely deliver." },
    { q: "Do you sell wholesale?", a: "A small, vetted wholesale programme opens quarterly to hotels, boutiques and gift concierges. Minimums apply. Write to wholesale@sanaa.eg." },
    { q: "How do you pay the makers?", a: "Makers receive 80–85% of shelf price, paid within seven days of delivery to the customer. The split is published on every product page." },
  ] : [
    { q: "إلى أين تشحنون، وبأي سرعة؟", a: "إلى كامل مصر عبر بوسطة (اليوم التالي في القاهرة الكبرى، ٢-٤ أيام خارجها). الشحن العربي عبر أرامكس (٣-٧ أيام). العالم عند الطلب." },
    { q: "ماذا عن الإرجاع؟", a: "١٤ يومًا من الاستلام، باستثناء القطع المصنوعة حسب الطلب (وفقًا لقواعد جهاز حماية المستهلك). شحن الإرجاع مجاني إذا كان الخطأ منّا." },
    { q: "هل شموعكم وفخّاركم آمن؟", a: "فتائل الشموع من القطن، لا معدن. طلاء الفخار يُفحص من الرصاص والكادميوم في مختبرٍ مستقلّ بالقاهرة. النتائج مرفقة مع كل قطعة." },
    { q: "هل أستطيع طلب قطعةٍ خاصة؟", a: "نعم، في المكرمية والراتنج والفخار. المدة ٤-١٠ أسابيع. يحجز مبلغ ٣٠٪ الفسحة. لا نقبل إلا ما نستطيع تسليمه فعلًا." },
    { q: "هل تبيعون جملةً؟", a: "برنامج جملة صغير ومدروس يفتح كل ربع لفنادق ومحلات ومنسّقي هدايا. بحدٍّ أدنى. اكتب إلى wholesale@sanaa.eg." },
    { q: "كيف تدفعون للصنّاع؟", a: "يحصل الصانع على ٨٠-٨٥٪ من سعر العرض، خلال سبعة أيام من التسليم للعميل. النسبة منشورة على صفحة كل منتج." },
  ];
  return (
    <section style={{ padding: "140px 0", background: "var(--paper-2)" }}>
      <div className="container-wide">
        <div className="atelier-grid">
          <div>
            <div className="eyebrow" style={{ marginBottom: 24 }}>
              <span className="dot"></span>{lang === "en" ? "Good questions" : "أسئلة جيدة"}
            </div>
            <h2 style={{ fontFamily: "var(--ff-display)", fontSize: "clamp(44px, 5vw, 84px)", lineHeight: 1.0, letterSpacing: "-0.02em" }}>
              {lang === "en" ? <>The things you<br /><span style={{ fontStyle: "italic", color: "var(--terracotta)" }}>should ask first.</span></> : <>ما ينبغي أن<br /><span style={{ fontStyle: "italic", color: "var(--terracotta)" }}>تسأل عنه أوّلًا.</span></>}
            </h2>
            <div style={{ marginTop: 32 }}>
              <Star8 size={40} color="var(--terracotta)" />
            </div>
            <p style={{ marginTop: 32, fontSize: 15, color: "var(--olive)", maxWidth: 360, lineHeight: 1.6 }}>
              {lang === "en"
                ? "Cannot find your answer? Write to hello@sanaa.eg and a real human replies within the day."
                : "لم تجد إجابتك؟ اكتب إلى hello@sanaa.eg ويردّ إنسانٌ حقيقي خلال اليوم."}
            </p>
          </div>
          <div>
            {qs.map((it, i) => (
              <div key={i} style={{
                borderTop: "1px solid var(--line)",
                borderBottom: i === qs.length - 1 ? "1px solid var(--line)" : "none",
                padding: "24px 0",
                cursor: "pointer",
              }} onClick={() => setOpen(open === i ? -1 : i)}>
                <div style={{ display: "flex", justifyContent: "space-between", alignItems: "center", gap: 20 }}>
                  <h3 style={{ fontFamily: "var(--ff-display)", fontSize: 26, color: "var(--ink)", letterSpacing: "-0.01em" }}>{it.q}</h3>
                  <div style={{
                    width: 36, height: 36, borderRadius: "50%",
                    border: "1px solid var(--ink)", display: "grid", placeItems: "center",
                    transform: open === i ? "rotate(45deg)" : "none",
                    transition: "transform 0.3s",
                    fontSize: 18, flexShrink: 0,
                  }}>+</div>
                </div>
                <div style={{
                  maxHeight: open === i ? 200 : 0,
                  overflow: "hidden",
                  transition: "max-height 0.4s ease, margin-top 0.3s",
                  marginTop: open === i ? 14 : 0,
                }}>
                  <p style={{ fontSize: 15, color: "var(--olive)", lineHeight: 1.65, maxWidth: 620 }}>{it.a}</p>
                </div>
              </div>
            ))}
          </div>
        </div>
      </div>
    </section>
  );
}

Object.assign(window, { FeaturedPiece, CraftTrail, GiftGuide, Visit, Press, FAQ });
