// WineCard.jsx — wine product card in the grid // Editorial premium feel; neutral bottle silhouette on dark plinth, then meta beneath. const WineCard = ({ wine, showPrices, onClick, selectionMode, selected, onToggleSelect }) => { // Vary bottle tone slightly by wine type to add subtle visual rhythm // (still a single silhouette, just glass tint). Set to 'green' for pure consistency. const toneByType = (t) => { const k = (t || '').toLowerCase(); if (k.includes('blanc') || k.includes('espumo')) return 'clear'; if (k.includes('rosado') || k.includes('rosé')) return 'rose'; if (k.includes('dulce') || k.includes('generoso')) return 'brown'; return 'green'; }; const tone = toneByType(wine.tipo); return (
{if (!selected) e.currentTarget.style.borderColor = '#4A4A48';}} onMouseLeave={(e) => {e.currentTarget.style.borderColor = selected ? 'var(--comesa-red)' : 'var(--card-border, #2A2A28)';}}> {/* Selected badge — click to remove */} {selectionMode && selected && } {/* Bottle stage — real photos come on a white background, so the stage itself goes white for those (no dark frame around the photo); the vector BottleArt placeholder keeps its dark backdrop, which is what it was designed for. */}
{/* Spotlight — dark-stage only */} {!wine.imagen &&
} {/* Tipo badge */} {wine.tipo && {wine.tipo} } {/* Año */} {wine.anada && {wine.anada} } {wine.imagen ? {wine.nombre} : }
{/* Meta */}
{wine.bodega}

{wine.nombre}

{[wine.do, wine.region].filter(Boolean).join(' · ')}
{wine.variedad &&
{wine.variedad}
} {/* Price row */}
{showPrices ? : Ficha técnica } Ver
{/* Add to custom catalog */} {selectionMode && }
); }; const PriceBlock = ({ wine, compact = false }) => { const hasReal = !!wine.precio; const bottle = hasReal ? wine.precio : wine.precioDemo; const caja = wine.precioDemoCaja; const formatEur = (v) => { if (!v) return '—'; const n = parseFloat(String(v).replace(',', '.')); if (isNaN(n)) return v; return n.toFixed(2).replace('.', ',') + ' €'; }; return (
Botella · 75 cl {formatEur(bottle)} {!compact && caja && Caja x6 · {formatEur(caja)} }
); }; window.WineCard = WineCard; window.PriceBlock = PriceBlock;