(globalThis.TURBOPACK||(globalThis.TURBOPACK=[])).push(["object"==typeof document?document.currentScript:void 0,68780,e=>{"use strict";var t=e.i(43476),i=e.i(71645),s=e.i(99023),r=e.i(7233);let a=(0,e.i(75254).default)("circle-check",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);var n=e.i(46932),l=e.i(88653),o=e.i(65410);e.s(["QuotationWidget",0,({product:e})=>{let[c,d]=(0,i.useState)(0),[u,x]=(0,i.useState)(!1),{addItem:m}=(0,o.useQuotation)();return(0,t.jsxs)("div",{className:"bg-gray-100 p-8 rounded-2xl h-full flex flex-col justify-center items-center text-center relative overflow-hidden",children:[(0,t.jsx)("h3",{className:"text-gray-900 font-bold uppercase tracking-widest mb-4 text-sm",children:"COTIZA ESTE PRODUCTO"}),(0,t.jsx)("p",{className:"text-xs text-gray-500 mb-6 uppercase tracking-tighter",children:"Indica las unidades que necesitas"}),(0,t.jsxs)("div",{className:"flex items-center gap-4 mb-8",children:[(0,t.jsx)("button",{onClick:()=>d(e=>e>0?e-1:0),className:"w-10 h-10 rounded-full bg-white shadow-sm border border-gray-200 flex items-center justify-center text-red-600 hover:bg-red-50 transition-colors",children:(0,t.jsx)(s.Minus,{size:20,strokeWidth:3})}),(0,t.jsx)("div",{className:"bg-white px-6 py-3 rounded-full border border-gray-200 shadow-inner min-w-[140px] flex items-center",children:(0,t.jsx)("input",{type:"number",value:0===c?"":c,placeholder:"0",onChange:e=>{let t=parseInt(e.target.value);d(isNaN(t)?0:t)},className:"w-full bg-transparent text-center text-xl font-bold text-gray-800 outline-none [appearance:textfield] [&::-webkit-outer-spin-button]:appearance-none [&::-webkit-inner-spin-button]:appearance-none",min:"0"})}),(0,t.jsx)("button",{onClick:()=>d(e=>e+1),className:"w-10 h-10 rounded-full bg-white shadow-sm border border-gray-200 flex items-center justify-center text-red-600 hover:bg-red-50 transition-colors",children:(0,t.jsx)(r.Plus,{size:20,strokeWidth:3})})]}),(0,t.jsxs)(n.motion.button,{whileHover:{scale:1.02},whileTap:{scale:.98},onClick:()=>{c<=0||(m({productId:e.id,name:e.nombre,image:e.imagen,quantity:c,specs:e.especificaciones}),x(!0),setTimeout(()=>x(!1),3e3))},disabled:c<=0,className:`w-full py-4 rounded-full font-bold flex items-center justify-center gap-3 shadow-lg transition-all uppercase tracking-widest text-sm ${c>0?"bg-red-600 text-white shadow-red-200 hover:bg-red-700":"bg-gray-300 text-gray-500 cursor-not-allowed shadow-none"}`,children:[(0,t.jsx)(r.Plus,{size:18,strokeWidth:3}),"Añadir a la cotización"]}),(0,t.jsx)(l.AnimatePresence,{children:u&&(0,t.jsxs)(n.motion.div,{initial:{y:50,opacity:0},animate:{y:0,opacity:1},exit:{y:50,opacity:0},className:"absolute inset-x-0 bottom-0 bg-green-600 text-white py-2 flex items-center justify-center gap-2",children:[(0,t.jsx)(a,{size:16}),(0,t.jsx)("span",{className:"text-xs font-bold uppercase tracking-widest",children:"¡Agregado con éxito!"})]})})]})}],68780)}]);