index.html 29 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593
  1. <!DOCTYPE html>
  2. <html lang="es">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <title>Biergarten Klein</title>
  6. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. <!-- Meta tags para evitar cache -->
  8. <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
  9. <meta http-equiv="Pragma" content="no-cache">
  10. <meta http-equiv="Expires" content="0">
  11. <!-- Fuentes + Tailwind -->
  12. <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
  13. <link rel="stylesheet" as="style" onload="this.rel='stylesheet'"
  14. href="https://fonts.googleapis.com/css2?display=swap&family=Noto+Sans:wght@400;500;700;900&family=Spline+Sans:wght@400;500;700">
  15. <script src="https://cdn.tailwindcss.com?plugins=forms,container-queries"></script>
  16. <link rel="stylesheet" href="express/animations.css">
  17. <!--Tailwind-->
  18. <script>
  19. tailwind.config = {
  20. theme: {
  21. extend: {
  22. colors: {
  23. 'custom-dark': '#101419',
  24. 'custom-dark-hover': '#37404a',
  25. 'gray-50': '#f9fafb',
  26. 'gray-100': '#f3f4f6',
  27. }
  28. }
  29. }
  30. }
  31. </script>
  32. <!-- Markdown -->
  33. <script src="https://cdn.jsdelivr.net/npm/marked/marked.min.js"></script>
  34. <script src="express/js/app.js" type="module"></script>
  35. <link rel="stylesheet" href="express/styles.css">
  36. </head>
  37. <body class="h-[100dvh] max-h-[100dvh] flex flex-col bg-gray-50 overflow-x-hidden"
  38. style='font-family:"Spline Sans","Noto Sans",sans-serif;'>
  39. <!-- ---------- HEADER ---------- -->
  40. <header class="flex-col top-0 inset-x-0 z-10 bg-gray-50 p-2 flex justify-center items-center border-b border-gray-200">
  41. <h1 id="mainTitle" class="text-[26px] font-bold text-[#101419] tracking-tight">
  42. Biergarten Klein
  43. </h1>
  44. </header>
  45. <!-- ---------- MAIN ---------- -->
  46. <main class="relative flex-1 flex flex-col min-h-0 overflow-x-hidden">
  47. <!-- ===== MENÚ tab ===== -->
  48. <section id="menuTab" data-index="0" class="min-h-0 overflow-y-auto h-full" data-tab>
  49. <div class="pt-4 pb-3">
  50. <!-- Barra de progreso para cerveza gratis -->
  51. <div class="mx-4 mb-6 p-4 bg-gradient-to-r from-amber-50 to-orange-50 rounded-xl border border-amber-200">
  52. <div class="flex items-center justify-between mb-2">
  53. <div class="flex items-center gap-2">
  54. <span class="text-lg">🍺</span>
  55. <span class="text-sm font-semibold text-amber-800">¡Cerveza gratis al 100%!</span>
  56. </div>
  57. <span id="progressText" class="text-sm font-bold text-amber-700">100%</span>
  58. </div>
  59. <div class="relative w-full h-3 bg-amber-100 rounded-full overflow-hidden shadow-inner">
  60. <!-- Barra de progreso animada -->
  61. <div id="progressBar" class="h-full bg-gradient-to-r from-amber-400 to-orange-500 rounded-full transition-all duration-500 ease-out shadow-sm relative overflow-hidden" style="width: 100%">
  62. <!-- Efecto de brillo -->
  63. <div class="absolute inset-0 bg-gradient-to-r from-transparent via-white/30 to-transparent skew-x-12 animate-pulse"></div>
  64. </div>
  65. <!-- Indicador de meta -->
  66. <div class="absolute right-1 top-1/2 transform -translate-y-1/2">
  67. <div class="w-2 h-2 bg-amber-600 rounded-full border border-white shadow-sm"></div>
  68. </div>
  69. </div>
  70. <div class="flex items-center justify-between mt-2">
  71. <span class="text-xs text-amber-700">Cada compra suma puntos</span>
  72. <button id="rewardBtn" class="text-xs bg-amber-500 hover:bg-amber-600 text-white px-3 py-1 rounded-full font-medium transition-colors duration-200 opacity-50 cursor-not-allowed" disabled>
  73. 🎉 ¡Reclamar!
  74. </button>
  75. </div>
  76. </div>
  77. </div>
  78. <div class="px-4 overflow-y-auto">
  79. <form>
  80. <input type="text" id="searchInput" placeholder="Buscar..." class="w-full px-4 py-2 mb-4 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-[#101419]">
  81. </form>
  82. <ul id="productList" class="space-y-6">
  83. </ul>
  84. </div>
  85. <template id="product-card-template">
  86. <li class="flex items-stretch justify-between gap-4 rounded-xl">
  87. <div class="flex flex-[2_2_0px] flex-col gap-4">
  88. <div class="flex flex-col gap-1">
  89. <p class="product-type text-[#58728d] text-sm"></p>
  90. <p class="product-name text-[#101419] text-base font-bold leading-tight"></p>
  91. <p class="product-description text-[#58728d] text-sm"></p>
  92. </div>
  93. <div class="flex items-center gap-3">
  94. <button class="add-to-cart-btn flex items-center gap-1 w-fit h-8 px-3 rounded-full bg-[#101419] hover:bg-[#37404a] text-white text-sm font-medium">
  95. <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="16" height="16" fill="currentColor">
  96. <path d="M12 5v14m7-7H5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
  97. </svg>
  98. Añadir
  99. </button>
  100. <span class="product-price text-sm font-semibold text-[#101419]"></span>
  101. </div>
  102. </div>
  103. <div class="product-image flex-1 aspect-video bg-cover bg-center rounded-xl"></div>
  104. </li>
  105. </template>
  106. </section>
  107. <!-- ===== CHAT ===== -->
  108. <section id="chatTab" data-index="2" data-tab class="flex hidden flex-col flex-1 min-h-0">
  109. <!-- Contenedor de mensajes que puede crecer y hacer scroll -->
  110. <div id="chatMessages" class="flex-1 overflow-y-auto px-5 md:px-8 py-4 flex flex-col gap-4">
  111. <!-- Sugerencias y Bajada -->
  112. <div class="text-center text-gray-600 px-5 text-sm leading-relaxed max-w-full">
  113. <h2 class="text-md text-gray-500 mt-5">Conversa con nuestro asistente IA: descubre nuestras cervezas 🍻 y sugiere mejoras para nuestra app ✨<span class="mx-0.5">🍻</span></h2>
  114. <!-- Ideas de mensajes -->
  115. <div id="chatSuggestions" class="grid grid-cols-1 gap-3 max-w-2xl mx-auto mt-5">
  116. <div class="bg-white border border-gray-200 rounded-xl p-4 cursor-pointer hover:border-gray-300 hover:shadow-sm transition-all duration-200 text-left flex items-center gap-4">
  117. <div class="text-lg mb-1">🍺</div>
  118. <div class="chat-suggestion text-gray-400 font-medium text-xs">¿Que me puedes contar de la burlesque?</div>
  119. </div>
  120. <div class="bg-white border border-gray-200 rounded-xl p-4 cursor-pointer hover:border-gray-300 hover:shadow-sm transition-all duration-200 text-left flex items-center gap-4">
  121. <div class="text-lg mb-1">⁉️</div>
  122. <div class="chat-suggestion text-gray-400 font-medium text-xs">Mi sugerencia para la aplicacion es...</div>
  123. </div>
  124. <div class="bg-white border border-gray-200 rounded-xl p-4 cursor-pointer hover:border-gray-300 hover:shadow-sm transition-all duration-200 text-left flex items-center gap-4">
  125. <div class="text-lg mb-1">🍕</div>
  126. <div class="chat-suggestion text-gray-400 font-medium text-xs">¿Qué pizza queda bien con la hoppy mosh?</div>
  127. </div>
  128. <div class="bg-white border border-gray-200 rounded-xl p-4 cursor-pointer hover:border-gray-300 hover:shadow-sm transition-all duration-200 text-left flex items-center gap-4">
  129. <div class="text-lg mb-1">📱</div>
  130. <div class="chat-suggestion text-gray-400 font-medium text-xs">La orden no se envio bien</div>
  131. </div>
  132. </div>
  133. </div>
  134. </div>
  135. <!-- Indicador de carga - FIJO arriba del input -->
  136. <div id="aiLoadingIndicator" class="hidden flex px-5 py-3 text-left text-sm text-gray-500 italic flex-shrink-0">
  137. Pensando
  138. </div>
  139. <!-- Input del chat - FIJO en la parte inferior -->
  140. <div class="px-4 py-4 md:px-5 md:py-5 bg-white border-t border-gray-200 flex-shrink-0">
  141. <form id="chatForm" class="flex items-center bg-gray-50 border border-gray-300 rounded-3xl px-5 py-1 transition-colors focus-within:border-gray-400">
  142. <input
  143. id="chatInput"
  144. class="flex-1 sticky flex-shrink-0 bg-transparent border-none outline-none text-gray-900 text-sm py-3 placeholder-gray-500"
  145. autocomplete="off"
  146. placeholder="Pregunta lo que quieras"
  147. maxlength="2000"
  148. >
  149. <button id="sendChatButton" type="submit" class="bg-custom-dark hover:bg-custom-dark-hover text-white border-none rounded-2xl px-4 py-2.5 text-sm transition-colors ml-2 disabled:bg-gray-400 disabled:cursor-not-allowed">
  150. Enviar
  151. </button>
  152. </form>
  153. </div>
  154. </section>
  155. <!-- ===== CARRITO ===== -->
  156. <section id="cartTab" data-tab data-index="1" class="flex flex-col hidden flex-1 min-h-0">
  157. <header class="p-4 border-b border-gray-200">
  158. <h3 class="text-lg font-bold text-[#101419]">Tu pedido</h3>
  159. </header>
  160. <div id="cartItems" class="flex-1 overflow-y-auto p-4 space-y-2"></div>
  161. <p id="emptyCartText" class="hidden text-center text-gray-400 mt-4">Tu carrito está vacío.</p>
  162. <footer class="p-4 border-t border-gray-200 space-y-3">
  163. <div class="flex justify-between text-base">
  164. <span>Total:</span>
  165. <span id="cartTotal">$0</span>
  166. </div>
  167. <button id="checkoutButton"
  168. class="w-full bg-[#101419] hover:bg-[#37404a] disabled:opacity-50 text-white py-2 rounded-md"
  169. disabled>
  170. Envia tu orden
  171. </button>
  172. </footer>
  173. <div class="max-w-4xl mx-auto bg-white rounded-xl shadow-sm border border-gray-200 overflow-hidden">
  174. <!-- Header con nombre de usuario -->
  175. <div class="bg-gray-50 px-6 py-4 border-b border-gray-200">
  176. <h2 id="usernameTable" class="text-[19px] font-bold text-[#101419]">Pedido de Juan Pérez</h2>
  177. </div>
  178. <div class="overflow-x-auto max-h-[33vh]">
  179. <table id="historyTable" class="w-full">
  180. <thead class="bg-gray-50 border-b border-gray-200">
  181. <tr>
  182. <th class="px-6 py-3 text-left text-sm font-bold text-[#101419]">Cantidad</th>
  183. <th class="px-6 py-3 text-left text-sm font-bold text-[#101419]">Producto</th>
  184. <th class="px-6 py-3 text-right text-sm font-bold text-[#101419]">Precio</th>
  185. </tr>
  186. </thead>
  187. <tbody class="divide-y divide-gray-200">
  188. <template id="historyRowTemplate">
  189. <tr class="hover:bg-gray-50 transition-colors">
  190. <td class="list-element-quantity px-6 py-4 text-sm text-[#58728d]">1</td>
  191. <td class="px-6 py-4">
  192. <div class="flex flex-col">
  193. <span class="list-element-name text-sm font-medium text-[#101419]">Klein Lager</span>
  194. </div>
  195. </td>
  196. <td class="list-element-price px-6 py-4 text-sm font-semibold text-[#101419] text-right">$6.000</td>
  197. </tr>
  198. </template>
  199. </tbody>
  200. <!-- Total -->
  201. <tfoot class="bg-gray-50 border-t border-gray-200">
  202. <tr>
  203. <td colspan="2" class="px-6 py-4 text-base font-bold text-[#101419] text-right">
  204. Total General:
  205. </td>
  206. <td id="cartHistoryTotal" class="px-6 py-4 text-lg font-bold text-[#101419] text-right">
  207. $0
  208. </td>
  209. </tr>
  210. </tfoot>
  211. </table>
  212. </div>
  213. </div>
  214. </section>
  215. </main>
  216. <!-- ---------- NAVBAR ---------- -->
  217. <footer class="inset-x-0 z-10 border-t border-gray-200 bg-gray-50 px-4 py-2">
  218. <nav class="flex gap-2">
  219. <button data-target="menuTab" data-title="Biergarten Klein" class="active tab-btn flex-1 flex flex-col items-center text-[#58728d]">
  220. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="h-8"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M5 12l-2 0l9 -9l9 9l-2 0" /><path d="M5 12v7a2 2 0 0 0 2 2h10a2 2 0 0 0 2 -2v-7" /><path d="M9 21v-6a2 2 0 0 1 2 -2h2a2 2 0 0 1 2 2v6" /></svg><span class="text-xs font-medium">Inicio</span>
  221. </button>
  222. <button data-target="cartTab" data-title="Carrito Klein" class="tab-btn flex-1 flex flex-col items-center text-[#58728d]">
  223. <div id="cartIcon">
  224. <span id="cartCount">0</span>
  225. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" fill="currentColor"
  226. viewBox="0 0 256 256" class="h-8">
  227. <path
  228. d="M222.14,58.87A8,8,0,0,0,216,56H54.68L49.79,29.14A16,16,0,0,0,34.05,16H16a8,8,0,0,0,0,16h18L59.56,172.29a24,24,0,0,0,5.33,11.27,28,28,0,1,0,44.4,8.44h45.42A27.75,27.75,0,0,0,152,204a28,28,0,1,0,28-28H83.17a8,8,0,0,1-7.87-6.57L72.13,152h116a24,24,0,0,0,23.61-19.71l12.16-66.86A8,8,0,0,0,222.14,58.87ZM96,204a12,12,0,1,1-12-12A12,12,0,0,1,96,204Zm96,0a12,12,0,1,1-12-12A12,12,0,0,1,192,204Zm4-74.57A8,8,0,0,1,188.1,136H69.22L57.59,72H206.41Z" />
  229. </svg>
  230. </div>
  231. <span class="text-xs font-medium">Carrito</span>
  232. </button>
  233. <button data-target="chatTab" data-title="KleinBot" class="tab-btn flex-1 flex flex-col items-center text-[#58728d]">
  234. <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="h-8"><path stroke="none" d="M0 0h24v24H0z" fill="none"/><path d="M8 9h8" /><path d="M8 13h6" /><path d="M18 4a3 3 0 0 1 3 3v8a3 3 0 0 1 -3 3h-5l-5 3v-3h-2a3 3 0 0 1 -3 -3v-8a3 3 0 0 1 3 -3h12z" /></svg>
  235. <span class="text-xs font-medium">Chat IA</span>
  236. </button>
  237. </nav>
  238. </footer>
  239. <!-- ---------- TOAST ---------- -->
  240. <div id="toastCart"
  241. class="fixed top-4 left-1/2 -translate-x-1/2 bg-[#101419] text-white text-sm
  242. rounded-md px-4 py-2 shadow-lg opacity-0 pointer-events-none z-50
  243. origin-left">
  244. </div>
  245. <!-- MODALS -->
  246. <!-- === MODAL INICIO DE SESIÓN === -->
  247. <div id="sessionModal"
  248. class="fixed inset-0 bg-black/70 flex items-center justify-center z-50 p-4">
  249. <form id="loginForm" class="bg-white w-full max-w-md p-8 rounded-xl shadow-xl space-y-6">
  250. <div class="text-center">
  251. <h2 class="text-2xl font-bold text-gray-900">¡Bienvenido!</h2>
  252. <p id="loginMessage" class="text-sm text-gray-600 mt-2">
  253. Ingresa tus datos para comenzar tu pedido
  254. </p>
  255. </div>
  256. <div class="space-y-4">
  257. <div>
  258. <label for="emailInput" class="block text-sm font-medium text-gray-700 mb-2">
  259. Correo electrónico
  260. </label>
  261. <input id="emailInput"
  262. name="email"
  263. type="email"
  264. class="w-full border border-gray-300 px-4 py-3 rounded-lg focus:ring-2 focus:ring-[#101419] focus:border-transparent outline-none transition-all"
  265. placeholder="tu@email.com"
  266. required />
  267. </div>
  268. <div>
  269. <label for="pinInput" class="block text-sm font-medium text-gray-700 mb-2">
  270. PIN de 4 dígitos
  271. </label>
  272. <input id="pinInput"
  273. name="pin"
  274. type="password"
  275. maxlength="4"
  276. pattern="[0-9]{4}"
  277. class="w-full border border-gray-300 px-4 py-3 rounded-lg focus:ring-2 focus:ring-[#101419] focus:border-transparent outline-none transition-all"
  278. placeholder="••••"
  279. required />
  280. </div>
  281. <div>
  282. <label for="tableInput" class="block text-sm font-medium text-gray-700 mb-2">
  283. Número de mesa
  284. </label>
  285. <input id="tableInput"
  286. name="table"
  287. type="number"
  288. min="1"
  289. max="99"
  290. class="w-full border border-gray-300 px-4 py-3 rounded-lg focus:ring-2 focus:ring-[#101419] focus:border-transparent outline-none transition-all"
  291. placeholder="Ej: 5"
  292. required />
  293. </div>
  294. </div>
  295. <span id="ErrorLogin" class="hidden text-red-500 text-sm">Todo cago, perdon</span>
  296. <button id="sessionAcceptBtn"
  297. type="submit"
  298. class="w-full bg-[#101419] hover:bg-[#37404a] text-white py-3 rounded-lg font-medium transition-colors duration-200 focus:ring-2 focus:ring-offset-2 focus:ring-[#101419]">
  299. Comenzar pedido
  300. </button>
  301. </form>
  302. </div>
  303. <!-- Modal de Términos y Condiciones del Regalo -->
  304. <div id="rewardModal" class="fixed hidden inset-0 bg-black/70 flex items-center justify-center z-50 p-4">
  305. <div class="bg-white w-full max-w-lg max-h-[90vh] rounded-xl shadow-xl overflow-hidden">
  306. <!-- Header -->
  307. <div class="bg-gradient-to-r from-amber-500 to-orange-500 px-6 py-4 text-white">
  308. <div class="flex items-center justify-between">
  309. <div class="flex items-center gap-3">
  310. <span class="text-2xl">🍺</span>
  311. <h2 class="text-xl font-bold">¡Cerveza Gratis!</h2>
  312. </div>
  313. <button id="closeRewardModal" class="text-white/80 hover:text-white text-2xl font-bold transition-colors">
  314. ×
  315. </button>
  316. </div>
  317. </div>
  318. <!-- Content -->
  319. <div class="overflow-y-auto max-h-[60vh] px-6 py-4">
  320. <div class="space-y-4">
  321. <!-- Descripción del premio -->
  322. <div class="bg-amber-50 border border-amber-200 rounded-lg p-4">
  323. <h3 class="font-semibold text-amber-800 mb-2">🎉 ¡Felicitaciones!</h3>
  324. <p class="text-amber-700 text-sm">
  325. Has alcanzado el 100% de progreso y puedes reclamar una cerveza gratis de tu elección.
  326. </p>
  327. </div>
  328. <!-- Términos y Condiciones -->
  329. <div class="space-y-3">
  330. <h4 class="font-bold text-gray-800 text-base">Términos y Condiciones:</h4>
  331. <div class="text-sm text-gray-600 space-y-2">
  332. <div class="flex items-start gap-2">
  333. <span class="text-amber-500 font-bold">•</span>
  334. <p>Válido únicamente en Biergarten Klein para consumo en el local.</p>
  335. </div>
  336. <div class="flex items-start gap-2">
  337. <span class="text-amber-500 font-bold">•</span>
  338. <p>La cerveza gratis debe ser reclamada el mismo día que se alcanza el 100%.</p>
  339. </div>
  340. <div class="flex items-start gap-2">
  341. <span class="text-amber-500 font-bold">•</span>
  342. <p>Aplica para cervezas de barril regulares (no incluye cervezas premium o importadas).</p>
  343. </div>
  344. <div class="flex items-start gap-2">
  345. <span class="text-amber-500 font-bold">•</span>
  346. <p>No acumulable con otras promociones o descuentos.</p>
  347. </div>
  348. <div class="flex items-start gap-2">
  349. <span class="text-amber-500 font-bold">•</span>
  350. <p>El premio no tiene valor en efectivo y no es transferible.</p>
  351. </div>
  352. <div class="flex items-start gap-2">
  353. <span class="text-amber-500 font-bold">•</span>
  354. <p>Biergarten Klein se reserva el derecho de modificar o cancelar esta promoción sin previo aviso.</p>
  355. </div>
  356. <div class="flex items-start gap-2">
  357. <span class="text-amber-500 font-bold">•</span>
  358. <p>Debes ser mayor de 18 años para reclamar bebidas alcohólicas.</p>
  359. </div>
  360. </div>
  361. </div>
  362. <!-- Instrucciones -->
  363. <div class="bg-blue-50 border border-blue-200 rounded-lg p-4">
  364. <h4 class="font-semibold text-blue-800 mb-2">📋 Instrucciones:</h4>
  365. <p class="text-blue-700 text-sm">
  366. Una vez aceptes los términos, se generará un código que deberás mostrar al mesero junto con tu identificación para reclamar tu cerveza gratis.
  367. </p>
  368. </div>
  369. </div>
  370. </div>
  371. <!-- Footer con checkbox y botones -->
  372. <div class="border-t border-gray-200 px-6 py-4 space-y-4">
  373. <!-- Checkbox de aceptación -->
  374. <label class="flex items-start gap-3 cursor-pointer">
  375. <input id="acceptTermsCheckbox" type="checkbox" class="mt-1 w-4 h-4 text-amber-600 bg-gray-100 border-gray-300 rounded focus:ring-amber-500 focus:ring-2">
  376. <span class="text-sm text-gray-700">
  377. He leído y acepto los términos y condiciones para reclamar mi cerveza gratis.
  378. </span>
  379. </label>
  380. <!-- Botones -->
  381. <div class="flex gap-3">
  382. <button id="cancelRewardBtn" class="flex-1 bg-gray-100 hover:bg-gray-200 text-gray-700 py-3 rounded-lg font-medium transition-colors duration-200">
  383. Cancelar
  384. </button>
  385. <button id="claimRewardBtn" class="flex-1 bg-amber-500 hover:bg-amber-600 text-white py-3 rounded-lg font-medium transition-colors duration-200 opacity-50 cursor-not-allowed" disabled>
  386. 🎉 Reclamar Premio
  387. </button>
  388. </div>
  389. </div>
  390. </div>
  391. </div>
  392. <div id="successRewardModal" class="fixed hidden inset-0 bg-black/70 flex items-center justify-center z-50 p-4">
  393. <div class="bg-white w-full max-w-md rounded-xl shadow-xl overflow-hidden">
  394. <!-- Header -->
  395. <div class="bg-[#101419] px-6 py-8 text-white text-center relative">
  396. <!-- Elementos decorativos sutiles -->
  397. <div class="absolute top-3 left-4 text-amber-300 text-lg">✨</div>
  398. <div class="absolute top-4 right-6 text-amber-300 text-sm">🎉</div>
  399. <div class="absolute bottom-3 right-4 text-amber-300 text-sm">💫</div>
  400. <!-- Icono principal -->
  401. <div class="text-6xl mb-3">🍺</div>
  402. <!-- Título -->
  403. <h2 class="text-2xl font-bold mb-2">¡FELICIDADES!</h2>
  404. <div class="bg-white/20 rounded-full px-3 py-1 inline-block">
  405. <p class="text-gray-100 text-sm font-medium">🎁 Premio Reclamado</p>
  406. </div>
  407. </div>
  408. <!-- Content -->
  409. <div class="px-6 py-6 space-y-4">
  410. <!-- Mensaje de bienvenida -->
  411. <div class="text-center">
  412. <div class="bg-gray-50 rounded-lg p-4 border border-gray-200">
  413. <h3 class="text-lg font-bold text-[#101419] mb-1">🍻 ¡Tu cerveza gratis te espera!</h3>
  414. <p class="text-[#58728d] text-sm">Sigue estos pasos para reclamar tu premio</p>
  415. </div>
  416. </div>
  417. <!-- Instrucciones -->
  418. <div class="space-y-3">
  419. <div class="flex items-start gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200">
  420. <div class="bg-[#101419] text-white rounded-full w-7 h-7 flex items-center justify-center text-sm font-bold flex-shrink-0">1</div>
  421. <div class="text-sm">
  422. <div class="font-bold text-[#101419] mb-1">👨‍💼 Espera al mesero</div>
  423. <div class="text-[#58728d]">Este se acercará con tu comprobante de premio</div>
  424. </div>
  425. </div>
  426. <div class="flex items-start gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200">
  427. <div class="bg-[#101419] text-white rounded-full w-7 h-7 flex items-center justify-center text-sm font-bold flex-shrink-0">2</div>
  428. <div class="text-sm">
  429. <div class="font-bold text-[#101419] mb-1">🍺 Elige tu cerveza favorita</div>
  430. <div class="text-[#58728d]">Selecciona cualquier cerveza hasta <span class="font-semibold">$5,000</span></div>
  431. </div>
  432. </div>
  433. <div class="flex items-start gap-3 p-3 bg-gray-50 rounded-lg border border-gray-200">
  434. <div class="bg-[#101419] text-white rounded-full w-7 h-7 flex items-center justify-center text-sm font-bold flex-shrink-0">3</div>
  435. <div class="text-sm">
  436. <div class="font-bold text-[#101419] mb-1">🎉 ¡Disfruta al máximo!</div>
  437. <div class="text-[#58728d]">Tu cerveza gratis está lista para disfrutar 🥳</div>
  438. </div>
  439. </div>
  440. </div>
  441. <!-- Nota importante -->
  442. <div class="bg-amber-50 border border-amber-200 rounded-lg p-3">
  443. <div class="flex items-center gap-2 mb-1">
  444. <span class="text-base">⏰</span>
  445. <h4 class="font-semibold text-amber-800 text-sm">Importante</h4>
  446. </div>
  447. <p class="text-amber-700 text-sm">Este premio es válido solo para el día de hoy. ¡No pierdas esta oportunidad!</p>
  448. </div>
  449. </div>
  450. <!-- Footer -->
  451. <div class="px-6 py-4 bg-gray-50 border-t border-gray-200">
  452. <button id="closeSuccessRewardModal" class="w-full bg-[#101419] hover:bg-[#37404a] text-white py-3 rounded-lg font-medium transition-colors duration-200">
  453. <span class="flex items-center justify-center gap-2">
  454. <span>🎊</span>
  455. Aceptar
  456. <span>🍻</span>
  457. </span>
  458. </button>
  459. </div>
  460. </div>
  461. </div>
  462. <!-- ---------- JS: conmutar tabs + toast ---------- -->
  463. <script>
  464. const animation_time = 200
  465. let transitioning = false;
  466. // conmutar pestañas
  467. const buttons = document.querySelectorAll('.tab-btn')
  468. buttons.forEach(btn => {
  469. btn.addEventListener('click', () => {
  470. const target = btn.dataset.target;
  471. const active = document.querySelector(':not(.hidden)[data-tab]');
  472. const activeIndex = active.dataset.index;
  473. const to = document.querySelector(`#${target}[data-tab]`);
  474. const toIndex = to.dataset.index;
  475. const height = to.offsetHeight;
  476. if (activeIndex === toIndex || transitioning) return;
  477. buttons.forEach(button => {
  478. button.classList.remove('active')
  479. })
  480. btn.classList.add('active')
  481. active.style.height = "100%";
  482. active.style.width = "100vw"
  483. to.style.height = "100%";
  484. to.style.width = "100vw"
  485. to.style.zIndex = "1";
  486. active.style.zIndex = "0";
  487. transitioning = true;
  488. const otherTabs = document.querySelectorAll('[data-tab]');
  489. otherTabs.forEach(tab => {
  490. if (tab !== active && tab !== to) {
  491. tab.classList.add('hidden');
  492. tab.classList.remove(`animate-[slideLeft_${animation_time}ms_ease-out]`, `animate-[slideRight_${animation_time}ms_ease-out]`);
  493. tab.classList.remove(`animate-[slideLeftIn_${animation_time}ms_ease-out]`, `animate-[slideRightIn_${animation_time}ms_ease-out]`);
  494. }
  495. });
  496. to.classList.remove('hidden');
  497. // Animate tab transition
  498. if (activeIndex < toIndex) {
  499. // Slide left
  500. active.classList.add(`animate-[slideLeft_${animation_time}ms_ease-out]`);
  501. to.classList.add(`animate-[slideRightIn_${animation_time}ms_ease-out]`);
  502. } else if (activeIndex > toIndex) {
  503. // Slide right
  504. active.classList.add(`animate-[slideRight_${animation_time}ms_ease-out]`);
  505. to.classList.add(`animate-[slideLeftIn_${animation_time}ms_ease-out]`);
  506. }
  507. setTimeout(() => {
  508. active.classList.remove(`animate-[slideLeft_${animation_time}ms_ease-out]`, `animate-[slideRight_${animation_time}ms_ease-out]`);
  509. active.classList.add('hidden');
  510. to.classList.remove(`animate-[slideLeftIn_${animation_time}ms_ease-out]`, `animate-[slideRightIn_${animation_time}ms_ease-out]`);
  511. transitioning = false;
  512. }, animation_time);
  513. // Update header title if needed
  514. const title = btn.dataset.title;
  515. if (title) {
  516. document.getElementById('mainTitle').textContent = title;
  517. }
  518. });
  519. });
  520. // toast simple
  521. window.showToast = (msg) => {
  522. const toast = document.getElementById('toastCart');
  523. toast.textContent = msg;
  524. toast.style.animation = 'none'; // reset
  525. void toast.offsetWidth; // reflow
  526. toast.style.opacity = '1';
  527. toast.style.animation = 'popup 1s ease-out';
  528. toast.addEventListener('animationend', () => {
  529. toast.style.animation = 'none';
  530. toast.style.opacity = '0';
  531. });
  532. };
  533. </script>
  534. </body>
  535. </html>