/*
 * Design reminder: Practical Navy + Mint Editorial. Keep the page direct, family-owned,
 * and screenshot-faithful: dark navy hero, mint actions, editorial two-column flow,
 * documentary property imagery, and a conversion modal that dominates the dimmed page.
 * Enhancement rule: reduce form friction through three short steps, visible progress,
 * calm validation, and a clear success state without adding backend claims.
 */

import { useEffect, useRef, useState, type FormEvent, type RefObject } from "react";
import SEOHead from "@/components/SEOHead";
import TrustBadges from "@/components/TrustBadges";
import SellerFAQ from "@/components/SellerFAQ";
import { MapView } from "@/components/Map";
import { locationData } from "@/data/locationData";
import { submitLeadToCrm } from "@/lib/leadSubmission";
import { formatUSPhoneInput } from "@shared/phone";
import { SITE_HERO_IMAGES } from "@/lib/pageHeroVisuals";
import { openCashOfferDialog } from "@/lib/cashOfferTrigger";
import {
  ArrowRight,
  Check,
  CheckCircle2,
  ChevronLeft,
  ChevronRight,
  Clock3,
  House,
  LoaderCircle,
  Mail,
  MapPin,
  Menu,
  Phone,
  ShieldCheck,
  Sparkles,
  TriangleAlert,
  X,
} from "lucide-react";

const HERO_IMAGE = SITE_HERO_IMAGES.home;
const ABOUT_IMAGE = SITE_HERO_IMAGES.homeAbout;
const DETAIL_IMAGE = SITE_HERO_IMAGES.homeDetail;
const BRAND_MARK = "/assets/original-home-buyers-logo.png";

type Situation = { icon: typeof House; title: string; copy: string };

const situations: Situation[] = [
  { icon: House, title: "Inherited Property", copy: "Explore options for an estate-related home or shared family decision." },
  { icon: Sparkles, title: "Needs Repairs", copy: "Discuss a house with repair, cosmetic, deferred-maintenance, or condition concerns." },
  { icon: TriangleAlert, title: "Foreclosure", copy: "Consider a sale conversation while you seek timely professional guidance." },
  { icon: ShieldCheck, title: "Probate Property", copy: "Review an estate-related property once authority and required approvals are understood." },
  { icon: Phone, title: "Tenant Challenges", copy: "Discuss occupied rentals, access questions, or landlord coordination concerns." },
  { icon: House, title: "Code or Permit Issues", copy: "Share known compliance, permit, or unpermitted-work concerns during a property review." },
  { icon: ArrowRight, title: "Relocation or Job Change", copy: "Explore a direct option when a move or job change shapes your timing." },
  { icon: Check, title: "Taxes or Title Questions", copy: "Talk through property details while the appropriate professionals address title matters." },
  { icon: House, title: "Divorce or Separation", copy: "Consider a potential sale after clarifying ownership, authority, and decision-making." },
  { icon: TriangleAlert, title: "Vacant or Damaged Home", copy: "Discuss a vacant home, fire damage, water issues, mold, or other property concerns." },
  { icon: ShieldCheck, title: "Expired Listing", copy: "Compare a direct property review with another traditional listing approach." },
  { icon: Phone, title: "Behind on Payments", copy: "Discuss the property while working with qualified loan, legal, or financial advisers." },
];

const advantages = [
  { icon: Sparkles, title: "As-Is Property Review", copy: "Share the home in its current condition instead of beginning with traditional listing preparation." },
  { icon: Check, title: "No Traditional Listing Commission", copy: "A direct sale does not use a listing agent; review any proposed costs and terms in writing." },
  { icon: Clock3, title: "Closing Coordination", copy: "Discuss timing after the property, title, documents, and local closing process are reviewed." },
  { icon: ShieldCheck, title: "Title-Company Closing", copy: "When appropriate, a reputable title or closing professional can coordinate the transaction." },
  { icon: House, title: "Less Listing Coordination", copy: "Avoid the public-listing process while still reviewing the details that matter for your sale." },
  { icon: Phone, title: "Direct Communication", copy: "Ask questions about the property review and any potential written purchase terms without pressure." },
];

const processSteps = [
  { number: "01", title: "Call or Complete the Form", copy: "Share the property address and the best way to reach you. Our team will follow up to learn more." },
  { number: "02", title: "Discuss or Review the Property", copy: "We may ask questions, review available information, or arrange a walkthrough when useful for the property." },
  { number: "03", title: "Review Written Terms", copy: "If a direct purchase is practical, review potential written terms and discuss timing before deciding whether to proceed." },
];

type OfferValues = {
  address: string;
  name: string;
  phone: string;
  email: string;
  consent: boolean;
};

type OfferStep = 1 | 2 | 3;

type MarketSuggestion = { label: string; href: string; kind: "county" | "state" };

declare global {
  interface Window {
    umami?: { track?: (eventName: string, eventData?: Record<string, string>) => void };
  }
}

function trackFloatingOfferClick() {
  if (typeof window === "undefined") return;
  window.umami?.track?.("cash_offer_cta_clicked", { placement: "floating" });
  window.dispatchEvent(new CustomEvent("cash-offer-cta-clicked", { detail: { placement: "floating" } }));
}

const offerSteps: Array<{ number: OfferStep; label: string; title: string }> = [
  { number: 1, label: "Property", title: "Tell us about the property" },
  { number: 2, label: "Contact", title: "How can we reach you?" },
  { number: 3, label: "Review", title: "Review and send" },
];

function locationSlug(value: string) {
  return value.toLowerCase().replaceAll(" ", "-");
}

function getMarketSuggestion(components?: google.maps.GeocoderAddressComponent[] | google.maps.places.AddressComponent[]) {
  if (!components) return null;
  const state = components.find((component) => component.types.includes("administrative_area_level_1"));
  if (!state) return null;

  const stateName = ("long_name" in state ? state.long_name : state.longText) ?? "";
  const stateCode = ("short_name" in state ? state.short_name : state.shortText) ?? "";

  const stateSlug = locationSlug(stateName);
  const stateMarkets = locationData[stateSlug] || [];
  if (!stateMarkets.length) return null;

  const county = components.find((component) => component.types.includes("administrative_area_level_2"));
  const countyFullName = (county ? ("long_name" in county ? county.long_name : county.longText) : "") ?? "";
  const countyName = countyFullName.replace(/\s+(county|parish|borough|census area|municipality)$/i, "");
  const countySlug = countyName ? locationSlug(countyName) : "";

  if (countySlug && stateMarkets.includes(countySlug)) {
    return { label: `${countyName} County, ${stateCode}`, href: `/areas-we-serve/${stateSlug}/${countySlug}-county/`, kind: "county" } satisfies MarketSuggestion;
  }

  return { label: `Explore local markets in ${stateName}`, href: `/areas-we-serve/${stateSlug}/`, kind: "state" } satisfies MarketSuggestion;
}

function StepProgress({ step }: { step: OfferStep }) {
  return (
    <div className="step-progress" aria-label={`Offer form progress: step ${step} of 3`}>
      <div className="step-progress__top"><span>Step {step} of 3</span><strong>{offerSteps[step - 1].title}</strong></div>
      <div className="progress-track" aria-hidden="true"><span style={{ width: `${(step / 3) * 100}%` }} /></div>
      <div className="step-progress__labels">
        {offerSteps.map((item) => <span className={step >= item.number ? "is-active" : ""} key={item.number}>{item.number}. {item.label}</span>)}
      </div>
    </div>
  );
}

function Field({ id, label, value, placeholder, type = "text", helper, onChange, onBlur, inputRef, inputMode, maxLength }: { id: string; label: string; value: string; placeholder: string; type?: string; helper?: string; onChange: (value: string) => void; onBlur?: () => void; inputRef?: RefObject<HTMLInputElement | null>; inputMode?: React.HTMLAttributes<HTMLInputElement>["inputMode"]; maxLength?: number }) {
  return (
    <div className="field">
      <label htmlFor={id}>{label}</label>
      <input ref={inputRef} id={id} name={id} type={type} inputMode={inputMode} maxLength={maxLength} value={value} placeholder={placeholder} onBlur={onBlur} onChange={(event) => onChange(event.target.value)} required={label !== "Email Address (Optional)"} />
      {helper && <small>{helper}</small>}
    </div>
  );
}

export function ThreeStepOfferDialog({ onClose }: { onClose: () => void }) {
  const [step, setStep] = useState<OfferStep>(1);
  const [values, setValues] = useState<OfferValues>({ address: "", name: "", phone: "", email: "", consent: false });
  const [error, setError] = useState("");
  const [isSubmitting, setIsSubmitting] = useState(false);
  const [submitted, setSubmitted] = useState(false);
  const [mapsReady, setMapsReady] = useState(false);
  const [marketSuggestion, setMarketSuggestion] = useState<MarketSuggestion | null>(null);
  const addressInputRef = useRef<HTMLInputElement>(null);
  const geocoderRef = useRef<google.maps.Geocoder | null>(null);
  const autocompleteRef = useRef<google.maps.places.Autocomplete | null>(null);

  function updateValue(key: keyof OfferValues, value: string | boolean) {
    setValues((current) => ({ ...current, [key]: value }));
    setError("");
    if (key === "address") setMarketSuggestion(null);
  }

  function handleMapReady() {
    if (!window.google || geocoderRef.current) return;
    geocoderRef.current = new window.google.maps.Geocoder();
    setMapsReady(true);
  }

  useEffect(() => {
    if (!mapsReady || !addressInputRef.current || autocompleteRef.current || !window.google?.maps?.places) return;
    const autocomplete = new window.google.maps.places.Autocomplete(addressInputRef.current, {
      componentRestrictions: { country: "us" },
      fields: ["formatted_address", "address_components"],
      types: ["address"],
    });
    autocomplete.addListener("place_changed", () => {
      const place = autocomplete.getPlace();
      if (place.formatted_address) updateValue("address", place.formatted_address);
      setMarketSuggestion(getMarketSuggestion(place.address_components));
    });
    autocompleteRef.current = autocomplete;
    return () => {
      window.google?.maps.event.clearInstanceListeners(autocomplete);
      autocompleteRef.current = null;
    };
  }, [mapsReady]);

  useEffect(() => {
    const address = values.address.trim();
    if (!mapsReady || address.length < 8 || !geocoderRef.current) return;
    const timer = window.setTimeout(() => {
      geocoderRef.current?.geocode({ address, componentRestrictions: { country: "US" } }, (results, status) => {
        if (status === "OK" && results?.[0]) setMarketSuggestion(getMarketSuggestion(results[0].address_components));
      });
    }, 650);
    return () => window.clearTimeout(timer);
  }, [mapsReady, values.address]);

  function validateCurrentStep() {
    if (step === 1 && !values.address.trim()) return "Enter the property address to continue.";
    if (step === 2 && !values.name.trim()) return "Add your name so our team knows who to contact.";
    if (step === 2 && values.phone.replace(/\D/g, "").length < 10) return "Enter a valid U.S. phone number to continue.";
    if (step === 3 && values.email && !/^\S+@\S+\.\S+$/.test(values.email)) return "Enter a valid email address or leave it blank.";
    if (step === 3 && !values.consent) return "Please check the consent box before sending your request.";
    return "";
  }

  function handleNext() {
    const validationError = validateCurrentStep();
    if (validationError) { setError(validationError); return; }
    setStep((current) => (current === 3 ? 3 : (current + 1) as OfferStep));
  }

  function handleBack() {
    setError("");
    setStep((current) => (current === 1 ? 1 : (current - 1) as OfferStep));
  }

  async function handleSubmit(event: FormEvent<HTMLFormElement>) {
    event.preventDefault();
    const validationError = validateCurrentStep();
    if (validationError) { setError(validationError); return; }
    setIsSubmitting(true);
    try {
      const result = await submitLeadToCrm({
        propertyAddress: values.address,
        name: values.name,
        phone: values.phone,
        email: values.email,
        leadSource: "homepage-offer-modal",
        consent: values.consent,
      });
      if (!result.success) throw new Error("Lead submission was not accepted.");
      setSubmitted(true);
    } catch {
      setError("We could not save your request just now. Please try again shortly.");
    } finally {
      setIsSubmitting(false);
    }
  }

  if (submitted) {
    return (
      <div className="modal-layer" role="presentation">
        <section className="offer-modal offer-modal--success" role="dialog" aria-modal="true" aria-labelledby="offer-success-title">
          <button className="modal-close" aria-label="Close cash offer form" onClick={onClose}><X size={18} strokeWidth={2.5} /></button>
          <div className="success-state" aria-live="polite">
            <div className="success-state__icon"><CheckCircle2 size={34} /></div>
            <span className="eyebrow eyebrow--pill">REQUEST RECEIVED</span>
            <h2 id="offer-success-title">You’re all set.</h2>
            <p>Thanks for telling us about <strong>{values.address}</strong>. A member of the Original Home Buyers team will review your details and follow up at <strong>{values.phone}</strong>.</p>
            <div className="success-state__note"><Clock3 size={16} /> We’ll be in touch as soon as possible during normal business hours.</div>
            <button className="button button--mint button--full" onClick={onClose}>Close and Return to Site</button>
          </div>
        </section>
      </div>
    );
  }

  return (
    <div className="modal-layer" role="presentation" onMouseDown={(event) => event.target === event.currentTarget && onClose()}>
      <div className="modal-progress-banner"><StepProgress step={step} /></div>
      <section className="offer-modal" role="dialog" aria-modal="true" aria-labelledby="offer-modal-title">
        <button className="modal-close" aria-label="Close cash offer form" onClick={onClose}><X size={18} strokeWidth={2.5} /></button>
        <span className="eyebrow eyebrow--pill">FREE · NO OBLIGATION</span>
        <h2 id="offer-modal-title">Request Your Cash Offer</h2>
        <p className="modal-intro">A few quick details helps us understand the property and your timeline.</p>
        <form className="offer-form offer-form--steps" onSubmit={handleSubmit}>
          {step === 1 && <div className="offer-step" key="property-step"><Field id="modal-address" inputRef={addressInputRef} label="Property Address" value={values.address} placeholder="Start typing your U.S. address..." helper="Free U.S.-only address suggestions." onChange={(value) => updateValue("address", value)} /><MapView className="address-market-map" onMapReady={handleMapReady} />{marketSuggestion && <a className="market-suggestion" href={marketSuggestion.href} onClick={() => window.umami?.track?.("nearest_market_suggestion_clicked", { market_type: marketSuggestion.kind, market: marketSuggestion.label })}><MapPin size={17} /><span><small>Local market suggestion</small><strong>{marketSuggestion.label}</strong></span><ArrowRight size={16} /></a>}<div className="step-tip"><MapPin size={16} /><span>We buy houses in any condition, anywhere in the U.S.</span></div></div>}
          {step === 2 && <div className="offer-step" key="contact-step"><Field id="modal-name" label="Your Name" value={values.name} placeholder="First and last name" onChange={(value) => updateValue("name", value)} /><Field id="modal-phone" label="Phone Number" type="tel" inputMode="tel" maxLength={14} value={values.phone} placeholder="(555) 555-5555" helper="Enter a 10-digit U.S. phone number." onChange={(value) => updateValue("phone", formatUSPhoneInput(value))} /></div>}
          {step === 3 && <div className="offer-step" key="review-step"><Field id="modal-email" label="Email Address (Optional)" value={values.email} type="email" placeholder="you@example.com" onChange={(value) => updateValue("email", value)} /><div className="review-card"><div><span>Property</span><strong>{values.address}</strong></div><div><span>Contact</span><strong>{values.name} · {values.phone}</strong></div></div><label className="consent consent--large" htmlFor="modal-consent"><input id="modal-consent" type="checkbox" checked={values.consent} onChange={(event) => updateValue("consent", event.target.checked)} /><span>By clicking “Get My Cash Offer,” I agree to receive calls, emails, and texts from Original Home Buyers about offers and services. Text “STOP” to unsubscribe. See our <a href="/privacy.html">Privacy Policy</a> and <a href="/terms.html">Terms</a>.</span></label></div>}
          {error && <p className="form-error" role="alert">{error}</p>}
          <div className="step-actions">
            {step > 1 ? <button className="button button--ghost" type="button" onClick={handleBack}><ChevronLeft size={16} /> Back</button> : <span />}
            {step < 3 ? <button className="button button--mint" type="button" onClick={handleNext}>Continue <ChevronRight size={16} /></button> : <button className="button button--mint" type="submit" disabled={isSubmitting}>{isSubmitting ? <><LoaderCircle className="loading-spinner" size={17} /> Sending securely...</> : <>Get My Cash Offer <ArrowRight size={16} /></>}</button>}
          </div>
        </form>
        {isSubmitting && <div className="loading-status" role="status" aria-live="polite"><span className="loading-dots"><i /><i /><i /></span> Preparing your request…</div>}
      </section>
    </div>
  );
}

function HeroFormPreview({ onOpen }: { onOpen: () => void }) {
  return (
    <div className="hero-form-preview">
      <div className="hero-form-preview__line"><span>01</span><div><strong>Property details</strong><small>Tell us where the house is.</small></div></div>
      <div className="hero-form-preview__line"><span>02</span><div><strong>Your contact details</strong><small>Choose how we can reach you.</small></div></div>
      <div className="hero-form-preview__line"><span>03</span><div><strong>Review and send</strong><small>No obligation to accept an offer.</small></div></div>
      <button className="button button--mint button--full" onClick={onOpen}>Start My Cash Offer <ArrowRight size={16} /></button>
      <p><ShieldCheck size={13} /> Free · No obligation · Takes about 60 seconds</p>
    </div>
  );
}

export default function Home() {
  const [mobileMenuOpen, setMobileMenuOpen] = useState(false);

  function openOffer() {
    setMobileMenuOpen(false);
    openCashOfferDialog();
  }

  return (
    <div className="site-shell">
      <SEOHead
        title="Sell Your House Fast for Cash Nationwide | Original Home Buyers"
        description="Sell your house fast for cash nationwide. Original Home Buyers purchases houses as-is with no repairs, no agent commissions, and flexible closing dates. Request a free cash offer."
        schemaType="Organization"
      />
      <div className="page-underlay">
        <div className="utility-bar"><div className="shell utility-bar__inner"><a href="tel:+12404105636"><Phone size={13} /> Call us at <strong>(240) 410-5636</strong> for a free, no-obligation property review.</a></div></div>
        <header className="site-header"><div className="shell header-inner"><a className="brand" href="/" aria-label="Original Home Buyers home"><img src={BRAND_MARK} alt="" className="brand__mark" /><span className="brand__words"><strong>Original</strong><span>Home Buyers</span><small>FAMILY-OWNED <i>|</i> NATIONWIDE</small></span></a><nav className={`main-nav ${mobileMenuOpen ? "main-nav--open" : ""}`} aria-label="Primary navigation"><a href="/sell-your-house-fast.html" onClick={() => setMobileMenuOpen(false)}>Sell Your House Fast</a><a href="/how-it-works.html" onClick={() => setMobileMenuOpen(false)}>How It Works</a><a href="/situations.html" onClick={() => setMobileMenuOpen(false)}>What We Buy</a><a href="/locations.html" onClick={() => setMobileMenuOpen(false)}>Areas We Serve</a><a href="/blog.html" onClick={() => setMobileMenuOpen(false)}>Seller Education</a><a href="/about.html" onClick={() => setMobileMenuOpen(false)}>About Us</a><a href="/contact.html" onClick={() => setMobileMenuOpen(false)}>Contact</a></nav><button className="button button--mint header-cta" onClick={openOffer}>Get My Cash Offer</button><button className="menu-toggle" aria-label="Toggle navigation" aria-expanded={mobileMenuOpen} onClick={() => setMobileMenuOpen((value) => !value)}>{mobileMenuOpen ? <X size={22} /> : <Menu size={22} />}</button></div></header>

        <main id="top">
          <section className="hero" id="sell-fast" style={{ backgroundImage: `linear-gradient(90deg, rgba(2, 34, 64, .96) 0%, rgba(2, 39, 74, .86) 50%, rgba(3, 40, 74, .74) 100%), url(${HERO_IMAGE})` }}><div className="shell hero__inner"><div className="hero__copy"><span className="eyebrow eyebrow--line">FAMILY-OWNED REAL ESTATE COMPANY</span><h1>Sell Your House Fast.<br />We Buy Nationwide,<br /><em>As-Is.</em></h1><p>Original Home Buyers reviews homes nationwide for potential direct cash-purchase opportunities. If a traditional listing no longer fits your situation, start with a straightforward property conversation and consider any written terms at your own pace.</p><ul className="check-list"><li><Check size={16} /> Review the house in its current condition</li><li><Check size={16} /> No traditional listing commission in a direct sale</li><li><Check size={16} /> Discuss potential terms after property review</li><li><Check size={16} /> No obligation to accept a potential offer</li></ul><div className="hero__actions"><button className="button button--mint" onClick={openOffer}>Get My Cash Offer</button><a className="text-link" href="/how-it-works.html">See How It Works <ArrowRight size={16} /></a></div><span className="free-note">Free <i>·</i> No Obligation</span></div><div className="hero__form-card" id="offer-form"><span className="eyebrow eyebrow--pill">FREE · NO OBLIGATION</span><h2>Request Your<br />Cash Offer</h2><p>Complete three short steps and we’ll follow up about the property.</p><HeroFormPreview onOpen={openOffer} /></div></div></section>

          <TrustBadges />

	          <SellerFAQ />

	          <section className="trust-strip" aria-label="Our advantages"><div className="shell trust-strip__grid"><div className="trust-item"><House size={21} /><span><strong>No Repairs</strong><small>We buy the house as-is.</small></span></div><div className="trust-item"><span className="trust-item__symbol">$0</span><span><strong>No Commissions</strong><small>You do not pay agent fees.</small></span></div><div className="trust-item"><Clock3 size={22} /><span><strong>No Waiting</strong><small>Choose a closing date that works.</small></span></div><div className="trust-item"><ShieldCheck size={22} /><span><strong>Title Company Closing</strong><small>A transparent professional closing.</small></span></div></div></section>

	          <section className="selling-paths" aria-labelledby="selling-paths-title"><div className="shell"><div className="selling-paths__heading"><span className="eyebrow eyebrow--line eyebrow--dark">COMPARE YOUR OPTIONS</span><h2 id="selling-paths-title">Selling Directly vs. Listing With an Agent</h2><p>Both paths can work. The practical difference is usually the amount of time, preparation, coordination, and uncertainty you want to take on.</p></div><div className="selling-paths__grid"><article className="selling-path selling-path--cash"><div className="selling-path__topline"><span>DIRECT CASH OFFER</span><span className="selling-path__best">A simpler path</span></div><h3>Sell to Original Home Buyers</h3><p className="selling-path__intro">A direct, as-is option designed for sellers who value convenience and a clear next step.</p><ul className="selling-path__list"><li><Check size={17} /><span><strong>As-is property review</strong><small>No traditional listing preparation is required.</small></span></li><li><Check size={17} /><span><strong>No traditional agent commission</strong><small>A direct sale does not use a listing agent.</small></span></li><li><Check size={17} /><span><strong>Fewer visits to coordinate</strong><small>Avoid the usual public-showing process.</small></span></li><li><Check size={17} /><span><strong>Cash offer process</strong><small>Terms are discussed after we review the property.</small></span></li><li><Check size={17} /><span><strong>Closing timing discussed with you</strong><small>Timing depends on title, property review, and local process.</small></span></li><li><Check size={17} /><span><strong>No obligation to accept</strong><small>Consider your options before deciding.</small></span></li></ul></article><div className="selling-paths__versus" aria-hidden="true"><span>VS</span></div><article className="selling-path selling-path--agent"><div className="selling-path__topline"><span>TRADITIONAL LISTING</span></div><h3>List With an Agent</h3><p className="selling-path__intro">A conventional option that may suit sellers with time to prepare, market, and negotiate.</p><ul className="selling-path__list"><li><Check size={17} /><span><strong>Broader market exposure</strong><small>A listing can reach buyers who may value different features.</small></span></li><li><Check size={17} /><span><strong>Preparation may be needed</strong><small>Condition, marketing, and local norms can shape the work involved.</small></span></li><li><Check size={17} /><span><strong>Showings and negotiations</strong><small>Buyer visits, offer terms, and timing are typically coordinated through the listing.</small></span></li><li><Check size={17} /><span><strong>Buyer conditions can apply</strong><small>Financing, appraisal, and inspection terms vary by buyer and contract.</small></span></li><li><Check size={17} /><span><strong>Timeline varies by market</strong><small>Demand, pricing, and property condition can all affect a sale.</small></span></li><li><Check size={17} /><span><strong>Costs vary by agreement</strong><small>Commission and closing arrangements should be reviewed with your agent.</small></span></li></ul></article></div><div className="selling-paths__closing"><p>The right choice depends on your timeline, your home’s condition, your financial goals, and your local market. If you want a direct sale with less listing coordination, requesting an offer costs nothing and does not commit you to sell.</p><button className="button button--mint" onClick={openOffer}>Get My Cash Offer <ArrowRight size={16} /></button><small>Free, no-obligation property review.</small></div></div></section>
	
          <section className="section selling-guide" aria-labelledby="selling-guide-title"><div className="shell"><div className="selling-guide__intro"><span className="eyebrow eyebrow--line eyebrow--dark">CHOOSE THE PATH THAT FITS</span><h2 id="selling-guide-title">How Fast Do You Need to Sell Your House?</h2><p>There is no one-size-fits-all answer. Your property’s condition, decision-makers, title, finances, and timing all shape whether a direct sale or a traditional listing path may be worth considering.</p></div><div className="selling-guide__grid"><article><div className="icon-box"><House size={22} /></div><h3>Explore a Direct As-Is Sale</h3><p>Tell us about the property. If a direct purchase is practical, we may present written terms after a property-specific review for you to consider without obligation.</p></article><article><div className="icon-box"><Check size={22} /></div><h3>Consider a Traditional Listing</h3><p>A qualified local real estate professional can explain the preparation, marketing, buyer negotiations, and contract terms involved in listing a home.</p></article><article><div className="icon-box"><Clock3 size={22} /></div><h3>Compare Before You Decide</h3><p>Review the responsibilities, costs, timing, and contingencies that may apply to each path, then choose the option that fits your priorities.</p></article></div><div className="selling-guide__callout"><div><strong>Before you list, compare your options.</strong><p>Requesting a property review does not commit you to sell. A direct offer can be one data point as you evaluate your next move.</p></div><div className="selling-guide__actions"><button className="button button--mint" onClick={openOffer}>Request a Property Review <ArrowRight size={16} /></button><a className="text-link" href="/compare-selling-options.html">Compare selling paths <ArrowRight size={16} /></a></div></div></div></section>

          <section className="section section--advantage" id="advantage"><div className="shell"><div className="section-heading section-heading--center"><span className="eyebrow eyebrow--line eyebrow--dark">OUR ADVANTAGE</span><h2>Direct, Practical Options for<br className="desktop-only" /> Homeowners Nationwide</h2><p>We offer a property-specific alternative to a traditional listing for homeowners who want to explore a direct, as-is sale.</p></div><div className="advantage-grid">{advantages.map(({ icon: Icon, title, copy }) => <article className="advantage-card" key={title}><div className="icon-box"><Icon size={22} /></div><h3>{title}</h3><p>{copy}</p></article>)}</div></div></section>

          <section className="section section--steps" id="how-it-works"><div className="shell"><div className="section-heading section-heading--center"><span className="eyebrow eyebrow--line eyebrow--dark">HOW WE WORK</span><h2>Three Simple Steps</h2><p>Our goal is to make selling your house as straightforward and stress-free as possible.</p></div><div className="steps-grid">{processSteps.map((item) => <article className="step-card" key={item.number}><span className="step-number">{item.number}</span><h3>{item.title}</h3><p>{item.copy}</p></article>)}</div></div></section>

          <section className="section section--about" id="about"><div className="shell about-grid"><div className="about-copy"><span className="eyebrow eyebrow--line eyebrow--dark">ABOUT US</span><h2>Family-Owned and Focused on Practical Solutions</h2><p>Original Home Buyers is a family-owned real estate investment company that reviews homes for potential direct, as-is cash-purchase opportunities. We work with homeowners facing a range of property situations and explain the next steps clearly after learning about the house.</p><p>When a walkthrough is useful, we can coordinate a convenient time to see the property. Any potential purchase terms are based on property-specific review and are presented in writing for you to consider without obligation.</p><a className="button button--mint" href="/about.html">Learn About Our Company <ArrowRight size={16} /></a></div><div className="about-image-wrap"><img src={ABOUT_IMAGE} alt="A modest home that may be reviewed for a direct as-is sale" /><span className="image-caption">Practical options. Clear next steps.</span></div></div></section>

          <section className="section section--situations" id="situations"><div className="shell"><div className="section-heading section-heading--center"><span className="eyebrow eyebrow--line eyebrow--dark">WE UNDERSTAND YOUR SITUATION</span><h2>A Practical Way to Start<br className="desktop-only" /> a Complex Home Sale</h2><p>Foreclosure concerns, divorce, estate decisions, title questions, vacancy, damage, tenants, and relocation can each bring different considerations. A direct property conversation can help you understand whether a written offer is worth considering alongside the guidance of the appropriate professionals.</p></div><div className="situations-grid">{situations.map(({ icon: Icon, title, copy }) => <article className="situation-card" key={title}><Icon size={19} /><h3>{title}</h3><p>{copy}</p></article>)}</div><div className="situation-note"><ShieldCheck size={20} /><p><strong>Your next step should fit the situation.</strong> For legal, tax, title, lending, estate, or listing questions, consult a qualified professional who can advise you based on your specific circumstances.</p></div><div className="center-action"><a className="button button--outline" href="/situations.html">View All Situations <ChevronRight size={16} /></a></div></div></section>

          <section className="section section--resources" aria-labelledby="seller-resources-title"><div className="shell"><div className="section-heading section-heading--center"><span className="eyebrow eyebrow--line eyebrow--dark">SELLER RESOURCES</span><h2 id="seller-resources-title">Read Before You Decide</h2><p>Explore the practical seller guides and property-situation pages already available on our site. Each resource is general nationwide information, not personal legal, tax, financial, or real estate advice.</p></div><div className="resource-grid"><a className="resource-card" href="/blog.html"><House size={21} /><h3>Seller Education Blog</h3><p>Read our nationwide articles about direct sales, listings, and self-managed sales.</p><span>View the blog <ArrowRight size={15} /></span></a><a className="resource-card" href="/cash-sale-benefits.html"><Clock3 size={21} /><h3>Cash Sale Benefits</h3><p>Understand potential cash-sale benefits and tradeoffs before reviewing an offer.</p><span>Read the guide <ArrowRight size={15} /></span></a><a className="resource-card" href="/blog.html#selling-without-agent"><Check size={21} /><h3>Selling Without an Agent</h3><p>Review the responsibilities of managing a home sale yourself.</p><span>Read the article <ArrowRight size={15} /></span></a><a className="resource-card" href="/seller-insights.html"><ShieldCheck size={21} /><h3>Seller Insights</h3><p>Compare preparation, contingencies, timing, and decision-making factors.</p><span>Explore insights <ArrowRight size={15} /></span></a><a className="resource-card" href="/sell-as-is.html"><House size={21} /><h3>Sell As-Is</h3><p>Consider a direct path when preparing a home for listing is not practical.</p><span>Explore as-is options <ArrowRight size={15} /></span></a><a className="resource-card" href="/foreclosure-help.html"><TriangleAlert size={21} /><h3>Foreclosure Help</h3><p>Review general considerations and seek timely local professional guidance.</p><span>Read the guide <ArrowRight size={15} /></span></a><a className="resource-card" href="/sell-inherited-property.html"><MapPin size={21} /><h3>Inherited Property</h3><p>Understand common estate and ownership questions before exploring a sale.</p><span>Read the guide <ArrowRight size={15} /></span></a><a className="resource-card" href="/sell-during-divorce.html"><Phone size={21} /><h3>Divorce &amp; Home Sales</h3><p>Consider ownership, authorization, and timing questions during a separation.</p><span>Read the guide <ArrowRight size={15} /></span></a></div></div></section>

          <section className="section section--fast-sale"><div className="shell fast-sale-grid"><div><span className="eyebrow eyebrow--line">SELL MY HOUSE FAST</span><h2>Looking for a Direct Home-Sale Option?</h2><p>Original Home Buyers reviews homes nationwide, including properties that need work or do not fit a traditional listing plan. A direct sale may reduce listing coordination, but any possible offer and timing depend on the property, title, and written terms.</p><a className="button button--mint" href="/sell-your-house-fast.html">Learn How to Sell Your House Fast <ArrowRight size={16} /></a></div><div className="detail-card"><img src={DETAIL_IMAGE} alt="Weathered exterior detail of a home" /><div><strong>Sell as-is.</strong><span>Begin with a property review in its current condition.</span></div></div></div></section>

          <section className="contact-cta" id="contact"><div className="shell contact-cta__inner"><span className="eyebrow eyebrow--line">GET STARTED</span><h2>Request a Free, No-Obligation Cash Offer</h2><p>Tell us about the house. We will contact you to discuss the property and your options.</p><button className="button button--mint" onClick={openOffer}>Get My Cash Offer <ArrowRight size={16} /></button></div></section>
        </main>

        <footer className="site-footer"><div className="shell footer-grid"><a className="brand brand--footer" href="/"><img src={BRAND_MARK} alt="" className="brand__mark" /><span className="brand__words"><strong>Original</strong><span>Home Buyers</span><small>FAMILY-OWNED <i>|</i> NATIONWIDE</small></span></a><div><strong>Explore</strong><a href="/sell-your-house-fast.html">Sell Your House Fast</a><a href="/how-it-works.html">How It Works</a><a href="/situations.html">What We Buy</a><a href="/locations.html">Areas We Serve</a><a href="/compare-selling-options.html">Compare Options</a></div><div><strong>Seller Education</strong><a href="/blog.html">Seller Education Blog</a><a href="/cash-sale-benefits.html">Cash Sale Benefits Guide</a><a href="/blog.html#selling-without-agent">Selling Without an Agent</a><a href="/seller-insights.html">Seller Insights</a></div><div><strong>Property Topics</strong><a href="/sell-as-is.html">Sell As-Is</a><a href="/foreclosure-help.html">Foreclosure Help</a><a href="/sell-inherited-property.html">Inherited Property</a><a href="/sell-during-divorce.html">Divorce & Home Sales</a></div><div><strong>Contact</strong><a href="tel:+12404105636">(240) 410-5636</a><a href="mailto:Info@Originalhomebuyers.com">Info@Originalhomebuyers.com</a><a href="/about.html">About Us</a><a href="/contact.html">Contact Us</a><a href="/privacy.html">Privacy Policy</a><a href="/terms.html">Terms of Use</a><div className="footer-social" aria-label="Social media"><a href="https://www.facebook.com/originalhomebuyers" target="_blank" rel="noreferrer" className="footer-social__link" aria-label="Follow Original Home Buyers on Facebook"><span aria-hidden="true">f</span></a><span className="footer-social__link footer-social__link--placeholder" role="img" aria-label="Instagram profile coming soon" title="Instagram profile coming soon"><span aria-hidden="true">◎</span></span><span className="footer-social__link footer-social__link--placeholder" role="img" aria-label="X profile coming soon" title="X profile coming soon"><span aria-hidden="true">𝕏</span></span><span className="footer-social__link footer-social__link--placeholder" role="img" aria-label="TikTok profile coming soon" title="TikTok profile coming soon"><span aria-hidden="true">♪</span></span></div></div></div><div className="shell footer-disclosures"><p>Original Home Buyers reviews homes for potential direct, as-is purchase opportunities. Any potential offer is property-specific and subject to review and written agreement; terms and amounts may vary.</p><p>Information on this website is for general informational purposes only and is not legal, financial, tax, or real estate advice. Consult an appropriately licensed professional for guidance specific to your situation.</p><p>Original Home Buyers is committed to the letter and spirit of the federal Fair Housing Act. We do not discriminate on the basis of race, color, religion, sex, national origin, disability, or familial status.</p></div><div className="shell footer-bottom"><span>© 2026 Original Home Buyers. All rights reserved.</span><span>Family-owned. Nationwide.</span></div></footer>
      </div>
      <button className="mobile-fab" onClick={() => { trackFloatingOfferClick(); openOffer(); }}><House size={17} /> Get Cash Offer <ArrowRight size={15} /></button>
    </div>
  );
}
