1import{j as e,m as N,A as Q}from"./vendor-motion-PgHbArYe.js";import{a as s,t as X,u as E}from"./vendor-i18n-COfIFlzV.js";import{c as J,R as W,P as Z,C as L,i as ee,X as te,d as b,O,T as $,D as z,j as ae,k as oe,f as se,p as re,e as ie,H as ne,g as le,F as ce,B as de,I as me,l as fe,h as ue}from"./index-DhKQRocp.js";import"./vendor-react-DzO2Pzrz.js";import"./vendor-sanity-Bzkfj_6K.js";const pe=J("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]),xe=W,ge=Z,V=s.forwardRef(({className:t,...a},o)=>e.jsx(O,{ref:o,className:b("fixed inset-0 z-50 bg-black/80 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0",t),...a}));V.displayName=O.displayName;const U=s.forwardRef(({className:t,children:a,...o},r)=>e.jsxs(ge,{children:[e.jsx(V,{}),e.jsxs(L,{ref:r,className:b("fixed left-[50%] top-[50%] z-50 grid w-full max-w-lg translate-x-[-50%] translate-y-[-50%] gap-4 border bg-background p-6 shadow-lg duration-200 data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 data-[state=closed]:slide-out-to-left-1/2 data-[state=closed]:slide-out-to-top-[48%] data-[state=open]:slide-in-from-left-1/2 data-[state=open]:slide-in-from-top-[48%] sm:rounded-lg",t),...o,children:[a,e.jsxs(ee,{className:"absolute right-4 top-4 roun
1ded-sm opacity-70 ring-offset-background transition-opacity hover:opacity-100 focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2 disabled:pointer-events-none data-[state=open]:bg-accent data-[state=open]:text-muted-foreground",children:[e.jsx(te,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"Close"})]})]})]}));U.displayName=L.displayName;const he=s.forwardRef(({className:t,...a},o)=>e.jsx($,{ref:o,className:b("text-lg font-semibold leading-none tracking-tight",t),...a}));he.displayName=$.displayName;const be=s.forwardRef(({className:t,...a},o)=>e.jsx(z,{ref:o,className:b("text-sm text-muted-foreground",t),...a}));be.displayName=z.displayName;const ye=ae("inline-flex items-center rounded-md border px-2.5 py-0.5 text-xs font-semibold transition-colors focus:outline-none focus:ring-2 focus:ring-ring focus:ring-offset-2",{variants:{variant:{default:"border-transparent bg-primary text-primary-foreground shadow hover:bg-primary/80",secondary:"border-transparent bg-secondary text-secondary-foreground hover:bg-secondary/80",destructive:"border-transparent bg-destructive text-destructive-foreground shadow hover:bg-destructive/80",outline:"text-foreground"}},defaultVariants:{variant:"default"}});function B({className:t,variant:a,...o}){return e.jsx("div",{className:b(ye({variant:a}),t),...o})}function je({src:t,tinySrc:a,alt:o,className:r}){const[m,p]=s.useState(!1);return e.jsxs("div",{className:"relative w-full h-full overflow-hidden",children:[e.jsx("img",{src:a,alt:"","aria-hidden":"true",className:"absolute inset-0 w-full h-full object-cover scale-110 blur-md"}),e.jsx("img",{src:t,alt:o,loading:"lazy",decoding:"async",onLoad:()=>p(!0),className:`absolute inset-0 w-full h-full object-cover transition-opacity duration-500 ${m?"opacity-100":"opacity-0"} ${r??""}`})]})}const T={Cocinas:"portfolio.filters.kitchens",Baños:"portfolio.filters.bathrooms",Armarios:"portfolio.filters.wardrobes"};function D(t,a,o){if(o&&o!=="es"){const r=t[`${a}_${o}`];if(r&&r.trim())return r}return t[a]??""}function _(t,{width:a,height:o,fit:r,quality:m=80}={}){if(!t)return"";if(typeof t=="object"&&t?._type==="image"){let n=se(t);return a&&(n=n.width(a)),o&&(n=n.height(o)),r&&(n=n.fit(r)),n.auto("format").quality(m).url()}return`${t}?w=${a??800}&q=${m}`}function ve({image:t,images:a,title:o,title_en:r,title_fr:m,title_de:p,title_nl:n,description:F,description_en:c,description_fr:y,description_de:i,description_nl:f,category:w,delay:q=0}){const[x,A]=s.useState(!1),[g,j]=s.useState(0),{t:M,i18n:H}=E(),P=H.language,l=Array.isArray(a)&&a.length>0?a:t?[t]:[],h=l.length>1,I={title:o,title_en:r,title_fr:m,title_de:p,title_nl:n,description:F,description_en:c,description_fr:y,description_de:i,description_nl:f},v=D(I,"title",P),R=D(I,"description",P),S=T[w]?M(T[w]):w,Y=_(l[0],{width:600,height:450,fit:"crop",quality:75}),G=_(l[0],{width:20,height:15,fit:"crop",quality:20}),k=s.useCallback(()=>j(d=>(d-1+l.length)%l.length),[l.length]),C=s.useCallback(()=>j(d=>(d+1)%l.length),[l.length]);s.useEffect(()=>{x&&j(0)},[x]),s.useEffect(()=>{if(!x||!h)return;const d=u=>{u.key==="ArrowLeft"&&k(),u.key==="ArrowRight"&&C()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[x,h,k,C]);const K=_(l[g],{width:1600,fit:"clip",quality:82});return e.jsxs(e.Fragment,{children:[e.jsxs(N.div,{initial:{opacity:0,scale:.95},whileInView:{opacity:1,scale:1},viewport:{once:!0},transition:{duration:.4,delay:q},className:"group relative overflow-hidden rounded-2xl cursor-pointer shadow-md hover:shadow-xl transition-all duration-300",onClick:()=>A(!0),children:[e.jsx("div",{className:"aspect-[4/3] overflow-hidden bg-muted",children:e.jsx(je,{src:Y,tinySrc:G,alt:v,className:"transition-transform duration-500 group-hover:scale-110"})}),h&&e.jsx("div",{className:"absolute top-3 right-3 bg-black/60 backdrop-blur-sm text-white text-xs font-semibold px-2.5 py-1 rounded-full",children:l.length}),e.jsx("div",{className:"absolute inset-0 bg-black/60 opacity-0 group-hover:opacity-100 transition-opacity duration-300 flex flex-col justify-end p-6",children:e.jsxs("div",{className:"transform translate-y-4 group-hover:translate-y-0 transition-transform duration-300",children:[e.jsx(B,{className:"mb-3 bg-primary text-primary-foreground hover:bg-primary/90 border-none font-semibold",children:S}),e.jsx("h3",{className:"text-xl font-bold mb-2 text-white",children:v}),e.jsx("p",{className:"text-sm text-white/80 line-clamp-2",children:R})]})})]}),e.jsx(xe,{open:x,onOpenChange:A,children:e.jsx(U,{className:"max-w-4xl bg-card border-none shadow-2xl max-h-[90vh] overflow-y-auto",children:e.jsxs("div",{className:"space-y-4",children:[e.jsxs("div",{className:"relative overflow-hidden rounded-xl bg-black/5",children:[e.jsx(Q,{mode:"wait",initial:!1,children:e.jsx(N.img,{src:K,alt:`${v} â foto ${g+1}`,decoding:"async",className:"w-full max-h-[60vh] object-contain",initial:{opacity:0,x:50}
1,animate:{opacity:1,x:0},exit:{opacity:0,x:-50},transition:{duration:.22}},g)}),h&&e.jsxs(e.Fragment,{children:[e.jsx("button",{onClick:d=>{d.stopPropagation(),k()},className:"absolute left-3 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/75 text-white rounded-full p-2 transition-colors","aria-label":"Foto anterior",children:e.jsx(pe,{className:"w-5 h-5"})}),e.jsx("button",{onClick:d=>{d.stopPropagation(),C()},className:"absolute right-3 top-1/2 -translate-y-1/2 bg-black/50 hover:bg-black/75 text-white rounded-full p-2 transition-colors","aria-label":"Siguiente foto",children:e.jsx(oe,{className:"w-5 h-5"})}),e.jsxs("div",{className:"absolute bottom-3 left-1/2 -translate-x-1/2 bg-black/60 backdrop-blur-sm text-white text-xs font-semibold px-3 py-1 rounded-full pointer-events-none",children:[g+1," / ",l.length]})]})]}),h&&e.jsx("div",{className:"flex justify-center items-center gap-2 pt-1",children:l.map((d,u)=>e.jsx("button",{onClick:()=>j(u),"aria-label":`Foto ${u+1}`,className:`h-2 rounded-full transition-all duration-200 ${u===g?"w-5 bg-primary":"w-2 bg-muted-foreground/35 hover:bg-muted-foreground/60"}`},u))}),e.jsxs("div",{className:"pt-2",children:[e.jsx(B,{className:"mb-4 bg-primary text-primary-foreground hover:bg-primary/90 border-none font-semibold text-sm px-3 py-1",children:S}),e.jsx("h3",{className:"text-3xl font-bold mb-3 text-foreground",children:v}),e.jsx("p",{className:"text-muted-foreground leading-relaxed text-lg",children:R})]})]})})})]})}const Ne=X.memo(ve),we=[{value:"Todos",key:"portfolio.filters.all"},{value:"Cocinas",key:"portfolio.filters.kitchens"},{value:"Baños",key:"portfolio.filters.bathrooms"},{value:"Armarios",key:"portfolio.filters.wardrobes"}],ke=` 2 *[_type == "portfolioProject"] | order(order asc, _createdAt asc) { 3 _id, 4 title, title_en, title_fr, title_de, title_nl, 5 category, 6 description, description_en, description_fr, description_de, description_nl, 7 images, 8 image, 9 order 10 } 11`;function Ie(){const[t,a]=s.useState("Todos"),[o,r]=s.useState(re),[m,p]=s.useState(!1),[n,F]=s.useState(null),{t:c}=E();s.useEffect(()=>{let i=!1;return ie.fetch(ke).then(f=>{i||r(f)}).catch(()=>{}),()=>{i=!0}},[]);const y=s.useMemo(()=>t==="Todos"?o:o.filter(i=>i.category===t),[t,o]);return e.jsxs(e.Fragment,{children:[e.jsxs(ne,{children:[e.jsx("title",{children:"Portfolio de Cocinas, Baños y Armarios Reformados | Cocinas Farely Benijófar"}),e.jsx("meta",{name:"description",content:"Descubre nuestros proyectos de cocinas, baños y armarios reformados en Benijófar y la Vega Baja del Segura. Fotos reales de reformas completadas con materiales de alta calidad."}),e.jsx("link",{rel:"canonical",href:"https://cocinasfarely.es/portfolio"}),e.jsx("meta",{property:"og:title",content:"Portfolio de Reformas â Cocinas Farely Benijófar"}),e.jsx("meta",{property:"og:description",content:"Proyectos reales de cocinas, baños y armarios a medida en la Vega Baja del Segura. InspÃrate con nuestros trabajos."}),e.jsx("meta",{property:"og:url",content:"https://cocinasfarely.es/portfolio"}),e.jsx("meta",{property:"og:image",content:"https://cocinasfarely.es/hero-cocina.jpg"})]}),e.jsx(le,{}),e.jsx(ce,{}),e.jsxs("div",{className:"pt-20",children:[e.jsx("section",{className:"section-spacing-sm bg-muted",children:e.jsx("div",{className:"container-custom text-center",children:e.jsxs(N.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{duration:.6},children:[e.jsx("h2",{className:"section-title",children:c("portfolio.header.title")}),e.jsx("p",{className:"text-xl text-muted-foreground max-w-3xl mx-auto",children:c("portfolio.header.subtitle")})]})})}),e.jsx("section",{className:"py-8 bg-background sticky top-20 z-30 border-b border-border",children:e.jsx("div",{className:"container-custom",children:e.jsx("div",{className:"flex flex-wrap justify-center gap-3",children:we.map(({value:i,key:f})=>e.jsx(de,{onClick:()=>a(i),variant:t===i?"default":"outline",className:"transition-all duration-200 active:scale-[0.98]",children:c(f)},i))})})}),e.jsx("section",{className:"section-spacing",children:e.jsxs("div",{className:"container-custom",children:[m&&e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:Array.from({length:8}).map((i,f)=>e.jsx("div",{className:"aspect-[4/3] rounded-2xl bg-muted animate-pulse"},f))}),!m&&n&&e.jsx("div",{className:"text-center py-20",children:e.jsx("p",{className:"text-xl text-destructive",children:c("portfolio.error")})}),!m&&!n&&e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4 gap-6",children:y.map((i,f)=>e.jsx(Ne,{...i,delay:f*.05},i._id))}),y.length===0&&e.jsx("div",{className:"text-center py-20",children:e.jsx("p",{className:"text-xl text-muted-foreground",children:c("portfolio.noResults")})})]})]})}),e.jsx("section",{className:"py-10 bg-muted border-t border-border",children:e.jsx("div",{className:"container-custom",children:e.jsxs(N.div,{initial:{opacity:0,y:16},whileInView:{opacity:1,y:0},viewport:{once:!0},transition:{duration:.5},className:"flex flex-col sm:flex-row items-center justify-center gap-6 text-center sm:text-left",children:[e.jsxs("p",{className:"text-muted-foreground text-base",children:[c("portfolio.social.title")," ",c("portfolio.social.subtitle")]}),e.jsxs("div",{className:"flex gap-3 shrink-0",children:[e.jsxs("a",{href:"https://www.instagram.com/cocinasfarely/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-card border border-border text-sm font-medium hover:bg-primary hover:text-primary-foreground hover:border-primary transition-all duration-200",children:[e.jsx(me,{className:"w-4 h-4"}),c("portfolio.social.followInstagram")]}),e.jsxs("a",{href:"https://www.facebook.com/CocinasFarely/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-card border border-border text-sm font-medium hover:bg-primary hover:text-primary-foreground hover:border-primary transition-all duration-200",children:[e.jsx(fe,{className:"w-4 h-4"}),c("portfolio.social.followFacebook")]})]})]})})})]}),e.jsx(ue,{})]})}
11export{Ie as default};
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.