/* shared.jsx — icons, small UI atoms, and all page copy.
   Exported to window for the other babel scripts. */

/* ---------------- ICONS (stroke, 24 viewBox) ---------------- */
const I = {
  truck: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M3 6h11v9H3zM14 9h4l3 3v3h-7z"/><circle cx="7" cy="18" r="1.7"/><circle cx="17.5" cy="18" r="1.7"/></svg>),
  sparkle: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M12 3l1.8 5.2L19 10l-5.2 1.8L12 17l-1.8-5.2L5 10l5.2-1.8z"/><path d="M19 15l.7 2 2 .7-2 .7-.7 2-.7-2-2-.7 2-.7z"/></svg>),
  phone: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.9" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M5 4h3l1.4 4-2 1.3a12 12 0 0 0 5.3 5.3l1.3-2 4 1.4v3a2 2 0 0 1-2.2 2A16 16 0 0 1 3 6.2 2 2 0 0 1 5 4z"/></svg>),
  check: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2.4" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M20 6 9 17l-5-5"/></svg>),
  star: (p) => (<svg viewBox="0 0 24 24" fill="currentColor" {...p}><path d="M12 2.5l2.9 6 6.6.9-4.8 4.6 1.2 6.5L12 17.8 6.1 20.5l1.2-6.5L2.5 9.4l6.6-.9z"/></svg>),
  arrow: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M5 12h14M13 6l6 6-6 6"/></svg>),
  shield: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M12 3l7 3v5c0 4.5-3 8-7 10-4-2-7-5.5-7-10V6z"/><path d="M9 12l2 2 4-4"/></svg>),
  leaf: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M5 19C5 11 11 5 19 5c0 8-6 14-14 14z"/><path d="M5 19c4-7 8-9 11-10"/></svg>),
  clock: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><circle cx="12" cy="12" r="9"/><path d="M12 7v5l3 2"/></svg>),
  tag: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M3 11l8-8 9 1 1 9-8 8z"/><circle cx="15" cy="9" r="1.4"/></svg>),
  pin: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M12 21s7-5.6 7-11a7 7 0 1 0-14 0c0 5.4 7 11 7 11z"/><circle cx="12" cy="10" r="2.4"/></svg>),
  sofa: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M4 11V8a2 2 0 0 1 2-2h12a2 2 0 0 1 2 2v3"/><path d="M3 12a2 2 0 0 1 2 2v3h14v-3a2 2 0 0 1 2-2 2 2 0 0 0-2 2v1H5v-1a2 2 0 0 0-2-2z"/><path d="M6 17v2M18 17v2"/></svg>),
  recycle: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M7 19h10M9 5l3-2 3 5M5 13l-2-3 5-3M19 11l2 3-5 3"/></svg>),
  menu: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" {...p}><path d="M4 7h16M4 12h16M4 17h16"/></svg>),
  quote: (p) => (<svg viewBox="0 0 24 24" fill="currentColor" {...p}><path d="M10 7c-3 .5-5 3-5 6.5V18h5v-5H7.5C7.7 11 8.7 9.8 10 9.4zM20 7c-3 .5-5 3-5 6.5V18h5v-5h-2.5c.2-2 1.2-3.2 2.5-3.6z"/></svg>),
  drag: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M9 7 5 12l4 5M15 7l4 5-4 5"/></svg>),
  box: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><path d="M3 8l9-5 9 5v8l-9 5-9-5z"/><path d="M3 8l9 5 9-5M12 13v8"/></svg>),
  mail: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><rect x="3" y="5" width="18" height="14" rx="2"/><path d="m4 7 8 6 8-6"/></svg>),
  gift: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><rect x="4" y="9" width="16" height="12" rx="1.5"/><path d="M4 13h16M12 9v12"/><path d="M12 9C9.5 9 8 5.6 10 4.6 11.4 4 12 6.5 12 9z"/><path d="M12 9c2.5 0 4-3.4 2-4.4C12.6 4 12 6.5 12 9z"/></svg>),
  appliance: (p) => (<svg viewBox="0 0 24 24" fill="none" stroke="currentColor" strokeWidth="1.8" strokeLinecap="round" strokeLinejoin="round" {...p}><rect x="6" y="3" width="12" height="18" rx="2"/><path d="M6 10h12"/><path d="M9 6v2M9 12.5v3"/></svg>),
  whatsapp: (p) => (<svg viewBox="0 0 24 24" fill="currentColor" {...p}><path d="M17.5 14.4c-.3-.15-1.7-.84-2-.94-.26-.1-.45-.15-.64.15-.19.29-.74.94-.9 1.13-.17.19-.33.21-.62.07-.3-.15-1.25-.46-2.38-1.47-.88-.78-1.47-1.75-1.64-2.05-.17-.29-.02-.45.13-.6.13-.13.3-.34.44-.51.15-.17.2-.29.3-.48.1-.19.05-.36-.02-.51-.08-.15-.64-1.55-.88-2.12-.23-.55-.47-.48-.64-.49l-.55-.01c-.19 0-.5.07-.76.36-.26.29-1 .98-1 2.38 0 1.4 1.02 2.76 1.17 2.95.15.19 2.01 3.07 4.88 4.3.68.3 1.21.47 1.63.6.68.22 1.31.19 1.8.12.55-.08 1.7-.69 1.94-1.36.24-.67.24-1.24.17-1.36-.07-.12-.26-.19-.55-.34zM12.04 21.5h-.01a9.4 9.4 0 0 1-4.79-1.31l-.34-.2-3.56.93.95-3.47-.22-.36a9.38 9.38 0 0 1-1.44-5 9.45 9.45 0 0 1 16.13-6.67 9.38 9.38 0 0 1 2.77 6.68c0 5.2-4.24 9.4-9.45 9.4zM20.5 3.5A11.34 11.34 0 0 0 12.04.01C5.78.01.68 5.1.68 11.36c0 2 .53 3.95 1.53 5.67L.58 23l6.1-1.6a11.32 11.32 0 0 0 5.36 1.37h.01c6.26 0 11.36-5.1 11.36-11.36 0-3.03-1.18-5.88-3.31-8.02z"/></svg>),
};

/* ---------------- small atoms ---------------- */
function Stars({ n = 5, ...p }) {
  return (<span className="stars" {...p}>{Array.from({ length: n }).map((_, i) => <I.star key={i} />)}</span>);
}

/* AfterMoving brand mark — open doorway/portal + blue sparkle */
function BrandMark({ door, spark, style }) {
  return (
    <svg viewBox="0 0 24 24" fill="none" style={style} aria-hidden="true">
      <path d="M8 21 V5 L16 8 V21" stroke={door} strokeWidth="2" strokeLinecap="round" strokeLinejoin="round" />
      <path d="M12 10.4 L12.75 11.75 L14.1 12.5 L12.75 13.25 L12 14.6 L11.25 13.25 L9.9 12.5 L11.25 11.75 Z" fill={spark} />
    </svg>
  );
}

function Logo({ light }) {
  const ink = light ? "#fff" : "var(--navy)";
  const tileBg = light ? "#FFFFFF" : "#101922";
  const doorColor = light ? "#101922" : "#FFFFFF";
  const tileBorder = light ? "1px solid #E4E7EC" : "1px solid rgba(255,255,255,.08)";
  return (
    <a href="#top" className="logo" style={{ display: "flex", alignItems: "center", gap: 11 }}>
      <span style={{
        width: 38, height: 38, borderRadius: 11, display: "grid", placeItems: "center",
        background: tileBg, boxShadow: "var(--shadow-md)", border: tileBorder, flex: "0 0 auto"
      }}>
        <BrandMark door={doorColor} spark="var(--accent)" style={{ width: 23, height: 23 }} />
      </span>
      <span style={{ fontFamily: "var(--ff-display)", fontWeight: 800, fontSize: 21, letterSpacing: "-0.02em", color: ink }}>
        After<span style={{ color: "var(--accent)" }}>Moving</span>
      </span>
    </a>
  );
}

/* striped placeholder — renders a real cover image when `src` is given, falling back
   to the striped fill + label if the image fails to load */
const UNSPLASH = (id, w = 1200, q = 72) => `https://images.unsplash.com/${id}?auto=format&fit=crop&w=${w}&q=${q}`;
function Ph({ label, navy, style, className = "", children, src, w, alt, eager }) {
  const url = src ? (src.startsWith("photo-") ? UNSPLASH(src, w || 1200) : src) : null;
  return (
    <div className={`ph ${navy ? "ph--navy" : ""} ${className}`} data-label={label} style={style}>
      {url && (
        <img className="ph__img" src={url} alt={alt || ""} decoding="async"
          loading={eager ? "eager" : "lazy"} fetchpriority={eager ? "high" : undefined}
          onError={(e) => { e.currentTarget.style.display = "none"; }} />
      )}
      {children}
    </div>
  );
}

/* ---------------- CONTENT ---------------- */
const PHONE = "(404) 436-0999";
const EMAIL = "info@aftermoving.com";
// International WhatsApp number, digits only (e.g. US: 1 + 10 digits). Update to the live business number.
const WHATSAPP = "14044360999";

/* Google Analytics event helper — safe no-op if gtag isn't loaded (e.g. local/preview) */
function track(eventName, params) {
  if (typeof window !== "undefined" && typeof window.gtag === "function") {
    window.gtag("event", eventName, params || {});
  }
}

const SERVICES = [
  {
    key: "junk",
    icon: I.truck,
    img: "assets/junk-removal-truck.jpg",
    tag: "Haul it away",
    title: "Junk Removal",
    body: "Furniture, appliances, boxes, garage clutter, renovation debris — we lift, load, and haul it all. You point, we carry. No item too heavy, no stairs too many.",
    points: ["Same-day & next-day pickup", "Eco-friendly: we donate & recycle first", "Full-service loading — you lift nothing"],
  },
  {
    key: "clean",
    icon: I.sparkle,
    img: "assets/post-move-cleaning.jpg",
    tag: "Make it shine",
    title: "Post-Move Cleaning",
    body: "A true white-glove deep clean once the rooms are empty. Baseboards, inside cabinets, appliances, bathrooms — left spotless and move-in (or inspection) ready.",
    points: ["Move-out & move-in deep cleans", "Inside ovens, fridges & cabinets", "Deposit-back & inspection guarantee"],
  },
];

const STEPS = [
  { n: "01", icon: I.tag, title: "Get your free quote", body: "Tell us what needs to go. Send a few photos and we’ll send you a flat, upfront price in minutes — no walkthrough needed." },
  { n: "02", icon: I.truck, title: "We do the heavy lifting", body: "Our crew shows up on time, loads every item, and hauls it all away. You don’t lift a finger — we handle it from the curb to the truck." },
  { n: "03", icon: I.sparkle, title: "Property cleared", body: "Walk into an empty, cleared-out space — ready for the next tenant, buyer, or moving truck. No junk left behind." },
];

const MORE_SERVICES = [
  { icon: I.gift, title: "Donation Drop-Off", body: "Got usable furniture or goods? We sort, load, and deliver them to local Atlanta charities — and bring you the donation receipt." },
  { icon: I.appliance, title: "Appliance Removal", body: "Fridges, washers, dryers, stoves, AC units — safely disconnected, hauled out, and recycled or donated, never dumped." },
];

const TESTIMONIALS = [
  { name: "Maya R.", role: "Renter, Atlanta", quote: "The apartment was a disaster after moving out — furniture left behind, everything a mess. AfterMoving cleared it all and cleaned so well I got my full deposit back. Worth every penny.", stars: 5 },
  { name: "Marcus T.", role: "Property Manager, Atlanta", quote: "I turn over 20+ units a year. They're the only crew I trust to haul, clean, and have a unit photo-ready in a single day. On time, every time.", stars: 5 },
  { name: "Priya & Sam", role: "Homeowners, Marietta", quote: "Closing was in two days and the garage was packed. They hauled 15 years of junk and left the whole house spotless. Genuinely saved our move.", stars: 5 },
];

const CITIES = ["Atlanta", "Marietta", "Alpharetta", "Roswell", "Sandy Springs", "Decatur", "Smyrna", "Duluth", "Kennesaw", "Johns Creek", "Lawrenceville", "Stockbridge"];

const GUARANTEES = [
  { icon: I.clock, title: "On-time promise", body: "We arrive in your window or your haul fee is on us." },
  { icon: I.leaf, title: "Eco-first hauling", body: "We donate and recycle before anything sees a landfill." },
  { icon: I.check, title: "Spotless guarantee", body: "Not happy with the clean? We re-clean free, same week." },
  { icon: I.tag, title: "Upfront flat quotes", body: "The price we quote is the price you pay — no surprise fees." },
];

Object.assign(window, { I, Stars, Logo, BrandMark, Ph, track, PHONE, EMAIL, WHATSAPP, SERVICES, MORE_SERVICES, STEPS, TESTIMONIALS, CITIES, GUARANTEES });
