import{r as e,t}from"./jsx-runtime-BbTa8W_M-1776590214964.js";import{o as n,r}from"./app-CXDQ5oEH-1776590214964.js";import{t as i}from"./useTranslation-D1etqd9u-1776590214964.js";import{t as a}from"./shield-check-BHIMgi8g-1776590214964.js";import{t as o}from"./tag-DWDSJqdF-1776590214964.js";e();var s=t();function c({product:e}){let{activeCurrency:t,currencies:c,appSettings:l}=n().props,{t:u}=i(),d=c?.find(t=>t.code===(e.currency_code||`USD`))?.exchange_rate||1,f=parseFloat(e.original_price||e.price||0)/parseFloat(d)*(t?parseFloat(t.exchange_rate):1),p=parseFloat(e.discount_percentage)||0,m=parseFloat(e.seller?.flash_sale_percentage)||0,h=Math.max(p,m),g=h>0,_=g?f-h/100*f:f,v=t?.symbol||`$`,y=e.images?.find(e=>e.is_main)||e.images?.[0],b=y?`/storage/${y.path}`:`/placeholder.jpg`;return(0,s.jsx)(r,{href:route(`product.view`,`${e.slug}_${e.id}`),className:`block h-full outline-none`,children:(0,s.jsxs)(`div`,{className:`group relative flex flex-col h-full bg-card rounded-2xl border border-border/50 overflow-hidden shadow-sm hover:shadow-xl hover:shadow-primary/5 hover:-translate-y-1 transition-all duration-300`,children:[(0,s.jsxs)(`div`,{className:`relative w-full aspect-square bg-white dark:bg-white/95 p-4 flex items-center justify-center overflow-hidden border-b border-border/40`,children:[(0,s.jsx)(`img`,{src:b,alt:e.title,loading:`lazy`,className:`w-full h-full object-contain group-hover:scale-110 transition-transform duration-700 ease-out`}),g&&e.stock>0&&(0,s.jsxs)(`div`,{className:`absolute top-2 left-2 sm:top-3 sm:left-3 bg-red-500 text-white text-[10px] sm:text-xs font-black px-2 py-1 rounded-md shadow-sm z-10 flex items-center gap-1`,children:[(0,s.jsx)(o,{className:`w-3 h-3`}),u(`-:percent%`,{percent:h})]}),e.stock===0&&(0,s.jsx)(`div`,{className:`absolute inset-0 bg-black/60 backdrop-blur-[2px] flex items-center justify-center z-20`,children:(0,s.jsx)(`span`,{className:`bg-background text-foreground px-4 py-1.5 text-xs font-black uppercase tracking-widest rounded-full shadow-lg`,children:u(`Out of Stock`)})})]}),(0,s.jsxs)(`div`,{className:`p-4 sm:p-5 flex flex-col flex-1`,children:[(0,s.jsx)(`p`,{className:`text-sm font-normal text-muted-foreground leading-snug line-clamp-2 group-hover:text-primary transition-colors mb-2`,children:e.title}),(0,s.jsxs)(`div`,{className:`mt-auto space-y-3`,children:[(0,s.jsxs)(`div`,{children:[g&&(0,s.jsxs)(`div`,{className:`text-[11px] text-muted-foreground line-through font-medium mb-0.5`,children:[v,f.toFixed(2)]}),(0,s.jsxs)(`div`,{className:`flex items-baseline gap-1`,children:[(0,s.jsxs)(`span`,{className:`font-black text-xl sm:text-2xl tracking-tight ${g?`text-red-600`:`text-foreground`}`,children:[v,_.toFixed(2)]}),(0,s.jsxs)(`span`,{className:`text-[10px] text-muted-foreground font-medium`,children:[`/`,u(`unit`)]})]})]}),(0,s.jsx)(`div`,{className:`flex items-center justify-between border-t border-border/50 pt-3`,children:(0,s.jsxs)(`span`,{className:`text-[11px] font-bold text-muted-foreground uppercase tracking-wider bg-muted/50 px-2 py-0.5 rounded-md`,children:[u(`MOQ`),`: `,e.moq]})}),(0,s.jsxs)(`div`,{className:`flex items-center gap-1.5 text-[10px] font-bold text-green-600 dark:text-green-500`,children:[(0,s.jsx)(a,{className:`w-3.5 h-3.5 shrink-0`}),(0,s.jsx)(`span`,{className:`truncate`,children:u(l?.protection_badge_name||`Buyer Protection`)})]})]})]})]})})}export{c as t};