// Product / Sector / About / Contact / Cases pages — strict brand.

/* ════════════════════ PRODUCTS INDEX ════════════════════ */
// Listing page: shows all seven products as cards.
// Routed to from the "Products" nav item.
function ProductsIndexPage({ onNavigate }) {
  const products = window.SOLO_DATA.products;
  return (
    <>
      <section style={{ padding: "80px 36px 100px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <Eyebrow style={{ marginBottom: 32 }}>The platform</Eyebrow>
          <h1 style={{
            fontFamily: "var(--font-display)", fontWeight: 700,
            fontSize: "clamp(56px, 8vw, 144px)", lineHeight: 0.92,
            letterSpacing: "-0.01em", textTransform: "uppercase",
            margin: "0 0 36px", color: "var(--fg)", maxWidth: 1280,
          }}>
            Products.
          </h1>
          <p style={{
            fontFamily: "var(--font-body)", fontSize: 20,
            lineHeight: 1.55, color: "var(--fg-soft)", maxWidth: 800,
          }}>
            Three towers, two solar add-ons and the Volt Box battery — all designed around the same aluminium chassis and Ajax ecosystem. Engineered, built and supported from our UK, Polish and Florida facilities.
          </p>
        </div>
      </section>

      {/* Towers */}
      <section style={{ padding: "120px 36px", background: "var(--surface)", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{
            display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 80,
            marginBottom: 56, alignItems: "end",
          }}>
            <div>
              <Eyebrow style={{ marginBottom: 32 }}>The towers</Eyebrow>
            </div>
            <H2>Pro Tower, Ultra Tower, SSU.</H2>
          </div>
          <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 24 }}>
            {products.filter(p => !p.isLegacy && !p.isAccessory && !p.isPerimeter && !p.comingSoon).map((p, i) => (
              <ProductIndexCard key={p.id} product={p} index={i} onNavigate={onNavigate} />
            ))}
          </div>
        </div>
      </section>

      {/* Vehicle security — SoloPost section temporarily removed on request.
          Data + assets retained. To restore: reinstate the block above and
          uncomment the SoloPost product entry in shared/data.js. */}

      {/* Coming Soon — next-generation towers, announced but not yet
          released (Core Tower, Elite Tower). Cards render with a
          "Coming Soon" badge next to the name and are non-interactive —
          no click-through until the product actually ships. Kept as its
          own section (rather than mixed into the live Towers grid above)
          so the current lineup never reads as incomplete or unreleased. */}
      {products.some(p => p.comingSoon) && (
        <section style={{ padding: "120px 36px", background: "var(--surface)", borderBottom: "1px solid var(--line)" }}>
          <div style={{ maxWidth: 1480, margin: "0 auto" }}>
            <div style={{
              display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 80,
              marginBottom: 56, alignItems: "end",
            }}>
              <div>
                <Eyebrow style={{ marginBottom: 32 }}>Coming soon</Eyebrow>
              </div>
              <H2>The next generation.</H2>
            </div>
            <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 24 }}>
              {products.filter(p => p.comingSoon).map((p) => (
                <ComingSoonProductCard key={p.id} product={p} />
              ))}
            </div>
          </div>
        </section>
      )}

      {/* Solar Add-ons */}
      <section style={{ padding: "120px 36px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{
            display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 80,
            marginBottom: 56, alignItems: "end",
          }}>
            <div>
              <Eyebrow style={{ marginBottom: 32 }}>Solar add-ons</Eyebrow>
            </div>
            <H2>Extend any deployment off-grid.</H2>
          </div>
          <p style={{
            fontFamily: "var(--font-body)", fontSize: 16,
            lineHeight: 1.6, color: "var(--fg-soft)",
            maxWidth: 720, margin: "0 0 40px",
          }}>
            The RS range is a pair of two-piece solar panels that pair with any Solo Pro or Ultra Tower — or run standalone for off-grid power applications. Choose 188 W or 365 W depending on the site's power draw.
          </p>
          <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 24 }}>
            {products.filter(p => p.isAccessory).map((p, i) => (
              <ProductIndexCard key={p.id} product={p} index={i} onNavigate={onNavigate} accessory />
            ))}
          </div>
        </div>
      </section>

      {/* Legacy */}
      <section style={{ padding: "120px 36px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{
            display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 80,
            marginBottom: 48, alignItems: "end",
          }}>
            <div>
              <Eyebrow style={{ marginBottom: 32 }}>Legacy support</Eyebrow>
              <SectionNumeral n={2} />
            </div>
            <H2>Earlier units, still supported.</H2>
          </div>
          {products.filter(p => p.isLegacy).map((p) => (
            <div key={p.id}
              onClick={() => onNavigate("product-detail", p.id)}
              style={{
                border: "1px solid var(--line)",
                padding: "36px 40px",
                cursor: "pointer",
                display: "grid", gridTemplateColumns: "160px 1.8fr 1fr",
                gap: 40, alignItems: "center",
                background: "var(--bg)",
              }}>
              {/* Legacy products don't have real product photos — use a
                  monospace label as a typographic anchor instead. */}
              <div style={{
                fontFamily: "var(--font-body)",
                fontSize: 11,
                letterSpacing: "0.28em",
                color: "var(--fg-dim)",
                textTransform: "uppercase",
                fontWeight: 500,
                borderLeft: "1px solid var(--line)",
                paddingLeft: 16,
              }}>
                Pre-2023<br/>range
              </div>
              <div>
                <Eyebrow style={{ marginBottom: 12 }}>{p.callsign}</Eyebrow>
                <H3 style={{ fontSize: 28, marginBottom: 14 }}>{p.name}</H3>
                <p style={{
                  fontFamily: "var(--font-body)", fontSize: 15,
                  lineHeight: 1.6, color: "var(--fg-soft)", margin: 0, maxWidth: 600,
                }}>{p.summary}</p>
              </div>
              <div style={{
                fontFamily: "var(--font-body)", fontSize: 13,
                color: "var(--fg)", display: "flex",
                alignItems: "center", justifyContent: "flex-end", gap: 14,
                letterSpacing: "0.16em", textTransform: "uppercase", fontWeight: 500,
              }}>
                <span>View legacy range</span>
                <span>→</span>
              </div>
            </div>
          ))}
        </div>
      </section>

      <FinalCTABand onNavigate={onNavigate} />
    </>
  );
}

// Coming Soon card — used on the Products listing page for
// next-generation products that have been announced but aren't released
// yet (Core Tower, Elite Tower). Deliberately non-interactive (no
// onClick, no hover lift, no cursor: pointer) since there's no product
// detail page to send visitors to. Shares the same photo-frame + name
// layout as ProductIndexCard for visual consistency, but swaps the
// "View specifications" footer for a "Coming Soon" badge next to the name.
function ComingSoonProductCard({ product }) {
  return (
    <div
      style={{
        background: "var(--bg)",
        border: "1px solid var(--line)",
        display: "flex", flexDirection: "column",
      }}
    >
      <div style={{
        aspectRatio: "4 / 3",
        position: "relative",
        background: "#ffffff",
        display: "grid", placeItems: "center",
        overflow: "hidden",
        borderBottom: "1px solid var(--line)",
      }}>
        <img
          src={productImage(product.id)}
          alt={`${product.name} — product render`}
          style={{
            position: "absolute", inset: 0,
            width: "100%", height: "100%",
            objectFit: "contain",
            display: "block",
            // Slightly muted so the not-yet-released render doesn't
            // read as a live, purchasable product photo.
            opacity: 0.55,
          }}
          loading="lazy"
        />
        <div style={{
          position: "absolute", top: 16, left: 16,
          fontFamily: "var(--font-body)", fontSize: 10,
          letterSpacing: "0.22em", color: "#fff",
          background: "rgba(0,0,0,0.6)",
          padding: "6px 10px",
          textTransform: "uppercase", fontWeight: 500,
        }}>{product.callsign}</div>
      </div>
      <div style={{ padding: "28px 28px 28px", display: "flex", flexDirection: "column", flex: 1 }}>
        <div style={{
          fontFamily: "var(--font-body)", fontSize: 11,
          letterSpacing: "0.22em", color: "var(--fg-dim)",
          marginBottom: 12, textTransform: "uppercase",
        }}>{product.type}</div>
        {/* Name + "Coming Soon" badge, side by side */}
        <div style={{ display: "flex", alignItems: "center", gap: 10, marginBottom: 12, flexWrap: "wrap" }}>
          <H3 style={{ fontSize: 26, margin: 0 }}>{product.name}</H3>
          <span style={{
            fontFamily: "var(--font-body)", fontSize: 10, fontWeight: 500,
            letterSpacing: "0.16em", textTransform: "uppercase",
            color: "var(--fg)", background: "transparent",
            border: "1px solid var(--fg)", padding: "4px 9px",
            whiteSpace: "nowrap",
          }}>Coming Soon</span>
        </div>
        <p style={{
          fontFamily: "var(--font-body)", fontSize: 14.5,
          lineHeight: 1.55, color: "var(--fg-soft)",
          margin: "0 0 20px",
        }}>{product.tagline}</p>
        <div style={{
          marginTop: "auto", paddingTop: 18, borderTop: "1px solid var(--line)",
          fontFamily: "var(--font-body)", fontSize: 12, fontWeight: 500,
          letterSpacing: "0.16em", color: "var(--fg-dim)",
          textTransform: "uppercase",
        }}>
          Details to follow
        </div>
      </div>
    </div>
  );
}

// Index card — used on the Products listing page.
// Visually similar to home ProductCard but with index-specific layout.
function ProductIndexCard({ product, index, onNavigate, accessory }) {
  const [hover, setHover] = useState(false);
  return (
    <div
      onClick={() => onNavigate("product-detail", product.id)}
      onMouseEnter={() => setHover(true)}
      onMouseLeave={() => setHover(false)}
      style={{
        background: "var(--bg)",
        border: "1px solid var(--line)",
        cursor: "pointer",
        transition: "transform 200ms, border-color 200ms",
        transform: hover ? "translateY(-3px)" : "translateY(0)",
        borderColor: hover ? "var(--fg)" : "var(--line)",
        display: "flex", flexDirection: "column",
      }}
    >
      <div style={{
        // 4:3 matches the tightly-cropped product photos.
        aspectRatio: "4 / 3",
        position: "relative",
        // Slate-grey studio background — consistent across every product
        // photo container on the site.
        background: "#ffffff",
        display: "grid", placeItems: "center",
        overflow: "hidden",
        borderBottom: "1px solid var(--line)",
      }}>
        {/* Plain <img> — no image-slot placeholder overlay so cards
            never flash "PRO TOWER RENDER" text before the photo loads.
            Objectfit: contain keeps the render centred on the dark
            studio gradient without cropping. */}
        <img
          src={productImage(product.id)}
          alt={`${product.name} — product render`}
          style={{
            position: "absolute", inset: 0,
            width: "100%", height: "100%",
            objectFit: "contain",
            display: "block",
          }}
          loading="lazy"
        />
        <div style={{
          position: "absolute", top: 16, left: 16,
          fontFamily: "var(--font-body)", fontSize: 10,
          letterSpacing: "0.22em", color: "#fff",
          background: "rgba(0,0,0,0.6)",
          padding: "6px 10px",
          textTransform: "uppercase", fontWeight: 500,
        }}>{product.callsign}</div>
      </div>
      <div style={{ padding: "28px 28px 28px", display: "flex", flexDirection: "column", flex: 1 }}>
        <div style={{
          fontFamily: "var(--font-body)", fontSize: 11,
          letterSpacing: "0.22em", color: "var(--fg-dim)",
          marginBottom: 12, textTransform: "uppercase",
        }}>{product.type}</div>
        <H3 style={{ fontSize: 26, marginBottom: 12 }}>{product.name}</H3>
        <p style={{
          fontFamily: "var(--font-body)", fontSize: 14.5,
          lineHeight: 1.55, color: "var(--fg-soft)",
          margin: "0 0 20px",
        }}>{product.tagline}</p>
        <div style={{
          marginTop: "auto", paddingTop: 18, borderTop: "1px solid var(--line)",
          display: "flex", justifyContent: "space-between", alignItems: "center",
          fontFamily: "var(--font-body)", fontSize: 12, fontWeight: 500,
          letterSpacing: "0.16em", color: "var(--fg)",
          textTransform: "uppercase",
        }}>
          <span>View specifications</span>
          <span style={{ transition: "transform 160ms", transform: hover ? "translateX(6px)" : "translateX(0)" }}>→</span>
        </div>
      </div>
    </div>
  );
}

/* ────────────────────────────────────────────────────────
 * PRODUCT_EDITORIAL — per-product content map for the product page
 * template. Products without an entry here silently skip the Overview,
 * Use Cases and Differentiators sections — no placeholder text ever
 * renders on the live site.
 *
 * Each entry:
 *   overview1, overview2 — two paragraphs for the Overview section
 *   useCases  — 4 short scenarios: { sector, scenario }
 *   diffs     — 3–4 key differentiator points: { title, body }
 * ──────────────────────────────────────────────────────── */
const PRODUCT_EDITORIAL = {
  "pro-tower": {
    overview1: "The Pro Tower is a rapidly deployable, professional-grade CCTV tower designed to provide visible security, remote monitoring, and site protection where fixed infrastructure is limited, temporary, or not commercially practical. Built for construction, infrastructure, utilities, vacant property, and high-risk operational sites, it gives end-clients a clear security presence, improved situational awareness, and a scalable alternative to traditional guarding or permanent CCTV installation.",
    overview2: "Ultra-portable and single-person deployable, the Pro Tower runs on ultra-low power consumption and stands at a mid-height 2.4m mast. For security partners, this means a tower that can be moved, sited, and operating in minutes — without specialist plant, certified lift teams, or external power. End-clients get a credible, on-brand security presence; partners get a unit that's commercially efficient to deploy at scale across every sector.",
    useCases: [
      { sector: "Construction",     scenario: "Site perimeter and entry-point coverage, project-duration deployments." },
      { sector: "Utilities",        scenario: "Substations, depots and unmanned assets needing visible presence without mains." },
      { sector: "Events",           scenario: "Pop-up perimeter and crowd-area monitoring for festivals and short-stay events." },
      { sector: "Remote locations", scenario: "Off-grid sites where mains power and fixed CCTV aren't commercially practical." },
    ],
    diffs: [
      { title: "Modular by design",       body: "Every component is designed to be swapped, upgraded or specced per site. Same chassis, custom build." },
      { title: "Ultra-low power",         body: "Engineered for minimum consumption — runs longer per battery, recovers faster on partial sun." },
      { title: "Autonomous",              body: "No mains required. 30+ days off-grid autonomy without sunlight on standard battery configuration." },
      { title: "Solar-powered as standard", body: "Hybrid solar + battery is the default, not an add-on. Every Pro Tower ships ready to run off-grid." },
    ],
  },
  "ultra-tower": {
    overview1: "The Ultra Tower is the Pro Tower's larger, higher-capacity counterpart, designed for sites that require a stronger visual deterrent, increased solar autonomy, and wider area coverage. With a larger footprint, enhanced solar capacity, ultra-low power consumption, and a higher 4.5m mast compared with the Pro Tower's 2.4m, the Ultra Tower is built for more demanding environments where extended deployment, improved visibility, and greater operational presence are required.",
    overview2: "For security partners, the Ultra Tower provides a robust, scalable solution for end-clients operating on larger construction sites, infrastructure projects, utilities locations, compounds, vacant property, and higher-risk areas. It is suited to partners who need a more substantial tower within their managed security offering, giving them a professional, reliable platform that can support remote monitoring, visible deterrence, and longer-duration site protection while maintaining a clear and commercially attractive deployment model.",
    useCases: [
      { sector: "Tier-1 construction", scenario: "Larger sites where Pro Tower coverage isn't sufficient — full-perimeter and overview deployments." },
      { sector: "Infrastructure",      scenario: "Long-duration projects where height and battery capacity matter more than ultra-portability." },
      { sector: "Compounds & yards",   scenario: "Higher-risk vacant property and storage compounds needing visible deterrence." },
      { sector: "Wide-area sites",     scenario: "Built for perimeter coverage or a single overview position above a larger footprint." },
    ],
    diffs: [
      { title: "Modular by design",     body: "Same engineering philosophy as the Pro Tower — every component specified per site." },
      { title: "Ultra-low power",       body: "Larger battery bay and solar capacity, still running on ultra-low consumption electronics." },
      { title: "4.5m operating height", body: "Nearly double the Pro Tower's mast height. Wider view, stronger presence, better camera reach." },
    ],
  },
  "ssu": {
    overview1: "The SSU Tower in a Box is a compact, modular CCTV tower solution designed to give security partners a portable and easy-to-deploy surveillance system without the size, transport demands, or handling requirements of a traditional tower. It is built around the Solo SSU platform, supplied in a packaged format that can be transported, stored, assembled, and deployed more easily.",
    overview2: "The concept is simple: instead of delivering a large pre-built tower, the partner receives a boxed, modular system that can be assembled on site and used to provide CCTV coverage, deterrence, and remote monitoring in locations where space, access, or logistics are restricted. For end-clients, it provides a practical security option for smaller sites, compounds, entrances, utilities areas, temporary works, vacant property, retail locations, and areas where a full-size CCTV tower may be unnecessary or difficult to position. For security partners, it creates a flexible product that is easier to stock, ship, install, relocate, and offer as part of a wider monitored security service.",
    useCases: [
      { sector: "Highways",          scenario: "Roadside and verge deployments where a full-size tower won't fit or can't be sited." },
      { sector: "Building-mounted",  scenario: "Bolted to a building façade, parapet or hoarding for fixed-position site coverage." },
      { sector: "Pole-mounted",      scenario: "Mounted to an existing pole or column where height is already available." },
      { sector: "Restricted access", scenario: "Sites where space, logistics or vehicle access make a full tower impractical." },
    ],
    diffs: [
      { title: "Where full towers won't fit", body: "Useful on sites where a full-size tower is impractical — restricted access, tight footprints, or fixed mounting points." },
      { title: "Hybrid power",                body: "Mains, solar and battery storage all supported. Run the SSU on whatever the site can provide." },
      { title: "Easy to ship and stock",      body: "Boxed, modular delivery. Partners can stock, ship, assemble, install, relocate and re-deploy with far less operational complexity than a conventional full-size tower." },
    ],
  },
  "rs1": {
    overview1: "The RS1 is a 188W add-on solar panel designed for the Pro Tower and Ultra Tower where installation locations or PV conditions create additional power challenges. It provides extra solar input to support battery charging, improve off-grid performance, and increase deployment resilience in areas with reduced sunlight, shading, poor orientation, or higher operational demand.",
    overview2: "Lightweight, two-piece construction means a single person can carry and rig it on site. The RS1 pairs natively with the Pro and Ultra Tower power systems — no extra cabling design needed, no factory-return required when site conditions change. Stocked alongside the towers, the RS1 lets partners flex their deployments for site-specific PV conditions without overspecifying every unit at quote stage.",
    useCases: [
      { sector: "Pro Tower pairing",   scenario: "Add to a Pro Tower when site shading or orientation reduces native PV recovery." },
      { sector: "Ultra Tower pairing", scenario: "Boosts the Ultra Tower's solar input on long-duration or low-PV deployments." },
      { sector: "Low-sunlight sites",  scenario: "Northern latitudes, deep urban canyons, winter deployments — anywhere PV underperforms." },
      { sector: "Global deployment",   scenario: "Supports any deployment globally where low PV or location is an issue." },
    ],
    diffs: [
      { title: "Ultra lightweight",       body: "Single-person carry and rig. No specialist plant or lift team required." },
      { title: "Two-piece construction",  body: "Splits in two for easier transport, storage and on-site handling." },
      { title: "Interconnectable",        body: "Daisy-chain multiple RS1 panels into the same tower for higher combined PV output." },
    ],
  },
  "rs2": {
    overview1: "The RS2 is the bigger brother of the RS1, designed to provide a higher-capacity solar add-on for Pro Tower and Ultra Tower deployments where greater solar recovery is required. While the RS1 uses a compact 188W panel, the RS2 uses a larger 365W panel to deliver increased PV input, supporting improved battery charging and stronger off-grid performance in locations with poor sunlight, shading, challenging orientation, or higher power demand.",
    overview2: "The key difference is size, orientation and output. The RS2 is a larger-format solar solution, giving partners a more powerful add-on option where the standard tower solar setup, or the smaller RS1, may not provide enough additional solar recovery. Its larger panel size and 365W capacity make it better suited to sites with difficult PV conditions, longer deployment requirements, or installations where maintaining battery performance is more critical.",
    useCases: [
      { sector: "Higher loads",        scenario: "Sites running additional sensors, beacons or auxiliary devices off the tower's power bus." },
      { sector: "Difficult PV sites",  scenario: "Heavy shading, poor orientation, or winter deployments where RS1 isn't enough." },
      { sector: "Long-duration sites", scenario: "Multi-month or multi-year deployments where battery resilience is critical." },
      { sector: "Global deployment",   scenario: "Supports higher loads and any deployment globally where low PV or location is an issue." },
    ],
    diffs: [
      { title: "Ultra lightweight",       body: "Two-piece design keeps the larger 365W panel rigging-friendly for a single person." },
      { title: "Two-piece construction",  body: "Splits in two for transport and storage — same handling profile as the RS1." },
      { title: "Interconnectable",        body: "Combine with RS1 panels or daisy-chain multiple RS2s for maximum solar recovery." },
    ],
  },
  "volt-box": {
    overview1: "The Volt Box is a 100Ah managed lithium battery system designed to provide dependable stored power for Pro Tower, Ultra Tower, and solar-assisted CCTV deployments. Built using Grade A 316 lithium battery cells, it supports stable off-grid performance, improved battery efficiency, and longer operational resilience where mains power is unavailable, unreliable, or not commercially practical.",
    overview2: "The system is designed to work alongside the tower's solar and power-management setup, helping maintain consistent operation through changing site conditions, reduced sunlight, overnight use, and higher operational demand. For security partners, the Volt Box provides a professional, scalable battery option that improves deployment flexibility and gives end-clients greater confidence in long-duration, low-maintenance site protection.",
    useCases: [
      { sector: "Pro Tower pairing",     scenario: "Bolts into the Pro Tower's battery bay to extend autonomy on long-duration sites." },
      { sector: "Ultra Tower pairing",   scenario: "Multiple Volt Box units stack into the Ultra Tower's larger bay for maximum runtime." },
      { sector: "Overnight resilience",  scenario: "Carries the system through nights and overcast days where solar recovery is reduced." },
      { sector: "Any Solo deployment",   scenario: "Compatible across the full Solo tower range — same battery, same management, same partner experience." },
    ],
    diffs: [
      { title: "Lightweight",         body: "Engineered to be handled by a single person — same single-deployment philosophy as the towers." },
      { title: "Lithium-ion (Grade A)", body: "Built with Grade A 316 lithium cells — long cycle life, stable performance, predictable degradation." },
      { title: "Two capacities",      body: "Comes in 100Ah and 314Ah options. Match the right capacity to the deployment without overspending on every unit." },
    ],
  },
  // Legacy range — no editorial copy defined yet. The product summary
  // on the hero block covers the legacy story; overview/useCases/diffs
  // sections are silently hidden for products not listed here.
};

// Compatible accessories shown on the Pro Tower + Ultra Tower pages only.
// Cross-sells to the solar add-ons and the Volt Box. The accessory pages
// don't get this section back (per the spec — towers only).
const TOWER_ACCESSORIES = ["rs1", "rs2", "volt-box"];

// Per-product hero image path. Falls back to the shared studio render
// when a product doesn't have its own photo yet. Used by every product
// image-slot — hero, overview, products-index card and accessory thumb.
const PRODUCT_IMAGES = {
  "pro-tower":   "assets/product-pro-tower.png?v=5",
  "ultra-tower": "assets/product-ultra-tower.png?v=5",
  "rt-tower":    "assets/product-rt-tower.png?v=4",
  "ssu":         "assets/product-ssu.png?v=4",
  "rs1":         "assets/product-rs1-user.png?v=3",
  "rs2":         "assets/product-rs2.png?v=3",
  "volt-box":    "assets/product-volt-box.png?v=3",
  "solo-post":   "assets/product-solo-post.png",
};
// Per-product alternate photo for the Overview section (paragraph 2 side).
// Falls back to the hero if no alt exists.
const PRODUCT_OVERVIEW_IMAGES = {
  "pro-tower":   "assets/product-pro-tower-alt-1.png?v=3",
  "ultra-tower": "assets/product-ultra-tower-alt-1.png?v=2",
  "rs1":         "assets/product-rs1-user.png?v=3",
  // "solo-post" omitted — falls back to the hero photo until a fresh
  // accessory-kit shot is supplied on the dark studio background.
};
const productOverviewImage = (id) => PRODUCT_OVERVIEW_IMAGES[id] || PRODUCT_IMAGES[id] || "assets/hero-studio-product.png";
if (typeof window !== "undefined") window.productOverviewImage = productOverviewImage;
const productImage = (id) => PRODUCT_IMAGES[id] || "assets/hero-studio-product.png";
// Expose on window so other React modules (home.jsx, sponsor pages,
// etc.) can resolve product-photo paths without duplicating the map.
if (typeof window !== "undefined") window.productImage = productImage;

/* ════════════════════ PRODUCT DETAIL ════════════════════ */
function ProductPage({ productId, onNavigate }) {
  const product = window.SOLO_DATA.products.find(p => p.id === productId) || window.SOLO_DATA.products[0];
  // "Other units" cross-sell excludes not-yet-released products — no
  // detail page worth cross-selling into until they actually ship.
  const others = window.SOLO_DATA.products.filter(p => p.id !== product.id && !p.comingSoon);

  // Data-sheet "coming soon" toast — clicking any Data sheet button opens
  // a small dismissible message anchored bottom-centre of the viewport.
  // Auto-dismisses after 4s; the user can also close it manually.
  const [dataSheetToast, setDataSheetToast] = useState(false);
  useEffect(() => {
    if (!dataSheetToast) return;
    const t = setTimeout(() => setDataSheetToast(false), 4000);
    return () => clearTimeout(t);
  }, [dataSheetToast]);

  return (
    <>
      <section style={{ padding: "60px 36px 100px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <Breadcrumb crumbs={["Home", "Products", product.name]} onNavigate={onNavigate} targets={["home", "product"]} />

          <div style={{
            display: "grid",
            gridTemplateColumns: "minmax(0, 1.1fr) minmax(0, 1fr)",
            gap: 80, alignItems: "center", marginTop: 40,
          }}>
            <div style={{ minWidth: 0 }}>
              <Eyebrow style={{ marginBottom: 24 }}>{product.classification}</Eyebrow>
              <h1 style={{
                fontFamily: "var(--font-display)",
                fontWeight: 700,
                // Sized so every product name fits the left column of the
                // hero grid without overflowing. Long names ("Volt Box
                // Battery", "Ultra Tower") sit down at ~72px on desktop
                // and wrap onto two lines; short names ("SSU", "RS1")
                // still hit the 96px ceiling for impact.
                // Length-aware sizing — long product names (>10 chars)
                // shrink one step; multi-word names always allow break.
                fontSize:
                  product.name.length > 12 ? "clamp(44px, 5.2vw, 76px)"
                  : product.name.length > 8 ? "clamp(52px, 6.4vw, 92px)"
                  : "clamp(56px, 7.5vw, 112px)",
                letterSpacing: "-0.01em", lineHeight: 0.92,
                textTransform: "uppercase",
                margin: "0 0 32px", color: "var(--fg)",
                overflowWrap: "break-word",
                wordBreak: "normal",     // stop mid-word breaks that produce ugly hyphenation
                hyphens: "manual",
                maxWidth: "100%",
              }}>{product.name}</h1>
              <p style={{
                fontFamily: "var(--font-body)", fontSize: 19,
                lineHeight: 1.55, color: "var(--fg-soft)",
                maxWidth: 580, marginBottom: 36,
              }}>{product.summary}</p>
              <div style={{ display: "flex", gap: 12, marginBottom: 48, flexWrap: "wrap" }}>
                <Button primary onClick={() => onNavigate("contact", { subject: `Request a quote for ${product.name}` })}>Request a quote →</Button>
                {/* Configure-this-unit CTA — only shown for products supported by the spec builder.
                    Pre-selects the platform on the builder page via query param. */}
                {(product.id === "pro-tower" || product.id === "ultra-tower") && (
                  <Button onClick={() => {
                    const platform = product.id === "pro-tower" ? "pro" : "ultra";
                    // Set the deep-link param the builder reads on mount
                    window.history.replaceState({}, "", `${location.pathname}?builder-product=${platform}`);
                    onNavigate("builder");
                  }}>Configure this unit →</Button>
                )}
                <Button onClick={() => setDataSheetToast(true)}>Data sheet (PDF)</Button>
              </div>

              <div style={{
                display: "grid", gridTemplateColumns: "1fr 1fr", gap: 0,
                border: "1px solid var(--line)",
              }}>
                {product.specs.slice(0, 4).map((s, i) => (
                  <div key={i} style={{
                    padding: "22px 26px",
                    borderRight: i % 2 === 0 ? "1px solid var(--line)" : "none",
                    borderTop: i >= 2 ? "1px solid var(--line)" : "none",
                  }}>
                    <div style={{
                      fontFamily: "var(--font-body)", fontSize: 11,
                      letterSpacing: "0.2em", color: "var(--fg-dim)",
                      textTransform: "uppercase", marginBottom: 8,
                    }}>{s.label}</div>
                    <div style={{
                      fontFamily: "var(--font-display)",
                      fontSize: 22, fontWeight: 700,
                      letterSpacing: "-0.005em",
                      color: "var(--fg)", textTransform: "uppercase",
                    }}>{s.value}</div>
                  </div>
                ))}
              </div>
            </div>
            <div style={{
              // SoloPost photos are landscape 16:9; everything else is portrait.
              // Use the right aspect ratio for the product so the photo fills the frame.
              position: "relative",
              // Every product photo on the site is now 4:3 (tightly cropped
              // around the subject) so the product fills the frame.
              aspectRatio: "4 / 3",
              // Slate-grey studio background — every product photo has a
              // transparent background, so this container fills behind them
              // to match the SoloPost photo's baked-in studio aesthetic.
              background: "#ffffff",
              border: "1px solid var(--line)", overflow: "hidden",
              display: "grid", placeItems: "center",
            }}>
              {/* Plain <img> — direct render of the product photo with
                  no image-slot placeholder overlay. Keeps the page
                  looking polished on first paint without any "PRO TOWER
                  HERO RENDER" flicker before the image resolves. */}
              <img
                src={productImage(product.id)}
                alt={`${product.name} — product render`}
                style={{
                  position: "absolute", inset: 0,
                  width: "100%", height: "100%",
                  objectFit: "contain",
                  display: "block",
                }}
              />
              <div style={{
                position: "absolute", top: 22, left: 22,
                fontFamily: "var(--font-body)", fontSize: 11,
                letterSpacing: "0.22em",
                // Container is now a light studio backdrop — use the near-black
                // fg colour as the chip fill so the SKU tag stays readable and
                // provides a strong contrast anchor against the white plate.
                background: "var(--fg)",
                padding: "8px 12px",
                border: "1px solid var(--fg)",
                textTransform: "uppercase", color: "var(--bg)",
              }}>{product.sku}</div>
            </div>
          </div>

        </div>
      </section>

      {/* ════════════════════ AT-A-GLANCE ════════════════════
          Headline stats pulled from the spec list — gives the page a
          visual rhythm beyond the hero's small 2x2 spec grid. */}
      {product.specs && product.specs.length >= 3 && (
        <section style={{
          padding: "80px 36px",
          background: "var(--bg)",
          borderBottom: "1px solid var(--line)",
        }}>
          <div style={{ maxWidth: 1480, margin: "0 auto" }}>
            <Eyebrow style={{ marginBottom: 28 }}>At a glance</Eyebrow>
            <div style={{
              display: "grid",
              gridTemplateColumns: `repeat(${Math.min(4, product.specs.length)}, 1fr)`,
              gap: 0,
              borderTop: "1px solid var(--line)", borderBottom: "1px solid var(--line)",
            }}>
              {product.specs.slice(0, 4).map((s, i, arr) => (
                <div key={i} style={{
                  padding: "32px 28px",
                  borderRight: i < arr.length - 1 ? "1px solid var(--line)" : "none",
                }}>
                  <div style={{
                    fontFamily: "var(--font-display)", fontWeight: 700,
                    fontSize: "clamp(24px, 2.6vw, 36px)", lineHeight: 1.05,
                    letterSpacing: "-0.005em", textTransform: "uppercase",
                    color: "var(--fg)", marginBottom: 12,
                  }}>{s.value}</div>
                  <div style={{
                    fontFamily: "var(--font-body)", fontSize: 11,
                    letterSpacing: "0.2em", textTransform: "uppercase",
                    color: "var(--fg-dim)", fontWeight: 500,
                  }}>{s.label}</div>
                </div>
              ))}
            </div>
          </div>
        </section>
      )}

      {/* ════════════════════ OVERVIEW ════════════════════
          Two-paragraph narrative + a dedicated portrait image slot.
          The image slot defaults to the studio render so the page never
          looks empty; user can drop a real product photo on top. */}
      <section style={{
        padding: "120px 36px",
        background: "var(--surface)",
        borderBottom: "1px solid var(--line)",
      }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{
            display: "grid", gridTemplateColumns: "1.2fr 1fr",
            gap: 80, alignItems: "center",
          }}>
            <div>
              <Eyebrow style={{ marginBottom: 28 }}>Overview</Eyebrow>
              <h2 style={{
                fontFamily: "var(--font-display)", fontWeight: 700,
                fontSize: "clamp(32px, 4.2vw, 56px)", lineHeight: 1.02,
                letterSpacing: "-0.005em", textTransform: "uppercase",
                margin: "0 0 28px", color: "var(--fg)", maxWidth: 720,
              }}>
                {product.tagline}
              </h2>
              {/* Overview paragraphs — silently hidden when no editorial
                  copy exists for a product, rather than showing placeholder
                  text. Add copy to PRODUCT_EDITORIAL[product.id] to opt in. */}
              {PRODUCT_EDITORIAL[product.id]?.overview1 && (
                <p style={{
                  fontFamily: "var(--font-body)", fontSize: 17,
                  lineHeight: 1.6, color: "var(--fg-soft)",
                  margin: "0 0 22px", maxWidth: 620,
                }}>{PRODUCT_EDITORIAL[product.id].overview1}</p>
              )}
              {PRODUCT_EDITORIAL[product.id]?.overview2 && (
                <p style={{
                  fontFamily: "var(--font-body)", fontSize: 17,
                  lineHeight: 1.6, color: "var(--fg-soft)",
                  margin: 0, maxWidth: 620,
                }}>{PRODUCT_EDITORIAL[product.id].overview2}</p>
              )}
            </div>

            {/* Dedicated editorial image slot — separate from the hero
                image so partners can show a different angle here.
                SoloPost photos are landscape; everything else is portrait. */}
            <div style={{
              position: "relative",
              // Match the 4:3 ratio of the tightly-cropped product photos.
              aspectRatio: "4 / 3",
              // Same slate-grey studio background as the hero — every product
              // photo has a transparent background so this fills behind.
              background: "#ffffff",
              border: "1px solid var(--line)",
              overflow: "hidden",
            }}>
              <img
                src={productOverviewImage(product.id)}
                alt={`${product.name} — overview photo`}
                style={{
                  position: "absolute", inset: 0,
                  width: "100%", height: "100%",
                  objectFit: "contain",
                  display: "block",
                }}
                loading="lazy"
              />
              <div style={{
                position: "absolute", top: 20, left: 22,
                fontFamily: "var(--font-body)", fontSize: 11,
                letterSpacing: "0.22em", textTransform: "uppercase",
                color: "#fff", background: "rgba(0,0,0,0.55)",
                padding: "6px 10px",
                backdropFilter: "blur(6px)",
                fontWeight: 500,
              }}>{product.name}</div>
            </div>
          </div>
        </div>
      </section>

      {/* ════════════════════ USE CASES ════════════════════
          Sector + 1-line scenario cards. Generic "where this product
          tends to deploy" — partners use these to anchor end-client
          conversations. */}
      {PRODUCT_EDITORIAL[product.id]?.useCases && (
        <section style={{
          padding: "120px 36px",
          background: "var(--bg)",
          borderBottom: "1px solid var(--line)",
        }}>
          <div style={{ maxWidth: 1480, margin: "0 auto" }}>
            <div style={{
              display: "grid", gridTemplateColumns: "1fr 1.6fr",
              gap: 80, marginBottom: 56, alignItems: "end",
            }}>
              <Eyebrow>Where it deploys</Eyebrow>
              <h2 style={{
                fontFamily: "var(--font-display)", fontWeight: 700,
                fontSize: "clamp(32px, 4.2vw, 56px)", lineHeight: 1.02,
                letterSpacing: "-0.005em", textTransform: "uppercase",
                margin: 0, color: "var(--fg)",
              }}>Typical use cases.</h2>
            </div>
            <div style={{
              display: "grid", gridTemplateColumns: "repeat(4, 1fr)",
              gap: 0, border: "1px solid var(--line)",
            }}>
              {PRODUCT_EDITORIAL[product.id].useCases.map((uc, i, arr) => (
                <div key={i} style={{
                  padding: "32px 28px 36px",
                  background: "var(--surface)",
                  borderRight: i < arr.length - 1 ? "1px solid var(--line)" : "none",
                  display: "flex", flexDirection: "column",
                  minHeight: 200,
                }}>
                  <div style={{
                    fontFamily: "var(--font-body)", fontSize: 11,
                    letterSpacing: "0.22em", color: "var(--fg-dim)",
                    textTransform: "uppercase", marginBottom: 18, fontWeight: 500,
                  }}>Sector</div>
                  <div style={{
                    fontFamily: "var(--font-display)", fontWeight: 700,
                    fontSize: 18, letterSpacing: "0.005em",
                    textTransform: "uppercase", color: "var(--fg)",
                    marginBottom: 16,
                  }}>{uc.sector}</div>
                  <p style={{
                    fontFamily: "var(--font-body)", fontSize: 14,
                    lineHeight: 1.55, color: "var(--fg-soft)",
                    margin: 0, flex: 1,
                  }}>{uc.scenario}</p>
                </div>
              ))}
            </div>
          </div>
        </section>
      )}

      {/* ════════════════════ KEY DIFFERENTIATORS ════════════════════
          3–4 short points explaining why a partner picks this product.
          Lives on every product (light treatment on the accessories;
          flagship treatment on the towers via a dark background). */}
      {PRODUCT_EDITORIAL[product.id]?.diffs && (
        <section style={{
          padding: "120px 36px",
          background: !product.isAccessory ? "var(--black)" : "var(--surface)",
          color: !product.isAccessory ? "var(--invert-fg)" : "var(--fg)",
          borderBottom: "1px solid var(--line)",
        }}>
          <div style={{ maxWidth: 1480, margin: "0 auto" }}>
            <div style={{
              display: "grid", gridTemplateColumns: "1fr 1.6fr",
              gap: 80, marginBottom: 56, alignItems: "end",
            }}>
              <div style={{
                fontFamily: "var(--font-body)", fontSize: 11,
                letterSpacing: "0.22em", textTransform: "uppercase",
                color: !product.isAccessory ? "rgba(255,255,255,0.55)" : "var(--fg-dim)",
                fontWeight: 500,
              }}>Why {product.name}</div>
              <h2 style={{
                fontFamily: "var(--font-display)", fontWeight: 700,
                fontSize: "clamp(32px, 4.2vw, 56px)", lineHeight: 1.02,
                letterSpacing: "-0.005em", textTransform: "uppercase",
                margin: 0,
                color: !product.isAccessory ? "var(--invert-fg)" : "var(--fg)",
              }}>Key differentiators.</h2>
            </div>
            <div style={{
              display: "grid",
              gridTemplateColumns: `repeat(${PRODUCT_EDITORIAL[product.id].diffs.length}, 1fr)`,
              gap: 0,
              border: `1px solid ${!product.isAccessory ? "rgba(255,255,255,0.18)" : "var(--line)"}`,
            }}>
              {PRODUCT_EDITORIAL[product.id].diffs.map((d, i, arr) => (
                <div key={i} style={{
                  padding: "36px 28px 40px",
                  borderRight: i < arr.length - 1
                    ? `1px solid ${!product.isAccessory ? "rgba(255,255,255,0.18)" : "var(--line)"}`
                    : "none",
                  minHeight: 200,
                  display: "flex", flexDirection: "column",
                }}>
                  <div style={{
                    fontFamily: "var(--font-display)", fontWeight: 700,
                    fontSize: "clamp(22px, 2.2vw, 28px)", lineHeight: 1.1,
                    letterSpacing: "-0.005em", textTransform: "uppercase",
                    color: !product.isAccessory ? "var(--invert-fg)" : "var(--fg)",
                    marginBottom: 16,
                  }}>{String(i + 1).padStart(2, "0")}.</div>
                  <h3 style={{
                    fontFamily: "var(--font-display)", fontWeight: 700,
                    fontSize: 17, letterSpacing: "0.005em",
                    textTransform: "uppercase",
                    color: !product.isAccessory ? "var(--invert-fg)" : "var(--fg)",
                    margin: "0 0 14px",
                  }}>{d.title}</h3>
                  <p style={{
                    fontFamily: "var(--font-body)", fontSize: 14,
                    lineHeight: 1.55,
                    color: !product.isAccessory ? "rgba(255,255,255,0.72)" : "var(--fg-soft)",
                    margin: 0, flex: 1,
                  }}>{d.body}</p>
                </div>
              ))}
            </div>
          </div>
        </section>
      )}

      {/* Full spec — variants comparison if the product has multiple model
          variants (e.g. Volt Box 100 / 300), or the standard single-product
          spec block otherwise. */}
      <section style={{
        padding: "120px 36px",
        background: "var(--surface)",
        borderBottom: "1px solid var(--line)",
      }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{
            display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 80,
            marginBottom: 64, alignItems: "end",
          }}>
            <div>
              <Eyebrow style={{ marginBottom: 32 }}>
                {product.variants ? "The lineup" : "Specification"}
              </Eyebrow>
              <SectionNumeral n={1} />
            </div>
            <H2>
              {product.variants ? "Two models. Pick the one that fits." : "Full technical reference."}
            </H2>
          </div>

          {product.variants ? (
            <VariantsComparison variants={product.variants} />
          ) : (
            <div style={{
              display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 0,
              border: "1px solid var(--line)", background: "var(--bg)",
            }}>
              {product.specs.map((s, i) => (
                <div key={i} style={{
                  display: "grid", gridTemplateColumns: "1fr 1fr", gap: 24,
                  padding: "22px 28px",
                  borderRight: i % 2 === 0 ? "1px solid var(--line)" : "none",
                  borderTop: i >= 2 ? "1px solid var(--line)" : "none",
                  alignItems: "baseline",
                }}>
                  <span style={{
                    fontFamily: "var(--font-body)", fontSize: 11,
                    letterSpacing: "0.2em", color: "var(--fg-dim)",
                    textTransform: "uppercase",
                  }}>{s.label}</span>
                  <span style={{
                    fontFamily: "var(--font-display)", fontSize: 17,
                    color: "var(--fg)", fontWeight: 700,
                    textTransform: "uppercase",
                  }}>{s.value}</span>
                </div>
              ))}
            </div>
          )}
        </div>
      </section>

      {/* ════════════════════ COMPATIBLE ACCESSORIES ════════════════════
          Only on the two flagship towers (Pro + Ultra). Cross-sells to
          the RS1 / RS2 solar add-ons and the Volt Box battery. Each card
          links to the accessory's own product detail page. */}
      {(product.id === "pro-tower" || product.id === "ultra-tower") && (
        <section style={{
          padding: "120px 36px",
          background: "var(--surface)",
          borderBottom: "1px solid var(--line)",
        }}>
          <div style={{ maxWidth: 1480, margin: "0 auto" }}>
            <div style={{
              display: "grid", gridTemplateColumns: "1fr 1.6fr",
              gap: 80, marginBottom: 56, alignItems: "end",
            }}>
              <Eyebrow>Works with</Eyebrow>
              <h2 style={{
                fontFamily: "var(--font-display)", fontWeight: 700,
                fontSize: "clamp(32px, 4.2vw, 56px)", lineHeight: 1.02,
                letterSpacing: "-0.005em", textTransform: "uppercase",
                margin: 0, color: "var(--fg)",
              }}>Compatible accessories.</h2>
            </div>

            <div style={{ display: "grid", gridTemplateColumns: "repeat(3, 1fr)", gap: 24 }}>
              {TOWER_ACCESSORIES.map((id) => {
                const acc = window.SOLO_DATA.products.find((p) => p.id === id);
                if (!acc) return null;
                return (
                  <button
                    key={id}
                    type="button"
                    onClick={() => onNavigate("product-detail", id)}
                    style={{
                      all: "unset", cursor: "pointer",
                      background: "var(--bg)",
                      border: "1px solid var(--line)",
                      display: "flex", flexDirection: "column",
                      transition: "border-color 160ms",
                    }}
                    onMouseEnter={(e) => e.currentTarget.style.borderColor = "var(--fg)"}
                    onMouseLeave={(e) => e.currentTarget.style.borderColor = "var(--line)"}
                  >
                    <div style={{
                      position: "relative",
                      // 4:3 matches the tightly-cropped product photos.
                      aspectRatio: "4 / 3",
                      // Slate-grey studio background — consistent with every other
                      // product photo container across the site.
                      background: "#ffffff",
                      borderBottom: "1px solid var(--line)",
                      overflow: "hidden",
                    }}>
                      <img
                        src={productImage(id)}
                        alt={acc.name}
                        style={{
                          position: "absolute", inset: 0,
                          width: "100%", height: "100%",
                          objectFit: "contain",
                          display: "block",
                        }}
                        loading="lazy"
                      />
                    </div>
                    <div style={{ padding: "22px 26px 26px" }}>
                      <div style={{
                        fontFamily: "var(--font-body)", fontSize: 11,
                        letterSpacing: "0.22em", color: "var(--fg-dim)",
                        textTransform: "uppercase", marginBottom: 10, fontWeight: 500,
                      }}>{acc.type}</div>
                      <div style={{
                        fontFamily: "var(--font-display)", fontWeight: 700,
                        fontSize: 22, letterSpacing: "0.005em",
                        textTransform: "uppercase", color: "var(--fg)",
                        marginBottom: 10,
                      }}>{acc.name}</div>
                      <p style={{
                        fontFamily: "var(--font-body)", fontSize: 13.5,
                        lineHeight: 1.55, color: "var(--fg-soft)",
                        margin: 0,
                      }}>{acc.tagline}</p>
                      <div style={{
                        marginTop: 18, paddingTop: 14, borderTop: "1px solid var(--line)",
                        display: "flex", justifyContent: "space-between", alignItems: "center",
                        fontFamily: "var(--font-body)", fontSize: 11,
                        letterSpacing: "0.22em", textTransform: "uppercase",
                        color: "var(--fg)", fontWeight: 500,
                      }}>
                        <span>View</span>
                        <span>→</span>
                      </div>
                    </div>
                  </button>
                );
              })}
            </div>
          </div>
        </section>
      )}

      {/* Compare */}
      <section style={{ padding: "120px 36px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{
            display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 80,
            marginBottom: 48, alignItems: "end",
          }}>
            <div>
              <Eyebrow style={{ marginBottom: 32 }}>Across the platform</Eyebrow>
              <SectionNumeral n={2} />
            </div>
            <H2>Other units.</H2>
          </div>
          <div style={{ display: "grid", gridTemplateColumns: "repeat(2, 1fr)", gap: 24 }}>
            {others.map((p) => (
              <div key={p.id} onClick={() => onNavigate("product-detail", p.id)} style={{
                padding: "32px",
                border: "1px solid var(--line)",
                cursor: "pointer",
                display: "grid", gridTemplateColumns: "1fr 120px", gap: 24,
                alignItems: "center",
              }}>
                <div>
                  <Eyebrow>{p.callsign}</Eyebrow>
                  <H3 style={{ fontSize: 24, margin: "12px 0 10px" }}>{p.name}</H3>
                  <p style={{
                    fontFamily: "var(--font-body)", fontSize: 14.5,
                    color: "var(--fg-soft)", margin: 0,
                  }}>{p.tagline}</p>
                </div>
                {/* Schematic removed; tiny related-product thumbnail uses the
                    real product photo via PRODUCT_IMAGES instead. */}
                <div style={{
                  width: 140, height: 140,
                  // Slate-grey studio background — matches the rest of the
                  // product photo containers across the site.
                  background: "#ffffff",
                  border: "1px solid var(--line)",
                  flexShrink: 0,
                  position: "relative",
                  overflow: "hidden",
                }}>
                  <img
                    src={productImage(p.id)}
                    alt={p.name}
                    style={{
                      position: "absolute", inset: 0,
                      width: "100%", height: "100%",
                      objectFit: "contain",
                      display: "block",
                    }}
                    loading="lazy"
                  />
                </div>
              </div>
            ))}
          </div>
        </div>
      </section>

      <FinalCTABand onNavigate={onNavigate} />

      {/* Data-sheet "coming soon" toast — anchored bottom-centre, fades
          in/out, auto-dismisses after 4s. Rendered here so it appears
          on top of any section on the product page. */}
      <DataSheetToast open={dataSheetToast} onClose={() => setDataSheetToast(false)} />
    </>
  );
}

/* ──────────── DataSheetToast ────────────
 * Small dismissible message shown when the user clicks any Data sheet
 * (PDF) button. Positioned bottom-centre of the viewport, fades in with
 * a subtle slide-up, and auto-dismisses after a few seconds. Also
 * closes on click of the ✕ or the backdrop.
 */
function DataSheetToast({ open, onClose }) {
  return (
    <>
      {/* Click-through backdrop — dismisses on click but doesn't dim the page. */}
      <div
        onClick={onClose}
        style={{
          position: "fixed", inset: 0, zIndex: 300,
          pointerEvents: open ? "auto" : "none",
          background: "transparent",
        }}
        aria-hidden={!open}
      />
      <div
        role="status"
        aria-live="polite"
        style={{
          position: "fixed",
          left: "50%",
          bottom: 32,
          transform: `translateX(-50%) translateY(${open ? "0" : "20px"})`,
          zIndex: 301,
          background: "var(--fg)",
          color: "var(--bg)",
          padding: "18px 20px 18px 24px",
          minWidth: 300, maxWidth: "calc(100vw - 40px)",
          display: "flex", alignItems: "center", gap: 18,
          boxShadow: "0 20px 40px -12px rgba(0,0,0,0.35)",
          opacity: open ? 1 : 0,
          transition: "opacity 220ms cubic-bezier(0.4, 0, 0.2, 1), transform 260ms cubic-bezier(0.4, 0, 0.2, 1)",
          pointerEvents: open ? "auto" : "none",
        }}
      >
        {/* Info glyph */}
        <div aria-hidden style={{
          width: 20, height: 20, flex: "0 0 auto",
          display: "flex", alignItems: "center", justifyContent: "center",
        }}>
          <svg width="20" height="20" viewBox="0 0 20 20" fill="none">
            <circle cx="10" cy="10" r="9" stroke="currentColor" strokeWidth="1.2" />
            <rect x="9.1" y="8.4" width="1.8" height="6.2" fill="currentColor" />
            <circle cx="10" cy="5.6" r="1" fill="currentColor" />
          </svg>
        </div>
        <div style={{ flex: 1, minWidth: 0 }}>
          <div style={{
            fontFamily: "var(--font-body)",
            fontSize: 10, letterSpacing: "0.22em",
            textTransform: "uppercase", opacity: 0.6,
            fontWeight: 500, marginBottom: 4,
          }}>Data sheet</div>
          <div style={{
            fontFamily: "var(--font-body)", fontSize: 14,
            lineHeight: 1.45, fontWeight: 500,
          }}>Available soon in your region.</div>
        </div>
        <button
          onClick={onClose}
          aria-label="Dismiss"
          style={{
            background: "none", border: "none",
            color: "var(--bg)", opacity: 0.7,
            cursor: "pointer", padding: "6px 8px",
            fontSize: 16, lineHeight: 1,
          }}
        >✕</button>
      </div>
    </>
  );
}

/* ──────────── VariantsComparison ────────────
 * Side-by-side comparison card for products that come in multiple model
 * variants. Currently used by Volt Box (100 Ah / 314 Ah).
 *
 * Two cards on a 2-col grid. Each shows the variant name, subtitle,
 * tagline and a spec table. Spec rows share labels across both variants
 * so visual scanning across rows is easy. If a variant has a spec the
 * other doesn't, it still renders cleanly — we union all labels.
 */
function VariantsComparison({ variants }) {
  if (!variants || variants.length === 0) return null;
  // Union of all labels in order of first appearance across all variants.
  const labelOrder = [];
  const seen = new Set();
  for (const v of variants) {
    for (const spec of v.specs || []) {
      if (!seen.has(spec.label)) { seen.add(spec.label); labelOrder.push(spec.label); }
    }
  }
  // Helper: get a variant's value for a given label, or em-dash if missing.
  const valFor = (variant, label) => {
    const found = (variant.specs || []).find(s => s.label === label);
    return found ? found.value : "—";
  };

  return (
    <div style={{
      display: "grid",
      gridTemplateColumns: `repeat(${variants.length}, 1fr)`,
      gap: 0,
      border: "1px solid var(--line)",
      background: "var(--bg)",
    }}>
      {variants.map((v, vi) => (
        <div key={v.name} style={{
          borderRight: vi < variants.length - 1 ? "1px solid var(--line)" : "none",
          display: "flex", flexDirection: "column",
        }}>
          {/* Product image — appears at top of each variant panel.
              Falls back to a subtle placeholder gradient if no image
              is set, matching the studio-render look. */}
          <div style={{
            position: "relative",
            aspectRatio: "16 / 9",
            background: "#ffffff",
            borderBottom: "1px solid var(--line)",
            overflow: "hidden",
          }}>
            {v.image ? (
              <img
                src={v.image}
                alt={v.name}
                style={{
                  position: "absolute", inset: 0,
                  width: "100%", height: "100%",
                  objectFit: "contain",
                }}
                onError={(e) => { e.currentTarget.style.display = "none"; }}
              />
            ) : null}
            {/* Variant name overlay in the corner — brand-consistent
                with the main product hero label. */}
            <div style={{
              position: "absolute", top: 16, left: 18,
              fontFamily: "var(--font-body)", fontSize: 10,
              letterSpacing: "0.22em", textTransform: "uppercase",
              color: "#fff", background: "rgba(0,0,0,0.55)",
              padding: "5px 9px",
              backdropFilter: "blur(6px)",
              fontWeight: 500,
            }}>{v.subtitle}</div>
          </div>

          <div style={{
            padding: "36px 36px 40px",
            display: "flex", flexDirection: "column", flex: 1,
          }}>
          {/* Header */}
          <div style={{
            paddingBottom: 22, marginBottom: 24,
            borderBottom: "1px solid var(--line)",
          }}>
            <div style={{
              fontFamily: "var(--font-body)", fontSize: 11,
              letterSpacing: "0.22em", color: "var(--fg-dim)",
              textTransform: "uppercase", marginBottom: 10, fontWeight: 500,
            }}>{v.subtitle}</div>
            <div style={{
              fontFamily: "var(--font-display)", fontWeight: 700,
              fontSize: "clamp(26px, 3.2vw, 40px)", lineHeight: 1,
              letterSpacing: "0.005em", textTransform: "uppercase",
              color: "var(--fg)", marginBottom: 14,
            }}>{v.name}</div>
            <p style={{
              fontFamily: "var(--font-body)", fontSize: 14.5,
              lineHeight: 1.55, color: "var(--fg-soft)",
              margin: 0,
            }}>{v.tagline}</p>
          </div>

          {/* Specs */}
          <div style={{ display: "grid", gridTemplateColumns: "auto 1fr", gap: "14px 24px" }}>
            {labelOrder.map((label) => (
              <React.Fragment key={label}>
                <span style={{
                  fontFamily: "var(--font-body)", fontSize: 11,
                  letterSpacing: "0.2em", color: "var(--fg-dim)",
                  textTransform: "uppercase", paddingTop: 2,
                }}>{label}</span>
                <span style={{
                  fontFamily: "var(--font-display)", fontSize: 16,
                  color: "var(--fg)", fontWeight: 700,
                  textTransform: "uppercase",
                  letterSpacing: "0.005em",
                }}>{valFor(v, label)}</span>
              </React.Fragment>
            ))}
          </div>

          {/* SKU footnote */}
          {v.sku && (
            <div style={{
              marginTop: "auto", paddingTop: 22,
              borderTop: "1px solid var(--line)",
              display: "flex", justifyContent: "space-between",
              fontFamily: "var(--font-body)", fontSize: 11,
              letterSpacing: "0.18em", textTransform: "uppercase",
              color: "var(--fg-dim)", fontWeight: 500,
            }}>
              <span>SKU</span>
              <span>{v.sku}</span>
            </div>
          )}
          </div>{/* /panel-body */}
        </div>
      ))}
    </div>
  );
}

/* ════════════════════ SECTOR ════════════════════ */
// Per-sector hero image mapping. Mapped to the generated hero photos in
// /assets. Sectors not in this map fall back to the image-slot placeholder.
const SECTOR_HERO_IMAGES = {
  "construction":     "assets/hero-construction-dusk.png",
  "highways":         "assets/hero-motorway-night.png",
  "utilities":        "assets/hero-substation-bess.png",
  "renewables":       "assets/hero-substation-bess.png",  // BESS / solar field — same vibe
  "oil-gas":          "assets/hero-substation-bess.png",  // industrial infrastructure tone
  // 'vacant', 'rail', 'private-estates' etc. fall through to placeholder
};

function SectorPage({ sectorId, onNavigate }) {
  const sector = window.SOLO_DATA.sectors.find(s => s.id === sectorId) || window.SOLO_DATA.sectors[0];
  const ref = window.SOLO_DATA.cases[0];

  return (
    <>
      <section style={{ padding: "60px 36px 120px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <Breadcrumb crumbs={["Home", "Sectors", sector.name]} onNavigate={onNavigate} targets={["home", null]} />
          <Eyebrow style={{ marginTop: 40, marginBottom: 28 }}>Sector {sector.code}</Eyebrow>
          <h1 style={{
            fontFamily: "var(--font-display)", fontWeight: 700,
            // Shared by all sectors — sized so the longest single word
            // among them ("Construction.", "Renewables.", "Highways.")
            // always fits the 1480px column on one line without an
            // ugly mid-character break. Short sector names (Rail,
            // Private Estates) simply render a little less huge.
            fontSize: "clamp(52px, 7vw, 108px)", lineHeight: 0.9,
            letterSpacing: "-0.01em", textTransform: "uppercase",
            margin: "0 0 32px", color: "var(--fg)", maxWidth: "100%",
            overflowWrap: "break-word", wordBreak: "normal", hyphens: "manual",
          }}>{sector.name}.</h1>
          <p style={{
            fontFamily: "var(--font-body)", fontSize: 21,
            lineHeight: 1.5, color: "var(--fg-soft)",
            maxWidth: 800, marginBottom: 64,
          }}>{sector.summary}</p>

          {/* Stat strip — vertical row list (values like "< 14 min" wrap
              to 2 lines on narrower desktops and misalign a 4-col grid). */}
          <StatRow large stats={[
            [sector.deployments.toLocaleString(), "Deployments"],
            ["< 14 min", "Avg deploy"],
            ["99.6%", "Uptime SLA"],
            ["< 0.5%", "False positive"],
          ]} />
        </div>
      </section>

      <section style={{
        padding: "120px 36px",
        background: "var(--surface)",
        borderBottom: "1px solid var(--line)",
      }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{
            display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 80,
            marginBottom: 56, alignItems: "end",
          }}>
            <div>
              <Eyebrow style={{ marginBottom: 32 }}>Reference deployment</Eyebrow>
              <SectionNumeral n={1} />
            </div>
            <H2>Field record.</H2>
          </div>
          <div style={{ display: "grid", gridTemplateColumns: "1.2fr 1fr", gap: 64, alignItems: "center" }}>
            <div style={{
              position: "relative", aspectRatio: "4 / 3",
              background: "var(--bg)", overflow: "hidden",
              border: "1px solid var(--line)",
            }}>
              {/* Sector hero image — one of the generated heroes per
                  sector. If SECTOR_HERO_IMAGES has no entry for this
                  sector, render nothing rather than an image-slot
                  placeholder overlay — the parent container's grey
                  surface is a cleaner empty state. */}
              {SECTOR_HERO_IMAGES[sector.id] ? (
                <img
                  src={SECTOR_HERO_IMAGES[sector.id]}
                  alt={`${sector.name} deployment photograph`}
                  style={{
                    position: "absolute", inset: 0,
                    width: "100%", height: "100%",
                    objectFit: "cover",
                    display: "block",
                  }}
                  loading="lazy"
                />
              ) : null}
            </div>
            <div>
              <Eyebrow>{ref.product}</Eyebrow>
              <H3 style={{
                fontSize: "clamp(24px, 2.6vw, 36px)",
                marginTop: 18, marginBottom: 22, lineHeight: 1.2,
              }}>{ref.headline}</H3>
              <p style={{
                fontFamily: "var(--font-body)", fontSize: 16,
                lineHeight: 1.6, color: "var(--fg-soft)",
                marginBottom: 32,
              }}>{ref.summary}</p>
              <div style={{ paddingTop: 28 }}>
                <StatRow stats={ref.stats} />
              </div>
            </div>
          </div>
        </div>
      </section>

      <FinalCTABand onNavigate={onNavigate} />
    </>
  );
}

/* ════════════════════ ABOUT ════════════════════ */
function AboutPage({ onNavigate }) {
  return (
    <>
      {/* HERO */}
      <section style={{ padding: "80px 36px 120px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <Eyebrow style={{ marginBottom: 32 }}>Company</Eyebrow>
          <h1 style={{
            fontFamily: "var(--font-display)", fontWeight: 700,
            fontSize: "clamp(56px, 8vw, 144px)", lineHeight: 0.92,
            letterSpacing: "-0.01em", textTransform: "uppercase",
            margin: "0 0 40px", color: "var(--fg)", maxWidth: 1280,
          }}>
            We redefined the rapid-deployable space.
          </h1>
          <p style={{
            fontFamily: "var(--font-body)", fontSize: 21,
            lineHeight: 1.55, color: "var(--fg-soft)",
            maxWidth: 860,
          }}>
            Solo has redefined the rapid-deployable space with its range of products and services. Since 2019, we've built the platform — the towers, the SSU, the solar add-ons, the SIMs, the networks, the asset platform, the transport — under one roof. Everything in-house, by the group.
          </p>
        </div>
      </section>

      {/* MISSION — quiet, large, single statement */}
      <section style={{
        padding: "100px 36px",
        background: "var(--surface)",
        borderBottom: "1px solid var(--line)",
      }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1.8fr", gap: 80, alignItems: "start" }}>
            <Eyebrow>Our mission</Eyebrow>
            <h2 style={{
              fontFamily: "var(--font-display)", fontWeight: 700,
              fontSize: "clamp(32px, 4.4vw, 64px)", lineHeight: 1.05,
              letterSpacing: "-0.005em", textTransform: "uppercase",
              margin: 0, color: "var(--fg)", maxWidth: 1100,
            }}>
              To make rapidly-deployable security accessible to every scenario.
            </h2>
          </div>
        </div>
      </section>

      {/* OPERATING PRINCIPLE */}
      <section style={{ padding: "120px 36px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 80, alignItems: "start" }}>
            <Eyebrow style={{ marginBottom: 0 }}>How we work</Eyebrow>
            <div>
              <H2 style={{ marginBottom: 28 }}>Engineer first.</H2>
              <p style={{
                fontFamily: "var(--font-body)", fontSize: 19,
                lineHeight: 1.55, color: "var(--fg-soft)",
                maxWidth: 680, margin: "0 0 28px",
              }}>
                Every decision at Solo is made with a technical vision. The team that designs the platform is the same team that builds the units, supports the field deployments, and integrates the partner stack. There is no handoff — and there is no committee.
              </p>
              <p style={{
                fontFamily: "var(--font-body)", fontSize: 19,
                lineHeight: 1.55, color: "var(--fg-soft)",
                maxWidth: 680, margin: 0,
              }}>
                It's why Solo can do contract manufacturing, product design, data services, networks, asset management and transport as one operation — not as a stack of departments.
              </p>
            </div>
          </div>
        </div>
      </section>

      {/* PARTNERS WE WORK WITH */}
      <section style={{
        padding: "120px 36px",
        background: "var(--surface)",
        borderBottom: "1px solid var(--line)",
      }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 80, marginBottom: 56, alignItems: "start" }}>
            <Eyebrow>Industry partnerships</Eyebrow>
            <H2>We work with the industry's best.</H2>
          </div>
          <p style={{
            fontFamily: "var(--font-body)", fontSize: 18,
            lineHeight: 1.6, color: "var(--fg-soft)",
            maxWidth: 820, marginBottom: 48,
          }}>
            Solo partners with industry-leading providers across hardware, software integrations, platforms and connectivity. We build the chassis, the firmware and the operating model — and we choose best-in-class technology partners to round out the stack our customers deploy.
          </p>

          {/* Four category cards */}
          <div style={{
            display: "grid", gridTemplateColumns: "repeat(4, 1fr)", gap: 0,
            border: "1px solid var(--line)", background: "var(--bg)",
          }}>
            {[
              { title: "Hardware",                body: "Leading hardware partners across optics, power, comms and detection. Best-in-class components, tested in our own facilities before they go in a Solo unit." },
              { title: "Software integrations",   body: "Ajax, Victron and partner ecosystems integrated into the Solo platform — so every alert, battery state and asset shows up where it should." },
              { title: "Platforms",               body: "Cloud and on-prem platforms for monitoring, fleet management and incident response. Integrated through one API surface." },
              { title: "Connectivity",            body: "Multi-carrier connectivity partners across UK, EU and North America. Private APN options, managed data, fixed-package pricing." },
            ].map((p, i, arr) => (
              <div key={p.title} style={{
                padding: "36px 26px 40px",
                borderRight: i < arr.length - 1 ? "1px solid var(--line)" : "none",
                display: "flex", flexDirection: "column",
              }}>
                <H3 style={{ fontSize: 18, marginBottom: 16 }}>{p.title}</H3>
                <p style={{
                  fontFamily: "var(--font-body)", fontSize: 14.5,
                  lineHeight: 1.55, color: "var(--fg-soft)", margin: 0,
                }}>{p.body}</p>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/* WHO WE ARE — image + paragraph linking to Manufacturing */}
      <section style={{ padding: "120px 36px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{ display: "grid", gridTemplateColumns: "1.2fr 1fr", gap: 80, alignItems: "center" }}>
            <div style={{
              position: "relative", aspectRatio: "5 / 4",
              background: "var(--surface)",
              border: "1px solid var(--line)", overflow: "hidden",
            }}>
              <img
                src="assets/about-bedfordshire-hq.jpg?v=1"
                alt="Solo Secure factory floor — Bedfordshire HQ"
                style={{
                  position: "absolute", inset: 0,
                  width: "100%", height: "100%",
                  objectFit: "cover",
                  display: "block",
                }}
                loading="lazy"
              />
              <div style={{
                position: "absolute", top: 20, left: 22,
                fontFamily: "var(--font-body)", fontSize: 11,
                letterSpacing: "0.22em", textTransform: "uppercase",
                color: "#fff", background: "rgba(0,0,0,0.55)",
                padding: "6px 10px", backdropFilter: "blur(6px)",
              }}>Bedfordshire HQ · Solo Group</div>
            </div>
            <div>
              <Eyebrow style={{ marginBottom: 22 }}>Solo Group</Eyebrow>
              <H2 style={{ marginBottom: 22 }}>Everything in-house. By the group.</H2>
              <p style={{
                fontFamily: "var(--font-body)", fontSize: 17,
                lineHeight: 1.6, color: "var(--fg-soft)", marginBottom: 22,
              }}>
                Solo is owner-operated and engineer-led. We design, manufacture, prototype, assemble, test, support and deliver — under one roof. Three factories across the UK, Poland and Florida; one team running the operation end-to-end.
              </p>
              <p style={{
                fontFamily: "var(--font-body)", fontSize: 17,
                lineHeight: 1.6, color: "var(--fg-soft)", marginBottom: 32,
              }}>
                It's why we can ship a custom design in the same calendar as our standard range, and why every part of the platform answers to the same engineering standard.
              </p>
              <div style={{ display: "flex", gap: 12, flexWrap: "wrap" }}>
                <Button onClick={() => onNavigate("manufacturing")}>
                  See the factories →
                </Button>
                <Button onClick={() => onNavigate("services")}>
                  Services we operate
                </Button>
              </div>
            </div>
          </div>
        </div>
      </section>

      {/* OUR STORY HANDOFF — primary CTA */}
      <section style={{
        padding: "140px 36px",
        background: "var(--black)",
        color: "var(--invert-fg)",
        borderBottom: "1px solid var(--line)",
      }}>
        <div style={{
          maxWidth: 1480, margin: "0 auto",
          display: "grid", gridTemplateColumns: "1.3fr 1fr", gap: 80, alignItems: "center",
        }}>
          <div>
            <div style={{
              fontFamily: "var(--font-body)", fontSize: 12,
              letterSpacing: "0.22em", textTransform: "uppercase",
              color: "rgba(255,255,255,0.6)", fontWeight: 500,
              marginBottom: 32,
            }}>The full picture</div>
            <h2 style={{
              fontFamily: "var(--font-display)", fontWeight: 700,
              fontSize: "clamp(40px, 5.5vw, 84px)", lineHeight: 1,
              letterSpacing: "-0.005em", textTransform: "uppercase",
              margin: 0, color: "var(--invert-fg)",
            }}>
              Read our story.
            </h2>
          </div>
          <div style={{ display: "flex", flexDirection: "column", gap: 22, alignItems: "flex-start" }}>
            <p style={{
              fontFamily: "var(--font-body)", fontSize: 17,
              lineHeight: 1.55, color: "rgba(255,255,255,0.75)",
              margin: 0,
            }}>
              How Solo got here — the founding story, the milestones, and the work that redefined the rapid-deployable space.
            </p>
            <Button white onClick={() => onNavigate("our-story")}>
              Read Our Story →
            </Button>
          </div>
        </div>
      </section>
    </>
  );
}

/* ════════════════════ CONTACT ════════════════════ */
function ContactPage({ onNavigate, formSubject }) {
  return (
    <>
      {/* HERO + sales form */}
      <section style={{ padding: "80px 36px 100px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <Eyebrow style={{ marginBottom: 32 }}>Contact</Eyebrow>
          <div style={{ display: "grid", gridTemplateColumns: "1.1fr 1fr", gap: 80 }}>
            <div>
              <h1 style={{
                fontFamily: "var(--font-display)", fontWeight: 700,
                fontSize: "clamp(56px, 8vw, 124px)", lineHeight: 0.92,
                letterSpacing: "-0.01em", textTransform: "uppercase",
                margin: "0 0 28px", color: "var(--fg)",
              }}>
                Get in touch.
              </h1>
              <p style={{
                fontFamily: "var(--font-body)", fontSize: 18,
                lineHeight: 1.55, color: "var(--fg-soft)",
                maxWidth: 520, marginBottom: 40,
              }}>
                Demo requests, quotes, partnership enquiries, or anything else — drop us a message and we'll respond within one working day.
              </p>
              <div style={{
                display: "grid", gridTemplateColumns: "auto 1fr",
                gap: "16px 40px",
                borderTop: "1px solid var(--line)", paddingTop: 28,
                fontFamily: "var(--font-body)", fontSize: 16,
              }}>
                <ContactRow l="Email"   v="contactus@solosecure.group" />
                <ContactRow l="Support" v="Via partner programme" />
                <ContactRow l="Hours"   v="Mon–Fri 08:00–18:00 UTC" />
                <ContactRow l="Live chat" v="Bottom-right of every page" />
              </div>
            </div>
            <ContactForm formType="sales" subject={formSubject} />
          </div>
        </div>
      </section>

      {/* OFFICE ADDRESSES */}
      <section style={{ padding: "120px 36px", background: "var(--surface)", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <div style={{ display: "grid", gridTemplateColumns: "1fr 1.6fr", gap: 80, marginBottom: 56, alignItems: "end" }}>
            <Eyebrow>Our offices</Eyebrow>
            <H2>Three locations.</H2>
          </div>

          <div style={{
            display: "grid", gridTemplateColumns: "repeat(3, 1fr)",
            border: "1px solid var(--line)",
          }}>
            {[
              {
                role: "HQ + Factory",
                country: "United Kingdom",
                lines: ["Address line 1", "Bedfordshire", "Postcode", "United Kingdom"],
                phone: null, // TODO: add UK phone when issued
              },
              {
                role: "Factory",
                country: "Poland",
                lines: ["Address line 1", "Wrocław", "Postcode", "Poland"],
                phone: null, // TODO: add Poland phone when issued
              },
              {
                role: "Factory",
                country: "North America",
                lines: ["12070 SW Tom Mackie Blvd., Suite 105", "Port St. Lucie, FL 34953", "North America"],
                phone: "+1 (561) 293-7022",
              },
            ].map((o, i, arr) => (
              <div key={o.country} style={{
                background: "var(--bg)",
                borderRight: i < arr.length - 1 ? "1px solid var(--line)" : "none",
                padding: "36px 32px 40px",
                minHeight: 260,
                display: "flex", flexDirection: "column",
              }}>
                <Eyebrow style={{ color: "var(--fg)", marginBottom: 18 }}>{o.role}</Eyebrow>
                <h3 style={{
                  fontFamily: "var(--font-display)", fontWeight: 700,
                  fontSize: 22, letterSpacing: "0.005em",
                  textTransform: "uppercase", margin: "0 0 18px",
                  color: "var(--fg)",
                }}>{o.country}</h3>
                <div style={{
                  fontFamily: "var(--font-body)", fontSize: 14.5,
                  lineHeight: 1.6, color: "var(--fg-soft)",
                  marginBottom: 24,
                }}>
                  {o.lines.map((line) => <div key={line}>{line}</div>)}
                </div>
                <div style={{
                  marginTop: "auto", paddingTop: 16, borderTop: "1px solid var(--line)",
                }}>
                  {o.phone ? (
                    <>
                      <div style={{
                        fontFamily: "var(--font-body)", fontSize: 10,
                        letterSpacing: "0.22em", textTransform: "uppercase",
                        color: "var(--fg-faint)", fontWeight: 500,
                        marginBottom: 6,
                      }}>Phone</div>
                      <a
                        href={`tel:${o.phone.replace(/[^+0-9]/g, "")}`}
                        style={{
                          fontFamily: "var(--font-body)", fontSize: 15,
                          color: "var(--fg)", textDecoration: "none",
                          fontWeight: 500, letterSpacing: "-0.005em",
                        }}
                        onMouseEnter={(e) => e.currentTarget.style.textDecoration = "underline"}
                        onMouseLeave={(e) => e.currentTarget.style.textDecoration = "none"}
                      >{o.phone}</a>
                    </>
                  ) : (
                    <div style={{
                      fontFamily: "var(--font-body)", fontSize: 11,
                      letterSpacing: "0.14em", textTransform: "uppercase",
                      color: "var(--fg-faint)",
                    }}>
                      // Replace with full street address
                    </div>
                  )}
                </div>
              </div>
            ))}
          </div>
        </div>
      </section>

      {/*
        Support-ticket raising is deliberately NOT surfaced anywhere on the
        public site any more — not even as a "sign in to raise a ticket"
        pointer. It's a reseller-portal-only feature: only a signed-in
        reseller can reach it (support-page.jsx), and once there they can
        only raise tickets against their own company's own assets (see
        AssetLookupField in support-page.jsx / the assetUnitId check in
        POST /api/portal/tickets). The old pointer section that used to
        live here (id="support", "Raise a support ticket." + a button to
        reseller-login) has been removed entirely — a logged-out visitor
        should have zero path to anything ticket-shaped from the public
        site. Existing customers still see "Support: Via partner
        programme" in the contact details above, and the chat bubble's
        "existing partner" shortcut (contact-form.jsx) points at reseller
        login without naming the ticket feature.
      */}
    </>
  );
}

function ContactRow({ l, v }) {
  return (
    <>
      <span style={{
        fontFamily: "var(--font-body)", fontSize: 11,
        letterSpacing: "0.22em", color: "var(--fg-dim)",
        textTransform: "uppercase", paddingTop: 4, fontWeight: 500,
      }}>{l}</span>
      <span style={{ color: "var(--fg)" }}>{v}</span>
    </>
  );
}

/* ════════════════════ CASES ════════════════════ */
function CasesPage({ onNavigate }) {
  const cases = window.SOLO_DATA.cases;
  return (
    <>
      <section style={{ padding: "80px 36px 60px", borderBottom: "1px solid var(--line)" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          <Eyebrow style={{ marginBottom: 32 }}>Field record</Eyebrow>
          <h1 style={{
            fontFamily: "var(--font-display)", fontWeight: 700,
            // "Deployments." is a long single word — the old 168px
            // ceiling made it wider than the 1480px column at desktop
            // widths, forcing an ugly mid-character break.
            fontSize: "clamp(56px, 7.3vw, 118px)", lineHeight: 0.92,
            letterSpacing: "-0.01em", textTransform: "uppercase",
            margin: "0 0 28px", color: "var(--fg)", maxWidth: "100%",
            overflowWrap: "break-word", wordBreak: "normal", hyphens: "manual",
          }}>Deployments.</h1>
          <p style={{
            fontFamily: "var(--font-body)", fontSize: 18,
            lineHeight: 1.55, color: "var(--fg-soft)", maxWidth: 720,
          }}>
            A representative sample of Solo deployments. Full reference list available on request under NDA — typical for Tier-1 contract submissions.
          </p>
        </div>
      </section>
      <section style={{ padding: "0 36px 120px" }}>
        <div style={{ maxWidth: 1480, margin: "0 auto" }}>
          {cases.map((c, i) => (
            <div key={c.id} style={{
              padding: "60px 0",
              borderBottom: "1px solid var(--line)",
              display: "grid", gridTemplateColumns: "1.2fr 1fr 1fr",
              gap: 40, alignItems: "start",
            }}>
              <div>
                <Eyebrow style={{ marginBottom: 16 }}>{c.sector} · {c.product}</Eyebrow>
                <H3 style={{ fontSize: 24, marginBottom: 18, lineHeight: 1.2 }}>{c.headline}</H3>
                <p style={{
                  fontFamily: "var(--font-body)", fontSize: 14.5,
                  lineHeight: 1.6, color: "var(--fg-soft)",
                  margin: 0, maxWidth: 520,
                }}>{c.summary}</p>
              </div>
              <div style={{
                position: "relative", aspectRatio: "4 / 3",
                background: "var(--surface)", border: "1px solid var(--line)",
                overflow: "hidden",
              }}>
                <BakedPhoto id={`case-${c.id}`} alt={c.title || "Site photo"} />
              </div>
              <StatRow stats={c.stats} />
            </div>
          ))}
        </div>
      </section>
      <FinalCTABand onNavigate={onNavigate} />
    </>
  );
}

/* ════════════════════ CTA band (shared by inner pages) ════════════════════ */
function FinalCTABand({ onNavigate }) {
  return (
    <section style={{
      padding: "120px 36px",
      background: "var(--black)",
      color: "var(--invert-fg)",
      borderBottom: "1px solid var(--line)",
    }}>
      <div style={{
        maxWidth: 1480, margin: "0 auto",
        display: "grid", gridTemplateColumns: "1.3fr 1fr", gap: 80, alignItems: "center",
      }}>
        <div>
          <div style={{
            fontFamily: "var(--font-body)", fontSize: 12,
            letterSpacing: "0.22em", textTransform: "uppercase",
            color: "rgba(255,255,255,0.6)", marginBottom: 32,
            fontWeight: 500,
          }}>Ready to deploy</div>
          <h2 style={{
            fontFamily: "var(--font-display)", fontWeight: 700,
            fontSize: "clamp(40px, 5.5vw, 84px)", lineHeight: 1,
            letterSpacing: "-0.005em", textTransform: "uppercase",
            margin: 0, color: "var(--invert-fg)",
          }}>
            Stand up your first fleet in 14 days.
          </h2>
        </div>
        <div style={{ display: "flex", flexDirection: "column", gap: 20, alignItems: "flex-start" }}>
          <p style={{
            fontFamily: "var(--font-body)", fontSize: 17,
            lineHeight: 1.55, color: "rgba(255,255,255,0.75)",
            margin: 0,
          }}>
            Book a 30-minute briefing with the Solo commercial team.
          </p>
          <div style={{ display: "flex", gap: 12 }}>
            <Button white onClick={() => onNavigate("contact", { subject: "Request a demo" })}>Request a demo →</Button>
            <Button dark onClick={() => onNavigate("product")}>Explore platform</Button>
          </div>
        </div>
      </div>
    </section>
  );
}

/* ════════════════════ BREADCRUMB ════════════════════ */
function Breadcrumb({ crumbs, onNavigate, targets }) {
  return (
    <div style={{
      fontFamily: "var(--font-body)", fontSize: 11,
      letterSpacing: "0.22em", color: "var(--fg-dim)",
      textTransform: "uppercase", fontWeight: 500,
    }}>
      {crumbs.map((c, i) => (
        <span key={i}>
          {i > 0 && <span style={{ margin: "0 12px" }}>/</span>}
          {targets && targets[i] ? (
            <span onClick={() => onNavigate(targets[i])} style={{ cursor: "pointer" }}>{c}</span>
          ) : i === crumbs.length - 1 ? (
            <span style={{ color: "var(--fg)" }}>{c}</span>
          ) : (
            <span>{c}</span>
          )}
        </span>
      ))}
    </div>
  );
}

Object.assign(window, { ProductsIndexPage, ProductPage, SectorPage, AboutPage, ContactPage, CasesPage, FinalCTABand, Breadcrumb });
