const VARIANTS = {“living”:{“name”:”4-Bed Barndominium”,”slug”:”40×60-barndominium”,”breadcrumb”:”4-Bed Barndominium”,”sku”:”SS-40×60-BARNDO”,”units”:”1,847+”,”reviews”:”0″,”price”:48200,”was”:54950,”save”:6750,”monthly”:1004,”urgCount”:”4 buyers”,”heroTag”:”★ Highest Margin”,”gallery”:[“https://www.steelandstud.com/wp-content/uploads/2026/05/20×40-Metal-Building-House-of-Worship.jpg”,”https://www.steelandstud.com/wp-content/uploads/2026/05/40×25-Metal-Barn-Building-for-Farm-Ranch.jpg”,”https://www.steelandstud.com/wp-content/uploads/2026/05/40×25-Metal-Building-Home-Gym-Studio.jpg”,”https://www.steelandstud.com/wp-content/uploads/2026/05/40×25-Metal-Factory-Warehouse-Building.jpg”,”https://www.steelandstud.com/wp-content/uploads/2026/05/40×70-Metal-Barn-Building-for-Farm-Ranch.jpg”],”colors”:[{“id”:”slate”,”name”:”Slate Gray”,”hex”:”#3F4A55″,”popular”:true},{“id”:”charcoal”,”name”:”Charcoal”,”hex”:”#1A1F2C”},{“id”:”barnred”,”name”:”Barn Red”,”hex”:”#7A1F1F”},{“id”:”forest”,”name”:”Forest Green”,”hex”:”#1F4F38″},{“id”:”navy”,”name”:”Patriot Blue”,”hex”:”#274169″},{“id”:”mocha”,”name”:”Mocha”,”hex”:”#6B5340″},{“id”:”sand”,”name”:”Sand Beige”,”hex”:”#D6D2C4″},{“id”:”white”,”name”:”Polar White”,”hex”:”#E8E4DC”}],”sizes”:[{“id”:”40×50″,”label”:”40×50″,”subtitle”:”smaller”,”price”:40850,”current”:false,”hubSlug”:”40×50″},{“id”:”40×60″,”label”:”40×60″,”subtitle”:”this size”,”price”:48200,”current”:true,”hubSlug”:null},{“id”:”40×65″,”label”:”40×65″,”subtitle”:”longer”,”price”:51850,”current”:false,”hubSlug”:”40×65″},{“id”:”45×60″,”label”:”45×60″,”subtitle”:”wider”,”price”:53650,”current”:false,”hubSlug”:”45×60″}],”heights”:[{“id”:”7″,”label”:”7′”,”price”:0},{“id”:”8″,”label”:”8′”,”price”:0},{“id”:”9″,”label”:”9′”,”price”:0,”current”:true,”popular”:true},{“id”:”10″,”label”:”10′”,”price”:340},{“id”:”12″,”label”:”12′”,”price”:640},{“id”:”14″,”label”:”14′”,”price”:1180}],”h1″:”40×60 4-Bed Barndominium, build-ready residential shell.”,”tagline”:”Engineered 4-bed residential shell with kitchen rough-in, bath plumbing stubs, 200A entrance, and HVAC pre-pack, finish-out ready for drywall and flooring.”,”bullets”:[“2,400 sq ft residential shell”,”4 bedrooms stud-framed”,”Kitchen + bath plumbing rough”,”200A electrical entrance”,”HVAC rough-in central air”,”R-19 walls R-30 ceiling”,”Egress windows per code”,”2-3 weeks shell install”],”fpH2Variant”:”4-bed barndo shell”,”fpSub”:”40 feet wide × 60 feet long. Engineered residential shell with 4 bedrooms, kitchen rough-in, bath plumbing stubs, 200A entrance, HVAC rough-in.”,”fpInfoH”:”Residential-grade barndominium.”,”fpInfoP”:”Stud-framed 4 bedrooms + great room + kitchen + 2 bath, ready for finish trades (drywall + flooring + cabinets + appliances).”,”fpProtip”:”Total move-in-ready cost: shell $48,200 + slab $28,800 + finish $25-55K. Compare to $300-450/sf for new conventional construction.”,”fpKey”:”living”,”included”:[{“ic”:”🏗️”,”h”:”2,400 sq ft enclosed”,”p”:”Fully-enclosed 40×60 vertical-roof structure.”},{“ic”:”🚪”,”h”:”Roll-up + walk-in doors”,”p”:”Standard configuration door package.”},{“ic”:”🔩”,”h”:”14-gauge steel frame”,”p”:”American-rolled galvanized tubing.”},{“ic”:”🎨”,”h”:”1 standard color”,”p”:”Pick from 16 factory-baked finishes.”}],”specs”:[[“Width”,”40′”,false],[“Length”,”60′ + 6″ overhang”,false],[“Side height”,”9′ standard”,false],[“Floor space”,”2,400 sq ft”,true],[“Doors”,”1 × 9×8 roll-up”,false],[“Walk-in”,”Optional (+$345)”,false],[“Windows”,”Optional”,false],[“Wind”,”up to 180 mph”,true],[“Snow”,”up to 65 psf”,true],[“Roof”,”Vertical 3:12″,false],[“Frame”,”14 ga (12 ga upgrade)”,false],[“Sheeting”,”29 ga (26 ga upgrade)”,false],[“Anchoring”,”Concrete · Asphalt · Ground”,false],[“Lead time”,”3 – 5 weeks”,false],[“Bedroom framing”,”4 stud-framed bedrooms”,true],[“Plumbing rough”,”Kitchen + bath drain/supply”,false],[“Electrical”,”200A entrance + sub-panels”,false],[“HVAC”,”Mini-split rough-in × 2″,false],[“Insulation”,”R-19 walls / R-30 ceiling”,false],[“Egress”,”Code-compliant windows”,false]],”subUses”:[{“tag”:”PRIMARY RESIDENCE”,”h”:”4-bed barndominium”,”p”:”Full 4-bedroom layout with great room, kitchen, 2 bath, and 600 sq ft attached garage at one end.”,”img”:”https://www.steelandstud.com/wp-content/uploads/2026/05/20×40-Metal-Building-House-of-Worship.jpg”},{“tag”:”RENTAL INCOME”,”h”:”Long-term rental ADU”,”p”:”$2400-4400/mo rent depending on county. ROI in 4 to 7 years on the shell + finish cost.”,”img”:”https://www.steelandstud.com/wp-content/uploads/2026/05/40×25-Metal-Barn-Building-for-Farm-Ranch.jpg”},{“tag”:”GUEST + IN-LAW”,”h”:”Multigenerational housing”,”p”:”Single-level layout, walk-in shower, separate entrance, suitable for aging parents or guest house.”,”img”:”https://www.steelandstud.com/wp-content/uploads/2026/05/40×25-Metal-Building-Home-Gym-Studio.jpg”}],”lsi”:[“40×60 barndominium”,”4 bedroom barndo”,”40×60 barndo kit”,”2400 sq ft barndominium”,”metal building house 40×60″,”prefab barndominium”,”barndominium shell”,”barndo with ADU”,”pole barn house 40×60″],”crosssell”:[{“ic”:”🏗️”,”bundle”:”Bundle & Save”,”name”:”Concrete Pad Pour”,”desc”:”41×61×4″ slab to engineered spec.”,”p”:”$10,800″,”slug”:”concrete-pad-pour”},{“ic”:”🌡”,”bundle”:”Most Added”,”name”:”R-19 Insulation Package”,”desc”:”Roof & wall batt, vinyl-faced.”,”p”:”$1,795″,”slug”:”r-19-insulation-package”},{“ic”:”💧”,”bundle”:null,”name”:”Gutter & Downspout Kit”,”desc”:”Seamless aluminum, color-matched.”,”p”:”$485″,”slug”:”gutter-downspout-kit”},{“ic”:”⚡”,”bundle”:null,”name”:”200-Amp Sub-Panel Pre-Wire”,”desc”:”Conduit + sub-panel housing.”,”p”:”$695″,”slug”:”200-amp-sub-panel”}],”related”:[{“v”:”vehicle_storage”,”name”:”Fleet Vehicle Garage”,”p”:”Fleet Vehicle Garage”,”price”:”$43,950″,”ic”:”🚗”,”url”:”/metal-buildings/40×60-fleet-vehicle-garage/”},{“v”:”workshop_fabrication”,”name”:”Home Workshop”,”p”:”Home Workshop”,”price”:”$44,700″,”ic”:”🔧”,”url”:”/metal-buildings/40×60-workshop/”},{“v”:”office_retail_space”,”name”:”Garage + Office”,”p”:”Garage + Office”,”price”:”$45,800″,”ic”:”💼”,”url”:”/metal-buildings/40×60-office/”},{“v”:”rv_motorhome_storage”,”name”:”RV & Boat Garage”,”p”:”RV & Boat Garage”,”price”:”$44,375″,”ic”:”🚐”,”url”:”/metal-buildings/40×60-rv-motorhome-storage/”},{“v”:”equestrian_use”,”name”:”8-Stall Horse Barn”,”p”:”8-Stall Horse Barn”,”price”:”$45,200″,”ic”:”🐴”,”url”:”/metal-buildings/40×60-horse-barn/”},{“v”:”boat_trailer_storage”,”name”:”Boat & Trailer Garage”,”p”:”Boat & Trailer Garage”,”price”:”$44,235″,”ic”:”🚤”,”url”:”/metal-buildings/40×60-boat-trailer-storage/”},{“v”:”hobby_project_space”,”name”:”Hobby & Project Space”,”p”:”Hobby & Project Space”,”price”:”$45,400″,”ic”:”🎮”,”url”:”/metal-buildings/40×60-hobby-space/”}],”faqs”:[[“What’s actually included in the $48,200 shell?”,”Shell scope: structure + insulation pre-pack (R-19 walls / R-30 ceiling) + plumbing rough-in (kitchen + bath drain/supply) + 200A electrical entrance + HVAC mini-split rough-in + 4 egress windows per residential code. Finish-out trades (drywall, paint, flooring, cabinets, fixtures) are owner-supplied, plan $25,000 to $55,000 in trades depending on finishes.”],[“Can this be permitted as a primary residence?”,”40×60 barndominium shell meets IRC framing/ceiling/egress requirements when finished to code. The structure ships with stamped engineered drawings for residential occupancy in your wind/snow zone. Permitting is handled by your local building department, file the drawings plus your finish plans for the C of O.”],[“Property taxes after the barndominium?”,”Typically $25,000 to $80,000 assessed-value increase, $300 to $1,800/yr added property tax depending on county. Long-term rental income covers this 5 to 12× over.”],[“What’s the realistic total to move-in-ready?”,”Shell ($48,200) + slab/foundation ($8,000-$15,000) + finish trades ($25,000-$55,000) + appliances/fixtures ($6,000-$15,000) = roughly $78,200 to $133,200 total. Compare to ~$300-$450/sqft for new conventional construction.”],[“How long to move-in-ready?”,”Shell goes up in 2 to 3 weeks. Finish trades 8 to 14 weeks depending on your contractor. Full move-in-ready in 3 to 5 months on average.”],[“Financing options?”,”Construction loan for the shell + slab, then conventional mortgage on the finished build. Some lenders offer a single-close “barndo loan” that bundles everything; ask your local bank for “construction-to-permanent” products.”]],”_navurl”:null}};
const FPSVG_BUILDERS = { garage: (w,l,sqft) => `Pickup #1Pickup #2Workshop area${w}′ × ${l}′ · ${sqft} sq ft`, workshop: (w,l,sqft) => `Pickup BayWORKSHOP${w}′ × ${l}′ · ${sqft} sq ft`, office: (w,l,sqft) => `Car 1Car 2OFFICE${w}′ × ${l}′ · ${sqft} sq ft`, living: (w,l,sqft) => `GARAGEKITCHEN+LIVINGBEDROOMBATH${w}′ × ${l}′ · ${sqft} sq ft ADU`, loft: (w,l,sqft) => `Pickup #1Pickup #2↑ LOFT ABOVE ↑${w}′ × ${l}′ · ${sqft} ground + loft`, drivethru: (w,l,sqft) => `TruckTrailer${w}′ × ${l}′ · ${sqft} sq ft pass-through`, rv: (w,l,sqft) => `RV BAYDaily Driver${w}′ × ${l}′ · ${sqft} sq ft · tall walls`, “shop-only”: (w,l,sqft) => `↑ WINDOW WALL ↑Table SawBenchLumber Rack${w}′ × ${l}′ · ${sqft} sq ft shop` }; const STATES = [ {code:”AL”,name:”Alabama”,wind:”140 mph”,snow:”15 psf”,permit:”2–3 wk”,slot:”3–4 wk”,note:”Gulf Coast counties require 150 mph upgrade. Tornado Alley adjacent, concrete pad anchoring recommended.”}, {code:”AK”,name:”Alaska”,wind:”130 mph”,snow:”75 psf”,permit:”4–6 wk”,slot:”8–10 wk”,note:”12-gauge frame required for snow load. Lower 48 shipping adds ~$1,400.”}, {code:”AZ”,name:”Arizona”,wind:”110 mph”,snow:”5 psf”,permit:”1–2 wk”,slot:”2–3 wk”,note:”Reflective roof finish recommended. UV-rated 40-year paint warranty included.”}, {code:”AR”,name:”Arkansas”,wind:”130 mph”,snow:”15 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Tornado-prone, 12-gauge frame and 26-gauge sheeting widely chosen.”}, {code:”CA”,name:”California”,wind:”110 mph”,snow:”10 psf”,permit:”4–8 wk”,slot:”4–6 wk”,note:”Seismic anchoring required. ADU configuration qualifies for streamlined SB 9 / SB 35 permitting.”}, {code:”CO”,name:”Colorado”,wind:”120 mph”,snow:”55 psf”,permit:”3–5 wk”,slot:”5–7 wk”,note:”High-altitude snow: 65 psf required above 7,500 ft. Insulation strongly recommended.”}, {code:”CT”,name:”Connecticut”,wind:”130 mph”,snow:”40 psf”,permit:”3–5 wk”,slot:”4–6 wk”,note:”Coastal CT requires 150 mph wind upgrade.”}, {code:”DE”,name:”Delaware”,wind:”130 mph”,snow:”25 psf”,permit:”2–3 wk”,slot:”3–5 wk”,note:”Coastal salt-air, galvanized frame upgrade recommended for longevity.”}, {code:”FL”,name:”Florida”,wind:”160 mph”,snow:”0 psf”,permit:”3–6 wk”,slot:”3–5 wk”,note:”Hurricane zone, 12-gauge frame and Miami-Dade approved anchoring required. HVHZ certification available.”}, {code:”GA”,name:”Georgia”,wind:”130 mph”,snow:”10 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Coastal counties need 140+ mph. Atlanta metro permits run 3-4 weeks.”}, {code:”ID”,name:”Idaho”,wind:”110 mph”,snow:”35 psf”,permit:”3–5 wk”,slot:”4–6 wk”,note:”Mountain regions: 50 psf snow. Frost depth foundation specs required above 5,000 ft.”}, {code:”IL”,name:”Illinois”,wind:”120 mph”,snow:”25 psf”,permit:”3–5 wk”,slot:”4–6 wk”,note:”Chicago Suburbs require 130 mph + 30 psf snow.”}, {code:”IN”,name:”Indiana”,wind:”120 mph”,snow:”25 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Standard certification works statewide. NW Indiana may need 35 psf.”}, {code:”IA”,name:”Iowa”,wind:”130 mph”,snow:”30 psf”,permit:”2–4 wk”,slot:”4–6 wk”,note:”Tornado-prone, 12-gauge frame upgrade common.”}, {code:”KS”,name:”Kansas”,wind:”140 mph”,snow:”20 psf”,permit:”2–3 wk”,slot:”3–5 wk”,note:”Tornado Alley center, 12-gauge frame strongly recommended.”}, {code:”KY”,name:”Kentucky”,wind:”130 mph”,snow:”15 psf”,permit:”2–3 wk”,slot:”3–5 wk”,note:”Eastern KY mountain counties need 25 psf snow.”}, {code:”LA”,name:”Louisiana”,wind:”150 mph”,snow:”0 psf”,permit:”3–5 wk”,slot:”3–5 wk”,note:”Hurricane zone south of I-10, 12-gauge frame and elevated foundation common.”}, {code:”ME”,name:”Maine”,wind:”110 mph”,snow:”55 psf”,permit:”3–5 wk”,slot:”5–7 wk”,note:”Heavy snow, 65 psf upgrade common. R-19 insulation recommended.”}, {code:”MD”,name:”Maryland”,wind:”130 mph”,snow:”30 psf”,permit:”3–5 wk”,slot:”3–5 wk”,note:”Standard cert fits. Eastern Shore may need 140 mph upgrade.”}, {code:”MA”,name:”Massachusetts”,wind:”130 mph”,snow:”45 psf”,permit:”4–6 wk”,slot:”5–7 wk”,note:”Cape Cod and Islands require 150 mph wind.”}, {code:”MI”,name:”Michigan”,wind:”110 mph”,snow:”40 psf”,permit:”2–4 wk”,slot:”4–6 wk”,note:”Upper Peninsula: 60 psf snow.”}, {code:”MN”,name:”Minnesota”,wind:”110 mph”,snow:”50 psf”,permit:”3–5 wk”,slot:”5–7 wk”,note:”Northern MN: 65 psf snow required.”}, {code:”MS”,name:”Mississippi”,wind:”140 mph”,snow:”5 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Gulf Coast counties: 150 mph wind cert required.”}, {code:”MO”,name:”Missouri”,wind:”130 mph”,snow:”20 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Tornado-prone, 12-gauge frame strongly recommended.”}, {code:”MT”,name:”Montana”,wind:”120 mph”,snow:”40 psf”,permit:”3–5 wk”,slot:”5–8 wk”,note:”Mountain counties need 60+ psf snow. Remote delivery surcharges may apply.”}, {code:”NE”,name:”Nebraska”,wind:”130 mph”,snow:”30 psf”,permit:”2–3 wk”,slot:”3–5 wk”,note:”Tornado Alley, 12-gauge upgrade strongly chosen.”}, {code:”NV”,name:”Nevada”,wind:”100 mph”,snow:”5 psf”,permit:”2–3 wk”,slot:”3–5 wk”,note:”Reflective roof recommended.”}, {code:”NH”,name:”New Hampshire”,wind:”110 mph”,snow:”50 psf”,permit:”3–5 wk”,slot:”5–7 wk”,note:”Northern NH: 65 psf snow.”}, {code:”NJ”,name:”New Jersey”,wind:”130 mph”,snow:”30 psf”,permit:”4–6 wk”,slot:”4–6 wk”,note:”Shore counties: 140 mph wind.”}, {code:”NM”,name:”New Mexico”,wind:”100 mph”,snow:”20 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”High-altitude builds need 35 psf snow load.”}, {code:”NY”,name:”New York”,wind:”120 mph”,snow:”45 psf”,permit:”4–6 wk”,slot:”5–7 wk”,note:”NYC area requires extensive permitting. Upstate: 50–65 psf snow.”}, {code:”NC”,name:”North Carolina”,wind:”140 mph”,snow:”15 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Coastal counties: 150 mph wind cert. Mountain region: 30+ psf snow.”}, {code:”ND”,name:”North Dakota”,wind:”110 mph”,snow:”40 psf”,permit:”2–4 wk”,slot:”4–6 wk”,note:”Severe winters, 12-gauge frame standard, R-19 insulation common.”}, {code:”OH”,name:”Ohio”,wind:”110 mph”,snow:”25 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Standard certification fits statewide.”}, {code:”OK”,name:”Oklahoma”,wind:”140 mph”,snow:”10 psf”,permit:”2–3 wk”,slot:”3–5 wk”,note:”Tornado Alley, 12-gauge frame standard, safe room option available.”}, {code:”OR”,name:”Oregon”,wind:”100 mph”,snow:”35 psf”,permit:”3–5 wk”,slot:”5–7 wk”,note:”Coastal: 110 mph. ADU configuration qualifies for HB 2001 streamlined permitting.”}, {code:”PA”,name:”Pennsylvania”,wind:”110 mph”,snow:”35 psf”,permit:”3–5 wk”,slot:”4–6 wk”,note:”Snow belt counties: 50 psf required.”}, {code:”RI”,name:”Rhode Island”,wind:”130 mph”,snow:”40 psf”,permit:”4–6 wk”,slot:”5–7 wk”,note:”Coastal: 150 mph wind.”}, {code:”SC”,name:”South Carolina”,wind:”140 mph”,snow:”10 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Coastal counties: 150 mph cert required.”}, {code:”SD”,name:”South Dakota”,wind:”120 mph”,snow:”35 psf”,permit:”2–3 wk”,slot:”3–5 wk”,note:”Black Hills region: 50 psf.”}, {code:”TN”,name:”Tennessee”,wind:”130 mph”,snow:”15 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”East TN mountains need 30 psf snow.”}, {code:”TX”,name:”Texas”,wind:”140 mph”,snow:”5 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Coast: 150 mph + windborne debris cert. Panhandle: 130 mph.”}, {code:”UT”,name:”Utah”,wind:”100 mph”,snow:”30 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Mountain counties: 50–65 psf snow.”}, {code:”VT”,name:”Vermont”,wind:”110 mph”,snow:”55 psf”,permit:”3–5 wk”,slot:”5–7 wk”,note:”Heavy snow, 65 psf standard. Insulation strongly recommended.”}, {code:”VA”,name:”Virginia”,wind:”130 mph”,snow:”25 psf”,permit:”2–4 wk”,slot:”3–5 wk”,note:”Tidewater: 140 mph. Blue Ridge: 35 psf snow.”}, {code:”WA”,name:”Washington”,wind:”100 mph”,snow:”25 psf”,permit:”3–5 wk”,slot:”4–6 wk”,note:”Cascade Mountains: 50+ psf snow. ADU permitting streamlined statewide.”}, {code:”WV”,name:”West Virginia”,wind:”110 mph”,snow:”30 psf”,permit:”2–4 wk”,slot:”4–6 wk”,note:”Mountain terrain, site access review required.”}, {code:”WI”,name:”Wisconsin”,wind:”110 mph”,snow:”40 psf”,permit:”3–5 wk”,slot:”4–6 wk”,note:”Northern WI: 60 psf snow load.”}, {code:”WY”,name:”Wyoming”,wind:”130 mph”,snow:”40 psf”,permit:”2–4 wk”,slot:”4–6 wk”,note:”High wind statewide, 12-gauge frame standard.”} ]; let CURRENT = {variant:’garage’, size:’40×60′, height:’9′, color:’slate’, imgIdx:0}; function parseSize(sizeId){const m=sizeId.match(/(d+)x(d+)/);return m?[parseInt(m[1]),parseInt(m[2])]:[20,40];} function setVariant(v, opts){ opts = opts || {}; const data = VARIANTS[v]; if(!data) return; const prevSize = CURRENT.size, prevColor = CURRENT.color; CURRENT.variant = v; if(!opts.preserveSubs){ const matchSize = data.sizes.find(s=>s.id===prevSize); CURRENT.size = matchSize ? matchSize.id : (data.sizes.find(s=>s.current)||data.sizes[0]).id; const matchColor = data.colors.find(c=>c.id===prevColor); CURRENT.color = matchColor ? matchColor.id : (data.colors.find(c=>c.popular)||data.colors[0]).id; CURRENT.height = (data.heights.find(h=>h.current)||data.heights[0]).id; CURRENT.imgIdx = 0; } document.getElementById(‘sx-root’).dataset.variant = v; document.getElementById(‘config-display’).textContent = data.name; document.getElementById(‘hero-tag’).textContent = data.heroTag; document.getElementById(‘sku-id’).textContent = data.sku; document.getElementById(‘units-sold’).textContent = data.units; document.getElementById(‘review-count’).textContent = data.reviews; document.getElementById(‘hero-bullets’)._sxNoClobberInnerHTML = /* pre-rendered hero-bullets */ data.bullets.map(b=>`
`).join(”); document.getElementById(‘urg-count’).textContent = data.urgCount; document.getElementById(‘fp-info-h’).textContent = data.fpInfoH; document.getElementById(‘fp-info-p’).textContent = data.fpInfoP; document.getElementById(‘fp-protip’).innerHTML = data.fpProtip; document.getElementById(‘incl-variant’).textContent = data.name; document.getElementById(‘sx-incl’)._sxNoClobberInnerHTML = /* pre-rendered sx-incl */ data.included.map(i=>`
`).join(”); document.getElementById(‘specs-variant’).textContent = data.name; document.getElementById(‘su-variant’).textContent = data.name; document.getElementById(‘sx-subuses’)._sxNoClobberInnerHTML = /* pre-rendered sx-subuses */ data.subUses.map(s=>`
`).join(”); document.getElementById(‘xsell-variant’).textContent = data.name; document.getElementById(‘sx-xsell’)._sxNoClobberInnerHTML = /* pre-rendered sx-xsell */ data.crosssell.map(x=>`
`).join(”); document.getElementById(‘rv-variant’).textContent = data.name; document.getElementById(‘sx-rel’)._sxNoClobberInnerHTML = /* pre-rendered sx-rel */ data.related.map(r=>`
`).join(”); document.getElementById(‘faq-variant’).textContent = data.name; document.getElementById(‘sx-faqs’)._sxNoClobberInnerHTML = /* pre-rendered sx-faqs */ data.faqs.map((f,i)=>`
${f[0]}
${f[1]}
`).join(”); document.getElementById(‘final-variant’).textContent = data.name; swapGallery(data); renderConfig(data); renderSizes(data); renderHeights(data); renderColors(data); updateSizeDependentContent(); } function updateSizeDependentContent(){ const data = VARIANTS[CURRENT.variant]; const sz = data.sizes.find(s=>s.id===CURRENT.size) || data.sizes[0]; const [w, l] = parseSize(sz.id); const sqft = w * l; const sizeLabel = sz.label; let h1 = data.h1.replace(/20×40|20×40/gi, sizeLabel); if(!h1.includes(‘×’)) h1 = sizeLabel + ‘ ‘ + h1; document.getElementById(‘hero-h1’).innerHTML = h1; let tagline = data.tagline.replace(/20×40|20×40/gi, sizeLabel).replace(/800 sq ft/gi, sqft + ‘ sq ft’); document.getElementById(‘hero-tagline’).textContent = tagline; const variantTitle = h1.replace(/]+>/g,”); document.title = `${variantTitle} | Steel and Stud`; document.getElementById(‘page-title’).textContent = document.title; document.getElementById(‘meta-desc’).setAttribute(‘content’, `${sizeLabel} ${data.name} – ${sqft} sq ft metal building. ${tagline.slice(0,120)}`); document.getElementById(‘bc-variant’).textContent = `${sizeLabel} ${data.breadcrumb}`; document.getElementById(‘url-path’).textContent = `${sizeLabel.toLowerCase().replace(‘×’,’x’)}/${data.slug}`; if(history.replaceState) history.replaceState({variant:CURRENT.variant,size:CURRENT.size},”,`?config=${CURRENT.variant}&size=${CURRENT.size}`); document.getElementById(‘curr-size’).textContent = sizeLabel; document.getElementById(‘curr-name’).textContent = data.name; const fpBuilder = FPSVG_BUILDERS[data.fpKey] || FPSVG_BUILDERS.garage; document.getElementById(‘fp-svg-container’).innerHTML = fpBuilder(w, l, sqft); const sizeRepl = (s) => (s||”).replace(/20 feet wide × 40 feet long/gi, `${w} feet wide × ${l} feet long`).replace(/20×40|20×40/gi, sizeLabel).replace(/800 sq ft/gi, sqft+’ sq ft’); document.getElementById(‘fp-sub’).textContent = sizeRepl(data.fpSub); document.getElementById(‘fp-h2-variant’).textContent = sizeRepl(data.fpH2Variant); document.getElementById(‘fp-info-h’).textContent = sizeRepl(data.fpInfoH); document.getElementById(‘fp-info-p’).textContent = sizeRepl(data.fpInfoP); document.getElementById(‘fp-protip’).innerHTML = sizeRepl(data.fpProtip); const updatedSpecs = data.specs.map(s => { const key = s[0].toLowerCase(); let val = s[1]; if(key.startsWith(‘width’)) val = w + ‘′, 0″’; else if(key.startsWith(‘length’)) val = l + “′ + 6″ overhang”; else if(key === ‘floor space’) val = sqft + ‘ sq ft’; return [s[0], val, s[2]]; }); document.getElementById(‘sx-specs’).innerHTML = `
`).join(”)}
`).join(”)}
`; /* Long-form description */ document.getElementById(‘desc-variant’).textContent = `${sizeLabel} ${data.name}`; document.getElementById(‘sx-desc’)._sxNoClobberInnerHTML = /* pre-rendered sx-desc */ buildDescription(data, sizeLabel, sqft, w, l); /* People Also Ask */ document.getElementById(‘paa-variant’).textContent = data.name; document.getElementById(‘sx-paa’)._sxNoClobberInnerHTML = /* pre-rendered sx-paa */ buildPAA(data, sizeLabel, sqft).map((q,i) => `<details class="sx-paa-q"${i
` ).join(”); /* Schema with Google Merchant Center fields */ const curColor = data.colors.find(c=>c.id===CURRENT.color)||data.colors[0]; document.getElementById(‘sx-schema-product’).textContent = JSON.stringify({ “@context”:”https://schema.org”,”@type”:”Product”, “name”:`${sizeLabel} ${data.name}`,”sku”:data.sku,”mpn”:data.sku, “gtin13″:”0860000″ + data.sku.replace(/D/g,”).padEnd(6,’0′).slice(0,6), “description”:tagline,”image”:data.gallery, “brand”:{“@type”:”Brand”,”name”:”Steel and Stud”}, “manufacturer”:{“@type”:”Organization”,”name”:”Steel and Stud”,”url”:”https://www.steelandstud.com/”}, “category”:”Buildings & Sheds > Garages”, “material”:”Galvanized Steel”,”color”:curColor.name, “weight”:{“@type”:”QuantitativeValue”,”value”:Math.round(sqft*4.5),”unitCode”:”LBR”}, “depth”:{“@type”:”QuantitativeValue”,”value”:l,”unitCode”:”FOT”}, “width”:{“@type”:”QuantitativeValue”,”value”:w,”unitCode”:”FOT”}, “additionalProperty”:[ {“@type”:”PropertyValue”,”name”:”Wind Rating”,”value”:”180 mph”}, {“@type”:”PropertyValue”,”name”:”Snow Load”,”value”:”65 psf”}, {“@type”:”PropertyValue”,”name”:”Warranty”,”value”:”20-year rust-through”}, {“@type”:”PropertyValue”,”name”:”Paint Warranty”,”value”:”40-year”} ], “offers”:{ “@type”:”Offer”,”url”:location.href, “price”:sz.price.toString(),”priceCurrency”:”USD”, “priceValidUntil”:”2026-12-31″,”availability”:”https://schema.org/InStock”, “itemCondition”:”https://schema.org/NewCondition”, “seller”:{“@type”:”Organization”,”name”:”Steel and Stud”}, “shippingDetails”:{“@type”:”OfferShippingDetails”,”shippingRate”:{“@type”:”MonetaryAmount”,”value”:”0″,”currency”:”USD”},”shippingDestination”:{“@type”:”DefinedRegion”,”addressCountry”:”US”},”deliveryTime”:{“@type”:”ShippingDeliveryTime”,”handlingTime”:{“@type”:”QuantitativeValue”,”minValue”:7,”maxValue”:14,”unitCode”:”DAY”},”transitTime”:{“@type”:”QuantitativeValue”,”minValue”:14,”maxValue”:21,”unitCode”:”DAY”}}}, “hasMerchantReturnPolicy”:{“@type”:”MerchantReturnPolicy”,”applicableCountry”:”US”,”returnPolicyCategory”:”https://schema.org/MerchantReturnFiniteReturnWindow”,”merchantReturnDays”:7,”returnMethod”:”https://schema.org/ReturnByMail”,”returnFees”:”https://schema.org/RestockingFees”} } }); document.getElementById(‘sx-schema-faq’).textContent = JSON.stringify({ “@context”:”https://schema.org”,”@type”:”FAQPage”, “mainEntity”:data.faqs.map(f=>({“@type”:”Question”,”name”:f[0],”acceptedAnswer”:{“@type”:”Answer”,”text”:f[1].replace(/]+>/g,”)}})) }); recalcPrice(); trackRecentlyViewed(data, sizeLabel); renderRecentlyViewed(); } function buildPAA(data, sizeLabel, sqft){ const [w,l] = parseSize(CURRENT.size); return [ [`How much does a ${sizeLabel} ${data.name.toLowerCase()} cost?`, `A ${sizeLabel} ${data.name.toLowerCase()} starts at $${data.price.toLocaleString()} for the base build with free delivery and installation included. Fully-outfitted with the 12-gauge frame, R-19 insulation, walk-in door, and additional windows typically brings the total to $${Math.round(data.price * 1.45).toLocaleString()}–$${Math.round(data.price * 1.65).toLocaleString()}. Most buyers finance with $0 down rent-to-own for around $${data.monthly}/month.`], [`Is a ${sizeLabel} metal garage better than wood construction?`, `Yes, for cost, longevity, and maintenance. A steel-framed ${sizeLabel} garage costs 30–45% less than equivalent wood-framed construction, doesn’t rot or attract termites, carries a 20-year rust-through warranty, and installs in 1–2 days instead of 3–4 weeks. Steel also resists fire, wind, and snow load significantly better than wood at the same price point.`], [`Do I need a building permit for a ${sqft} sq ft metal building?`, `Almost always. Buildings over 200 sq ft require an accessory building permit in most U.S. counties. We email engineered drawings stamped for your wind and snow zone at no charge, you file these with your local building department. Permit timing varies 2–6 weeks by jurisdiction.`], [`What foundation does a ${sizeLabel} metal building need?`, `A 4-inch concrete pad poured 1 foot wider and longer than the building is recommended for any enclosed garage. For your ${sizeLabel}, that’s a ${w+1}′ × ${l+1}′ × 4″ slab. We can also anchor to asphalt or compacted gravel for carport uses. Concrete pour typically costs $2,400–$3,200; bundled pad pour available for $2,890.`], [`How long does a metal garage actually last?`, `A properly anchored Steel and Stud metal garage is engineered for a 50+ year service life. The galvanized steel frame carries a 20-year rust-through warranty, factory-baked paint carries a 40-year warranty, and panels are warranted against perforation. Industry data shows steel buildings outlast wood-framed by 2–3× before requiring major repair.`], [`Can I get financing without a credit check for a ${sizeLabel} garage?`, `Yes. Our rent-to-own partner TimePayment does not pull credit. Provide ID, proof of income (2 pay stubs), and your first month’s payment. Approvals typically happen within 8 minutes. Spread payments across 36–60 months, no balloon, no early-payoff penalty. Typical RTO payment on your ${sizeLabel}: $${data.monthly}/month.`], [`How fast can I get a metal garage installed?`, `Standard lead time is 3–5 weeks from order to installation. Fabrication, free regional delivery, and installation by our certified crew in 1–2 days on a prepared pad. Rush delivery (1–2 weeks) is available in some metros for $345.`], [`Will a ${sizeLabel} metal building meet HOA / county requirements?`, `In most cases yes. Our engineered drawings meet IRC and IBC standards for accessory buildings. Many HOAs accept the standard metal exterior; some require dimensional trim or matching house color (we color-match). Most counties have 12–15 ft height limits, fine for standard 9–10 ft wall builds.`] ]; } function buildDescription(data, sizeLabel, sqft, w, l){ const v = data.name.toLowerCase(); return `
Engineered for your county
Every ${sizeLabel} ${v} is fabricated from American-rolled galvanized steel and engineered against the exact wind and snow loads your jurisdiction requires.
- Standard: 140 mph wind / 35 psf snow
- 12-ga upgrade: 180 mph / 65 psf
- Permit drawings stamped and emailed free
Construction details
The same materials commercial fabricators use, not residential-grade. Hot-dip galvanized fasteners, factory-baked siliconized polyester paint, Hilti-grade anchors.
- Frame: 14-ga (12-ga upgrade) galvanized tubing
- Panels: 29-ga G-90 (26-ga upgrade)
- Fasteners: #14 self-drilling with EPDM washer
Free delivery & install, really free
Regional-route delivery plus 1–2 day on-site installation by a certified crew, bundled into your headline price. No hidden unloading fees, fuel surcharges, or site-prep charges.
- $0 deposit · pay only after walkthrough sign-off
- 3–5 week lead time on regional routes
- All 48 states · rush option available
Warranty & lifespan
Three independent warranties cover the structure, the finish, and the workmanship, and the practical service life of the building exceeds them all.
- 20-yr rust-through warranty on frame & panels
- 40-yr paint warranty against fading + chalking
- 1-yr craftsmanship on installation
$0-down financing
Three financing paths to fit any credit situation. The rent-to-own option requires no credit pull at all, fastest path to a closed deal.
- RTO: $${data.monthly}/mo, no credit check, 36–60 mo
- Financing: 0% promo APR · 84 mo term
- Cash discount: 4% on $10K+ orders
Why ${sizeLabel}?
${sqft} sq ft sits in the sweet spot for residential and light-commercial, fits standard quarter-acre setbacks, comfortably below the 1,000 sq ft municipal threshold that triggers extra inspections.
- ${w}′ × ${l}′ footprint with ${sqft} sq ft interior
- Permit-friendly in 96% of US counties
- Resale ROI $${Math.round(sqft*8).toLocaleString()}–$${Math.round(sqft*12).toLocaleString()} added home value
`; } function renderConfig(data){ /* SX use-case-products: cards are pre-rendered static HTML; no-op. */ } function swapGallery(data){ const main = document.getElementById(‘sx-gallery-main’); const img = document.getElementById(‘hero-img’); main.classList.add(‘swapping’); setTimeout(()=>{ img.src = data.gallery[CURRENT.imgIdx] || data.gallery[0]; img.alt = `${data.name} – view ${CURRENT.imgIdx + 1}`; main.classList.remove(‘swapping’); }, 200); document.getElementById(‘sx-gallery-thumbs’)._sxNoClobberInnerHTML = /* pre-rendered sx-gallery-thumbs */ data.gallery.map((src,i)=>`
`).join(”); } function selectImage(i){CURRENT.imgIdx = i; swapGallery(VARIANTS[CURRENT.variant]);} function renderSizes(data){ document.getElementById(‘sx-sizes’)._sxNoClobberInnerHTML = /* pre-rendered sx-sizes */ data.sizes.map(s=>`
`).join(”); document.getElementById(‘size-display’).textContent = (data.sizes.find(s=>s.id===CURRENT.size)||data.sizes[0]).label; } function selectSize(sizeId){ CURRENT.size = sizeId; document.getElementById(‘size-display’).textContent = VARIANTS[CURRENT.variant].sizes.find(s=>s.id===sizeId).label; document.querySelectorAll(‘.sx-sz’).forEach(el=>el.classList.toggle(‘active’, el.dataset.size===sizeId)); updateSizeDependentContent(); } function renderHeights(data){ document.getElementById(‘sx-heights’)._sxNoClobberInnerHTML = /* pre-rendered sx-heights */ data.heights.map(h=>`
`).join(”); document.getElementById(‘height-display’).textContent = (data.heights.find(h=>h.id===CURRENT.height)||data.heights[0]).label; } function selectHeight(hId){ CURRENT.height = hId; document.getElementById(‘height-display’).textContent = VARIANTS[CURRENT.variant].heights.find(h=>h.id===hId).label; document.querySelectorAll(‘.sx-hg’).forEach(el=>el.classList.toggle(‘active’, el.dataset.h===hId)); recalcPrice(); } function renderColors(data){ document.getElementById(‘sx-colors’)._sxNoClobberInnerHTML = /* pre-rendered sx-colors */ data.colors.map(c=>`${c.popular?’★‘:”}`).join(”) + ``; const curC = data.colors.find(c=>c.id===CURRENT.color) || data.colors[0]; document.getElementById(‘color-display’).textContent = curC.name; document.getElementById(‘curr-color’).textContent = curC.name; document.getElementById(‘curr-color-swatch’).style.background = curC.hex; document.getElementById(‘color-name-display’).textContent = curC.name; applyColorOverlay(curC.hex); } function selectColor(cId){ CURRENT.color = cId; const sel = VARIANTS[CURRENT.variant].colors.find(c=>c.id===cId); if(sel){ document.getElementById(‘color-display’).textContent = sel.name; document.getElementById(‘curr-color’).textContent = sel.name; document.getElementById(‘curr-color-swatch’).style.background = sel.hex; document.getElementById(‘color-name-display’).textContent = sel.name; document.querySelectorAll(‘.sx-cg’).forEach(el=>el.classList.toggle(‘active’, el.dataset.c===cId)); applyColorOverlay(sel.hex); } } function applyColorOverlay(hex){ const ov = document.getElementById(‘sx-color-overlay’); if(ov){ const r=parseInt(hex.substr(1,2),16),g=parseInt(hex.substr(3,2),16),b=parseInt(hex.substr(5,2),16); const brightness=(r+g+b)/3; ov.style.background=hex; ov.style.opacity=brightness<80?0.65:brightness<140?0.5:brightnesss.id===CURRENT.size) || data.sizes[0]; const ht = data.heights.find(h=>h.id===CURRENT.height) || data.heights[0]; const basePrice = sz.price, heightUp = ht.price || 0; /* Sum all customize-option upcharges (recovered from audit) */ const optTotal = Object.values(CURRENT.options||{}).reduce((s,o)=>s+(o && o.p ? o.p : 0),0); const total = basePrice + heightUp + optTotal; const wasPrice = Math.round(total * 1.14); const save = wasPrice – total; const monthly = Math.round(total / 60 + 18); const priceEl = document.getElementById(‘price-now’); priceEl.textContent = ‘$’ + total.toLocaleString(); priceEl.classList.remove(‘pulse’); void priceEl.offsetWidth; priceEl.classList.add(‘pulse’); document.getElementById(‘price-was’).textContent = ‘$’ + wasPrice.toLocaleString(); document.getElementById(‘price-save’).textContent = ‘Save $’ + save.toLocaleString(); document.getElementById(‘price-mo’).textContent = ‘$’ + monthly + ‘/mo’; let bd = `Base ${sz.label}: $${basePrice.toLocaleString()}`; if(heightUp > 0) bd += `${ht.label} walls: +$${heightUp.toLocaleString()}`; bd += `Free install & delivery`; document.getElementById(‘price-breakdown’).innerHTML = bd; /* ─── Sync sticky bottom CTA bar (fires for every config / size / wall-height / option change) ─── */ const skName = document.getElementById(‘sticky-name’); if(skName) skName.textContent = `${sz.label} ${data.name}`; const skPrice = document.getElementById(‘sticky-price’); if(skPrice) skPrice.textContent = ‘$’ + total.toLocaleString(); const skWas = document.getElementById(‘sticky-was’); if(skWas) skWas.textContent = ‘$’ + wasPrice.toLocaleString(); const skSave = document.getElementById(‘sticky-save’); if(skSave) skSave.textContent = ‘$’ + save.toLocaleString(); const skMo = document.getElementById(‘sticky-mo’); if(skMo) skMo.textContent = ‘$’ + monthly + ‘/mo’; } function renderStates(){ document.getElementById(‘sx-states’).innerHTML = STATES.map(s => `
` ).join(”); } function showState(code){ const s = STATES.find(x=>x.code===code); if(!s) return; document.querySelectorAll(‘.sx-st’).forEach(el => el.classList.toggle(‘active’, el.dataset.st===code)); const data = VARIANTS[CURRENT.variant]; const sizeLabel = (data.sizes.find(sz=>sz.id===CURRENT.size)||data.sizes[0]).label; const detail = document.getElementById(‘sx-state-detail’); detail.classList.add(‘show’); detail.innerHTML = `
`; } function trackRecentlyViewed(data, sizeLabel){ try { let recent = JSON.parse(localStorage.getItem(‘sx_recent’) || ‘[]’); const id = `${CURRENT.variant}-${CURRENT.size}`; recent = recent.filter(r => r.id !== id); recent.unshift({id,variant:CURRENT.variant,size:CURRENT.size,name:data.name,sizeLabel,price:(data.sizes.find(s=>s.id===CURRENT.size)||data.sizes[0]).price,img:data.gallery[0],ts:Date.now()}); recent = recent.slice(0, 8); localStorage.setItem(‘sx_recent’, JSON.stringify(recent)); } catch(e){} } function renderRecentlyViewed(){ try { const recent = JSON.parse(localStorage.getItem(‘sx_recent’) || ‘[]’); const current = `${CURRENT.variant}-${CURRENT.size}`; const filtered = recent.filter(r => r.id !== current).slice(0, 4); const section = document.getElementById(‘recent’); if(filtered.length === 0){section.style.display=’none’;return;} section.style.display = ”; const fmtTime = (ts) => { const m = Math.floor((Date.now() – ts) / 60000); if(m < 1) return 'Just now'; if(m < 60) return m + 'm ago'; const h = Math.floor(m/60); if(h `
`).join(”); } catch(e){} } /* === RECOVERED: customize-option click handlers (were missing from on-disk file) === */ function initOptionPills(){ document.querySelectorAll(‘.sx-opt-pill’).forEach(btn => { btn.onclick = () => { const opt = btn.dataset.opt; const v = btn.dataset.v; const p = parseInt(btn.dataset.p || ‘0’, 10) || 0; /* Capture a clean label from the button (strip price suffix and “(included)” markers) */ const raw = (btn.textContent || ”).trim(); const label = raw.replace(/[+-]?$[d,]+/g,”).replace(/(included)/gi,”).replace(/s+/g,’ ‘).trim(); CURRENT.options = CURRENT.options || {}; CURRENT.options[opt] = { v: v, p: p, label: label }; /* Toggle active class within this option group */ document.querySelectorAll(‘.sx-opt-pill[data-opt=”‘+opt+'”]’).forEach(el => { el.classList.toggle(‘active’, el === btn); }); if (typeof updateCustomizationSummary === ‘function’) updateCustomizationSummary(); if (typeof recalcPrice === ‘function’) recalcPrice(); /* Also sync sticky bar */ try { const total = (function(){ const data = VARIANTS[CURRENT.variant]; const sz = data.sizes.find(s=>s.id===CURRENT.size) || data.sizes[0]; const ht = data.heights.find(h=>h.id===CURRENT.height) || data.heights[0]; const optT = Object.values(CURRENT.options||{}).reduce((s,o)=>s+(o&&o.p?o.p:0),0); return sz.price + (ht.price||0) + optT; })(); const skp = document.getElementById(‘sticky-price’); if (skp) skp.textContent = ‘$’ + total.toLocaleString(); const skw = document.getElementById(‘sticky-was’); if (skw) skw.textContent = ‘$’ + Math.round(total*1.14).toLocaleString(); const sks = document.getElementById(‘sticky-save’); if (sks) sks.textContent = ‘$’ + (Math.round(total*1.14) – total).toLocaleString(); const skm = document.getElementById(‘sticky-mo’); if (skm) skm.textContent = ‘$’ + Math.round(total/60 + 18) + ‘/mo’; } catch(e) { console.warn(‘[sx26] sticky sync skipped:’, e); } }; }); } function updateCustomizationSummary(){ const itemsEl = document.getElementById(‘sx-cust-summary-items’); const subEl = document.getElementById(‘sx-cust-subtotal’); const items = Object.entries(CURRENT.options || {}) .filter(([k,v]) => v && v.p !== 0) .map(([k,v]) => ({ label: v.label, p: v.p, k: k })); const subTotal = items.reduce((s,i) => s + i.p, 0); if (itemsEl) { if (items.length === 0) { itemsEl.innerHTML = ‘No upgrades, base build‘; } else { itemsEl.innerHTML = items.map(i => ‘ 0 ? ‘ upgrade’ : ”) + ‘”>’ + i.label + ‘ ‘ + (i.p > 0 ? ‘+’ : ”) + ‘$’ + i.p.toLocaleString() + ‘‘ ).join(”); } } if (subEl) subEl.textContent = (subTotal >= 0 ? ‘+’ : ‘-‘) + ‘$’ + Math.abs(subTotal).toLocaleString(); } document.addEventListener(‘DOMContentLoaded’, () => { renderStates(); showState(‘TX’); const params = new URLSearchParams(location.search); const v = params.get(‘config’); const initSize = params.get(‘size’); setVariant(‘living’); if(initSize){ const sizeExists = VARIANTS[CURRENT.variant].sizes.find(s=>s.id===initSize); if(sizeExists){CURRENT.size=initSize;renderSizes(VARIANTS[CURRENT.variant]);updateSizeDependentContent();} } /* === RECOVERED: bind customize-option pill clicks and prime summary === */ if (typeof initOptionPills === ‘function’) initOptionPills(); if (typeof updateCustomizationSummary === ‘function’) updateCustomizationSummary(); window.addEventListener(‘popstate’, () => { const p = new URLSearchParams(location.search); const cv = p.get(‘config’); if(cv && VARIANTS[cv]) setVariant(cv); }); /* === RECOVERED: sticky bottom CTA scroll handler (removed in late session edit) === */ try { var __stickyEl = document.getElementById(‘sx-sticky-cta’); var __galleryMain = document.getElementById(‘sx-gallery-main’); var __lastImgChange = 0; var __handleScroll = function() { if (__stickyEl && __stickyEl.classList) { if (window.scrollY > 500) __stickyEl.classList.add(‘show’); else __stickyEl.classList.remove(‘show’); } /* Optional scroll-rotation of hero gallery while pinned */ var hero = document.querySelector(‘.sx-hero’); if (hero && __galleryMain && typeof VARIANTS !== ‘undefined’ && typeof CURRENT !== ‘undefined’) { var heroRect = hero.getBoundingClientRect(); if (heroRect.bottom > 200 && heroRect.top 800) { var heroHeight = hero.offsetHeight; var progress = Math.min(1, Math.max(0, (100 – heroRect.top) / heroHeight)); var newIdx = Math.min(data.gallery.length – 1, Math.floor(progress * data.gallery.length)); if (newIdx !== CURRENT.imgIdx) { CURRENT.imgIdx = newIdx; if (typeof swapGallery === ‘function’) swapGallery(data); __lastImgChange = Date.now(); } } } } }; window.addEventListener(‘scroll’, __handleScroll, { passive: true }); __handleScroll(); } catch(e) { console.warn(‘[sx26 recovery] sticky CTA scroll handler failed:’, e); } });






















































































































































