import{z as h,e as g,r as c,u as m,j as e,L as t,s as d}from"./index-D5aSL5Lk.js";import{u as f,a as j}from"./useMetaDescription-Dr9AdqMY.js";import{u as N}from"./useDocumentTitle-B-SBpz7s.js";import{H as b,P as v,b as y,c as C}from"./Header-CQ-hRMFy.js";import{I as w,B as o,F as P}from"./Footer-B625QnUy.js";import{P as T}from"./ProductCard-5OM8mCzQ.js";import{S as _}from"./StructuredBreadcrumb-BCzmleui.js";import{C as z,a as S}from"./card-Xe3d9dhi.js";import{T as E}from"./trending-up-DwS3N9Bd.js";import{T as q}from"./tag-DyoEMiBs.js";import"./OptimizedImage-BDiwQDT8.js";import"./checkbox-CzTzIcmO.js";import"./index-DVk-hwER.js";import"./check-DCNsCDBV.js";import"./index-CeP29QIk.js";import"./index-CL0xAu-I.js";import"./chevron-right-Dnq_A__P.js";import"./seoHelpers-DphZaCAd.js";import"./external-link-RH3nu8XI.js";const X=()=>{f(),N("404 - Pagina nu a fost găsită | Clyper"),j("Pagina solicitată nu a fost găsită. Explorează produsele populare, categoriile preferate sau caută produsul dorit.");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(b,{}),e.jsxs("div",{className:"container mx-auto px-4 py-12",children:[e.jsx(_,{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(v,{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(w,{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(y,{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(C,{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(E,{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(z,{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(T,{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(P,{})]})};export{X as default};