import{d as e,l as t,m as n,u as r}from"./index-DOJOKqWn.js";var i=e();function a({product:e}){let a=n(),{addToCart:o}=r();if(!e)return null;let s=e.sizes&&Array.isArray(e.sizes)&&e.sizes.length>0?e.sizes.every(e=>(parseInt(e.stock)||0)<=0||!!e.outOfStock):e.stock<=0,c=JSON.parse(localStorage.getItem(`alfaras-user`)||`null`),l=c&&c.isAdmin,u=t=>{t.stopPropagation(),!(s||l)&&o(e,e.sizes?.[0]||{ml:50,price:e.price,mrp:e.mrp})},d=e.mrp>e.price?Math.round((e.mrp-e.price)/e.mrp*100):0;return(0,i.jsxs)(`div`,{className:`artifact-card`,onClick:()=>a(`/product/${e.id}`),style:{cursor:`pointer`,position:`relative`,opacity:s?.75:1},children:[(0,i.jsxs)(`div`,{className:`artifact-image-wrap`,style:{position:`relative`},children:[(0,i.jsx)(`img`,{src:e.image,alt:e.name,className:`artifact-image`,onError:e=>{e.target.onerror=null,e.target.src=`/assets/bottles/home_spinning.png`},style:{filter:s?`grayscale(80%) sepia(20%) brightness(0.65)`:`sepia(8%) brightness(0.88) contrast(1.02)`}}),(0,i.jsx)(`div`,{className:`artifact-smoke-overlay`}),(0,i.jsx)(`span`,{className:`artifact-code`,children:e.artifactCode}),s?(0,i.jsx)(`span`,{className:`artifact-limited-badge`,style:{background:`#EF4444`,border:`1px solid #EF4444`,color:`#FFF`},children:`Out of Stock`}):e.isLimited?(0,i.jsx)(`span`,{className:`artifact-limited-badge`,children:`Limited`}):e.isNew?(0,i.jsx)(`span`,{className:`artifact-limited-badge`,style:{background:`transparent`,border:`1px solid var(--gold)`,color:`var(--gold)`},children:`Recovered`}):null,!s&&d>0&&(0,i.jsxs)(`span`,{style:{position:`absolute`,bottom:12,right:12,background:`rgba(196,155,58,0.9)`,color:`var(--obsidian)`,fontFamily:`var(--font-cinzel)`,fontSize:`9px`,fontWeight:600,letterSpacing:`0.1em`,padding:`4px 8px`,borderRadius:2,zIndex:12},children:[d,`% OFF`]}),(0,i.jsx)(`div`,{style:{position:`absolute`,inset:0,display:`flex`,alignItems:`center`,justifyContent:`center`,background:`rgba(8,6,4,0.6)`,opacity:0,transition:`opacity 0.3s ease`,zIndex:10},className:`artifact-card-overlay`,children:(0,i.jsx)(`span`,{style:{fontFamily:`var(--font-cinzel)`,fontSize:`9px`,letterSpacing:`0.35em`,color:`var(--gold)`,textTransform:`uppercase`,border:`1px solid var(--gold)`,padding:`10px 20px`},children:`View Artifact`})})]}),(0,i.jsxs)(`div`,{className:`artifact-body`,children:[(0,i.jsx)(`p`,{className:`artifact-arabic-name`,children:e.arabicName}),(0,i.jsx)(`p`,{className:`artifact-en-name`,children:e.name}),(0,i.jsx)(`p`,{className:`artifact-subtitle`,children:e.subtitle}),(0,i.jsx)(`div`,{style:{display:`flex`,gap:6,flexWrap:`wrap`,marginBottom:12},children:e.topNotes?.slice(0,2).map(e=>(0,i.jsx)(`span`,{style:{fontFamily:`var(--font-cinzel)`,fontSize:`8px`,letterSpacing:`0.15em`,color:`var(--text-muted)`,border:`1px solid var(--border)`,padding:`3px 8px`,textTransform:`uppercase`},children:e},e))}),(0,i.jsxs)(`div`,{className:`artifact-meta`,children:[(0,i.jsxs)(`div`,{children:[d>0?(0,i.jsxs)(`div`,{style:{display:`flex`,flexDirection:`column`,gap:2},children:[(0,i.jsx)(`span`,{style:{textDecoration:`line-through`,fontSize:11,color:`var(--text-muted)`,fontFamily:`var(--font-cinzel)`,letterSpacing:`0.05em`},children:t(e.mrp)}),(0,i.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:6},children:[(0,i.jsx)(`p`,{className:`artifact-price`,style:{color:`var(--gold)`},children:t(e.price)}),(0,i.jsxs)(`span`,{style:{background:`var(--gold)`,color:`var(--obsidian)`,fontFamily:`var(--font-cinzel)`,fontSize:`8px`,fontWeight:700,letterSpacing:`0.05em`,padding:`2px 6px`,borderRadius:2},children:[d,`% OFF`]})]})]}):(0,i.jsx)(`p`,{className:`artifact-price`,style:{color:`var(--gold)`},children:t(e.price)}),(0,i.jsx)(`p`,{style:{fontFamily:`var(--font-cinzel)`,fontSize:`8px`,letterSpacing:`0.1em`,color:`var(--text-muted)`,marginTop:2},children:e.concentration})]}),(0,i.jsxs)(`div`,{style:{textAlign:`right`},children:[(0,i.jsx)(`p`,{className:`artifact-heritage`,children:e.heritageYear}),(0,i.jsx)(`p`,{style:{fontFamily:`var(--font-display)`,fontSize:11,fontStyle:`italic`,color:`var(--text-muted)`,marginTop:2},children:e.originRegion})]})]}),!l&&(0,i.jsx)(`button`,{onClick:u,disabled:s,style:{marginTop:16,width:`100%`,background:`transparent`,border:`1px solid var(--border)`,color:`var(--text-muted)`,fontFamily:`var(--font-cinzel)`,fontSize:`9px`,letterSpacing:`0.3em`,textTransform:`uppercase`,padding:`10px`,cursor:s?`not-allowed`:`pointer`,transition:`all 0.3s ease`,opacity:s?.5:1},onMouseEnter:e=>{s||(e.currentTarget.style.borderColor=`var(--gold)`,e.currentTarget.style.color=`var(--obsidian)`,e.currentTarget.style.background=`var(--gold)`)},onMouseLeave:e=>{s||(e.currentTarget.style.borderColor=`var(--border)`,e.currentTarget.style.color=`var(--text-muted)`,e.currentTarget.style.background=`transparent`)},children:s?`Out of Stock`:`Acquire This Artifact`})]}),(0,i.jsx)(`style`,{children:`
        .artifact-card:hover .artifact-card-overlay { opacity: 1 !important; }
      `})]})}export{a as t};