1import{u as w,s as v,r as N,j as e,L as i,A as d,m as j,n as y,p as k,O as A,f as S}from"./index-CPwdQzsK.js";import{A as L}from"./arrow-left-BJs9Uf2i.js";import{A as _}from"./arrow-right-CDg2TIiN.js";function C(o){let t=0;for(let r=0;r<o.length;r++)t=t*31+o.charCodeAt(r)>>>0;return t}const B={"most loved":"bg-accent text-accent-foreground","chef special":"bg-emerald-600 text-white",new:"bg-foreground text-background",signature:"bg-rose-600 text-white",halal:"bg-emerald-700 text-white","most popular":"bg-amber-500 text-white",spicy:"bg-rose-600 text-white",vegan:"bg-emerald-600 text-white"},F="bg-accent text-accent-foreground",m=[{label:"Most Loved",className:"bg-accent text-accent-foreground"},{label:"Chef Special",className:"bg-emerald-600 text-white"},{label:"New",className:"bg-foreground text-background"},{label:"Signature",className:"bg-rose-600 text-white"}],u=["Serves 1-2","Slow Cooked","House Blend","Hand Crafted","Wood Fired"];function D(){const{data:o=[]}=w({queryKey:["menu_slider_home"],queryFn:async()=>{const{data:a}=await v.from("menu_items").select("id,name,description,price,image_url,badge,tag").eq("available",!0).order("sort_order").limit(12);return a??[]}}),t=N.useRef(null),r=a=>{const n=t.current;if(!n)return;const s=n.querySelector("[data-card]"),l=s?s.offsetWidth+32:440;n.scrollBy({left:a*l,behavior:"smooth"})};return o.length?e.jsxs("section",{className:"py-24 md:py-32 bg-background overflow-hidden",children:[e.jsxs("div",{className:"max-w-7xl mx-auto px-6 flex flex-col md:flex-row md:items-end justify-between gap-8 mb-12 md:mb-16",children:[e.jsxs("div",{className:"space-y-3",children:[e.jsx("span",{className:"block text-[11px] font-bold tracking-[0.3em] text-accent uppercase",children:"From the Kitchen"}),e.jsx("h2",{className:"text-4xl md:text-6xl font-semibold tracking-tight leading-[1.05]",children:"Taste our menu."})]}),e.jsxs("div",{className:"flex items-center gap-6 md:gap-10",children:[e.jsxs("div",{className:"flex gap-3",children:[e.jsx("button",{"aria-label":"Previous",onClick:()=>r(-1),className:"group p-4 rounded-full border border-foreground
1/15 text-foreground/40 hover:border-accent hover:text-accent transition-all bg-background shadow-sm cursor-pointer",children:e.jsx(L,{className:"w-5 h-5 transform group-hover:-translate-x-0.5 transition-transform"})}),e.jsx("button",{"aria-label":"Next",onClick:()=>r(1),className:"group p-4 rounded-full border border-foreground/15 text-foreground/40 hover:border-accent hover:text-accent transition-all bg-background shadow-sm cursor-pointer",children:e.jsx(_,{className:"w-5 h-5 transform group-hover:translate-x-0.5 transition-transform"})})]}),e.jsxs(i,{to:"/menu",className:"hidden sm:inline-flex items-center gap-3 text-sm font-semibold text-foreground border-b-2 border-foreground pb-1.5 hover:text-accent hover:border-accent transition-all",children:["Full menu ",e.jsx(d,{className:"w-4 h-4"})]})]})]}),e.jsxs("div",{ref:t,className:"flex gap-6 md:gap-8 overflow-x-auto scroll-smooth snap-x snap-mandatory pl-6 pr-6 pb-12 [scrollbar-width:none] [&::-webkit-scrollbar]:hidden",children:[o.map((a,n)=>{const s=C(a.id),l=a.badge?.trim(),x=a.tag?.trim(),c=m[s%m.length],g=l||c.label,h=l?B[l.toLowerCase()]??F:c.className,p=x||u[(s>>3)%u.length],b=(4.5+(s>>5)%6/10).toFixed(1);return e.jsxs(j.article,{"data-card":!0,initial:{opacity:0,y:30},whileInView:{opacity:1,y:0},viewport:{once:!0,margin:"-50px"},transition:{duration:.55,delay:Math.min(n*.05,.3),ease:[.16,1,.3,1]},className:"group relative snap-start shrink-0 w-[85%] sm:w-[60%] md:w-[460px] bg-card rounded-3xl p-2.5 border border-foreground
1/10 hover:shadow-2xl hover:shadow-accent/10 transition-all duration-500",children:[e.jsx(i,{to:"/menu","aria-label":`View ${a.name} on full menu`,className:"absolute inset-0 z-10 rounded-3xl focus:outline-none focus-visible:ring-2 focus-visible:ring-accent"}),e.jsxs("div",{className:"relative aspect-[16/10] overflow-hidden rounded-2xl bg-secondary",children:[a.image_url?e.jsx("img",{src:k(a.image_url,{width:800,quality:70}),srcSet:y(a.image_url,[400,600,800,1200]),sizes:"(max-width: 768px) 90vw, (max-width: 1280px) 45vw, 600px",alt:a.name,loading:"lazy",decoding:"async",className:"w-full h-full object-cover transition-transform duration-[1000ms] group-hover:scale-110"}):e.jsx("div",{className:"w-full h-full bg-gradient-to-br from-secondary to-muted"}),e.jsx("div",{className:"absolute top-5 left-5",children:e.jsx("span",{className:`${h} text-[10px] font-bold px-4 py-1.5 rounded-full uppercase tracking-widest shadow-lg`,children:g})}),e.jsx("div",{className:"absolute inset-0 bg-black/0 md:group-hover:bg-black/15 transition-all duration-500 pointer-events-none"}),e.jsx("div",{className:"absolute bottom-4 inset-x-4 z-20 md:translate-y-6 md:opacity-0 md:group-hover:translate-y-0 md:group-hover:opacity-100 transition-all duration-500",children:e.jsxs("a",{href:A,target:"_blank",rel:"noopener noreferrer",onClick:f=>f.stopPropagation(),className:"w-full bg-background text-foreground py-3 rounded-xl text-sm font-bold shadow-2xl flex items-center justify-center gap-2 hover:bg-accent hover:text-accent-foreground transition-all transform hover:-translate-y-1",children:[e.jsx("span",{children:"Order online"}),e.jsx(d,{className:"w-4 h-4",strokeWidth:2.5})]})})]}),e.jsxs("div",{className:"relative px-3 py-4",children:[e.jsxs("div",{className:"flex justify-between items-start gap-3 mb-2",children:[e.jsx("h3",{className:"text-lg font-semibold tracking-tight leading-tight",children:a.name}),e.jsxs("div",{className:"shrink-0 flex items-center gap-1 bg-accent/10 px-1.5 py-0.5 rounded-md",children:[e.jsx(S,{className:"w-3 h-3 fill-accent text-accent"}),e.jsx("span",{className:"text-[11px] font-bold text-accent",children:b})]})]}),a.description&&e.jsx("p",{className:"text-muted-foreground text-xs leading-relaxed line-clamp-2 mb-3",children:a.description}),e.jsxs("div",{className:"flex items-center gap-2.5 font-medium",children:[e.jsxs("span",{className:"text-base tabular-nums",children:["$",Number(a.price).toFixed(2)]}
1),e.jsx("span",{className:"h-3 w-px bg-foreground/15"}),e.jsx("span",{className:"text-[10px] text-muted-foreground uppercase tracking-widest font-bold",children:p})]})]})]},a.id)}),e.jsx("div",{className:"shrink-0 w-2"})]})]}):null}export{D as MenuSlider};
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.