/* ProductLightbox — modal de detalle de producto. Se abre al hacer click en cualquier foto del portafolio. Cierra con ESC, click en el backdrop o botón X. Lee la ficha desde window.productData. */ const ProductLightbox = ({ src, onClose, t, lang }) => { const data = src ? window.productData?.[src] : null; const open = Boolean(data); // ESC para cerrar + bloquear scroll del body React.useEffect(() => { if (!open) return; const onKey = (e) => { if (e.key === 'Escape') onClose(); }; document.addEventListener('keydown', onKey); const prev = document.body.style.overflow; document.body.style.overflow = 'hidden'; return () => { document.removeEventListener('keydown', onKey); document.body.style.overflow = prev; }; }, [open, onClose]); if (!open) return null; const pick = (field) => { if (!field) return ''; if (typeof field === 'string') return field; return field[lang] || field.es || ''; }; return (
e.stopPropagation()} className="lightbox-card" style={{ background: 'var(--bg-1)', color: 'var(--ink)', width: 'min(1200px, 100%)', maxHeight: 'calc(100vh - 48px)', display: 'grid', gridTemplateColumns: 'minmax(0, 1.2fr) minmax(0, 1fr)', overflow: 'hidden', position: 'relative', border: '1px solid var(--hairline)', boxShadow: '0 30px 80px rgba(0,0,0,0.5)', }} > {/* Botón cerrar */} {/* Imagen */}
{pick(data.title)}
{pick(data.category)} {data.measures && ( {data.measures} )}
{/* Ficha */}
{t('FICHA · ACEROLAB', 'PRODUCT · ACEROLAB')}

{pick(data.title)}

{[ { l: t('Cliente', 'Client'), v: pick(data.client) }, { l: t('Medidas', 'Measurements'), v: data.measures || '—' }, { l: t('Material', 'Material'), v: pick(data.material) }, { l: t('Acabado', 'Finish'), v: pick(data.finish) }, ].map((row, i) => (
{row.l.toUpperCase()}
{row.v || '—'}
))}
{t('DESCRIPCIÓN DEL TRABAJO', 'PROJECT DESCRIPTION')}

{pick(data.description)}

{data.highlights && (
{t('CARACTERÍSTICAS', 'KEY FEATURES')}
    {(data.highlights[lang] || data.highlights.es || []).map((h, i) => (
  • {h}
  • ))}
)}
{t('Cotizar similar', 'Quote similar')}
); }; window.ProductLightbox = ProductLightbox;