import{z as h,e as g,r as c,u as m,j as e,L as t,s as d}from"./index-6Z-OT1jL.js";import{u as f}from"./useNoIndex-Ngrlxcbu.js";import{u as j}from"./useDocumentTitle-mYu--wVy.js";import{H as N,P as b,b as v,c as y}from"./Header-Dbd8Gbtv.js";import{I as C,B as o,F as w}from"./Footer-BxmDcSs9.js";import{P}from"./ProductCard-ChUEdbNJ.js";import{S as T}from"./StructuredBreadcrumb-BzDqN1jx.js";import{C as _,a as S}from"./card-1NGkWztB.js";import{T as z}from"./trending-up-z5ZAfF0D.js";import{T as q}from"./tag-D3gmCVGo.js";import"./OptimizedImage-TPX5Bo2m.js";import"./checkbox-C7jOvJrX.js";import"./index-C3ZtVRy4.js";import"./check-DiFNHi6R.js";import"./index-CWGEgL-r.js";import"./index-9jEq4PH8.js";import"./chevron-right-B8kt63SH.js";import"./seoHelpers-DphZaCAd.js";import"./external-link-EcCVLE-V.js";const W=()=>{f(),j("404 - Pagina nu a fost găsită | Clyper");const i=h(),u=g(),[r,x]=c.useState("");c.useEffect(()=>{console.error("404 Error: User attempted to access non-existent route:",i.pathname)},[i.pathname]);const{data:n=[]}=m({queryKey:["suggested-products"],queryFn:async()=>{const{data:s,error:a}=await d.from("products").select("id, name, price, image_url, store_name, affiliate_link, category, slug").eq("is_active",!0).order("created_at",{ascending:!1}).limit(4);if(a)throw a;return s||[]}}),{data:l=[]}=m({queryKey:["popular-categories-404"],queryFn:async()=>{const{data:s,error:a}=await d.rpc("get_top_categories",{limit_count:6});if(a)throw a;return s||[]}}),p=s=>{s.preventDefault(),r.trim()&&u(`/products?search=${encodeURIComponent(r.trim())}`)};return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(N,{}),e.jsxs("div",{className:"container mx-auto px-4 py-12",children:[e.jsx(T,{items:[{label:"Acasă",href:"/"},{label:"404 - Pagina nu a fost găsită"}]}),e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("div",{className:"inline-flex items-center justify-center w-20 h-20 rounded-full bg-muted mb-6",children:e.jsx(b,{className:"h-10 w-10 text-muted-foreground"})}),e.jsx("h1",{className:"text-6xl font-bold mb-4",children:"404"}),e.jsx("h2",{className:"text-2xl font-semibold mb-3",children:"Pagina nu a fost găsită"}),e.jsx("p",{className:"text-muted-foreground text-lg mb-8 max-w-2xl mx-auto",children:"Ne pare rău, dar pagina pe care o căutați nu există sau a fost mutată. Explorează produsele noastre sau folosește căutarea de mai jos."}),e.jsx("form",{onSubmit:p,className:"max-w-2xl mx-auto mb-8",children:e.jsxs("div",{className:"flex gap-2",children:[e.jsx(C,{type:"text",placeholder:"Caută produse, categorii, branduri...",value:r,onChange:s=>x(s.target.value),className:"flex-1 h-12 text-base"}),e.jsxs(o,{type:"submit",size:"lg",className:"px-8",children:[e.jsx(v,{className:"mr-2 h-5 w-5"}),"Caută"]})]})}),e.jsxs("div",{className:"flex flex-wrap gap-4 justify-center",children:[e.jsx(o,{asChild:!0,variant:"default",size:"lg",children:e.jsxs(t,{to:"/",children:[e.jsx(y,{className:"mr-2 h-5 w-5"}),"Pagina principală"]})}),e.jsx(o,{asChild:!0,variant:"outline",size:"lg",children:e.jsxs(t,{to:"/products",children:[e.jsx(z,{className:"mr-2 h-5 w-5"}),"Toate produsele"]})})]})]}),l.length>0&&e.jsxs("div",{className:"mb-16",children:[e.jsx("h3",{className:"text-2xl font-bold mb-6 text-center",children:"Categorii Populare"}),e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-3 lg:grid-cols-6 gap-4",children:l.map(s=>e.jsx(t,{to:`/products?category=${encodeURIComponent(s.name)}`,children:e.jsx(_,{className:"hover:shadow-lg transition-all hover:scale-105 cursor-pointer h-full",children:e.jsxs(S,{className:"p-4 text-center",children:[e.jsx("div",{className:"bg-primary/10 w-12 h-12 rounded-full flex items-center justify-center mx-auto mb-3",children:e.jsx(q,{className:"h-6 w-6 text-primary"})}),e.jsx("h4",{className:"font-semibold text-sm mb-1",children:s.name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.count," produse"]})]})})},s.name))})]}),n.length>0&&e.jsxs("div",{children:[e.jsx("h3",{className:"text-2xl font-bold mb-6 text-center",children:"Produse Recomandate"}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6",children:n.map(s=>e.jsx(P,{product:s},s.id))})]}),e.jsx("div",{className:"mt-16 text-center",children:e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Ai întâmpinat probleme? ",e.jsx(t,{to:"/contact",className:"text-primary hover:underline",children:"Contactează-ne"})," pentru asistență."]})})]}),e.jsx(w,{})]})};export{W as default};