// Product Detail — Data for The Nest
// Fulfilled by BiltWise Structures LLC (Greenwood, SC) under NC modular state label · NTA cert 11/14/2023

const PRODUCT = {
  id: 1,
  name: "The Nest",
  tagline: "One bedroom. One life. All in one delivery.",
  builder: {
    name: "PERCH",
    rating: null,               // Empty state — no fake reviews at launch
    reviews: 0,
    deliveries: 0,
    responseTime: "Same-day reply from Concierge",
    since: 2024,
    location: "Atlanta, GA",
    bio: "PERCH is the modern marketplace for factory-built housing — modular, prefab, container, and tiny. Every listing is escrow-guaranteed, dealer-licensed, and delivered with full manufacturer disclosure. The Nest is our first branded home: a compact, state-labeled modular one-bedroom you can put on your land and move into.",
  },
  // ---- Manufacturer disclosure ----
  // PUBLIC (pre-Reserve): generic "anchor manufacturing partner" + state label + cert details.
  // PRIVATE (at Reserve/contract signing): full legal name, address, NTA approver — per NC modular dealer regs.
  // This is the Priceline / Impresa-adjacent pattern: enough trust cue to convert, name held until signing.
  manufacturer: {
    // Publicly displayed
    publicName: "Our anchor manufacturing partner",
    publicLocation: "South Carolina",
    stateLabel: "NC Modular State Label",
    ntaCertDate: "November 14, 2023",
    ntaCertLabel: "NTA-certified third-party inspection",
    disclosure: "The Nest is manufactured to order by our anchor manufacturing partner under NC modular state label, NTA-approved November 14, 2023. PERCH is your single point of contact — a licensed modular dealer and marketplace principal. Manufacturer warranty passes through directly to you. Site scope (foundation, utility hookups, HVAC install, set crew, permits) is coordinated separately through PERCH's site-partner network or your chosen general contractor.",
    // Revealed at Reserve / contract signing only (kept in data for that flow, never rendered publicly)
    privateName: "BiltWise Structures LLC",
    privateAddressCity: "Greenwood",
    privateAddressState: "SC",
    ntaApprover: "Luke Lehman, NTA Inc.",
  },
  price: 129000,
  depositPct: 20,
  depositAmount: 25800,
  priceLabel: "Free Site Delivery Included · Nationwide (ex. HI/AK)",
  deliveryFootprint: "Nationwide (ex. HI / AK)",
  extendedRangeNote: "Freight to your prepared site is included in the base price on the contiguous US. Alaska and Hawaii quoted separately.",
  productDescription: "A right-sized, state-labeled modular one-bedroom you can put on your own land — the ADU your aging parents will actually enjoy, the minimalist retreat you've been drawing on napkins, the guest house that finally pays for itself. 567 finished square feet. One 36-foot module. Built to full code with the NC state modular label, factory-installed systems, and PERCH HomeCare Plus warranty. Free freight to your site. Start your build today; move in inside 12 weeks. Compliant luxury, without the six-month site build.",
  siteScopeEstimate: { low: 18000, high: 28000, note: "Foundation, utility hookups, set crew, HVAC install, permits — arranged separately." },
  sqft: 567,
  beds: 1,
  baths: 1,
  type: "Modular Home",
  certified: true,
  delivery: "10–12 weeks",
  warranty: "PERCH HomeCare Plus · Included",
  warrantyPackage: {
    name: "PERCH HomeCare Plus",
    subtitle: "Extended Protection",
    intro: "Every Nest ships with our bundled homecare package — the coverage travels with the deed.",
    tiers: [
      { years: 10, label: "Structural Integrity", desc: "Load-bearing frame, roof structure, exterior envelope, wind and moisture warranty." },
      { years: 7,  label: "Major Home Systems",   desc: "HVAC, electrical, plumbing — full parts and labor coverage." },
      { years: 7,  label: "Home Appliances",       desc: "Range, water heater, mini-split heads, exhaust — full replacement or repair." },
    ],
    footnote: "Coverage begins at Certificate of Occupancy. Transferable to next owner one time within the coverage window.",
  },
  features: [
    "State-labeled modular · NC-approved",
    "Single module · one delivery",
    "2×6 walls · R-19 insulation",
    "21 SEER mini-split · 2 zones",
    "Escrow-guaranteed through PERCH",
  ],

  // ---- LISTING ECONOMICS (drives re-engineering fee disclosure in Site Verification) ----
  // The Nest is a PERCH contract-manufactured listing with margin baked into the sticker.
  // For third-party marketplace listings, this flips to false and buyer sees the re-eng quote as pass-through.
  listingEconomics: {
    reEngineeringCovered: true,
    coveredNote: "Re-engineering fees for out-of-footprint delivery are absorbed by PERCH on this listing — no pass-through cost to you.",
    passThroughNote: "Re-engineering fees are quoted per builder and passed through at cost. Concierge scopes them within 24 hours of reserve.",
  },

  // ---- ACCESSIBILITY + PREMIUM ADD-ONS (Tesla-configurator pattern in the buy box) ----
  // Factory adds are dramatically cheaper than field retrofits — priced accordingly.
  // Unico is BiltWise-exclusive per Sean; won't appear on non-BiltWise listings.
  addOns: [
    { key:'mobility', title:'Mobility Access', price:3500, blurb:'36" doorways · roll-in curbless shower · ADA grab bars · lever handles · lowered switches (15"–48" reach)', tag:'Accessibility' },
    { key:'hearing',  title:'Deaf / Hard of Hearing', price:1200, blurb:'Strobe smoke + CO detectors · visual doorbell w/ flasher · visual notification receptacles at bed + bath', tag:'Accessibility' },
    { key:'vision',   title:'Blind / Low Vision', price:900, blurb:'Voice-annunciating smoke detectors · tactile switch caps · high-contrast trim + switchplates · braille placards at bath', tag:'Accessibility' },
    { key:'unico',    title:'Unico HVAC + HEPA', price:5000, blurb:'Unico high-velocity system with hospital-grade HEPA filtration. Replaces the standard 21 SEER mini-split. BiltWise partnership exclusive.', tag:'Premium' },
  ],
  specs: [
    { label: "Dimensions",       value: "35'-6\" × 15'-9\"" },
    { label: "Living Space",     value: "567 sq ft" },
    { label: "Ceiling Height",   value: "9' flat" },
    { label: "Frame",            value: "2×6 conventional wood, 16\" OC" },
    { label: "Wall Insulation",  value: "R-19" },
    { label: "Roof Insulation",  value: "R-38" },
    { label: "Roof System",      value: ".060 Mule Hide EPDM · 2.5/12 low-slope" },
    { label: "Exterior Siding",  value: "GA-Pacific vinyl Dutchlap (fiber-cement upgrade available)" },
    { label: "Windows",          value: "PlyGem Low-E argon, picture-framed" },
    { label: "Electrical",       value: "200A panel · Decora switches" },
    { label: "Plumbing",         value: "PEX supply + DWV vents · Rheem 50-gal water heater" },
    { label: "HVAC",             value: "21 SEER mini-split · 9,000 + 18,000 BTU heads (installed on-site)" },
    { label: "Kitchen",          value: "Full Shaker cabinetry · laminated butcher-block counters · Elkay stainless sink · Pfister brushed nickel pull-down faucet" },
    { label: "Bathroom",         value: "60×36 shower w/ Pfister McAllen trim · comfort-height toilet · cultured marble vanity" },
    { label: "Flooring",         value: "CALI Vinyl Pro 7mm Geo Core LVP throughout" },
    { label: "Interior Doors",   value: "2-panel Logan hollow-core · Kwikset Delta locksets" },
    { label: "Foundation",       value: "Crawl space (buyer-prepped per engineering specs)" },
    { label: "Wind Rating",      value: "115 mph Vult · Exposure C" },
    { label: "Seismic Design",   value: "Category C" },
    { label: "Snow Load",        value: "Ground 20 PSF · Roof 20 PSF" },
    { label: "Climate Zone",     value: "4" },
    { label: "Est. Ship Weight", value: "~15,000–18,000 lbs (verified at build-order confirmation)" },
    { label: "Certifications",   value: "NC Residential 2018 · NC NEC 2017 · NC IECC 2018 · State-labeled modular · NTA cert 11/14/2023" },
    { label: "Delivery States",  value: "NC · SC · GA · TN · VA (extended range on request)" },
  ],
  // Rooms — unified for both the right-panel list AND the hover overlay on the plan image.
  // xPct/yPct = top-left corner of hover hit-region as % of the DISPLAYED image bounds.
  // Calibrated against the current floor-plan.png (36'-0" × 16'-0" plan drawn with dimension
  // callouts around the perimeter). If the image is swapped, retune these.
  //
  // Actual layout (reading the plan left→right):
  //   [ BEDROOM 1 ][ BATH (top) + closet+utility ][ KITCHEN galley (bottom) ][ LIVING ]
  //
  floorplanRooms: [
    { name: "Bedroom",           sqft: "123 sq ft", notes: "10'-0\" × 12'-4\" · reach-in closet · gable window",                       xPct: 25, yPct: 37, wPct: 20, hPct: 35 },
    { name: "Bathroom",          sqft: "~55 sq ft", notes: "60×36 shower · comfort-height WC · cultured marble vanity",                xPct: 45, yPct: 37, wPct: 13, hPct: 17 },
    { name: "Utility / Pantry",  sqft: "~40 sq ft", notes: "50-gal Rheem water heater · pantry · HVAC air handler",                    xPct: 58, yPct: 37, wPct:  9, hPct: 17 },
    { name: "Kitchen",           sqft: "~80 sq ft", notes: "16'-10\" galley · Shaker cabinets · butcher-block counters · Elkay sink",  xPct: 43, yPct: 58, wPct: 29, hPct: 14 },
    { name: "Living / Dining",   sqft: "171 sq ft", notes: "13'-3\" × 14'-9\" · picture window · zoned mini-split return",             xPct: 72, yPct: 37, wPct: 15, hPct: 35 },
  ],
  // provenance: 'render' = 3D visualization, 'signed' = C2PA-signed real photograph
  // C2PA signing only applies to real photos from builder site, factory floor, and delivered builds.
  // The Nest is unreleased; all imagery is render. First signed photos land at Frame milestone + delivery.
  images: [
    { file: "exterior-front.jpg",      alt: "The Nest — front elevation: black gooseneck sconce, dark 6-panel entry door with 4-lite upper window, and picture window flanked by decorative raised-panel shutters.", provenance: 'render' },
    { file: "exterior-front-side.jpg", alt: "The Nest — front-and-side oblique showing the entry, shuttered picture window, and the long side wall with the shuttered secondary window and small square windows.", provenance: 'render' },
    { file: "living-dining.jpg",       alt: "The Nest interior — living and dining space with warm afternoon light.", provenance: 'render' },
    { file: "kitchen.jpg",             alt: "The Nest kitchen — 16-foot galley with Shaker cabinets and butcher-block counters.", provenance: 'render' },
    { file: "bedroom.jpg",             alt: "The Nest bedroom — 10 × 13 primary with morning light.", provenance: 'render' },
    { file: "bathroom.jpg",            alt: "The Nest bathroom — 60×36 shower, cultured marble vanity, comfort-height toilet.", provenance: 'render' },
  ],

  // ---- CERTIFICATION STACK: three tiers PERCH stands behind ----
  // Tier language matches the public standard at /certification/standard (stubbed for launch).
  certificationStack: {
    builder:  { tier: 'PERCH-Certified Builder',  status: 'held',    detail: 'Ops audit passed · 200+ units shipped · GL + product-liability insurance on file · references verified.' },
    unit:     { tier: 'Third-Party Inspected Unit', status: 'held', detail: 'NTA state-label inspection completed 11/14/2023 by Luke Lehman · NC modular label affixed · IRC 2021 + NC Residential 2018 code path.' },
    delivery: { tier: 'Site-Verified for Delivery', status: 'per-buyer', detail: 'The Land Check tool runs against your address on the product page — zoning, setbacks, wastewater availability, and destination-state component approvals all checked before you commit. Green means clear.' },
  },

  // ---- COMPONENT × STATE APPROVAL MATRIX ----
  // The failed sale on FL was door + 6 windows without FL product approval codes.
  // Never again. Every certified unit ships with this matrix pre-checked per delivery state.
  componentApprovals: {
    states: ['NC','SC','GA','TN','VA','FL','TX'],
    rows: [
      { component: 'Entry door · 6-panel steel',       NC:'approved', SC:'approved', GA:'approved', TN:'approved', VA:'approved', FL:'on-request', TX:'on-request' },
      { component: 'Windows · PlyGem picture-frame Low-E', NC:'approved', SC:'approved', GA:'approved', TN:'approved', VA:'approved', FL:'on-request', TX:'on-request' },
      { component: 'Roof · Mule Hide EPDM',            NC:'approved', SC:'approved', GA:'approved', TN:'approved', VA:'approved', FL:'on-request', TX:'on-request' },
      { component: 'Siding · GA-Pacific vinyl Dutchlap', NC:'approved', SC:'approved', GA:'approved', TN:'approved', VA:'approved', FL:'on-request', TX:'on-request' },
      { component: 'Tie-downs · engineered anchor package', NC:'approved', SC:'approved', GA:'approved', TN:'approved', VA:'approved', FL:'on-request', TX:'on-request' },
    ],
    footnote: 'Standard delivery footprint (NC · SC · GA · TN · VA) uses existing component approvals as-is. Nationwide delivery is available — states outside the default footprint may require plan re-engineering (windows, doors, tie-downs, or roof) to clear their state code. Re-engineering + extended freight quoted within 24 hours of reserve.',
  },

  // ---- QUANTITY TIERS: buy 1, 2, or 3 Nests with a factory-setup discount at scale ----
  // Placeholder discounts — factory setup amortizes across units, so 3-5% is typical modular-industry math.
  // Adjust discountPct + savingsLabel when BiltWise confirms real quantity pricing.
  quantityTiers: [
    { qty: 1, discountPct: 0,    label: '1 Nest',  savingsLabel: null,               badge: null },
    { qty: 2, discountPct: 0.03, label: '2 Nests', savingsLabel: 'Save $7,740',      badge: 'Popular' },
    { qty: 3, discountPct: 0.05, label: '3 Nests', savingsLabel: 'Save $19,350',     badge: 'Best value' },
  ],

  // ---- FREIGHT / DELIVERY MATH ----
  // Category is derived from unit dimensions (see unitDimensions below).
  // Real freight quote runs origin→destination haversine × rate/mile.
  // Origin: BiltWise Greenwood SC (29646).
  freight: {
    origin: { zip:'29646', city:'Greenwood', state:'SC', lat:34.1953, lng:-82.1637 },
    // Super-load rate range for the Nest (15'-9" wide). Midpoint used for estimates.
    // Category rates:
    //   standard  (≤8'6" wide, ≤13'6" tall): $3-5/mi
    //   wide      (8'6"–12' wide):            $8-14/mi
    //   super     (>12' wide OR >13'6" tall): $15-25/mi
    ratePerMile: { standard: 4, wide: 11, super: 20 },
    // Freight-included footprint. Anything else is quoted.
    includedStates: ['NC','SC','GA','TN','VA'],
    // Long-haul cutoff — beyond this mileage from origin, freight requires case-by-case Concierge review.
    longHaulMiles: 800,
  },

  // Dimensions drive freight category. 15'-9" wide = 189" > 144" (12ft) → super-load.
  unitDimensions: { widthInches: 189, heightInches: 162, lengthInches: 426, freightCategory: 'super' },

  // ---- BUILD SLOTS (placeholder — Cameron confirms real numbers per production window) ----
  buildSlots: {
    totalThisWindow: 4,
    remainingThisWindow: 3,
    windowLabel: 'Q4 2026',
    nextWindowLabel: 'Q1 2027',
  },

  // ---- COMPARE TO SITE-BUILT (buyer's biggest unspoken question: why not stick-built?) ----
  // Prices reflect module + site scope where relevant. "$129K + ~$22K site scope = ~$151K delivered" for The Nest.
  // Site-built floor is $250K — nobody builds a 567 sqft 1BR/1BA under $200K in 2026, and $250K is the realistic lower bound.
  compareRows: [
    { dim: 'Price for a 1BR/1BA',       nest: '$129,000 module · ~$22,000 site scope', siteBuilt: '$250,000–$450,000 typical'          },
    { dim: 'Timeline to move-in',       nest: '10–12 weeks',                            siteBuilt: '9–18 months'                        },
    { dim: 'Weather risk to schedule',  nest: 'None — built indoors',                   siteBuilt: 'High — every rain day is a delay'   },
    { dim: 'Warranty',                  nest: '10 yr structural · 7 yr systems',        siteBuilt: '1 yr builder default (2-10 program if opted in)' },
    { dim: 'Financing options',         nest: 'Modular mortgage · cash · const-to-perm',siteBuilt: 'Construction loan required'         },
    { dim: 'Code path',                 nest: 'State-labeled modular · pre-inspected',  siteBuilt: 'Full stick-built inspection chain'  },
    { dim: 'Change orders mid-build',   nest: 'Locked at signing',                      siteBuilt: 'Common — cost overruns average 20%' },
    { dim: 'Resale',                    nest: 'Sells as real property (with land)',     siteBuilt: 'Sells as real property'             },
  ],
  compareSummary: {
    winner: 'The Nest',
    savingsLow: 99000,   // $250K low - $151K
    savingsHigh: 299000, // $450K high - $151K
    monthsSaved: '7–15 months faster',
  },

  // ---- "WHAT IF..." TRANSPARENCY (four honest answers, trust-multiplier) ----
  transparencyFAQ: [
    { q: 'What if my build hits a delay?',                    a: 'Weather doesn\'t affect the factory — that\'s a category advantage. If a permit, engineering revision, or supplier issue slips the schedule, Concierge notifies you within 24 hours with a new date and a written cause. Every milestone stays in escrow until it clears — no money moves for stages that haven\'t happened.' },
    { q: 'What if I need to cancel after I reserve?',         a: 'Before we lock production (typically day 10 after reserve), you cancel with a full refund minus any engineering already run — usually $0–$1,200 depending on how far revisions have progressed. After production starts, cancellation reverts to the manufacturer\'s change-order policy, which we disclose in full at signing.' },
    { q: 'What if the state code changes during my build?',   a: 'Code changes generally apply to permits filed after the effective date, not to units already in production under an approved state label. If a change does affect your unit, PERCH covers the re-engineering cost on The Nest (contract-manufactured with margin baked). On third-party marketplace listings, we quote pass-through and disclose before signing.' },
    { q: 'What if the manufacturer goes under?',              a: 'Every PERCH transaction runs through licensed escrow — funds only release after our manufacturer uploads dated video/photo proof of the milestone and you sign it off digitally. If a manufacturer partner ever ceased operations mid-build, your remaining escrow balance would be returned in full and we would coordinate placement with another PERCH-Certified builder to complete or restart the build.' },
  ],

// ---- SCHEDULE A CALL / BANDWIDTH-PRESERVING CONTACT ----
  scheduleContact: {
    email: 'cam@ownperch.com',
    replyWindow: '24 hours',
    // TODO: replace with real Calendly link when Cameron greenlights inbound booking
    calendlyUrl: null,
    note: 'Every note routes to Cameron. We reply within 24 hours to set a call — or answer in writing if that\'s faster for you.',
  },

  // ---- WHO YOU'RE BUYING FROM (durable, one line, quotable — buyer-facing, not internal-sounding) ----
  regulatoryPositioning: 'PERCH is a licensed modular home dealer and an insured, escrow-guaranteed transaction platform. Every build is inspected, escrowed, and warrantied end-to-end.',

  // ---- PERCH BY THE NUMBERS (footer strip — investor signal, quiet, small type) ----
  perchByNumbers: {
    buildersCertified: 12,
    waitlistBuyers: 4447,
    unitsInProduction: 3,
    footprintDefault: '5 states',
    footprintAvailable: 'all 50',
  },

  // ---- REVIEWS: empty state at launch. No fake data. ----
  reviews: [],
  reviewsEmptyState: {
    title: "Be the first.",
    body: "The Nest is our newest listing. Reviews open the moment our first delivery signs off. Watch this space — or reserve now to be one of the first names on it.",
  },

  similar: [
    { id:3, name:"Backcountry X22",  builder:"Backcountry Containers", sqft:280,  beds:1, baths:1, price:74000,  img:2 },
    { id:4, name:"Method EL-40",     builder:"Method Homes",           sqft:840,  beds:2, baths:1, price:168000, img:3 },
    { id:8, name:"Steel Cabin 320",  builder:"OOD Homes",              sqft:320,  beds:1, baths:1, price:92000,  img:7 },
  ],
  included: [
    "Complete factory-finished module (interior + exterior)",
    "200A electrical service panel + Decora switches throughout",
    "21 SEER mini-split HVAC system (units supplied, installed on-site)",
    "Rheem 50-gallon electric water heater installed",
    "Full Shaker kitchen · Elkay stainless sink · Pfister pull-down faucet",
    "60×36 shower · comfort-height toilet · cultured marble vanity",
    "CALI Vinyl Pro LVP throughout · picture-framed PlyGem Low-E windows",
    "GA-Pacific vinyl Dutchlap siding · Mule Hide EPDM roof",
    "Kwikset Delta SmartKey exterior locksets · exterior GFCI + LED lighting",
    "Freight delivery to your prepared site (NC · SC · GA · TN · VA)",
    "NC modular state label · NTA cert · full code compliance package",
    "PERCH escrow-guaranteed transaction · HomeCare Plus warranty (10 yr structural · 7 yr systems · 7 yr appliances)",
  ],
  buyerResponsibility: [
    "Land acquisition, survey, and zoning verification (Land Check tool available)",
    "Soil testing (percolation / geotech report — required by most jurisdictions)",
    "Crawl-space or slab foundation prepared per manufacturer engineering specs",
    "Building permits + zoning approval (Concierge team provides checklist)",
    "Utility hookups: water, sewer, electric (200A service drop)",
    "Site preparation, grading, and access road (min. 14' wide for delivery truck)",
    "Set crew + crane (~$3,500–$6,500 typical for single-module set)",
    "On-site HVAC line-set connection (units are pre-charged and supplied)",
    "Final inspections (varies by county) and certificate of occupancy",
    "Floor insulation install (per RESCheck spec, supplied but installed on-site)",
  ],
  customizations: [
    // Dependencies (stub for builder-upload schema):
    // - Cedar accent panel siding = natural stained wood, cannot be painted → forces Exterior Color = Cedar
    // - Any Exterior Color other than Cedar disables the Cedar accent panel siding option
    { category: "Exterior Siding", options: ["Vinyl Dutchlap (included)", "Fiber Cement upgrade", "Cedar accent panel"], default: 0, type: "swatch", textures: ["siding-vinyl-dutchlap.jpg", "siding-fiber-cement.jpg", "siding-cedar-panel.jpg"],
      // Option[2] (Cedar accent panel) requires Exterior Color = Cedar (index 2 in the color list)
      dependencies: { 2: { requires: { "Exterior Color": 2 } } }
    },
    { category: "Exterior Color",  options: ["Cream (included)", "Charcoal", "Cedar", "Sage"], default: 0, type: "color", colors: ["#F5EBD8", "#3A3D3F", "#A67E5C", "#90A483"], renders: ["exterior-front.jpg", "exterior-charcoal.jpg", "exterior-cedar.jpg", "exterior-sage.jpg"],
      // Only Cedar color (index 2) allows Cedar accent panel siding (Exterior Siding option index 2)
      dependencies: { 0: { disables: { "Exterior Siding": [2] } }, 1: { disables: { "Exterior Siding": [2] } }, 3: { disables: { "Exterior Siding": [2] } } }
    },
    { category: "Flooring",        options: ["Natural Oak LVP (included)", "Walnut LVP", "Slate Gray LVP", "Birch LVP"], default: 0, type: "swatch", textures: ["lvp-natural-oak.jpg", "lvp-walnut.jpg", "lvp-slate-gray.jpg", "lvp-birch.jpg"] },
    { category: "Cabinet Finish",  options: ["Natural Birch Shaker (included)", "Matte White", "Forest Green", "Charcoal"], default: 0, type: "color", colors: ["#C9A87C", "#F5F0E6", "#3E5540", "#2E2E2E"] },
  ],
  faqs: [
    // Honest-questions block (merged from standalone TransparencyBlock — buyers only look for FAQ, keep the trust content there)
    {
      q: "What if my build hits a delay?",
      a: "Weather doesn’t affect the factory — that’s a category advantage. If a permit, engineering revision, or supplier issue slips the schedule, Concierge notifies you within 24 hours with a new date and a written cause. Every milestone stays in escrow until it clears — no money moves for stages that haven’t happened.",
    },
    {
      q: "What if I need to cancel after I reserve?",
      a: "Before we lock production (typically day 10 after reserve), you cancel with a full refund minus any engineering already run — usually $0–$1,200 depending on how far revisions have progressed. After production starts, cancellation reverts to the manufacturer’s change-order policy, which we disclose in full at signing.",
    },
    {
      q: "What if the state code changes during my build?",
      a: "Code changes generally apply to permits filed after the effective date, not to units already in production under an approved state label. If a change does affect your unit, PERCH covers the re-engineering cost on The Nest (contract-manufactured with margin baked). On third-party marketplace listings, we quote pass-through and disclose before signing.",
    },
    {
      q: "What if the manufacturer goes under?",
      a: "Every PERCH transaction runs through licensed escrow — funds only release after our manufacturer uploads dated video/photo proof of the milestone and you sign it off digitally. If a manufacturer partner ever ceased operations mid-build, your remaining escrow balance would be returned in full and we would coordinate placement with another PERCH-Certified builder to complete or restart the build.",
    },
    {
      q: "Who actually builds The Nest?",
      a: "The Nest is manufactured to order by our anchor manufacturing partner in South Carolina. They hold the NC modular state label with NTA-certified third-party inspection (11/14/2023). Full manufacturer name and address are disclosed as part of your signed docs at Reserve, per NC modular dealer regs. PERCH is your single point of contact end-to-end — a licensed modular dealer and marketplace principal. Manufacturer warranty passes through directly to you.",
    },
    {
      q: "What foundation do I need?",
      a: "The Nest is engineered for a crawl-space foundation. Our manufacturing partner provides full engineering specs at contract signing. Most buyers hire a local contractor — typical cost is $4,000–$9,000 depending on soil conditions and jurisdiction. A slab foundation is available as a site-scope upgrade; ask Concierge.",
    },
    {
      q: "What states can you deliver to?",
      a: "Standard delivery is NC, SC, GA, TN, and VA — our manufacturing partner's freight radius. Extended-range delivery to FL, AL, KY, WV, MD, DE, or coastal SE states is available with a freight quote (typically $1.50–$2.50 per loaded mile beyond standard). Not currently available west of the Mississippi.",
    },
    {
      q: "What is 'module + freight' vs. site scope?",
      a: "$129,000 covers the completed factory module and freight to your prepared site. Site scope — foundation, utility hookups, HVAC line-set install, set crew, permits, and site prep — is quoted separately and typically runs $18,000–$28,000 depending on jurisdiction and site conditions. PERCH Concierge can provide a full budget worksheet before you reserve.",
    },
    {
      q: "How is payment handled?",
      a: "The entire transaction moves through licensed escrow. You start your build with a 20% production deposit ($25,800). Balance funds sit in escrow and release milestone-by-milestone as our manufacturing partner uploads photo and video proof of each production stage — Frame, Dry-In, Systems Rough-In, Delivery + Set, Final. You review the proof inside your PERCH inbox and digitally sign the milestone. Only then does escrow release the next tranche to BiltWise. Wire, ACH, and construction financing all settle through the same milestone lane.",
    },
    {
      q: "Can I finance it?",
      a: "Yes. The Nest qualifies for modular home construction financing through several PERCH-partnered lenders. Because it carries the NC state modular label (not HUD/manufactured), it appraises and finances as real property once permanently affixed to a foundation. Ask Concierge to pre-qualify you before you reserve.",
    },
    {
      q: "What certifications does it carry?",
      a: "The Nest is engineered to IRC 2021 and NC Residential Code 2018 with NC Electrical 2017 and NC Energy 2018 references. It ships with the NC modular state label and NTA third-party inspection certification (11/14/2023, Luke Lehman). Structural rating: 115 mph wind (Vult, Exposure C), Seismic Category C, Climate Zone 4, 20 PSF ground snow load.",
    },
    {
      q: "Can it be built to my state's residential code?",
      a: "Almost always, yes — but it may need re-engineering first. The Nest ships as-built to IRC 2021 + NC Residential Code 2018, which is directly accepted in NC and neighboring states with matching or older code cycles. For other states, Our manufacturing partner re-engineers the plans to your state's adopted residential code before we open the production ticket (typical add: 2–3 weeks, no extra module cost). Tell us your build state at Reserve and Concierge coordinates the re-engineering; your contractor gets the final stamped set inside your dashboard.",
    },
    {
      q: "How do I share this with my contractor?",
      a: "Click 'Share with Contractor' in the sidebar. We email your GC the full contractor package: engineering spec sheet, foundation and utility hookup drawings, NC modular state label docs, code references, and the site-scope checklist. After your production slot confirms, your GC gets shared access to your PERCH dashboard so they can pull permits, review milestone proofs, and coordinate the set date directly.",
    },
    {
      q: "How long from reserve to move-in?",
      a: "10–12 weeks reserve-to-move-in on a well-scoped site. Slot confirm 1–2 weeks, factory build 6 weeks, ship + set 1 week, button-up + inspection 1 week. Site prep runs in parallel with factory build — no lost time. Faster than site-built (usually 6–9 months), because the module ships turnkey.",
    },
    {
      q: "What's the warranty?",
      a: "Every Nest ships with PERCH HomeCare Plus — bundled into the base price, no add-on. 10 years on structural integrity (load-bearing frame, roof, exterior envelope). 7 years on major home systems (HVAC, electrical, plumbing — parts and labor). 7 years on home appliances (range, water heater, mini-split, exhaust). Coverage begins at Certificate of Occupancy and is transferable to the next owner one time within the coverage window. PERCH additionally guarantees the transaction end-to-end: if the module fails delivery inspection, escrow refunds and PERCH covers the difference.",
    },
    {
      q: "Can I see it in person before I buy?",
      a: "Our manufacturing partner's Greenwood, SC facility hosts scheduled walk-throughs of in-progress builds by appointment. Ask Concierge to coordinate. We're also planning a permanent PERCH Nest showroom home in NC — first one lands with our first delivery in Q4.",
    },
  ],
  // Social proof: honest at launch. No inflated "12 viewers this week" theater.
  socialProof: {
    launch: true,
    launchDate: "August 2026",
    launchLabel: "First PERCH-branded listing · Newly available",
  },
  sku: "PN-NEST-567-M1",
  gtin: null,   // No GTIN assigned yet
  category: "Modular Homes > One-Bedroom",
};

const PLACEHOLDER_COLORS_PDP = [
  ['#3D5C3A','#5a7d56'], ['#4a6741','#6b8e67'], ['#2d4a30','#4d6a50'],
  ['#5c7a58','#7d9b79'], ['#3a5937','#5b7a58'], ['#4d6b4a','#6e8c6b'],
  ['#365534','#577655'], ['#486846','#698967'],
];

function estimateMonthlyPDP(price, years = 7, rate = 0.069) {
  const r = rate / 12;
  const n = years * 12;
  return Math.round(price * (r * Math.pow(1+r, n)) / (Math.pow(1+r, n) - 1));
}

// PlaceholderImg — renders a REAL <img> when PRODUCT.images[index] has a .file property,
// otherwise falls back to the gradient placeholder. This lets the same gallery components
// handle both mocked and real listings without any layout changes.
function PlaceholderImg({ index, label, style }) {
  const item = PRODUCT.images && PRODUCT.images[index];
  const hasReal = item && typeof item === 'object' && item.file;

  if (hasReal) {
    return React.createElement('img', {
      src: '/homes/the-nest/images/' + item.file,
      alt: item.alt || 'The Nest',
      loading: index === 0 ? 'eager' : 'lazy',
      style: { width:'100%', height:'100%', objectFit:'cover', display:'block', ...style }
    });
  }

  const [c1, c2] = PLACEHOLDER_COLORS_PDP[index % PLACEHOLDER_COLORS_PDP.length];
  const labelText = typeof label === 'string' ? label : (label && label.alt) || 'photo';
  return React.createElement('div', { style: { width:'100%', height:'100%', background:`linear-gradient(135deg, ${c1}, ${c2})`, display:'flex', alignItems:'center', justifyContent:'center', position:'relative', overflow:'hidden', ...style } },
    React.createElement('div', { style: { position:'absolute', inset:0, opacity:0.08, backgroundImage:'repeating-linear-gradient(45deg, transparent, transparent 10px, rgba(255,255,255,0.5) 10px, rgba(255,255,255,0.5) 12px)' }}),
    React.createElement('div', { style: { textAlign:'center', color:'rgba(255,255,255,0.6)', fontFamily:'var(--font-mono)', fontSize:11, letterSpacing:'0.08em', textTransform:'uppercase' }},
      React.createElement('div', { style: { fontSize:28, marginBottom:6, opacity:0.5 }}, '⌂'),
      labelText
    )
  );
}

// Unified icon system — Material Symbols Outlined at a refined weight (300 / opsz 20).
// Chosen over 21st.dev catalog icons because they require shadcn/npm install; the UMD-Babel
// runtime here loads Material Symbols via Google Fonts and gives us 3000+ consistent glyphs
// with no build step. FILL=0 for editorial outline register (Kinfolk-adjacent).
function PDPIcon({ name, size=20, style={}, fill=0, weight=300 }) {
  return React.createElement('span', {
    className:'material-symbols-outlined',
    style: {
      fontSize:size,
      fontVariationSettings: '"FILL" ' + fill + ', "wght" ' + weight + ', "GRAD" 0, "opsz" 20',
      lineHeight: 1,
      verticalAlign: 'middle',
      ...style
    }
  }, name);
}

Object.assign(window, { PRODUCT, PLACEHOLDER_COLORS_PDP, estimateMonthlyPDP, PlaceholderImg, PDPIcon });
