index.html 32 KB

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