diff --git a/FRONTEND.md b/FRONTEND.md new file mode 100644 index 0000000..7c17762 --- /dev/null +++ b/FRONTEND.md @@ -0,0 +1,230 @@ +# FRONTEND.md — Guía de modificación del frontend + +> Documento de control para dirigir cambios **solo de frontend** en SmartMenu Collina. +> Léelo (humano y Claude) antes de cada tarea. Si un cambio te obliga a salir del +> alcance definido aquí, **detente y avisa** antes de continuar. + +--- + +## 1. Objetivo y alcance + +**Solo modificamos la capa de presentación.** UI, estilos, layout, animaciones, +textos visibles, accesibilidad y comportamiento de cliente (estado local, +interacciones). No tocamos contratos de API, base de datos, autenticación ni lógica +de servidor. + +### ✅ Permitido (zona de trabajo) + +| Área | Rutas | +| --- | --- | +| Componentes públicos (menú QR) | `src/components/public/**` | +| Componentes del editor | `src/components/editor/**` *(solo UI, no la firma de `api.ts`)* | +| Componentes del admin | `src/components/admin/**` | +| Componente compartido | `src/components/LanguageSwitch.tsx` | +| Estilos globales / tokens | `src/app/globals.css`, `tailwind.config.ts`, `postcss.config.mjs` | +| Layout y páginas (solo JSX/estilos) | `src/app/layout.tsx`, `src/app/page.tsx`, `src/app/**/page.tsx` | +| Textos de interfaz (i18n) | `messages/es.json`, `messages/en.json` | +| Assets estáticos | `public/**` | + +### ⛔ Prohibido sin autorización explícita + +- `src/app/api/**` — endpoints (contrato HTTP). +- `prisma/**` — esquema, migraciones, seed. +- `src/lib/**` — lógica de dominio (auth, prisma, orders-bus, menu, palette, upload, + import, anthropic, guard…). **Excepción de solo lectura:** puedes *leer* + `macros.ts`, `palette.ts`, `contrast.ts`, `types.ts` para respetar sus tipos y + constantes, pero no los modificas. +- `src/components/editor/api.ts` y `src/components/editor/types.ts` — son el puente + con el backend; cambiar su forma rompe el contrato. +- `src/i18n/**`, `next.config.mjs`, `Dockerfile`, `docker-compose.yml`, + `docker-entrypoint.sh`, `.env*`. + +> Si un cambio de UI parece exigir tocar un endpoint o `src/lib`, casi siempre hay +> una alternativa de presentación. Propónla primero. + +--- + +## 2. Mapa rápido del frontend + +``` +src/ +├─ app/ +│ ├─ layout.tsx # fuentes (Fraunces/Inter), , providers +│ ├─ globals.css # tokens CSS, .glass, flip 3D, safe-area +│ ├─ page.tsx # landing raíz (premium minimalista: marca + CTA único) +│ ├─ [slug]/page.tsx # menú público (server) → PublicMenu +│ ├─ [slug]/editor/... # editor protegido +│ └─ admin/page.tsx # panel maestro +└─ components/ + ├─ public/ → Gallery, AiConsultant, BrandHeader, DishCard, ListRow, + │ SplitPanel, MediaThumb, PublicMenu (615 L, núcleo), MacrosBack, + │ SuggestionCarousel + ├─ editor/ → Editor, CatalogTab, OrdersTab (717 L), ProductEditor, QrTab, + │ PaletteTab, BrandTab, VersionHistory, PublishModal, ImportModal, + │ EditorLogin, SectionTitleEditor + └─ admin/ → AdminLogin, AdminPanel +``` + +Archivos núcleo (cámbialos con cuidado, son grandes y muy referenciados): +`PublicMenu.tsx`, `OrdersTab.tsx`, `ProductEditor.tsx`, `QrTab.tsx`, `CatalogTab.tsx`. + +Cuenta dividida unificada (cuentas de mesa, batches, timers de entrega): UI en +`editor/OrdersTab.tsx` y `public/SplitPanel.tsx`; sus endpoints +`api/[slug]/split/{mine,subaccounts,sync}` viven en la zona ⛔ (no se tocan). + +Motor de recomendaciones determinista local: `src/lib/recommendations.ts` +(reemplazó a `lib/pairings.ts`) — solo lectura, alimenta `SuggestionCarousel`. + +Assets de video del rediseño en `public/videos/`: `landing-bg.mp4` (fondo de la landing) +y `panel-restaurante.mp4` (fondo del login del editor). El dock inferior del editor vive +en `Editor.tsx` (clases `.dock-*`). + +--- + +## 3. Sistema de diseño (respetar siempre) + +La estética es **glassmorphism claro/transparente con animaciones high-end**. No +introducir un look nuevo sin pedirlo. + +### Tokens de color (CSS vars en `globals.css`) +La paleta del restaurante es **configurable en runtime** vía estas variables — úsalas, +no hardcodees colores de marca: + +``` +--bg, --bg-2 fondos --surface cristal +--accent acento --text texto --tab píldoras +``` + +> **Acción primaria = rojo `#dc2626` hardcodeado** (rediseño): botones "Agregar a mi +> orden", FAB "Orden", CTA de la landing, "Guardar y publicar", login, etc. NO usan +> `--accent` (la sección de Paleta se retirará después). Acentos secundarios del FAB: +> azul `#1e3a5f` (mesero), negro `#111` (dividir cuenta). + +### Tipografía (rediseño) +- **Montserrat** = UI + display (cuerpo y títulos). Cargada en `layout.tsx` (`next/font`, + var `--font-montserrat`); `.display` la usa. +- **Merriweather** = SOLO el wordmark "Smart Menu" de la landing (`.wordmark`, var + `--font-merriweather`). + +### Colores de macros — ESTÁNDAR FIJO (no configurable) +Definidos en `tailwind.config.ts` (`colors.macro`) y `src/lib/macros.ts`. **Nunca** +los cambies ni los sustituyas por colores de paleta: + +| Macro | Token Tailwind | Hex | +| --- | --- | --- | +| Proteína | `macro-protein` | `#dc2626` | +| Carbohidratos | `macro-carbs` | `#B45309` | +| Azúcares | `macro-sugar` | `#BE185D` | +| Grasas | `macro-fat` | `#CA8A04` | +| Fibra | `macro-fiber` | `#15803D` | +| Calorías | `macro-kcal` | `#1D4ED8` | + +### Clases utilitarias propias +- `.glass`, `.glass-soft`, `.glass-pill` — superficies de cristal. +- `.liquid-btn` — botón "cristal líquido" (opt-in). +- `.ai-smoke` / `.ai-smoke-red` / `.ai-smoke-green` — botones de gradiente animado (IA / orden / split). +- `.seg-btn`(`.is-active`) — control segmentado (Tarjetas/Lista). +- `.cat-btn` / `.cat-bar`(`.is-stuck`) / `.stuck-name` / `.cat-row` — tabs de sección sticky del menú público. +- `.dock-bar` / `.dock-btn` / `.dock-chip` / `.dock-dot` / `.dock-tip` — dock inferior del editor (en `Editor.tsx`). +- `.macro-cell` / `.macro-num` — celdas de macros (cara trasera de la tarjeta), con brillo. +- `.pendiente-green` / `.pendiente-yellow` / `.pendiente-red` — cronómetros de entrega (OrdersTab). +- `.editable-num` — input numérico sin spinner. +- `.aurora` — fondo aurora animado (disponible para la landing). +- `.display` — tipografía Montserrat para títulos; `.wordmark` — Merriweather (landing). +- `.flip-scene` / `.flip-card` / `.flip-face` — flip 3D de macros (perspective 1400px). +- `.no-scrollbar` — tabs horizontales. +- `safe-*` — respeto de safe-area (notch / barra de gestos). **Úsalas** en headers, + FABs, tab bars y modales en vez de paddings fijos. + +### Animaciones disponibles (Tailwind) +`animate-fade-up`, `animate-spawn`, `animate-pulse-dot`. Reúsalas antes de crear +keyframes nuevos. Curva estándar: `cubic-bezier(0.22, 1, 0.36, 1)`. + +--- + +## 4. Reglas de internacionalización (i18n) + +- **Bilingüe ES/EN obligatorio.** Todo texto visible sale de `messages/es.json` y + `messages/en.json` vía `next-intl` (`useTranslations`). **Nunca** hardcodees + cadenas en el JSX. +- Si agregas una clave, **agrégala en ambos** archivos con el mismo path. +- **Sentence case** en toda la UI (no Title Case): "Realizar orden", no "Realizar Orden". +- Contenido dinámico (nombres/descripciones de platillos) ya viene como `{ es, en }`; + selecciona el idioma activo, no lo traduzcas en el cliente. + +--- + +## 5. Reglas de oro (guardrails) + +1. **Mobile-first.** El público y el editor son móviles primero. Verifica en ancho + ~390px antes que en desktop. +2. **No romper el contrato de datos.** Consume las props/tipos existentes + (`components/editor/types.ts`, `lib/types.ts`); no cambies su forma. +3. **Sin dependencias nuevas** salvo autorización. Ya hay `lucide-react` (iconos), + `clsx`, `qr-code-styling`. Úsalas. +4. **Cambios mínimos y localizados.** Toca solo lo necesario para el objetivo; imita + el estilo del código vecino (naming, densidad de comentarios, idioma). +5. **Accesibilidad:** contraste suficiente sobre cristal (hay helper `lib/contrast.ts`), + `aria-label` en botones de solo icono, foco visible, `alt` en imágenes. +6. **Sin estados de servidor nuevos.** Estado local de UI (useState/useReducer) sí; + nuevos fetch/endpoints no. +7. **Reduce motion:** si agregas animación fuerte, respeta `prefers-reduced-motion`. + +--- + +## 6. Flujo de trabajo por cada cambio + +1. **Definir** el cambio en una línea (ver §8, tabla de tareas). +2. **Localizar** los componentes afectados (§2). Leer antes de editar. +3. **Confirmar alcance:** ¿toca algo de la zona ⛔? → avisar y proponer alternativa. +4. **Implementar** usando tokens, clases utilitarias e i18n existentes. +5. **Verificar** (§7). +6. **Reportar:** qué archivos cambiaron y por qué, en una frase. + +### Comandos +```bash +npm install # primera vez +npm run dev # http://localhost:3000 — desarrollo en vivo +npm run lint # ESLint (next lint) +npm run build # prisma generate + next build (chequeo de tipos/SSR) +``` +> Las rutas reales: menú `/{slug}`, editor `/{slug}/editor?k={secret}`, admin `/admin`. +> El seed (`npm run db:seed`) imprime el link con secreto y `admin / demo1234`. + +--- + +## 7. Checklist de verificación (antes de dar por hecho un cambio) + +- [ ] Se ve bien en móvil (~390px) y no se rompe en desktop. +- [ ] Todo texto nuevo está en `es.json` **y** `en.json`, en sentence case. +- [ ] Usa tokens de paleta (`--accent`, etc.), no hex de marca hardcodeados. +- [ ] Colores de macros intactos (§3). +- [ ] `npm run lint` y `npm run build` sin errores nuevos. +- [ ] No se modificó nada de la zona ⛔ (api, prisma, lib, contratos). +- [ ] safe-area respetada en headers/FABs/tab bars/modales. +- [ ] Contraste y `aria-label` correctos. + +--- + +## 8. Registro de tareas (lo llena el humano que dirige) + +> Una fila por cambio solicitado. Claude la toma de arriba hacia abajo. + +| # | Cambio (qué y dónde) | Componente(s) objetivo | Estado | Notas | +| - | --- | --- | --- | --- | +| 1 | _ej. Aumentar el tamaño del precio en la tarjeta de platillo_ | `public/DishCard.tsx` | pendiente | | +| 2 | | | | | +| 3 | | | | | + +--- + +## 9. Plantilla para pedir un cambio + +``` +Objetivo: +Pantalla/ruta: · +Componente(s): +Detalle: +Restricciones: solo frontend · respetar glass + macros + i18n + mobile-first +Aceptación: +``` diff --git a/Frontend Actualizado/admin-login.html b/Frontend Actualizado/admin-login.html new file mode 100644 index 0000000..fefba37 --- /dev/null +++ b/Frontend Actualizado/admin-login.html @@ -0,0 +1,63 @@ + + + + + + +Admin · login — SmartMenu + + + + + + +
+
+
+

Panel maestro Collina

+ + + +
+
+
+ + diff --git a/Frontend Actualizado/admin-panel.html b/Frontend Actualizado/admin-panel.html new file mode 100644 index 0000000..d1f3d59 --- /dev/null +++ b/Frontend Actualizado/admin-panel.html @@ -0,0 +1,113 @@ + + + + + + +Admin · panel — SmartMenu + + + + + + +
+

Panel maestro Collina

+ +
+

Nuevo restaurante

+
+ + + + +
+ +
+

Restaurante «Café del Parque» creado. Guarda estas credenciales (se muestran una vez):

+
    +
  • Usuario: cafedelparque
  • +
  • Contraseña: x7Kp9mQ2
  • +
  • Link de editor: https://menu.collina.mx/cafedelparque/editor?k=9f3a1c7e
  • +
  • Link público: https://menu.collina.mx/cafedelparque
  • +
+
+
+ +
+

Restaurantes

+ +
+
+ + diff --git a/Frontend Actualizado/assets/landing-bg.mp4 b/Frontend Actualizado/assets/landing-bg.mp4 new file mode 100644 index 0000000..380759e Binary files /dev/null and b/Frontend Actualizado/assets/landing-bg.mp4 differ diff --git a/Frontend Actualizado/assets/panel-restaurante.mp4 b/Frontend Actualizado/assets/panel-restaurante.mp4 new file mode 100644 index 0000000..586e85e Binary files /dev/null and b/Frontend Actualizado/assets/panel-restaurante.mp4 differ diff --git a/Frontend Actualizado/editor-catalogo.html b/Frontend Actualizado/editor-catalogo.html new file mode 100644 index 0000000..fa35f8d --- /dev/null +++ b/Frontend Actualizado/editor-catalogo.html @@ -0,0 +1,259 @@ + + + + + + +Editor · catálogo — SmartMenu + + + + + + +
+ + + + +
+ + + + diff --git a/Frontend Actualizado/editor-historial.html b/Frontend Actualizado/editor-historial.html new file mode 100644 index 0000000..bcd4fa5 --- /dev/null +++ b/Frontend Actualizado/editor-historial.html @@ -0,0 +1,192 @@ + + + + + + +Editor · historial — SmartMenu + + + + + + +
+ + + +
+ + + + + diff --git a/Frontend Actualizado/editor-login.html b/Frontend Actualizado/editor-login.html new file mode 100644 index 0000000..eb85fed --- /dev/null +++ b/Frontend Actualizado/editor-login.html @@ -0,0 +1,68 @@ + + + + + + +Editor · login — SmartMenu + + + + + + +
+
+ +
+
+

Trattoria della Collina

+

Iniciar sesión

+ + + +
+
+
+ + diff --git a/Frontend Actualizado/editor-marca.html b/Frontend Actualizado/editor-marca.html new file mode 100644 index 0000000..2a77f18 --- /dev/null +++ b/Frontend Actualizado/editor-marca.html @@ -0,0 +1,202 @@ + + + + + + +Editor · marca — SmartMenu + + + + + + +
+ + + +
+ + + + diff --git a/Frontend Actualizado/editor-ordenes.html b/Frontend Actualizado/editor-ordenes.html new file mode 100644 index 0000000..2324541 --- /dev/null +++ b/Frontend Actualizado/editor-ordenes.html @@ -0,0 +1,297 @@ + + + + + + +Editor · órdenes — SmartMenu + + + + + + +
+ + + +
+ + + + diff --git a/Frontend Actualizado/editor-producto.html b/Frontend Actualizado/editor-producto.html new file mode 100644 index 0000000..a42bd29 --- /dev/null +++ b/Frontend Actualizado/editor-producto.html @@ -0,0 +1,168 @@ + + + + + + +Editor · producto — SmartMenu + + + + + + +
+ +
+ + +
+
+
+

Editar

+ +
+ + +
+ Nombre +
+
+ ES + +
+
+ EN + +
+
+ + +
+
+
+ + +
+ Descripción +
+ + +
+ + +
+
+
+ + +
+
+ Precio + +
+
+ Sección + +
+
+ + +
+ Fotos y videos +
+ + +
+
+ + +
+ Macros +
+ + + + + + +
+
+ + +
+ Alérgenos +
+ + + + + + + +
+
+ + +
+ Tags de dieta +
+ + + + + + +
+
+ +
+ + +
+
+
+
+ + diff --git a/Frontend Actualizado/publico-carrito-split.html b/Frontend Actualizado/publico-carrito-split.html new file mode 100644 index 0000000..52a5696 --- /dev/null +++ b/Frontend Actualizado/publico-carrito-split.html @@ -0,0 +1,201 @@ + + + + + + +Carrito y split — SmartMenu + + + + + + + + +
+ Carrito · «Tu pedido» + +
+ + +
+ Split · «Mi cuenta» (timers de entrega) + +
+ + + diff --git a/Frontend Actualizado/publico-consultor-ia.html b/Frontend Actualizado/publico-consultor-ia.html new file mode 100644 index 0000000..a35dc47 --- /dev/null +++ b/Frontend Actualizado/publico-consultor-ia.html @@ -0,0 +1,168 @@ + + + + + + +Consultor IA — SmartMenu + + + + + + + +
+ + + + +
+ + +
+
+
+

Consultor del menú

+ +
+ +
+ +

Para una opción ligera y alta en proteína, estas dos te van perfecto. Y si quieres redondear la comida, mira lo de «para acompañar».

+ +
+ +
+
+
Salmón a la parrilla
+

Alto en proteína y omega-3, con guarnición de verduras. Ideal si buscas algo ligero.

+
+ +
+
+
+
Carpaccio de res
+

Entrada ligera, baja en carbohidratos y rica en proteína magra.

+
+ +
+ + +

Para acompañar

+
+
+
Bruschetta al pomodoro
+

Un entrante fresco que equilibra el plato sin pesar.

+
+ +
+
+ + +
+

También te puede gustar

+
+
+ Risotto ai funghi +
+ Risotto ai funghi + $18.50 + +
+
+
+ Tiramisú +
+ Tiramisú + $9.00 + +
+
+
+ Bruschetta al pomodoro +
+ Bruschetta al pomodoro + $8.50 + +
+
+
+
+
+ + +
+ + +
+
+
+
+ + + diff --git a/Frontend Actualizado/publico-landing.html b/Frontend Actualizado/publico-landing.html new file mode 100644 index 0000000..1d30fef --- /dev/null +++ b/Frontend Actualizado/publico-landing.html @@ -0,0 +1,145 @@ + + + + + + +Landing — SmartMenu + + + + + + + + +
+
+ + + + + +
+ +
+ +

+ Smart Menu +

+ + + +
+ + + Solicita una demo + + +
+
+ + + + diff --git a/Frontend Actualizado/publico-menu.html b/Frontend Actualizado/publico-menu.html new file mode 100644 index 0000000..ef97535 --- /dev/null +++ b/Frontend Actualizado/publico-menu.html @@ -0,0 +1,508 @@ + + + + + + +Menú público — SmartMenu + + + + + + + + + + + + + + + +
+ + + +
+ + + +
+
+ + + + + diff --git a/Frontend Actualizado/publico-tarjeta-flip.html b/Frontend Actualizado/publico-tarjeta-flip.html new file mode 100644 index 0000000..be438a6 --- /dev/null +++ b/Frontend Actualizado/publico-tarjeta-flip.html @@ -0,0 +1,204 @@ + + + + + + +Tarjeta flip — SmartMenu + + + + + + + +

Toca la tarjeta de la izquierda (botón «Toca para ver macros» / ✕) para ver el giro 3D. La derecha muestra la cara trasera fija.

+ +
+ + +
+ Tarjeta · flip interactivo + +
+ + +
+ Cara trasera · macros (colores fijos) + +
+ +
+ + + diff --git a/messages/en.json b/messages/en.json index 3ef1809..c2676f2 100644 --- a/messages/en.json +++ b/messages/en.json @@ -52,9 +52,17 @@ "macroLegend": "Macro color code", "tapToFlip": "Tap to see macros", "viewCards": "Cards", - "viewList": "List" + "viewList": "List", + "nutrition": "Nutrition facts", + "addToOrderLong": "Add to my order", + "explore": "Explore our menu", + "askClaude": "Ask Claude", + "order": "Order", + "splitAction": "Split bill", + "flipBack": "Back" }, "macros": { + "title": "Macros", "protein": "Protein", "carbs": "Carbs", "sugar": "Sugars", @@ -111,6 +119,8 @@ "split": "Split", "tableTotal": "Table total", "completeTable": "Complete table", + "waiterAlert": "ALERT at Table {table}", + "pending": "PENDING", "tableSubaccount": "Table", "subaccountEmpty": "No dishes yet.", "paid": "Paid", @@ -263,6 +273,19 @@ "editorLink": "Editor link", "publicLink": "Public link", "credentials": "Initial credentials", - "active": "Active" + "active": "Active", + "slugOptional": "Slug (optional)", + "slugPlaceholder": "generated from the name", + "language": "Language", + "localeEs": "ES", + "localeEn": "EN", + "createdNotice": "Restaurant «{name}» created. Save these credentials (shown only once):", + "username": "Username", + "password": "Password", + "empty": "No restaurants yet.", + "statusActive": "active", + "statusInactive": "inactive", + "publicPrefix": "public", + "editorPrefix": "editor" } } diff --git a/messages/es.json b/messages/es.json index 05c4f5e..45e9a56 100644 --- a/messages/es.json +++ b/messages/es.json @@ -52,9 +52,17 @@ "macroLegend": "Código de color de macros", "tapToFlip": "Toca para ver macros", "viewCards": "Tarjetas", - "viewList": "Lista" + "viewList": "Lista", + "nutrition": "Datos nutricionales", + "addToOrderLong": "Agregar a mi orden", + "explore": "Explora nuestro menú", + "askClaude": "Preguntar a Claude", + "order": "Orden", + "splitAction": "Dividir cuenta", + "flipBack": "Regresar" }, "macros": { + "title": "Macros", "protein": "Proteína", "carbs": "Carbohidratos", "sugar": "Azúcares", @@ -111,6 +119,8 @@ "split": "Dividida", "tableTotal": "Total de la mesa", "completeTable": "Completar mesa", + "waiterAlert": "ALERTA en Mesa {table}", + "pending": "PENDIENTE", "tableSubaccount": "Mesa", "subaccountEmpty": "Aún sin platillos.", "paid": "Pagado", @@ -263,6 +273,19 @@ "editorLink": "Link de editor", "publicLink": "Link público", "credentials": "Credenciales iniciales", - "active": "Activo" + "active": "Activo", + "slugOptional": "Slug (opcional)", + "slugPlaceholder": "se genera del nombre", + "language": "Idioma", + "localeEs": "ES", + "localeEn": "EN", + "createdNotice": "Restaurante «{name}» creado. Guarda estas credenciales (se muestran una vez):", + "username": "Usuario", + "password": "Contraseña", + "empty": "Aún no hay restaurantes.", + "statusActive": "activo", + "statusInactive": "inactivo", + "publicPrefix": "público", + "editorPrefix": "editor" } } diff --git a/package-lock.json b/package-lock.json index b30cb97..fbd2fd1 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1522,7 +1522,6 @@ "version": "2.3.3", "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "dev": true, "hasInstallScript": true, "license": "MIT", "optional": true, diff --git a/public/videos/landing-bg.mp4 b/public/videos/landing-bg.mp4 new file mode 100644 index 0000000..380759e Binary files /dev/null and b/public/videos/landing-bg.mp4 differ diff --git a/public/videos/panel-restaurante.mp4 b/public/videos/panel-restaurante.mp4 new file mode 100644 index 0000000..586e85e Binary files /dev/null and b/public/videos/panel-restaurante.mp4 differ diff --git a/src/app/globals.css b/src/app/globals.css index f56a071..c3ff0f8 100644 --- a/src/app/globals.css +++ b/src/app/globals.css @@ -21,7 +21,7 @@ body { body { color: var(--text); - font-family: var(--font-inter), system-ui, sans-serif; + font-family: var(--font-montserrat), system-ui, sans-serif; background: radial-gradient(1200px 800px at 80% -10%, rgba(255, 255, 255, 0.6), transparent 60%), radial-gradient(1000px 700px at -10% 110%, rgba(255, 255, 255, 0.4), transparent 55%), @@ -55,7 +55,12 @@ body { } .display { - font-family: var(--font-fraunces), Georgia, serif; + font-family: var(--font-montserrat), system-ui, sans-serif; + } + + /* Reserved for the landing "Smart Menu" wordmark. */ + .wordmark { + font-family: var(--font-merriweather), Georgia, serif; } } @@ -163,6 +168,337 @@ body { scrollbar-width: none; } +/* ============================================================ + Redesign design-system primitives (ported from the mockups) + ============================================================ */ + +/* ---- Primary action color (hardcoded red across restaurants) ---- */ +:root { + --action: #dc2626; +} + +/* ---- "Liquid glass" button (opt-in via .liquid-btn) ---- */ +.liquid-btn { + position: relative; + background: + linear-gradient(135deg, rgba(255, 255, 255, 0.65), rgba(245, 242, 237, 0.25) 55%, rgba(180, 83, 9, 0.06)), + rgba(255, 255, 255, 0.4); + backdrop-filter: blur(10px) saturate(160%); + -webkit-backdrop-filter: blur(10px) saturate(160%); + border: 1px solid rgba(255, 255, 255, 0.9); + box-shadow: + 0 10px 24px -6px rgba(40, 30, 20, 0.22), + 0 2px 6px rgba(40, 30, 20, 0.1), + inset 0 2px 2px rgba(255, 255, 255, 1), + inset 0 -6px 12px rgba(180, 160, 140, 0.18), + inset 0 0 0 1px rgba(255, 255, 255, 0.5); + overflow: hidden; + color: #2a2520; + transition: box-shadow 0.25s ease, transform 0.25s ease; +} +.liquid-btn::before { + content: ''; + position: absolute; + left: 6%; + right: 6%; + top: 2px; + height: 42%; + border-radius: 999px; + pointer-events: none; + background: linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(255, 255, 255, 0)); + filter: blur(0.5px); + opacity: 0.9; +} +.liquid-btn:hover { + box-shadow: + 0 14px 30px -6px rgba(40, 30, 20, 0.28), + 0 3px 8px rgba(40, 30, 20, 0.14), + inset 0 2px 3px rgba(255, 255, 255, 1), + inset 0 -7px 14px rgba(180, 160, 140, 0.22), + inset 0 0 0 1px rgba(255, 255, 255, 0.6); + transform: translateY(-1px); +} + +/* ---- Animated gradient "smoke" buttons (AI / order / split) ---- */ +@keyframes ai-smoke { + 0% { background-position: 0% 50%; } + 50% { background-position: 100% 50%; } + 100% { background-position: 0% 50%; } +} +.ai-smoke, +.ai-smoke-red, +.ai-smoke-green { + background-size: 300% 300%; + color: #fff; + border: none; + animation: ai-smoke 6s ease-in-out infinite; +} +.ai-smoke { background-image: linear-gradient(120deg, #d97757, #e89b7d, #c2410c, #e08a5f, #d97757); } +.ai-smoke-red { background-image: linear-gradient(120deg, #dc2626, #f05252, #991b1b, #ef4444, #dc2626); } +.ai-smoke-green { background-image: linear-gradient(120deg, #4c1d95, #6d28d9, #3b0764, #5b21b6, #4c1d95); } +@media (prefers-reduced-motion: reduce) { + .ai-smoke, + .ai-smoke-red, + .ai-smoke-green { animation: none; } +} + +/* ---- Segmented control (e.g. Tarjetas / Lista) ---- */ +.seg-btn { + color: rgba(42, 37, 32, 0.5); + background: transparent; + border: none; + cursor: pointer; + transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease; +} +.seg-btn.is-active { + color: #111; + background: #fff; + box-shadow: 0 2px 8px rgba(40, 30, 20, 0.14), 0 0 0 1px rgba(0, 0, 0, 0.04); +} + +/* ---- Category pills + sticky "stuck" bar (public menu sections) ---- */ +.cat-btn { + display: flex; + align-items: center; + gap: 8px; + background: #f0f0f0; + color: #111; + border: none; + cursor: pointer; + transition: background 0.2s ease, color 0.2s ease; +} +.cat-btn.is-active { + background: #111; + color: #fff; +} +.cat-bar { + background: #ffffff; + display: flex; + flex-direction: column; + transition: box-shadow 0.25s ease, background 0.25s ease; +} +.cat-bar.is-stuck { + box-shadow: 0 6px 16px -6px rgba(40, 30, 20, 0.18), 0 1px 0 rgba(0, 0, 0, 0.04); +} +.cat-row { + display: flex; + gap: 8px; + overflow-x: auto; +} +.stuck-name { + display: none; + font-weight: 700; + font-size: 18px; + color: #111; + margin-bottom: 12px; + padding-left: 2px; +} +.cat-bar.is-stuck .stuck-name { display: block; } +.cat-bar.is-stuck .cat-row { justify-content: flex-start; gap: 22px; } +.cat-bar.is-stuck .cat-btn { + background: transparent !important; + color: rgba(42, 37, 32, 0.45) !important; + border-radius: 0 !important; + padding: 0 0 9px !important; + position: relative; + font-weight: 600; +} +.cat-bar.is-stuck .cat-btn.is-active { background: transparent !important; color: #111 !important; } +.cat-bar.is-stuck .cat-btn.is-active::after { + content: ''; + position: absolute; + left: 0; + right: 0; + bottom: 0; + height: 3px; + border-radius: 3px; + background: #111; +} + +/* ---- Editor bottom dock navigation ---- */ +.dock-bar { + display: flex; + align-items: center; + justify-content: space-between; + gap: 4px; + width: 100%; + padding: 20px 18px 14px; + border-radius: 32px; + background: #fff; + border: 1px solid rgba(0, 0, 0, 0.05); + box-shadow: 0 16px 36px -10px rgba(0, 0, 0, 0.2), 0 4px 12px rgba(0, 0, 0, 0.08); +} +.dock-btn { + flex: 1 1 0; + height: 46px; + border: none; + background: transparent; + cursor: pointer; + position: relative; + display: flex; + align-items: center; + justify-content: center; + padding: 0; +} +.dock-chip { + width: 46px; + height: 46px; + border-radius: 16px; + display: flex; + align-items: center; + justify-content: center; + color: #1b1916; + transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.5, 1), background 0.25s, box-shadow 0.25s; +} +.dock-btn:hover .dock-chip { transform: translateY(-3px); } +.dock-btn.is-active .dock-chip { + background: #ececec; + transform: translateY(-12px) scale(1.06); + box-shadow: 0 8px 16px rgba(0, 0, 0, 0.12), inset 0 0 0 1px rgba(0, 0, 0, 0.03); +} +.dock-dot { + position: absolute; + bottom: -4px; + left: 50%; + width: 6px; + height: 6px; + border-radius: 999px; + background: #111; + transform: translateX(-50%) scale(0); + transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.5, 1); +} +.dock-btn.is-active .dock-dot { transform: translateX(-50%) scale(1); } +.dock-tip { + position: absolute; + bottom: calc(100% + 6px); + left: 50%; + padding: 7px 16px; + border-radius: 14px; + background: #fff; + color: #1b1916; + font-size: 14px; + font-weight: 500; + white-space: nowrap; + opacity: 0; + transform: translateX(-50%) translateY(6px) scale(0.95); + transition: opacity 0.2s, transform 0.2s; + pointer-events: none; + box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.2); +} +.dock-btn:hover .dock-tip { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); } + +/* ---- Macro grid (back of dish card) + shimmering numbers ---- */ +.macro-cell { + background: #fff; + border: 1px solid rgba(0, 0, 0, 0.04); + box-shadow: 0 1px 3px rgba(40, 30, 20, 0.06); +} +@keyframes macro-shine { + 0% { background-position: 250% 0; } + 100% { background-position: -150% 0; } +} +.macro-num { + background-image: linear-gradient( + 100deg, + var(--c) 0%, + var(--c) 42%, + color-mix(in srgb, var(--c) 35%, #ffffff) 50%, + var(--c) 58%, + var(--c) 100% + ); + background-size: 250% 100%; + -webkit-background-clip: text; + background-clip: text; + -webkit-text-fill-color: transparent; + color: transparent; + animation: macro-shine 5.5s linear infinite; +} +@media (prefers-reduced-motion: reduce) { + .macro-num { animation: none; } +} + +/* ---- Order delivery-timer pulses (editor orders) ---- */ +@keyframes pendiente-pulse { + 0%, 100% { box-shadow: 0 0 0 0 rgba(40, 189, 28, 0); } + 50% { box-shadow: 0 0 0 4px rgba(40, 189, 28, 0.5); } +} +@keyframes pendiente-pulse-yellow { + 0%, 100% { box-shadow: 0 0 0 0 rgba(224, 189, 58, 0); } + 50% { box-shadow: 0 0 0 4px rgba(224, 189, 58, 0.5); } +} +@keyframes pendiente-pulse-red { + 0%, 100% { box-shadow: 0 0 0 0 rgba(220, 38, 38, 0); } + 50% { box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.5); } +} +.pendiente-green { + background: #28bd1c; + color: #fff; + border: 1px solid #1f9416; + animation: pendiente-pulse 1.2s ease-in-out infinite; +} +.pendiente-yellow { + background: #fce167; + color: #4a3c00; + border: 1px solid #e0bd3a; + animation: pendiente-pulse-yellow 1.2s ease-in-out infinite; +} +.pendiente-red { + background: #ef4444; + color: #fff; + border: 1px solid #991b1b; + animation: pendiente-pulse-red 1.2s ease-in-out infinite; +} +@media (prefers-reduced-motion: reduce) { + .pendiente-green, + .pendiente-yellow, + .pendiente-red { animation: none; } +} + +/* ---- Numeric inputs without spinner (editor thresholds) ---- */ +.editable-num { + -moz-appearance: textfield; + appearance: textfield; +} +.editable-num::-webkit-outer-spin-button, +.editable-num::-webkit-inner-spin-button { + -webkit-appearance: none; + margin: 0; +} + +/* ---- Aurora background (landing) ---- */ +.aurora { + --white-gradient: repeating-linear-gradient(100deg, #fff 0%, #fff 7%, transparent 10%, transparent 12%, #fff 16%); + --aurora: repeating-linear-gradient(100deg, #3b82f6 10%, #a5b4fc 15%, #93c5fd 20%, #ddd6fe 25%, #60a5fa 30%); + position: absolute; + inset: -10px; + pointer-events: none; + opacity: 0.5; + will-change: transform; + background-image: var(--white-gradient), var(--aurora); + background-size: 300% 200%; + background-position: 50% 50%, 50% 50%; + filter: blur(10px) invert(1); + -webkit-mask-image: radial-gradient(ellipse at 100% 0%, #000 10%, transparent 70%); + mask-image: radial-gradient(ellipse at 100% 0%, #000 10%, transparent 70%); +} +.aurora::after { + content: ''; + position: absolute; + inset: 0; + background-image: var(--white-gradient), var(--aurora); + background-size: 200% 100%; + background-attachment: fixed; + mix-blend-mode: difference; + animation: aurora 60s linear infinite; +} +@keyframes aurora { + from { background-position: 50% 50%, 50% 50%; } + to { background-position: 350% 50%, 350% 50%; } +} +@media (prefers-reduced-motion: reduce) { + .aurora::after { animation: none; } +} + /* Safe-area helpers for edge-to-edge layout (viewport-fit=cover). The background covers behind the notch / dynamic island and gesture bar, while interactive content is padded so it isn't covered. On devices without insets diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 1d80308..dbe4c7c 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -1,17 +1,20 @@ import type { Metadata, Viewport } from 'next'; -import { Fraunces, Inter } from 'next/font/google'; +import { Montserrat, Merriweather } from 'next/font/google'; import { NextIntlClientProvider } from 'next-intl'; import { getLocale, getMessages } from 'next-intl/server'; import './globals.css'; -const fraunces = Fraunces({ +// Montserrat drives all UI + display type; Merriweather is reserved for the +// landing "Smart Menu" wordmark. +const montserrat = Montserrat({ subsets: ['latin'], - variable: '--font-fraunces', + variable: '--font-montserrat', display: 'swap', }); -const inter = Inter({ +const merriweather = Merriweather({ subsets: ['latin'], - variable: '--font-inter', + weight: ['300', '400', '700', '900'], + variable: '--font-merriweather', display: 'swap', }); @@ -39,7 +42,7 @@ export default async function RootLayout({ const messages = await getMessages(); return ( - + {children} diff --git a/src/app/page.tsx b/src/app/page.tsx index 7d70ccf..a226c52 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -1,49 +1,25 @@ import Link from 'next/link'; -// 4-point "magic" sparkle. -function Sparkle({ - className, - style, - color, - size, -}: { - className?: string; - style?: React.CSSProperties; - color: string; - size: number; -}) { - return ( - - - - ); -} - -// Sparkles scattered around the "by Collina" signature. -const SPARKLES: { top: string; left: string; size: number; color: string; delay: string }[] = [ - { top: '-18px', left: '-6%', size: 16, color: '#f59e0b', delay: '0.7s' }, - { top: '4px', left: '102%', size: 20, color: '#fb7185', delay: '1.0s' }, - { top: '34px', left: '8%', size: 12, color: '#fcd34d', delay: '1.4s' }, - { top: '40px', left: '88%', size: 14, color: '#d97706', delay: '0.9s' }, - { top: '-10px', left: '52%', size: 10, color: '#fbbf24', delay: '1.7s' }, - { top: '24px', left: '-2%', size: 9, color: '#fda4af', delay: '2.1s' }, - { top: '-2px', left: '78%', size: 11, color: '#f59e0b', delay: '1.2s' }, -]; - +// Landing premium minimalista: video de fondo + wordmark "Smart Menu" + CTA único. export default function Home() { return ( -
+
+ {/* Background video */} + + {/* Soft brand glow behind the wordmark */}
- {/* SmartMenu — the protagonist */} -

- Smart - Menu + {/* SmartMenu — the protagonist (Merriweather wordmark) */} +

+ Smart + Menu

- {/* by Collina — delicate signature + sparkles. Tapping it opens /admin. */} + {/* by Collina — tapping it opens /admin. */}
- {SPARKLES.map((s, i) => ( - - ))} - by Collina + by Collina Systems
@@ -85,14 +52,11 @@ export default function Home() { {/* Single sales CTA */} Solicita una demo - -

- Menús digitales que entienden a tus comensales. -

); } diff --git a/src/components/admin/AdminLogin.tsx b/src/components/admin/AdminLogin.tsx index 3055b8d..b7f1409 100644 --- a/src/components/admin/AdminLogin.tsx +++ b/src/components/admin/AdminLogin.tsx @@ -2,9 +2,12 @@ import { useState } from 'react'; import { useRouter } from 'next/navigation'; +import { useTranslations } from 'next-intl'; export default function AdminLogin() { const router = useRouter(); + const tAdmin = useTranslations('admin'); + const tAuth = useTranslations('auth'); const [user, setUser] = useState(''); const [password, setPassword] = useState(''); const [error, setError] = useState(false); @@ -27,26 +30,26 @@ export default function AdminLogin() { return (
-

Panel maestro Collina

+

{tAdmin('title')}

setUser(e.target.value)} - placeholder="usuario" + placeholder={tAuth('username')} className="glass-soft rounded-2xl px-4 py-3 outline-none" /> setPassword(e.target.value)} - placeholder="contraseña" + placeholder={tAuth('password')} className="glass-soft rounded-2xl px-4 py-3 outline-none" /> - {error &&

Credenciales incorrectas

} + {error &&

{tAuth('invalid')}

}
diff --git a/src/components/admin/AdminPanel.tsx b/src/components/admin/AdminPanel.tsx index 1d548f5..774ca25 100644 --- a/src/components/admin/AdminPanel.tsx +++ b/src/components/admin/AdminPanel.tsx @@ -1,6 +1,7 @@ 'use client'; import { useState } from 'react'; +import { useTranslations } from 'next-intl'; type Restaurant = { id: string; @@ -27,6 +28,7 @@ export default function AdminPanel({ initialRestaurants: Restaurant[]; baseUrl: string; }) { + const t = useTranslations('admin'); const [restaurants, setRestaurants] = useState(initialRestaurants); const [name, setName] = useState(''); const [slug, setSlug] = useState(''); @@ -74,64 +76,64 @@ export default function AdminPanel({ return (
-

Panel maestro Collina

+

{t('title')}

-

Nuevo restaurante

+

{t('newRestaurant')}

-
-

Restaurantes

+

{t('restaurants')}

- {restaurants.length === 0 &&

Aún no hay restaurantes.

} + {restaurants.length === 0 && ( +

{t('empty')}

+ )} {restaurants.map((r) => (
@@ -151,19 +155,19 @@ export default function AdminPanel({
diff --git a/src/components/editor/BrandTab.tsx b/src/components/editor/BrandTab.tsx index 40d97fb..9d1e221 100644 --- a/src/components/editor/BrandTab.tsx +++ b/src/components/editor/BrandTab.tsx @@ -103,12 +103,15 @@ export default function BrandTab({ )}
-
-
); })} - @@ -189,7 +198,7 @@ export default function BrandTab({ @@ -179,7 +182,7 @@ export default function CatalogTab({ {/* Global macros toggle — lives here with catalog assembly (near Cargar menú) */}
-
{t('showMacros')}
+
{t('showMacros')}
{showMacros ? t('showMacrosHint') : t('showMacrosDisclaimer')}
@@ -188,7 +191,7 @@ export default function CatalogTab({ onClick={toggleGlobalMacros} aria-pressed={showMacros} className={`relative h-7 w-12 shrink-0 rounded-full transition ${ - showMacros ? 'bg-green-500' : 'bg-gray-300' + showMacros ? 'bg-black' : 'bg-gray-300' }`} > {t('sectionMacros')} addProduct(s.id)} - className="mt-3 w-full rounded-2xl border border-dashed border-[var(--accent)]/40 py-2 text-sm font-medium text-[var(--accent)]" + className="mt-3 w-full rounded-2xl bg-black py-2 text-sm font-medium text-white" > + {t('addDish')} @@ -317,7 +320,8 @@ export default function CatalogTab({ diff --git a/src/components/editor/Editor.tsx b/src/components/editor/Editor.tsx index 6ca48a1..97a3a66 100644 --- a/src/components/editor/Editor.tsx +++ b/src/components/editor/Editor.tsx @@ -10,6 +10,7 @@ import BrandTab from './BrandTab'; import OrdersTab from './OrdersTab'; import QrTab from './QrTab'; import PublishModal from './PublishModal'; +import { ClipboardList, Palette, Store, Bell, QrCode, type LucideIcon } from 'lucide-react'; type Tab = 'catalog' | 'palette' | 'brand' | 'orders' | 'qr'; @@ -23,12 +24,12 @@ export default function Editor({ data, baseUrl }: { data: EditorData; baseUrl: s const [publishOpen, setPublishOpen] = useState(false); const [publishedName, setPublishedName] = useState(data.publishedVersionName); - const tabs: { id: Tab; label: string; icon: string }[] = [ - { id: 'catalog', label: t('catalog'), icon: '📋' }, - { id: 'palette', label: t('palette'), icon: '🎨' }, - { id: 'brand', label: t('brand'), icon: '🏷️' }, - { id: 'orders', label: t('orders'), icon: '🔔' }, - { id: 'qr', label: t('qr'), icon: '🔳' }, + const tabs: { id: Tab; label: string; Icon: LucideIcon }[] = [ + { id: 'catalog', label: t('catalog'), Icon: ClipboardList }, + { id: 'palette', label: t('palette'), Icon: Palette }, + { id: 'brand', label: t('brand'), Icon: Store }, + { id: 'orders', label: t('orders'), Icon: Bell }, + { id: 'qr', label: t('qr'), Icon: QrCode }, ]; return ( @@ -83,20 +84,24 @@ export default function Editor({ data, baseUrl }: { data: EditorData; baseUrl: s /> )} - {/* Bottom tab bar */} -
@@ -276,8 +275,8 @@ export default function OrdersTab({ {ordersEnabled && waiterCalls.length > 0 && (
{waiterCalls.map((c, i) => ( -
- 🔔 {t('table')} {c.tableNumber} +
+ {t('waiterAlert', { table: c.tableNumber })}
))} @@ -338,10 +337,9 @@ function TableCard({ const allPaid = subaccounts.every((o) => o.paid); return ( -
+
{t('table')} {table} - ${tableTotal.toFixed(2)}
{subaccounts.map((sub) => ( @@ -366,7 +364,8 @@ function TableCard({
@@ -450,18 +449,18 @@ function SubaccountCard({ {it.note && ↳ {it.note}} {tm.label} ); @@ -561,7 +560,8 @@ function ItemsEditPanel({ diff --git a/src/components/editor/ProductEditor.tsx b/src/components/editor/ProductEditor.tsx index 839496d..cfaf09b 100644 --- a/src/components/editor/ProductEditor.tsx +++ b/src/components/editor/ProductEditor.tsx @@ -3,7 +3,7 @@ import { useState } from 'react'; import { useTranslations } from 'next-intl'; import type { EditorProduct, EditorSection } from './types'; -import { MACRO_KEYS } from '@/lib/macros'; +import { MACRO_KEYS, MACRO_COLORS } from '@/lib/macros'; import { api } from './api'; const ALLERGENS = ['gluten', 'lácteos', 'frutos secos', 'mariscos', 'huevo', 'soya', 'pescado']; @@ -26,6 +26,7 @@ export default function ProductEditor({ }) { const t = useTranslations('editor'); const tm = useTranslations('macros'); + const tc = useTranslations('common'); const [draft, setDraft] = useState(product); const [saving, setSaving] = useState(false); const [translating, setTranslating] = useState(null); @@ -125,10 +126,14 @@ export default function ProductEditor({ return (
-
+
-

{t('edit')}

-
@@ -141,19 +146,17 @@ export default function ProductEditor({ value={draft.name.es ?? ''} onChange={(v) => set('name', { ...draft.name, es: v })} /> -
- - setDraft((d) => ({ - ...d, - name: { ...d.name, en: v }, - translationStatus: { ...d.translationStatus, en: 'reviewed' }, - })) - } - /> -
+ + setDraft((d) => ({ + ...d, + name: { ...d.name, en: v }, + translationStatus: { ...d.translationStatus, en: 'reviewed' }, + })) + } + /> set('price', Number(e.target.value))} - className="glass-soft w-full rounded-2xl px-3 py-2 outline-none" + className="glass-soft w-full rounded-2xl px-3 py-2 text-sm outline-none" /> {/* Macros */} - + {draft.aiEstimated.macros && } -
+
{MACRO_KEYS.map((key) => ( ))} @@ -315,17 +323,19 @@ export default function ProductEditor({ /> -
+ {/* Actions */} +
@@ -354,8 +364,8 @@ function Field({ className?: string; }) { return ( -
- {label} +
+ {label} {children}
); @@ -372,7 +382,7 @@ function LocaleInput({ }) { return (
- {prefix} + {prefix} onChange(e.target.value)} @@ -397,7 +407,7 @@ function TranslateRow({ @@ -429,10 +439,10 @@ function Chips({ + {v.id !== publishedId && ( + + )}
))}
diff --git a/src/components/public/AiConsultant.tsx b/src/components/public/AiConsultant.tsx index 65c1835..b242cee 100644 --- a/src/components/public/AiConsultant.tsx +++ b/src/components/public/AiConsultant.tsx @@ -64,7 +64,7 @@ export default function AiConsultant({ function Card(r: Recommendation, key: number) { const product = resolveDish(r.dish); return ( -
+
{r.dish}

{r.reason}

@@ -72,7 +72,8 @@ export default function AiConsultant({ {ordersEnabled && product && ( @@ -83,7 +84,7 @@ export default function AiConsultant({ return (
-
+

{t('title')}

-
+
{!answer && !loading &&

{t('intro')}

} {loading &&

{t('thinking')}

} {error &&

⚠️

} {answer && ( -
- {answer.intro &&

{answer.intro}

} +
+ {answer.intro &&

{answer.intro}

} {(() => { const direct = answer.recommendations.filter((r) => r.type !== 'complement'); const complement = answer.recommendations.filter((r) => r.type === 'complement'); @@ -106,7 +107,7 @@ export default function AiConsultant({ {direct.map((r, i) => Card(r, i))} {complement.length > 0 && ( <> -

+

{t('pairWith')}

{complement.map((r, i) => Card(r, direct.length + i))} @@ -120,7 +121,7 @@ export default function AiConsultant({ {/* Precomputed pairings carousel (reuses the cart component) */} {ordersEnabled && suggestions.length > 0 && ( -
+
)} @@ -137,7 +138,8 @@ export default function AiConsultant({ diff --git a/src/components/public/BrandHeader.tsx b/src/components/public/BrandHeader.tsx index 67fc2be..2fa437a 100644 --- a/src/components/public/BrandHeader.tsx +++ b/src/components/public/BrandHeader.tsx @@ -48,7 +48,7 @@ export default function BrandHeader({ const hasLogo = !!logo; const socialRow = links.length > 0 && ( -
+
{links.map((l, i) => { const Icon = iconFor(l.platform); return ( @@ -84,7 +84,7 @@ export default function BrandHeader({
{/* Banner — full-bleed, extends edge-to-edge behind the island. A short palette gradient stands in when there's a logo but no banner image. */} -
+
{hasBanner ? ( // eslint-disable-next-line @next/next/no-img-element @@ -100,9 +100,9 @@ export default function BrandHeader({
- {/* Logo + name + socials, the avatar centered over the banner's lower edge. */} -
-
+ {/* Logo (left) + name + socials, below the banner. */} +
+
{hasLogo ? ( // eslint-disable-next-line @next/next/no-img-element {name} @@ -112,8 +112,10 @@ export default function BrandHeader({
)}
-

{name}

- {socialRow} +
+

{name}

+ {socialRow} +
); diff --git a/src/components/public/DishCard.tsx b/src/components/public/DishCard.tsx index 122ddf2..90cddb4 100644 --- a/src/components/public/DishCard.tsx +++ b/src/components/public/DishCard.tsx @@ -32,69 +32,68 @@ export default function DishCard({ const sortedMedia = [...product.media].sort((a, b) => a.order - b.order); const cover = sortedMedia[0]; const hasVideo = sortedMedia.some((m) => m.type === 'video'); + const canAdd = ordersEnabled && !!onAdd; return (
-
+
{/* FRONT */} -
- -
-
-

{name}

- +
+
+ +
+
+
+

{name}

+ + ${product.price.toFixed(2)}
{description && (

{description}

)} -
- {product.dietTags.map((tag) => ( - - {tag} - - ))} - {product.allergens.map((a) => ( - - {a} - - ))} -
- {(showMacros || (ordersEnabled && onAdd)) && ( -
+ {(showMacros || canAdd) && ( +
{showMacros && ( )} - {ordersEnabled && onAdd && ( + {canAdd && ( )}
@@ -103,17 +102,22 @@ export default function DishCard({
{/* BACK */} -
-
+
+

{name}

-
+
+ +
diff --git a/src/components/public/MacrosBack.tsx b/src/components/public/MacrosBack.tsx index 6b4a023..8b5df0c 100644 --- a/src/components/public/MacrosBack.tsx +++ b/src/components/public/MacrosBack.tsx @@ -11,19 +11,26 @@ export default function MacrosBack({ macros }: { macros: Macros }) { {MACRO_KEYS.map((key) => { const value = macros[key]; return ( -
- -
-
{t(key)}
-
- {value != null ? `${value}${MACRO_UNIT[key] === 'g' ? ' g' : ''}` : '—'} - {key === 'kcal' && value != null ? ' kcal' : ''} -
+
+
+ {t(key)}
+ {value != null ? ( +
+ {`${value} ${MACRO_UNIT[key]}`} +
+ ) : ( +
+ — +
+ )}
); })} diff --git a/src/components/public/PublicMenu.tsx b/src/components/public/PublicMenu.tsx index cd2b877..5dc1da4 100644 --- a/src/components/public/PublicMenu.tsx +++ b/src/components/public/PublicMenu.tsx @@ -13,6 +13,7 @@ import AiConsultant from './AiConsultant'; import SuggestionCarousel from './SuggestionCarousel'; import SplitPanel, { type SplitSession } from './SplitPanel'; import { getRecommendations } from '@/lib/recommendations'; +import { LayoutGrid, List as ListIcon } from 'lucide-react'; type ViewMode = 'cards' | 'list'; @@ -47,7 +48,6 @@ export default function PublicMenu({ menu, slug }: { menu: MenuSnapshot; slug: s null, ); const [aiOpen, setAiOpen] = useState(false); - const [actionsOpen, setActionsOpen] = useState(false); const [cart, setCart] = useState([]); const [orderOpen, setOrderOpen] = useState(false); const [waiterOpen, setWaiterOpen] = useState(false); @@ -58,6 +58,27 @@ export default function PublicMenu({ menu, slug }: { menu: MenuSnapshot; slug: s // View preference is intentionally not persisted — always starts on cards. const [view, setView] = useState('cards'); const sectionRefs = useRef>({}); + const navRef = useRef(null); + const [stuck, setStuck] = useState(false); + + // Scroll-spy: highlight the section in view and switch the category bar to its + // compact "stuck" state (business name + underlined tabs) once it pins to the top. + useEffect(() => { + function onScroll() { + const nav = navRef.current; + if (nav) setStuck(nav.getBoundingClientRect().top <= 12); + const line = 140; + let current = sections[0]?.id ?? ''; + for (const s of sections) { + const el = sectionRefs.current[s.id]; + if (el && el.getBoundingClientRect().top <= line) current = s.id; + } + if (current) setActiveSection(current); + } + window.addEventListener('scroll', onScroll, { passive: true }); + onScroll(); + return () => window.removeEventListener('scroll', onScroll); + }, [sections]); // Flat index of active products for pairing lookups (by id) and consultant // add-to-cart resolution (by normalized name in either locale). @@ -194,45 +215,64 @@ export default function PublicMenu({ menu, slug }: { menu: MenuSnapshot; slug: s socialLinks={menu.restaurant.socialLinks} /> - {/* Section tabs */} - {sections.length > 0 && ( - - )} - - {/* View toggle (cards vs traditional list). Not persisted. */} -
-
+ {/* View toggle (Cards / List) + Ask Claude */} +
+
+
+ {/* Section heading + sticky category bar */} + {sections.length > 0 && ( + <> +

{t('explore')}

+ + + )} + {/* Sections */} {sections.map((s) => (
))} - {/* Floating actions — ordered vertical stack in the bottom-right corner so - they never overlap each other or cover dish names/prices. */} + {/* Floating actions — vertical stack, bottom-right. */}
- {actionsOpen && ( -
- - -
- )} - - {/* In a split session the cart IS the diner's subaccount → show one - 'Mi cuenta' button (split). Otherwise show the normal cart, plus a - separate Split button when split is enabled. */} + {/* In a split session the cart IS the diner's subaccount → 'My account'. + Otherwise the red 'Order' button (when ordering is enabled). */} {splitSession ? ( ) : ( - <> - {ordersEnabled && ( - - )} - {splitEnabled && ( - - )} - + ordersEnabled && ( + + ) )} - {/* 'More' (waiter / back to top) — distinct ⋯ icon, not a '+', to avoid - confusion with the add-to-cart '+' inside each dish. */} + {splitEnabled && !splitSession && ( + + )}
{/* Modals */} @@ -626,7 +634,7 @@ function OrderPanel({ @@ -634,7 +642,7 @@ function OrderPanel({ ) : ( @@ -644,7 +652,7 @@ function OrderPanel({ @@ -687,7 +695,7 @@ function WaiterPanel({ diff --git a/src/components/public/SplitPanel.tsx b/src/components/public/SplitPanel.tsx index b4d46bd..909a5a5 100644 --- a/src/components/public/SplitPanel.tsx +++ b/src/components/public/SplitPanel.tsx @@ -167,7 +167,7 @@ export default function SplitPanel({ @@ -188,16 +188,29 @@ export default function SplitPanel({ {pickText(l.product.name, locale)} - + ${(l.product.price * l.qty).toFixed(2)} - - {l.qty} - +
+ + {l.qty} + +
-
- {t('yourSubtotal')} +
+ {t('yourSubtotal')} ${yourSubtotal.toFixed(2)}
-
- {t('tableTotal')} +
+ {t('tableTotal')} ${tableTotal.toFixed(2)}
@@ -225,7 +238,7 @@ export default function SplitPanel({ diff --git a/src/lib/macros.ts b/src/lib/macros.ts index 288f7c8..0613abf 100644 --- a/src/lib/macros.ts +++ b/src/lib/macros.ts @@ -1,7 +1,7 @@ // Universal macro color code — FIXED across all restaurants (product standard). // Diners learn it once and recognize it in any menu. Never make this configurable. export const MACRO_COLORS = { - protein: '#C2410C', // terracotta + protein: '#dc2626', // red carbs: '#B45309', // toasted amber sugar: '#BE185D', // magenta fat: '#CA8A04', // gold diff --git a/tailwind.config.ts b/tailwind.config.ts index f464ce3..5021af1 100644 --- a/tailwind.config.ts +++ b/tailwind.config.ts @@ -7,13 +7,14 @@ const config: Config = { theme: { extend: { fontFamily: { - display: ['var(--font-fraunces)', 'Georgia', 'serif'], - body: ['var(--font-inter)', 'system-ui', 'sans-serif'], + display: ['var(--font-montserrat)', 'system-ui', 'sans-serif'], + body: ['var(--font-montserrat)', 'system-ui', 'sans-serif'], + serif: ['var(--font-merriweather)', 'Georgia', 'serif'], }, colors: { // Universal, non-configurable macro color code (product standard). macro: { - protein: '#C2410C', + protein: '#dc2626', carbs: '#B45309', sugar: '#BE185D', fat: '#CA8A04',