// Product detail drawer + Cart drawer
function ProductDetail({ product, onClose, onAdd }) {
const [size, setSize] = React.useState('4–5Y');
const [color, setColor] = React.useState(0);
if (!product) return null;
const sizes = ['2–3Y', '4–5Y', '6–7Y', '8–9Y'];
const colors = [
{ name: 'dune', hex: '#E0C998' },
{ name: 'tide', hex: '#9CA5A7' },
{ name: 'clay', hex: '#C9998A' },
];
return (
{product.tag && {product.tag}}
unisex
{product.sub.split(' · ')[1] || ''}
{product.name}
${product.price}.00
heavyweight 280gsm cotton linen. sewn in portugal. softer after every wash. built for the second kid, too.
color — {colors[color].name}
{colors.map((c, i) => (
setColor(i)} style={{
width: 44, height: 44, borderRadius: 999, background: c.hex,
boxShadow: color === i ? '0 0 0 2px var(--sand-100), 0 0 0 3px var(--tide-600)' : 'none',
cursor: 'pointer', transition: 'box-shadow var(--dur-fast) var(--ease-out)',
}} />
))}
size
size guide
{sizes.map(s => (
setSize(s)} style={{
padding: '14px 0', textAlign: 'center',
border: size === s ? '1px solid var(--tide-600)' : '1px solid rgba(74,58,36,0.12)',
borderRadius: 8,
background: size === s ? 'var(--sand-50)' : 'transparent',
fontSize: 14, color: 'var(--tide-700)', cursor: 'pointer',
transition: 'all var(--dur-fast) var(--ease-out)',
}}>{s}
))}
free shipping over $120. carbon-neutral every time.
sewn in small batches in portugal.
built to outlast the phase — and the next one, too.
);
}
function CartDrawer({ open, items, onClose, onQty, onCheckout }) {
if (!open) return null;
const total = items.reduce((s, it) => s + it.price * it.qty, 0);
return (
{items.length === 0 ? (
nothing here yet.
keep browsing, we'll be here.
) : items.map((it, i) => (
{it.name}
{it.color} · {it.size}
onQty(i, -1)} style={{ cursor: 'pointer', color: 'var(--tide-600)' }}>
{it.qty}
onQty(i, 1)} style={{ cursor: 'pointer', color: 'var(--tide-600)' }}>
${it.price * it.qty}
))}
{items.length > 0 && (
shippingcomplimentary
total
${total}.00
)}
);
}
Object.assign(window, { ProductDetail, CartDrawer });