/* ========================================================= Secciones mid (rev. usuario): - Sec 4: Cinco razones honestas (IA en el centro) - Sec 5: Zonas - Sec 6: CEO Isaac Ruiz (con foto y badges) - Sec 7: Viviendas destacadas - Sec 8: Propiedades (tabs + grid) ========================================================= */ /* ---------- Sec 4: 5 razones honestas — IA en el centro ---------- */ function Differentiators() { return (
{t("home.differentiators.eyebrow")}

{t("home.differentiators.intro")}

01

{t("home.differentiators.card1_title")}

{t("home.differentiators.card1_desc")}

02

{t("home.differentiators.card2_title")}

{t("home.differentiators.card2_desc")}

{/* Centro: tarjeta IA (razón estrella) */}
{t("home.differentiators.ia_badge")}

{t("home.differentiators.ia_title")}

{t("home.differentiators.ia_desc")}

{t("home.differentiators.ia_robot_alt")}
03

{t("home.differentiators.card3_title")}

{t("home.differentiators.card3_desc")}

04

{t("home.differentiators.card4_title")}

{t("home.differentiators.card4_desc")}

); } /* ---------- Sec 5: Zonas (tiles con banda navy) ---------- */ const ZONES = [ { slug: "playa-del-cura", name: "Playa del Cura", n: 12, img: "/assets/zone-playa-cura.jpg" }, { slug: "punta-prima", name: "Punta Prima", n: 8, img: "/assets/zone-punta-prima.jpg" }, { slug: "playa-de-la-mata", name: "Playa de la Mata", n: 9, img: "/assets/zone-playa-mata.jpg" }, { slug: "torrevieja-centro", name: "Torrevieja Centro", n: 15, img: "/assets/zone-torrevieja-centro.jpeg" }, { slug: "los-balcones", name: "Los Balcones", n: 6, img: "https://images.unsplash.com/photo-1600585154340-be6161a56a0c?auto=format&fit=crop&w=900&q=80" }, { slug: "los-frutales", name: "Los Frutales", n: 4, img: "https://images.unsplash.com/photo-1582719508461-905c673771fd?auto=format&fit=crop&w=900&q=80" }]; function Zones() { const [active, setActive] = useState(0); return (
{t("home.zones.eyebrow")}

{t("home.zones.intro")}

{ZONES.map((z, i) => { const descKey = "home.zones.desc_" + z.slug.replace(/-/g, "_"); const countKey = z.n === 1 ? "home.zones.count_one" : "home.zones.count_other"; return ( setActive(i)} onFocus={() => setActive(i)} style={{ backgroundImage: `url(${z.img})` }}> ); })}
); } /* ---------- Sec 6: CEO Isaac Ruiz ---------- */ function CEOSection() { const ref = useRef(null); const [visible, setVisible] = useState(false); useEffect(() => { const el = ref.current; if (!el || visible) return; const obs = new IntersectionObserver((entries) => { entries.forEach((e) => { if (e.isIntersecting) { setVisible(true); obs.disconnect(); } }); }, { threshold: 0.2 }); obs.observe(el); return () => obs.disconnect(); }, [visible]); return (
{t("home.ceo.eyebrow")}

{t("home.ceo.quote")}

Isaac Ruiz {t("home.ceo.author_role")}
{t("home.ceo.cred_ua")}
{t("home.ceo.cred_crs")}
{t("home.ceo.cred_apial")}

); } /* ---------- Property card ---------- */ function PropCard({ p }) { const href = `vivienda.html${p.ref ? `?ref=${encodeURIComponent(p.ref)}` : ""}`; const tagKey = p.tag === "IA optimizado" ? "home.propCard.tag_ai" : p.tag === "Destacado" ? "home.propCard.tag_featured" : p.tag === "Nuevo" ? "home.propCard.tag_new" : null; const tagText = tagKey ? t(tagKey) : p.tag; return (
{p.title}
{p.tag === "IA optimizado" ? {tagText} : p.tag === "Destacado" ? {tagText} : {tagText} } {t("home.propCard.tag_sale")}

{p.title}

{p.location}
{t("home.propCard.spec_beds", { n: p.beds })} {t(p.baths === 1 ? "home.propCard.spec_baths_one" : "home.propCard.spec_baths_other", { n: p.baths })} {t("home.propCard.spec_area", { n: p.area })}
{p.price}
); } /* ---------- Sec 7: Viviendas destacadas ---------- */ const FEATURED = [ { titleKey: "home.properties.f1_title", location: "Cabo Roig, Orihuela Costa", img: "https://images.unsplash.com/photo-1613490493576-7fde63acd811?auto=format&fit=crop&w=900&q=80", tag: "Destacado", price: "895.000 €", beds: 4, baths: 3, area: 280 }, { titleKey: "home.properties.f2_title", location: "La Zenia, Orihuela Costa", img: "https://images.unsplash.com/photo-1502672260266-1c1ef2d93688?auto=format&fit=crop&w=900&q=80", tag: "Nuevo", price: "265.000 €", beds: 3, baths: 2, area: 95 }, { titleKey: "home.properties.f3_title", locationKey: "home.properties.loc_torrevieja_centro", img: "https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?auto=format&fit=crop&w=900&q=80", tag: "IA optimizado", price: "320.000 €", beds: 2, baths: 2, area: 110 }, { titleKey: "home.properties.f4_title", location: "Punta Prima, Torrevieja", img: "https://images.unsplash.com/photo-1564013799919-ab600027ffc6?auto=format&fit=crop&w=900&q=80", tag: "Destacado", price: "650.000 €", beds: 4, baths: 3, area: 210 }, { titleKey: "home.properties.f5_title", location: "Playa del Cura, Torrevieja", img: "https://images.unsplash.com/photo-1493809842364-78817add7ffb?auto=format&fit=crop&w=900&q=80", tag: "Nuevo", price: "215.000 €", beds: 2, baths: 1, area: 82 }, { titleKey: "home.properties.f6_title", location: "Playa de la Mata, Torrevieja", img: "https://images.unsplash.com/photo-1512917774080-9991f1c4c750?auto=format&fit=crop&w=900&q=80", tag: "IA optimizado", price: "535.000 €", beds: 5, baths: 3, area: 245 }].map((p) => ({ ...p, title: t(p.titleKey), location: p.locationKey ? t(p.locationKey) : p.location })); function DiscoverSpecial() { const VISIBLE = 3; const N = FEATURED.length; const items = [...FEATURED, ...FEATURED.slice(0, VISIBLE)]; const [start, setStart] = useState(0); const [withTransition, setWithTransition] = useState(true); const viewportRef = useRef(null); const [cardW, setCardW] = useState(0); const gap = 28; useEffect(() => { const update = () => { if (!viewportRef.current) return; const w = viewportRef.current.offsetWidth; const perView = window.innerWidth >= 1100 ? VISIBLE : window.innerWidth >= 700 ? 2 : 1; setCardW((w - gap * (perView - 1)) / perView); }; update(); window.addEventListener("resize", update); return () => window.removeEventListener("resize", update); }, []); useEffect(() => { if (start === N) { const t = setTimeout(() => { setWithTransition(false); setStart(0); }, 500); return () => clearTimeout(t); } if (!withTransition) { const t = setTimeout(() => setWithTransition(true), 50); return () => clearTimeout(t); } }, [start, withTransition]); const next = () => { if (!withTransition) return; setStart((s) => Math.min(s + 1, N)); }; const prev = () => { if (!withTransition) return; if (start === 0) { setWithTransition(false); setStart(N); setTimeout(() => { setWithTransition(true); setStart(N - 1); }, 60); } else { setStart((s) => s - 1); } }; const trackOffset = -start * (cardW + gap); const activeDot = start % N; return (
{t("home.discoverSpecial.eyebrow")}

{t("home.discoverSpecial.intro")}

{items.map((p, i) =>
0 ? cardW + "px" : "100%" }}>
)}
{FEATURED.map((_, i) => )}
); } /* ---------- Sec 8: Propiedades (tabs + grid) ---------- */ const TAB_KEYS = [ { key: "all", i18n: "home.latestListings.tab_all" }, { key: "villas", i18n: "home.latestListings.tab_villas" }, { key: "apartments", i18n: "home.latestListings.tab_apartments" }, { key: "penthouses", i18n: "home.latestListings.tab_penthouses" }, { key: "bungalows", i18n: "home.latestListings.tab_bungalows" }, { key: "townhouses", i18n: "home.latestListings.tab_townhouses" } ]; const LISTINGS = [ { ref: "INV-2001", titleKey: "home.properties.l1_title", location: "Los Balcones, Torrevieja", img: "https://images.unsplash.com/photo-1600596542815-ffad4c1539a9?auto=format&fit=crop&w=900&q=80", tag: "Destacado", price: "560.000 €", beds: 4, baths: 3, area: 220 }, { ref: "INV-2002", titleKey: "home.properties.l2_title", location: "Punta Prima, Orihuela Costa", img: "https://images.unsplash.com/photo-1502672023488-70e25813eb80?auto=format&fit=crop&w=900&q=80", tag: "Nuevo", price: "189.000 €", beds: 2, baths: 1, area: 78 }, { ref: "INV-2003", titleKey: "home.properties.l3_title", location: "Villamartín, Orihuela Costa", img: "https://images.unsplash.com/photo-1568605114967-8130f3a36994?auto=format&fit=crop&w=900&q=80", tag: "IA optimizado", price: "298.000 €", beds: 3, baths: 2, area: 130 }, { ref: "INV-2004", titleKey: "home.properties.l4_title", location: "Playa Flamenca, Orihuela Costa", img: "https://images.unsplash.com/photo-1600585154526-990dced4db0d?auto=format&fit=crop&w=900&q=80", tag: "Destacado", price: "725.000 €", beds: 5, baths: 4, area: 310 }, { ref: "INV-2005", titleKey: "home.properties.l5_title", location: "La Zenia, Orihuela Costa", img: "https://images.unsplash.com/photo-1600607687939-ce8a6c25118c?auto=format&fit=crop&w=900&q=80", tag: "Nuevo", price: "395.000 €", beds: 3, baths: 2, area: 125 }, { ref: "INV-2006", titleKey: "home.properties.l6_title", locationKey: "home.properties.loc_torrevieja", img: "https://images.unsplash.com/photo-1600585154363-67eb9e2e2099?auto=format&fit=crop&w=900&q=80", tag: "IA optimizado", price: "165.000 €", beds: 2, baths: 1, area: 70 }].map((p) => ({ ...p, title: t(p.titleKey), location: p.locationKey ? t(p.locationKey) : p.location })); function LatestListings() { const [tab, setTab] = useState(TAB_KEYS[0].key); return (
{t("home.latestListings.eyebrow")}

{t("home.latestListings.intro")}

{TAB_KEYS.map((tk) => )}
{LISTINGS.map((p, i) => )}
); } Object.assign(window, { Differentiators, Zones, CEOSection, DiscoverSpecial, LatestListings, PropCard });