/* booking-home.jsx — hero mini-selector + home Reservar section The home Reservar section now embeds the real Smoobu widget so guests can book directly from the landing page. Bilingual via useT. */ /* global React, useT */ // ============ MINI SELECTOR (HERO) ============ // Lightweight teaser: 3 fields → jumps to #reservar (Smoobu widget below). function MiniBookingBar() { const { t } = useT(); const { useState } = React; const today = new Date().toISOString().slice(0,10); const addDays = (iso, n) => { const d = new Date(iso); d.setDate(d.getDate() + n); return d.toISOString().slice(0,10); }; const [ci, setCi] = useState(today); const [co, setCo] = useState(addDays(today, 2)); const [g, setG] = useState(2); const submit = () => { // 1) Hand the selection to the embedded booking widget so it re-renders // with the user's dates / guest count already filled in. window.dispatchEvent(new CustomEvent('booking:prefill', { detail: { checkIn: ci, checkOut: co, adults: g }, })); // 2) Smooth-scroll to the widget. We avoid scrollIntoView here because it // can misbehave inside framed editors; window.scrollTo is reliable. const el = document.getElementById('reservar'); if (el) { const top = el.getBoundingClientRect().top + window.pageYOffset - 8; window.scrollTo({ top, behavior: 'smooth' }); } }; const lbl = { fontFamily:'Montserrat, sans-serif', fontSize:10, fontWeight:700, letterSpacing:'.18em', textTransform:'uppercase', color:'#9A9A9A', display:'block', marginBottom:4 }; const inp = { width:'100%', border:'none', background:'transparent', padding:0, fontFamily:'Inter, sans-serif', fontSize:15, fontWeight:600, color:'#1A1A1A', outline:'none', cursor:'pointer' }; const cell = { padding:'14px 18px', borderRight:'1px solid #ECECEC', minWidth:130 }; return (
{t('rs_p')}