/* ============================================================
   RESET + VARIABLES
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin:0; padding:0; height:100%; }
body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  background:#ffffff;
  color:#111111;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overscroll-behavior-y: none;
}
button { font-family: inherit; cursor:pointer; border:none; background:none; padding:0; color:inherit; }
input, textarea, select { font-family: inherit; }
img { max-width:100%; display:block; }
a { color: inherit; text-decoration:none; }

:root {
  --accent: #111111;
  --accent-2: #c14a2a;
  --bg: #ffffff;
  --text: #111111;
  --text-2: #666666;
  --line: #f0f0f0;
  --soft: #f5f5f5;

  /* Panel */
  --panel-bg: #ffffff;
  --panel-surface: #ffffff;
  --panel-text: #2b1d12;
  --panel-text-2: #7a6a55;
  --panel-line: #ece1cf;
  --terracota: #c14a2a;
  --terracota-soft: #f5d9cc;
  --oliva: #6b7a3f;
  --dorado: #c89b3c;
  --crema: #fdf6ec;
}
.dark {
  --panel-bg: #1c1410;
  --panel-surface: #2a1f17;
  --panel-text: #f4ead9;
  --panel-text-2: #b89f7b;
  --panel-line: #3b2c20;
  --crema: #2a1f17;
}

/* ============================================================
   UTILIDADES
   ============================================================ */
.hidden { display:none !important; }
.center { display:flex; align-items:center; justify-content:center; }
.row { display:flex; align-items:center; }
.col { display:flex; flex-direction:column; }
.gap-2 { gap: 8px; } .gap-3 { gap:12px; } .gap-4 { gap:16px; }
.spacer { flex:1; }
.muted { color: var(--text-2); }
.scroll-hide::-webkit-scrollbar { display:none; }
.scroll-hide { -ms-overflow-style:none; scrollbar-width:none; }
.no-select { -webkit-user-select:none; user-select:none; }

/* Skeleton shimmer */
.skeleton {
  background: linear-gradient(90deg, #f0f0f0 0%, #f8f8f8 50%, #f0f0f0 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  border-radius: 8px;
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* Tap animation */
.tap { transition: transform .15s ease; }
.tap:active { transform: scale(0.92); }

/* ============================================================
   VISTAS BASE
   ============================================================ */
.view { display:none; min-height: 100dvh; }
.view.active { display:block; }
.client-view { background: var(--bg); color: var(--text); padding-bottom: 120px; }
.panel-view { background: var(--panel-bg); color: var(--panel-text); font-family: 'Plus Jakarta Sans', sans-serif; min-height:100dvh; }

/* ============================================================
   PANTALLA DE BIENVENIDA
   ============================================================ */
#view-welcome { display:none; min-height:100dvh; flex-direction:column; background:#000; color:#fff; position:relative; overflow:hidden; }
#view-welcome.active { display:flex; }
.welcome-hero {
  position:absolute; inset:0; z-index:0;
  background-size: cover; background-position: center;
  background-color:#111;
}
.welcome-hero::after {
  content:""; position:absolute; inset:0;
  background: linear-gradient(180deg, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.35) 35%, rgba(0,0,0,0.85) 65%, rgba(0,0,0,0.95) 100%);
}
.welcome-top {
  position:relative; z-index:2;
  flex:1;
  display:flex; flex-direction:column;
  align-items:center; justify-content:center;
  text-align:center;
  padding: 40px 24px 16px;
  padding-top: calc(40px + env(safe-area-inset-top));
  color:#fff;
}
.welcome-logo {
  width: 80px; height:80px; border-radius:22px;
  background: rgba(255,255,255,0.12); backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1px solid rgba(255,255,255,0.18);
  display:flex; align-items:center; justify-content:center;
  font-size: 40px; margin-bottom: 16px;
  overflow:hidden;
  box-shadow: 0 20px 50px rgba(0,0,0,0.4);
}
.welcome-logo img { width:100%; height:100%; object-fit:cover; border-radius:24px; }
.welcome-logo .initials {
  font-family: 'Plus Jakarta Sans', 'Inter', serif;
  font-weight: 800;
  font-size: 36px;
  letter-spacing: -0.04em;
  color: #fff;
  text-transform: uppercase;
}
.welcome-title {
  font-size: 32px; font-weight:800; letter-spacing:-0.03em; line-height:1.05;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.welcome-subtitle {
  font-size: 14px; opacity:.9; margin-top: 6px;
  max-width: 320px;
  text-shadow: 0 1px 10px rgba(0,0,0,0.5);
}
.welcome-body {
  position:relative; z-index:2;
  color:#111;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 20px 20px;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
  display:flex; flex-direction:column; gap: 8px;
}
.welcome-body h2 {
  margin: 0 0 6px; font-size: 11px; font-weight:700;
  text-transform:uppercase; letter-spacing:0.12em;
  color: rgba(255,255,255,0.6);
  text-align:center;
}
.welcome-langs {
  display:flex; justify-content:center; gap:6px;
  margin-bottom: 4px;
}
.welcome-langs button {
  padding: 5px 12px; border-radius:999px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.15);
  color: #fff; font-size: 11px; font-weight:700;
  letter-spacing: 0.04em;
}
.welcome-langs button.active {
  background: #fff; color: #111; border-color:#fff;
}
.mode-card {
  display:flex; align-items:center; gap:12px;
  padding: 12px 14px; border-radius:14px;
  background: rgba(255,255,255,0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  color: #111;
  transition: transform .15s ease, background .15s ease;
  border: 1px solid rgba(255,255,255,0.4);
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  width: 100%;
}
.mode-card:active { transform: scale(0.97); background:#f5f5f5; }
.mode-card.primary {
  background: #fff;
}
.mode-card .icon-box {
  width: 38px; height:38px; border-radius:10px;
  background: var(--soft); display:flex; align-items:center; justify-content:center;
  font-size: 18px; flex-shrink:0;
}
.mode-card.primary .icon-box { background:#111; color:#fff; }
.mode-card .text { flex:1; display:flex; flex-direction:column; gap:1px; text-align:left; min-width:0; }
.mode-card .text strong { font-size: 14px; font-weight:800; letter-spacing:-0.01em; }
.mode-card .text span { font-size: 11.5px; color: var(--text-2); line-height:1.25; }
.mode-card .arrow { color: var(--text-2); font-size: 18px; font-weight: 700; flex-shrink:0; }
.welcome-footer {
  position:relative; z-index:2;
  text-align:center; font-size: 10px; color: rgba(255,255,255,0.4);
  padding: 0 0 14px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  letter-spacing: 0.08em; text-transform: uppercase;
}

/* ============================================================
   CABECERA CLIENTE
   ============================================================ */
.client-header {
  position: sticky; top:0; z-index: 50;
  background:#fff; box-shadow: 0 1px 0 var(--line);
  display:flex; align-items:center; gap:10px;
  padding: 12px 16px; padding-top: max(12px, env(safe-area-inset-top));
}
.client-logo {
  display:flex; align-items:center; gap:10px;
  font-weight: 800; font-size: 16px; letter-spacing:-0.01em;
}
.client-logo .logo-icon {
  width: 34px; height:34px; border-radius:10px;
  background: #111; color: #fff;
  display:flex; align-items:center; justify-content:center;
  font-size: 14px;
  overflow:hidden;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.client-logo .logo-icon img { width:100%; height:100%; object-fit:cover; }
.client-logo .logo-icon .initials {
  font-family: 'Plus Jakarta Sans', 'Inter', sans-serif;
  font-weight: 800;
  font-size: 14px;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}
.client-header .icon-btn {
  width: 40px; height:40px; border-radius:50%;
  background: var(--soft);
  display:flex; align-items:center; justify-content:center;
  font-size: 16px;
}
.client-header .icon-btn:active { transform: scale(0.9); }
.mesa-pill {
  background:#111; color:#fff; padding:6px 12px;
  border-radius:999px; font-size:12px; font-weight:700;
  letter-spacing:0.02em;
}

/* Selector idioma */
.lang-switcher {
  display:inline-flex; background: var(--soft); border-radius:999px;
  padding: 3px; gap:0;
}
.lang-switcher button {
  padding: 4px 10px; border-radius:999px; font-size:11px; font-weight:700;
  color: var(--text-2); text-transform:uppercase;
}
.lang-switcher button.active { background:#111; color:#fff; }

/* ============================================================
   BUSCADOR / FILTROS
   ============================================================ */
.search-bar {
  padding: 12px 16px 8px;
  display:flex; gap:8px;
}
.search-input {
  flex:1; height: 44px; background: var(--soft);
  border:none; border-radius:14px; padding: 0 16px 0 40px;
  font-size: 15px; color: var(--text);
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='18' height='18' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2.4' stroke-linecap='round' stroke-linejoin='round'><circle cx='11' cy='11' r='7'/><path d='m20 20-3.5-3.5'/></svg>");
  background-repeat:no-repeat; background-position: 14px center;
}
.search-input:focus { outline: 2px solid #111; outline-offset:-2px; }

/* ============================================================
   CATEGORÍAS BANNER
   ============================================================ */
.menu-wrap { padding-bottom: 40px; }
.cat-section { margin: 0; }
.cat-banner {
  position:relative; height: 120px; width:100%;
  background-size: cover; background-position: center;
  display:flex; align-items:flex-end; padding: 16px;
  cursor:pointer;
  overflow:hidden;
}
.cat-banner::before {
  content:""; position:absolute; inset:0;
  background: rgba(0,0,0,0.38);
}
.cat-banner.no-img {
  background: var(--accent);
}
.cat-banner.no-img::before { background: rgba(0,0,0,0.25); }
.cat-banner-name {
  position:relative; z-index:1; color:#fff;
  font-weight: 800; font-size: 18px;
  text-transform:uppercase; letter-spacing:0.06em;
  display:flex; align-items:center; gap: 10px;
}
.cat-banner-name .cat-emoji { font-size: 22px; }
.cat-banner .expand {
  position:absolute; top: 50%; right: 16px; transform: translateY(-50%);
  width: 36px; height:36px; border-radius:50%;
  background:#fff; display:flex; align-items:center; justify-content:center;
  color:#111; font-size: 14px; z-index:2;
  transition: transform 0.3s ease;
}
.cat-section.open .cat-banner .expand { transform: translateY(-50%) rotate(180deg); }
.cat-content {
  max-height: 0; overflow:hidden;
  transition: max-height 0.3s ease;
}
/* La altura abierta la calcula JS con scrollHeight para evitar el hack 6000px */
.cat-section.open .cat-content { max-height: none; }

/* ============================================================
   TARJETAS DE PLATO
   ============================================================ */
.dish-list { padding: 0 16px; }
.dish-item {
  display:flex; gap: 14px; padding: 16px 0;
  border-bottom: 1px solid var(--line);
  align-items:flex-start;
  cursor:pointer;
  transition: background .15s ease;
}
.dish-item:last-child { border-bottom: none; }
.dish-thumb {
  width: 72px; height:72px; border-radius:10px;
  background: var(--soft);
  display:flex; align-items:center; justify-content:center;
  font-size: 32px; flex-shrink:0; overflow:hidden;
  position:relative;
}
.dish-thumb img { width:100%; height:100%; object-fit:cover; }
.dish-thumb.unavailable::after {
  content:""; position:absolute; inset:0; background: rgba(255,255,255,0.6);
}
.dish-info { flex:1; min-width:0; }
.dish-name {
  font-weight: 700; font-size: 15px; letter-spacing:-0.01em;
  display:flex; flex-wrap:wrap; gap: 6px; align-items:center;
  margin-bottom: 4px;
}
.dish-desc {
  font-size: 13px; color: var(--text-2);
  line-height: 1.35; overflow:hidden;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  margin-bottom: 6px;
}
.dish-meta { display:flex; flex-wrap:wrap; gap: 6px; align-items:center; }
.badge {
  font-size: 11px; padding: 3px 8px; border-radius:999px;
  background: var(--soft); color: var(--text-2);
  font-weight:600;
  display:inline-flex; align-items:center; gap:4px;
  white-space: nowrap;
}
.badge.popular { background: rgba(0,0,0,0.85); color:#fff; }
.badge.recomendado { background: var(--accent-2); color:#fff; }
.badge.fuera_carta { background: var(--dorado); color:#111; }
.badge.unavailable { background:#fee; color:#c00; }
.allergen-mini {
  display:inline-flex; align-items:center; gap:3px;
  font-size:11px; color: var(--text-2);
}
.allergen-mini .ai { font-size: 12px; }

.dish-price-col {
  display:flex; flex-direction:column; align-items:flex-end;
  gap: 8px; flex-shrink:0;
}
.dish-price { font-weight: 800; font-size: 15px; }
.add-btn {
  width: 32px; height:32px; border-radius:50%;
  background:#111; color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size: 18px; font-weight:600;
  transition: transform .15s ease;
}
.add-btn:active { transform: scale(0.85); }
.add-btn[disabled] { background:#ccc; cursor:not-allowed; }
.add-btn.no-channel { background:#666; }
.add-btn.no-channel:active { transform: scale(0.85); }

/* Sugerencia del día — tarjeta de plato normal con sello dorado */
.sugerencia-wrap {
  padding: 0 16px;
  margin-top: 4px;
}
.sugerencia-wrap .dish-item {
  background: linear-gradient(180deg, #fffaf0 0%, #fff 70%);
  border-radius: 14px;
  border: 1px solid #f0e2c4;
  padding: 14px;
  margin-bottom: 8px;
}
.sugerencia-wrap .dish-item:last-child { border-bottom: 1px solid #f0e2c4; }
.sugerencia-wrap .dish-thumb {
  overflow: visible;
  background: var(--soft);
}
.sugerencia-wrap .dish-thumb img {
  border-radius: 10px;
  width: 100%; height: 100%; object-fit: cover;
}
.dish-thumb { position: relative; }
.featured-sticker {
  position: absolute;
  top: -6px; right: -6px;
  background: linear-gradient(135deg, #c89b3c 0%, #e3b75b 100%);
  color: #fff;
  min-width: 24px; height: 24px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px;
  box-shadow: 0 3px 8px rgba(200,155,60,0.5);
  border: 2px solid #fff;
  z-index: 2;
}
.badge.sugerencia {
  background: linear-gradient(135deg, #c89b3c 0%, #e3b75b 100%);
  color: #fff;
  font-weight: 800;
  box-shadow: 0 2px 6px rgba(200,155,60,0.3);
}

/* Menú del día card */
.menu-dia-card {
  margin: 16px;
  padding: 20px; border-radius: 18px;
  background: linear-gradient(135deg, #111 0%, #2a2a2a 100%);
  color:#fff;
  position:relative; overflow:hidden;
}
.menu-dia-card .mdb-tag {
  display:inline-block; background: var(--accent-2); color:#fff;
  padding: 4px 10px; border-radius:999px; font-size:10px;
  font-weight:800; letter-spacing:0.08em; text-transform:uppercase;
  margin-bottom: 10px;
}
.menu-dia-card h3 { margin: 0 0 4px; font-size: 20px; font-weight:800; }
.menu-dia-card p { margin: 0; opacity:.85; font-size: 13px; }
.menu-dia-card .mdb-price {
  position:absolute; top: 16px; right: 16px;
  font-size: 24px; font-weight:800;
}
.menu-dia-card .mdb-cta {
  margin-top: 12px; background:#fff; color:#111;
  padding: 10px 20px; border-radius:999px;
  font-weight:700; font-size: 14px;
  display:inline-flex; align-items:center; gap:6px;
}

/* ============================================================
   BARRA INFERIOR PILL
   ============================================================ */
.client-bottom {
  position: fixed;
  left:50%; transform: translateX(-50%);
  bottom: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom));
  background:#111; color:#fff;
  border-radius:999px;
  padding: 6px 10px;
  display:flex; align-items:center; gap: 4px;
  z-index: 70;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  min-width: 220px; height: 60px;
  justify-content: space-around;
  pointer-events: auto;
}
.bottom-btn {
  width: 48px; height:48px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  color:#fff; font-size: 22px;
  transition: background .15s ease;
  cursor:pointer;
  background:transparent;
  flex-shrink:0;
}
.bottom-btn:hover { background: rgba(255,255,255,0.12); }
.bottom-btn:active { background: rgba(255,255,255,0.22); transform: scale(0.92); }
.cart-chip {
  display:flex; align-items:center; gap:8px;
  background:#fff; color:#111;
  padding: 8px 16px; border-radius:999px;
  font-weight:800; font-size: 14px;
  transition: transform .15s ease;
}
.cart-chip:active { transform: scale(0.95); }
.cart-chip .count {
  background:#111; color:#fff; min-width:20px; height:20px;
  border-radius:999px; display:inline-flex; align-items:center; justify-content:center;
  font-size: 11px; padding: 0 6px;
}

/* ============================================================
   OVERLAYS / MODALES
   ============================================================ */
.overlay {
  position: fixed; inset:0; z-index: 100;
  background: rgba(0,0,0,0.5);
  display: none;
  align-items:flex-end; justify-content:center;
  opacity: 0; transition: opacity .25s ease;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.overlay.open { display:flex; opacity: 1; }
.overlay.center-align { align-items:center; }
.sheet {
  background:#fff; width:100%; max-width: 480px;
  border-radius: 24px 24px 0 0;
  max-height: 85vh; overflow-y: auto;
  transform: translateY(100%);
  transition: transform .3s cubic-bezier(0.32, 0.72, 0, 1);
  padding-bottom: max(24px, env(safe-area-inset-bottom));
  display:flex; flex-direction:column;
}
.overlay.open .sheet { transform: translateY(0); }
.sheet.center {
  border-radius: 24px;
  max-height: 90vh;
  transform: scale(0.95);
  margin: 16px;
}
.overlay.open .sheet.center { transform: scale(1); }

.drag-handle {
  width: 36px; height: 4px; background: #ddd; border-radius:999px;
  margin: 12px auto 0; flex-shrink:0;
}
.sheet-header {
  display:flex; align-items:center; justify-content:space-between;
  padding: 16px 20px 8px; flex-shrink:0;
}
.sheet-title { font-size: 18px; font-weight:800; letter-spacing:-0.01em; }
.sheet-close {
  width: 36px; height:36px; border-radius:50%;
  background: var(--soft);
  display:flex; align-items:center; justify-content:center;
  font-size: 16px;
}
.sheet-body { padding: 0 20px 20px; flex:1; }

/* Modal plato hero */
.dish-modal-hero {
  height: 200px; margin: 0 -20px 16px;
  background-size: cover; background-position: center;
  background-color: var(--soft);
  display:flex; align-items:center; justify-content:center;
  font-size: 80px;
  position:relative;
}
.dish-modal-hero.has-img { font-size: 0; }
.dish-modal-title {
  font-size: 22px; font-weight:800; letter-spacing:-0.02em;
  margin-bottom: 4px;
}
.dish-modal-price {
  font-size: 22px; font-weight:800; color: var(--text);
  margin-bottom: 8px;
}
.dish-modal-desc {
  font-size: 14px; color: var(--text-2);
  line-height: 1.5; margin-bottom: 16px;
}
.section-title {
  font-size: 12px; font-weight:700;
  text-transform:uppercase; letter-spacing:0.08em;
  color: var(--text-2); margin: 16px 0 10px;
}
/* Estilo carta en el panel: título con gris del panel y secundario blanco con borde */
.panel-view .section-title { color: var(--panel-text-2); }
.panel-view .btn-secondary {
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  color: var(--panel-text);
}
.extra-row {
  display:flex; align-items:center; justify-content:space-between;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.extra-row .name { font-size: 14px; font-weight:600; }
.extra-row .price { font-size: 13px; color: var(--text-2); }
.checkbox {
  width: 22px; height:22px; border-radius:6px;
  border: 2px solid var(--line);
  display:flex; align-items:center; justify-content:center;
  flex-shrink:0; transition: all .15s ease;
}
.checkbox.checked { background:#111; border-color:#111; color:#fff; font-size: 12px; }

.quantity-row {
  display:flex; align-items:center; gap: 16px;
  padding: 12px 0;
}
.qty-btn {
  width: 36px; height:36px; border-radius:50%;
  background: var(--soft);
  display:flex; align-items:center; justify-content:center;
  font-size: 18px; font-weight:700;
}
.qty-btn:active { transform: scale(0.9); }
.qty-val { font-size: 18px; font-weight:800; min-width: 28px; text-align:center; }

.notes-textarea {
  width:100%; padding: 12px; border-radius:12px;
  border: 1.5px solid var(--line);
  font-size: 14px; resize: none; min-height: 70px;
}
.notes-textarea:focus { outline: none; border-color: #111; }

.btn-primary {
  width:100%; background: var(--terracota); color:#fff;
  padding: 16px; border-radius:999px;
  font-size: 15px; font-weight:700;
  display:flex; align-items:center; justify-content:center; gap:10px;
  box-shadow: 0 6px 16px rgba(193,74,42,0.25);
  transition: transform .15s ease, opacity .15s ease, box-shadow .15s ease;
}
.btn-primary:active { transform: scale(0.98); }
.btn-primary:disabled { opacity:.4; cursor:not-allowed; }
.btn-secondary {
  width:100%; background: var(--soft); color:#111;
  padding: 14px; border-radius:999px;
  font-size: 14px; font-weight:600;
  display:flex; align-items:center; justify-content:center; gap:8px;
}
.btn-danger {
  background: #d23a3a; color:#fff;
}
.btn-row { display:flex; gap:10px; }
.btn-row .btn-primary, .btn-row .btn-secondary { flex:1; }

/* ============================================================
   ALÉRGENOS GRID
   ============================================================ */
.allergen-grid {
  display:grid; grid-template-columns: repeat(4, 1fr);
  gap: 8px; margin: 8px 0 16px;
}
.allergen-chip {
  background: var(--soft); border-radius:10px;
  padding: 10px 6px; display:flex; flex-direction:column;
  align-items:center; gap:4px; font-size: 11px; font-weight:600;
  color: var(--text-2); transition: all .15s ease;
  text-align:center; min-height: 64px; justify-content:center;
}
.allergen-chip.active { background:#111; color:#fff; }
.allergen-chip .ai { font-size: 22px; line-height: 1; }

/* ============================================================
   CARRITO / CHECKOUT
   ============================================================ */
.cart-item {
  display:flex; gap: 12px; padding: 14px 0;
  border-bottom: 1px solid var(--line); align-items:center;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-thumb {
  width: 50px; height:50px; border-radius:10px;
  background: var(--soft);
  display:flex; align-items:center; justify-content:center;
  font-size: 22px; flex-shrink:0; overflow:hidden;
}
.cart-item-thumb img { width:100%; height:100%; object-fit:cover; }
.cart-item-info { flex:1; min-width:0; }
.cart-item-name { font-size: 14px; font-weight:700; }
.cart-item-extras { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.cart-item-notes { font-size: 11px; color: var(--accent-2); margin-top: 2px; }
.cart-item-price { font-weight: 800; font-size: 14px; white-space:nowrap; }
.cart-qty {
  display:flex; align-items:center; gap: 8px;
  background: var(--soft); border-radius:999px; padding: 4px;
}
.cart-qty button {
  width: 26px; height:26px; border-radius:50%;
  display:flex; align-items:center; justify-content:center;
  background:#fff;
}
.cart-qty span { font-size: 13px; font-weight:700; min-width: 18px; text-align:center; }

.cart-totals {
  display:flex; flex-direction:column; gap: 6px;
  padding: 12px 0; border-top: 1px solid var(--line);
  margin-top: 10px;
}
.cart-totals .row {
  display:flex; align-items:center; justify-content:space-between;
  font-size: 13px; color: var(--text-2);
}
.cart-totals .row.total {
  font-size: 18px; font-weight:800; color: var(--text);
  padding-top: 6px; border-top: 1px solid var(--line);
}

/* ============================================================
   TOAST
   ============================================================ */
.toast {
  position: fixed;
  bottom: 100px; left: 50%; transform: translateX(-50%) translateY(20px);
  background:#111; color:#fff; padding: 14px 20px;
  border-radius:14px; font-size: 14px; font-weight:600;
  opacity: 0; transition: all .3s ease;
  z-index: 200; pointer-events: none;
  max-width: 90%; text-align:center;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
  display:flex; align-items:center; gap:10px;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast.success { background: #1e7d3f; }
.toast.error { background: #c4302b; }

/* ============================================================
   COOKIE BANNER
   ============================================================ */
.cookie-banner {
  position: fixed;
  left: 16px; right: 16px;
  bottom: 90px;
  bottom: calc(90px + env(safe-area-inset-bottom));
  background: rgba(0,0,0,0.92);
  color:#fff;
  padding: 14px 16px; border-radius: 14px;
  display:none; align-items:center; gap:12px;
  z-index: 55;
  font-size: 13px;
  transform: translateY(150%);
  transition: transform .35s ease;
  box-shadow: 0 10px 30px rgba(0,0,0,0.3);
}
.cookie-banner.show { display:flex; }
.cookie-banner.visible { transform: translateY(0); }
.cookie-banner p { margin: 0; flex:1; }
.cookie-banner button {
  background:#fff; color:#111;
  padding: 8px 16px; border-radius:999px;
  font-size: 13px; font-weight:700; white-space:nowrap;
}

/* ============================================================
   MESA BIENVENIDA TOAST
   ============================================================ */
.mesa-welcome {
  position: fixed; inset:0;
  background: rgba(0,0,0,0.95);
  z-index: 300;
  display:flex; align-items:center; justify-content:center;
  flex-direction:column; gap:14px;
  color:#fff;
  opacity: 0; transition: opacity .4s ease;
  pointer-events:none;
}
.mesa-welcome.show { opacity:1; pointer-events:auto; }
.mesa-welcome .logo-big {
  width: 80px; height:80px; border-radius:20px;
  background: rgba(255,255,255,0.1);
  display:flex; align-items:center; justify-content:center;
  font-size: 40px; overflow:hidden;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #fff;
}
.mesa-welcome .logo-big img { width:100%; height:100%; object-fit:cover; border-radius:20px; }
.mesa-welcome .logo-big .initials {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 34px;
  font-weight: 800;
  letter-spacing: -0.04em;
  text-transform: uppercase;
}
.mesa-welcome .welcome-text { font-size: 14px; opacity:.7; letter-spacing:0.06em; text-transform:uppercase; }
.mesa-welcome .mesa-num { font-size: 36px; font-weight:800; letter-spacing:-0.02em; }

/* ============================================================
   PANEL NEGOCIO
   ============================================================ */
.panel-header {
  display:flex; align-items:center; gap: 12px;
  padding: 18px 20px; padding-top: max(18px, env(safe-area-inset-top));
  background: var(--panel-surface);
  border-bottom: 1px solid var(--panel-line);
}
.dark .panel-header { background: var(--panel-surface); }
.panel-header .title {
  font-size: 20px; font-weight:800; letter-spacing:-0.01em;
}
.panel-header .subtitle {
  font-size: 12px; color: var(--panel-text-2);
}
.panel-icon-btn {
  width: 40px; height:40px; border-radius:12px;
  background: var(--crema); color: var(--panel-text);
  display:flex; align-items:center; justify-content:center;
  font-size: 16px; flex-shrink:0;
}
.panel-icon-btn:active { transform: scale(0.92); }
.dark .panel-icon-btn { background: var(--panel-bg); }

.panel-body {
  padding: 16px;
  /* Reserva espacio para la bottom nav fija (alto botón + safe-area) */
  padding-bottom: calc(76px + env(safe-area-inset-bottom));
}

/* Bottom nav del panel */
.panel-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  background: var(--panel-surface);
  border-top: 1px solid var(--panel-line);
  display: flex;
  gap: 4px;
  padding: 6px 8px;
  padding-bottom: calc(6px + env(safe-area-inset-bottom));
  z-index: 50;
  box-shadow: 0 -4px 14px rgba(0,0,0,0.06);
  overflow-x: auto;
  scrollbar-width: none;
}
.panel-nav::-webkit-scrollbar { display: none; }
.panel-nav-btn {
  flex: 1;
  min-width: 64px;
  background: transparent;
  border: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 8px 4px;
  border-radius: 12px;
  color: var(--panel-text-2);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.02em;
  cursor: pointer;
  position: relative;
  transition: color .15s ease, background .15s ease;
  flex-shrink: 0;
}
.panel-nav-btn .ic { font-size: 20px; line-height: 1; transition: transform .15s ease; }
.panel-nav-btn:active { background: var(--crema); }
.panel-nav-btn.active { color: var(--terracota); }
.panel-nav-btn.active .ic { transform: scale(1.1); }
.panel-nav-btn.active::after {
  content: "";
  position: absolute;
  bottom: 2px; left: 50%;
  transform: translateX(-50%);
  width: 24px; height: 3px;
  background: var(--terracota);
  border-radius: 999px;
}
.panel-nav-btn .badge {
  position: absolute;
  top: 2px; left: 50%;
  margin-left: 4px;
  min-width: 16px; height: 16px;
  border-radius: 999px;
  background: var(--terracota);
  color: #fff;
  font-size: 9px;
  font-weight: 800;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 4px;
  box-shadow: 0 0 0 2px var(--panel-surface);
}

/* Etiqueta separadora entre grupos del hub */
.hub-group-label {
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--panel-text-2);
  text-transform: uppercase;
  font-weight: 700;
  margin: 18px 4px 8px;
}
.hub-group-label:first-of-type { margin-top: 6px; }

/* Hub grid */
.hub-grid {
  display:grid; grid-template-columns: repeat(2, 1fr);
  gap: 12px; margin-top: 8px;
}
.hub-card {
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius:18px; padding: 18px;
  display:flex; flex-direction:column; gap: 8px;
  position:relative; overflow:hidden;
  box-shadow: 0 2px 10px rgba(43,29,18,0.06);
  transition: transform .15s ease, box-shadow .15s ease;
}
.hub-card:active { transform: scale(0.97); box-shadow: 0 1px 4px rgba(43,29,18,0.08); }
.hub-card .ic {
  width: 44px; height:44px; border-radius:12px;
  background: var(--terracota-soft); color: var(--terracota);
  display:flex; align-items:center; justify-content:center;
  font-size: 22px;
}
.hub-card .title { font-size: 15px; font-weight:700; }
.hub-card .desc { font-size: 12px; color: var(--panel-text-2); }
.hub-card .count {
  position:absolute; top: 14px; right: 14px;
  min-width: 24px; height: 24px; padding: 0 7px;
  background: var(--terracota); color:#fff;
  border-radius:999px; font-size: 12px; font-weight:800;
  display:flex; align-items:center; justify-content:center;
}

/* Pin entry */
.pin-screen {
  min-height: 100dvh; display:flex; align-items:center; justify-content:center;
  flex-direction:column; gap: 20px;
  background: var(--panel-bg); color: var(--panel-text);
  padding: 24px;
  font-family: 'Plus Jakarta Sans', sans-serif;
}
.pin-title { font-size: 22px; font-weight:800; }
.pin-subtitle { font-size: 13px; color: var(--panel-text-2); margin-bottom: 12px; }
.pin-display {
  display:flex; gap: 10px;
}
.pin-dot {
  width: 18px; height:18px; border-radius:50%;
  background: var(--panel-line);
  transition: all .15s ease;
}
.pin-dot.filled { background: var(--terracota); transform: scale(1.1); }
/* Variante compacta para los modales de cambio de PIN */
.pin-dot--sm { width: 18px; height: 18px; }
.pin-pad {
  display:grid; grid-template-columns: repeat(3, 1fr);
  gap: 12px; max-width: 280px;
}
.pin-key {
  width: 72px; height:72px; border-radius:50%;
  background: var(--panel-surface); color: var(--panel-text);
  font-size: 24px; font-weight:600;
  display:flex; align-items:center; justify-content:center;
  border: 1px solid var(--panel-line);
}
.pin-key:active { background: var(--terracota); color:#fff; transform: scale(0.95); }
.pin-key.action { background:transparent; border:none; font-size: 14px; }
.pin-key.action:active { background:transparent; color: var(--terracota); }
.pin-error { color: #c4302b; font-size: 13px; font-weight:600; min-height: 18px; }
@keyframes pinShake {
  0%, 100% { transform: translateX(0); }
  20% { transform: translateX(-8px); }
  40% { transform: translateX(7px); }
  60% { transform: translateX(-5px); }
  80% { transform: translateX(3px); }
}

/* Cocina tickets */
.ticket {
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius: 16px; padding: 16px;
  margin-bottom: 12px;
  position:relative;
  border-left: 5px solid var(--terracota);
}
.ticket.estado-en_cocina { border-left-color: var(--dorado); }
.ticket.estado-listo { border-left-color: var(--oliva); }
.ticket-head {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 12px;
}
.ticket-id { font-size: 13px; font-weight:700; color: var(--panel-text-2); }
.ticket-mesa { font-size: 18px; font-weight:800; }
.ticket-time { font-size: 12px; color: var(--panel-text-2); }
.ticket-item {
  padding: 6px 0; border-bottom: 1px dashed var(--panel-line);
  display:flex; align-items:flex-start; gap:10px;
  font-size: 14px;
}
.ticket-item:last-child { border-bottom:none; }
.ticket-item .qty { font-weight:800; min-width: 22px; }
.ticket-item .name { flex:1; font-weight:600; }
.ticket-alert {
  background: #fee; border: 2px solid #d23a3a;
  color: #d23a3a; padding: 10px 12px; border-radius: 10px;
  margin: 10px 0; font-size: 13px; font-weight:700;
  display:flex; align-items:center; gap: 8px;
}
.ticket-notes {
  background: #fff4e6; border: 2px solid #f0884d;
  color: #b85a1c; padding: 8px 12px; border-radius: 10px;
  margin: 8px 0; font-size: 13px; font-weight:600;
}
.ticket-actions { display:flex; gap: 8px; margin-top: 12px; flex-wrap:wrap; }
.ticket-actions button {
  flex:1; padding: 10px; border-radius:10px;
  font-size: 13px; font-weight:700;
  background: var(--crema); color: var(--panel-text);
  min-width: 80px;
}
.ticket-actions button.primary {
  background: var(--terracota); color:#fff;
}
.ticket-actions button.secondary {
  background: var(--oliva); color:#fff;
}

/* Mesa grid panel */
.mesa-grid {
  display:grid; grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 10px;
}
.mesa-card {
  background: var(--panel-surface); border:1px solid var(--panel-line);
  border-radius: 14px; padding: 12px;
  display:flex; flex-direction:column; gap: 4px;
  position:relative; min-height: 90px;
  border-top: 4px solid var(--oliva);
}
.mesa-card.ocupada { border-top-color: var(--dorado); }
.mesa-card.cuenta { border-top-color: var(--terracota); }
.mesa-card .num { font-size: 22px; font-weight:800; }
.mesa-card .status { font-size: 11px; color: var(--panel-text-2); text-transform:uppercase; letter-spacing:0.04em; }
.mesa-card .meta { font-size: 12px; font-weight:600; margin-top: 2px; }
.mesa-card .note-dot {
  position:absolute; top: 8px; right: 8px;
  width: 10px; height:10px; border-radius:50%;
  background: #d23a3a;
}
.mesa-card .note-btn {
  position:absolute; top: 6px; right: 6px;
  width: 28px; height:28px; border-radius:50%;
  background: var(--crema); display:flex; align-items:center; justify-content:center;
  font-size: 13px;
}

/* Editor carta */
.editor-cat {
  background: var(--panel-surface); border-radius: 14px;
  padding: 14px; margin-bottom: 12px;
  border: 1px solid var(--panel-line);
}
.editor-cat-head {
  display:flex; align-items:center; justify-content:space-between;
  margin-bottom: 10px;
}
.editor-cat-title { font-size: 16px; font-weight:800; }
.editor-dish {
  display:flex; align-items:center; gap: 10px;
  padding: 10px; background: var(--crema);
  border-radius: 10px; margin-bottom: 6px;
}
.editor-dish .thumb {
  width: 44px; height:44px; border-radius:10px;
  background: var(--panel-bg);
  display:flex; align-items:center; justify-content:center;
  font-size: 20px; overflow:hidden; flex-shrink:0;
}
.editor-dish .thumb img { width:100%; height:100%; object-fit:cover; }
.editor-dish .info { flex:1; min-width:0; }
.editor-dish .name { font-size: 14px; font-weight:700; }
.editor-dish .price { font-size: 12px; color: var(--panel-text-2); }
.editor-dish .actions { display:flex; gap: 6px; }
.editor-dish .actions button {
  width: 32px; height:32px; border-radius:8px;
  background: var(--panel-surface); border:1px solid var(--panel-line);
  display:flex; align-items:center; justify-content:center;
  font-size: 13px;
}

/* Form fields */
.field { margin-bottom: 14px; }
.field label {
  display:block; font-size: 12px; font-weight:700;
  text-transform:uppercase; letter-spacing:0.06em;
  color: var(--text-2); margin-bottom: 6px;
}
.field input, .field select, .field textarea {
  width:100%; padding: 12px; border-radius:10px;
  border: 1.5px solid var(--line);
  font-size: 14px; background:#fff; color:#111;
}
.field input:focus, .field textarea:focus, .field select:focus { outline:none; border-color:#111; }
.field textarea { resize: vertical; min-height: 70px; }
.field-group {
  display:grid; gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
}
.lang-tabs {
  display:flex; gap:0; background: var(--soft); border-radius:10px;
  padding: 3px; margin-bottom: 8px;
}
.lang-tabs button {
  flex:1; padding: 6px 10px; font-size: 12px; font-weight:700;
  border-radius:8px; color: var(--text-2);
}
.lang-tabs button.active { background:#fff; color:#111; }

.toggle {
  position:relative; display:inline-block;
  width: 44px; height: 26px;
}
.toggle input { opacity:0; width:0; height:0; }
.toggle .slider {
  position:absolute; inset:0; background:#ccc;
  border-radius:999px; transition: .3s; cursor:pointer;
}
.toggle .slider::before {
  content:""; position:absolute; height: 20px; width:20px;
  left: 3px; top: 3px; background:#fff; border-radius:50%; transition: .3s;
}
.toggle input:checked + .slider { background: #111; }
.toggle input:checked + .slider::before { transform: translateX(18px); }

/* Estadísticas */
.kpi-grid {
  display:grid; grid-template-columns: repeat(2, 1fr); gap:10px;
  margin-bottom: 16px;
}
.kpi-card {
  background: var(--panel-surface); border:1px solid var(--panel-line);
  border-radius: 16px; padding: 14px;
  box-shadow: 0 2px 10px rgba(43,29,18,0.06);
}
.kpi-card .label {
  font-size: 11px; text-transform:uppercase; letter-spacing:0.06em;
  color: var(--panel-text-2); font-weight:700;
}
.kpi-card .value { font-size: 22px; font-weight:800; margin-top: 4px; }
.kpi-card .delta { font-size: 12px; color: var(--oliva); margin-top: 2px; }

.chart-wrap {
  background: var(--panel-surface); border:1px solid var(--panel-line);
  border-radius: 14px; padding: 14px; margin-bottom: 12px;
}
.chart-title {
  font-size: 14px; font-weight:800; margin-bottom: 8px;
}

/* QR */
.qr-card {
  background:#fff; color:#111;
  padding: 20px; border-radius: 18px;
  text-align: center;
  border: 1px solid var(--panel-line);
}
.qr-canvas-wrap {
  display:inline-block; padding: 12px; background:#fff; border-radius:12px;
  border: 1px solid #eee;
}
.qr-mesa { font-size: 16px; font-weight:800; margin-top: 12px; }
.qr-brand { font-size: 13px; color: #666; }

/* Mesa selector grid */
.mesa-selector-grid {
  display:grid; grid-template-columns: repeat(4, 1fr); gap:10px;
  margin: 12px 0;
}
.mesa-opt {
  aspect-ratio: 1/1; border-radius: 12px;
  background: var(--soft);
  display:flex; align-items:center; justify-content:center;
  font-size: 18px; font-weight:800;
  border: 2px solid transparent;
  transition: all .15s ease;
}
.mesa-opt.selected { background:#111; color:#fff; }
.mesa-opt:active { transform: scale(0.95); }

/* Empty state */
.empty-state {
  text-align:center; padding: 40px 20px; color: var(--text-2);
  display:flex; flex-direction:column; align-items:center; gap: 14px;
}
.empty-state svg { opacity: 0.8; }
.empty-state .title { font-size: 16px; font-weight:700; color: var(--text); }
.empty-state .desc { font-size: 13px; }

/* Info sobre nosotros */
.info-block {
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius: 16px;
  padding: 16px; margin-bottom: 12px;
  box-shadow: 0 2px 10px rgba(43,29,18,0.06);
}
.info-block h3 {
  margin: 0 0 8px; font-size: 12px; font-weight:700;
  text-transform:uppercase; letter-spacing:0.08em;
  color: var(--text-2);
}
.info-row {
  display:flex; align-items:center; gap: 12px;
  padding: 8px 0;
}
.info-row .ic {
  width: 36px; height:36px; border-radius:10px;
  background:#fff; display:flex; align-items:center; justify-content:center;
  font-size: 16px; flex-shrink:0;
}
.info-row .text { flex:1; font-size: 14px; }
.info-row .text .label { font-size: 12px; color: var(--text-2); }
.info-open { color: #1e7d3f; font-weight:700; }
.info-closed { color: #c4302b; font-weight:700; }
.gallery-grid {
  display:grid; grid-template-columns: repeat(2, 1fr); gap: 8px;
  margin-top: 8px;
}
.gallery-grid img {
  width:100%; height: 120px; object-fit:cover;
  border-radius: 12px; cursor:pointer;
  transition: transform .15s ease;
}
.gallery-grid img:active { transform: scale(0.97); }
.social-row { display:flex; gap: 8px; flex-wrap:wrap; }
.social-btn {
  flex: 1 1 calc(50% - 4px);
  display:flex; align-items:center; gap:8px;
  padding: 10px; background:#fff; border-radius: 10px;
  font-size: 13px; font-weight:600;
}

/* Cuenta */
.bill-list-item {
  display:flex; align-items:center; justify-content:space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.payment-method {
  display:flex; align-items:center; gap:12px;
  padding: 14px; border-radius: 12px;
  border: 2px solid var(--line);
  margin-bottom: 8px;
  cursor:pointer;
}
.payment-method.selected { border-color: #111; background:#fafafa; }
.payment-method .ic { font-size: 22px; }
.payment-method .info { flex:1; }
.payment-method .name { font-size: 14px; font-weight:700; }
.payment-method .desc { font-size: 12px; color: var(--text-2); }

/* Reservas */
.reservation-item {
  background: var(--panel-surface); border:1px solid var(--panel-line);
  padding: 14px; border-radius: 14px; margin-bottom: 10px;
  display:flex; align-items:center; gap: 12px;
}
.reservation-item .date {
  width: 56px; text-align:center;
  background: var(--terracota-soft); color: var(--terracota);
  border-radius: 10px; padding: 8px;
}
.reservation-item .date .day { font-size: 18px; font-weight:800; }
.reservation-item .date .month { font-size: 10px; font-weight:700; text-transform:uppercase; }
.reservation-item .info { flex:1; }
.reservation-item .info .name { font-weight:800; font-size: 14px; }
.reservation-item .info .meta { font-size: 12px; color: var(--panel-text-2); }
.reservation-item .actions { display:flex; gap: 6px; }
.reservation-item .actions button {
  width: 36px; height:36px; border-radius:10px;
  background: var(--crema); font-size: 14px;
}

/* Tracker */
.tracker {
  display:flex; align-items:flex-start; justify-content:space-between;
  margin: 20px 0 30px; position:relative;
}
.tracker::before {
  content:""; position:absolute; top: 18px; left: 16%; right: 16%;
  height: 2px; background: var(--line); z-index:0;
}
.tracker-step {
  flex:1; display:flex; flex-direction:column; align-items:center;
  gap:6px; position:relative; z-index:1;
}
.tracker-step .circle {
  width: 36px; height:36px; border-radius:50%;
  background: var(--soft); color: var(--text-2);
  display:flex; align-items:center; justify-content:center;
  font-size: 16px; font-weight:800;
  transition: all .3s ease;
}
.tracker-step.active .circle { background: #111; color:#fff; }
.tracker-step.done .circle { background: #1e7d3f; color:#fff; }
.tracker-step .label { font-size: 11px; font-weight:600; color: var(--text-2); text-align:center; }
.tracker-step.active .label { color: var(--text); font-weight:800; }

/* Confeti canvas */
#confetti-canvas {
  position: fixed; inset:0; pointer-events:none !important;
  z-index: 250;
  display:none;
}

/* Llamada camarero banner */
.waiter-banner {
  position: fixed; left: 16px; right: 16px;
  top: max(90px, env(safe-area-inset-top));
  background: #1e7d3f; color:#fff;
  padding: 14px 18px; border-radius: 14px;
  display:flex; align-items:center; gap: 10px;
  z-index: 60; font-size: 14px; font-weight:700;
  box-shadow: 0 10px 30px rgba(0,0,0,0.2);
  transform: translateY(-150%); transition: transform .3s ease;
}
.waiter-banner.show { transform: translateY(0); }

/* FAB Llamar camarero — esquina derecha */
.waiter-fab {
  position: fixed;
  right: 16px;
  bottom: 92px;
  bottom: calc(92px + env(safe-area-inset-bottom));
  background: linear-gradient(135deg, #1e7d3f 0%, #2a9b54 100%);
  color: #fff;
  padding: 12px 18px 12px 14px;
  border-radius: 999px;
  display: none;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: -0.01em;
  z-index: 65;
  box-shadow: 0 8px 24px rgba(30,125,63,0.45), 0 2px 6px rgba(0,0,0,0.15);
  cursor: pointer;
  transition: transform .15s ease, box-shadow .2s ease;
  animation: waiterPulse 2.4s ease-in-out infinite;
  white-space: nowrap;
}
.waiter-fab.visible { display: inline-flex !important; }
.waiter-fab:active { transform: scale(0.95); }
.waiter-fab .bell {
  width: 30px; height: 30px;
  background: rgba(255,255,255,0.22);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 16px;
  animation: bellRing 2.4s ease-in-out infinite;
}
@keyframes waiterPulse {
  0%, 100% { box-shadow: 0 8px 24px rgba(30,125,63,0.45), 0 2px 6px rgba(0,0,0,0.15), 0 0 0 0 rgba(30,125,63,0.4); }
  70% { box-shadow: 0 8px 24px rgba(30,125,63,0.45), 0 2px 6px rgba(0,0,0,0.15), 0 0 0 14px rgba(30,125,63,0); }
}
@keyframes bellRing {
  0%, 90%, 100% { transform: rotate(0); }
  92% { transform: rotate(-18deg); }
  94% { transform: rotate(15deg); }
  96% { transform: rotate(-10deg); }
  98% { transform: rotate(6deg); }
}
.waiter-fab.called {
  background: linear-gradient(135deg, #444 0%, #666 100%);
  animation: none;
  box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}
.waiter-fab.called .bell { animation: none; background: rgba(255,255,255,0.18); }

/* Pause banner */
.pause-banner {
  background: #fef3c7; color: #92400e;
  padding: 12px 16px; border-radius: 12px;
  margin: 12px 16px 0; font-size: 13px; font-weight:600;
  display:flex; align-items:center; gap: 10px;
  border-left: 4px solid #f59e0b;
}

/* Ticket de impresión */
@media print {
  body * { visibility: hidden; }
  #print-area, #print-area * { visibility: visible; }
  #print-area {
    position: absolute; left: 0; top: 0;
    width: 80mm; padding: 8mm 4mm;
    font-family: 'Courier New', monospace;
    color: #000; background:#fff;
    font-size: 12pt;
  }
  #print-area h2 { font-size: 14pt; text-align:center; margin: 0 0 4mm; }
  #print-area .row-line {
    display:flex; justify-content:space-between;
    border-bottom: 1px dashed #000;
    padding: 1mm 0;
  }
  #print-area .total {
    font-weight: bold; font-size: 13pt;
    border-top: 2px solid #000; padding-top: 2mm; margin-top: 2mm;
  }
  #print-area .center { text-align:center; }
}
#print-area { display:none; }

/* Sub-tabs panel */
.sub-tabs {
  display:flex; gap:6px; margin-bottom: 12px;
  overflow-x:auto; padding-bottom: 4px;
}
.sub-tabs button {
  padding: 8px 14px; background: var(--crema); color: var(--panel-text);
  border-radius:999px; font-size: 13px; font-weight:700;
  white-space:nowrap; flex-shrink:0;
  display:inline-flex; align-items:center; gap:7px;
}
.sub-tabs button svg { color: var(--terracota); }
.sub-tabs button.active { background: var(--terracota); color:#fff; }
.sub-tabs button.active svg { color:#fff; }
.sub-tabs button .sub-tab-count {
  display:inline-flex; align-items:center; justify-content:center;
  min-width:17px; height:17px; padding:0 4px; border-radius:999px;
  background: var(--dorado); color:#fff; font-size:11px; font-weight:800;
}

/* Lightbox */
.lightbox {
  position:fixed; inset:0; z-index: 300;
  background: rgba(0,0,0,0.95);
  display:none; align-items:center; justify-content:center;
  padding: 20px;
}
.lightbox.open { display:flex; }
.lightbox img { max-width:100%; max-height:100%; object-fit:contain; border-radius: 8px; }
.lightbox .close, .lightbox .nav {
  position:absolute;
  width: 48px; height: 48px; border-radius:50%;
  background: rgba(255,255,255,0.15); color:#fff;
  display:flex; align-items:center; justify-content:center;
  font-size: 22px; font-weight: 700; cursor: pointer;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.1);
  transition: background .15s ease, transform .15s ease;
  z-index: 2;
}
.lightbox .close { top: max(20px, env(safe-area-inset-top)); right: 20px; }
.lightbox .nav.prev { left: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .nav.next { right: 16px; top: 50%; transform: translateY(-50%); }
.lightbox .close:hover, .lightbox .nav:hover { background: rgba(255,255,255,0.25); }
.lightbox .nav.prev:active { transform: translateY(-50%) scale(0.92); }
.lightbox .nav.next:active { transform: translateY(-50%) scale(0.92); }
.lightbox .close:active { transform: scale(0.92); }
.lightbox .counter {
  position:absolute; bottom: max(20px, env(safe-area-inset-bottom));
  left: 50%; transform: translateX(-50%);
  background: rgba(0,0,0,0.5); color:#fff;
  padding: 6px 14px; border-radius: 999px;
  font-size: 13px; font-weight: 700;
  letter-spacing: 0.04em;
  backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
}

/* Stars rating */
.stars-row { display:flex; gap: 8px; justify-content:center; margin: 20px 0; }
.star-btn {
  font-size: 36px; filter: grayscale(1); opacity:.5;
  transition: all .15s ease;
}
.star-btn.active { filter: grayscale(0); opacity:1; transform: scale(1.1); }
.star-btn:active { transform: scale(0.95); }

/* Search dropdown */
.search-results {
  max-height: 50vh; overflow-y:auto;
}

/* Suggestions */
.suggestions-row {
  display:flex; gap: 10px; overflow-x:auto;
  padding: 4px 0 10px;
}
.suggestion-card {
  flex-shrink:0; width: 140px;
  background: var(--soft); border-radius:14px;
  padding: 10px;
}
.suggestion-card .img {
  width:100%; aspect-ratio: 1/1; border-radius: 10px;
  background:#fff; margin-bottom: 8px;
  display:flex; align-items:center; justify-content:center;
  font-size: 30px; overflow:hidden;
}
.suggestion-card .img img { width:100%; height:100%; object-fit:cover; }
.suggestion-card .name { font-size: 12px; font-weight:700; line-height:1.2; }
.suggestion-card .price { font-size: 12px; font-weight:800; margin-top: 4px; }

/* Iconos SVG inline allergens */
.ai { display:inline-flex; align-items:center; justify-content:center; vertical-align: middle; line-height:0; }
.ai svg { display:block; }
/* Iconos SVG de la carta: alineación coherente icono+texto */
.badge svg, .cat-emoji svg, .favs-title svg { display:block; }
.dish-modal-hero svg { display:block; margin:0 auto; }
.client-header .icon-btn svg, .bottom-btn svg, .waiter-fab .bell svg { display:block; }
.mode-card .icon-box { color: var(--terracota); }
.mode-card.primary .icon-box { color:#fff; }
.mode-card .icon-box svg { display:block; }

/* ============================================================
   TPV — Nuevo pedido (personal)
   ============================================================ */
.tpv-wrap { padding-bottom: 20px; }
.tpv-section-label {
  font-size: 12px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .05em; color: var(--panel-text-2, #888);
  margin: 16px 2px 8px;
}
.tpv-destinos { display: flex; flex-wrap: wrap; gap: 8px; }
.tpv-dest {
  min-width: 46px; padding: 10px 14px; border-radius: 12px;
  background: var(--panel-surface, #fff); color: var(--panel-text, #222);
  border: 1px solid var(--panel-line, #e5e5e5); font-weight: 700; font-size: 14px;
  cursor: pointer;
}
.tpv-dest.active { background: var(--terracota); color: #fff; border-color: var(--terracota); }

.tpv-ticket {
  margin-top: 12px; background: var(--panel-surface, #fff);
  border: 1px solid var(--panel-line, #e5e5e5); border-radius: 16px;
  padding: 12px 14px;
}
.tpv-ticket-head {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 800; font-size: 14px; margin-bottom: 6px;
}
.tpv-clear { background: transparent; border: 0; color: var(--terracota); font-weight: 700; font-size: 13px; cursor: pointer; }
.tpv-empty { color: var(--panel-text-2, #999); font-size: 13px; padding: 10px 2px; }
.tpv-row { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px solid var(--panel-line, #f0f0f0); }
.tpv-row:last-of-type { border-bottom: 0; }
.tpv-row-info { flex: 1; min-width: 0; }
.tpv-row-name { font-weight: 700; font-size: 14px; }
.tpv-row-price { font-size: 12px; color: var(--panel-text-2, #888); }
.tpv-qty { display: flex; align-items: center; gap: 10px; }
.tpv-qty button {
  width: 30px; height: 30px; border-radius: 50%; border: 1px solid var(--panel-line, #ddd);
  background: var(--crema, #f5f2ec); color: var(--panel-text, #222); font-size: 18px; font-weight: 700; cursor: pointer;
  display: flex; align-items: center; justify-content: center; line-height: 1;
}
.tpv-qty span { min-width: 18px; text-align: center; font-weight: 800; }
.tpv-total-row { display: flex; justify-content: space-between; align-items: center; margin-top: 10px; font-size: 14px; color: var(--panel-text-2, #666); }
.tpv-total-row strong { font-size: 20px; color: var(--panel-text, #111); }
.tpv-send {
  width: 100%; margin-top: 12px; padding: 14px; border: 0; border-radius: 14px;
  background: var(--terracota); color: #fff; font-weight: 800; font-size: 15px; cursor: pointer;
}
.tpv-send.disabled { opacity: .45; pointer-events: none; }

.tpv-cat-title { font-weight: 800; font-size: 13px; margin: 14px 2px 6px; color: var(--panel-text, #333); }
.tpv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.tpv-dish {
  display: flex; flex-direction: column; align-items: flex-start; gap: 2px;
  padding: 12px; border-radius: 12px; text-align: left; cursor: pointer;
  background: var(--panel-surface, #fff); border: 1px solid var(--panel-line, #e5e5e5);
}
.tpv-dish:active { transform: scale(.97); }
.tpv-dish-name { font-weight: 700; font-size: 13.5px; line-height: 1.2; }
.tpv-dish-price { font-size: 12px; color: var(--terracota); font-weight: 700; }
/* Buscador de platos */
.tpv-buscador {
  width: 100%; height: 42px; padding: 0 14px; margin-bottom: 12px;
  border: 1px solid var(--panel-line, #e5e5e5); border-radius: 12px;
  background: var(--panel-surface, #fff); color: var(--panel-text, #222); font-size: 14px;
}
/* Nota por plato en el ticket */
.tpv-row-nota { font-size: 12px; color: #b85a1c; margin-top: 2px; }
.tpv-row-notabtn {
  margin-top: 4px; padding: 0; border: 0; background: transparent;
  color: var(--terracota); font-size: 12px; font-weight: 700; cursor: pointer;
}
/* Cantidad tocable (abre selector rápido) */
.tpv-qty-num { cursor: pointer; text-decoration: underline dotted; }
/* Selector de cantidad rápida (overlay) */
.tpv-cant-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.tpv-cant-btn {
  padding: 16px 0; border: 1px solid var(--panel-line, #ddd); border-radius: 12px;
  background: var(--crema, #f5f2ec); font-size: 20px; font-weight: 800; cursor: pointer;
}
.tpv-cant-btn.active { background: var(--terracota); color: #fff; border-color: var(--terracota); }

/* Barra viendo Cocina en modo solo lectura */
.cocina-lectura .ticket-actions { display: none !important; }
.tpv-cocina-nota {
  font-size: 12.5px; color: var(--panel-text-2, #888);
  background: var(--crema, #f5f2ec); border-radius: 10px;
  padding: 8px 12px; margin: 0 0 12px;
}

/* Aviso: sin sesión de nube en este dispositivo */
.tpv-aviso {
  background: #fff4e5; border: 1px solid #e8a33d; color: #7a4d00;
  border-radius: 14px; padding: 11px 14px; margin-bottom: 14px;
  font-size: 12.5px; line-height: 1.45;
}
.tpv-aviso strong { display: block; font-weight: 800; font-size: 13px; margin-bottom: 2px; }

/* Barra pendiente de cobro */
.tpv-pend {
  background: var(--panel-surface, #fff); border: 1px solid var(--dorado, #c89b3c);
  border-radius: 14px; padding: 4px 12px;
}
.tpv-pend-row {
  display: flex; align-items: center; gap: 10px; padding: 10px 0;
  border-bottom: 1px solid var(--panel-line, #f0f0f0);
}
.tpv-pend-row:last-child { border-bottom: 0; }
.tpv-pend-info { flex: 1; min-width: 0; }
.tpv-pend-total { font-weight: 800; font-size: 15px; }
.tpv-pend-items {
  font-size: 12px; color: var(--panel-text-2, #888);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.tpv-pend-btn {
  flex-shrink: 0; padding: 9px 16px; border: 0; border-radius: 10px;
  background: var(--dorado, #c89b3c); color: #fff; font-weight: 800; font-size: 13px; cursor: pointer;
}

/* Sticky bottom on sheets */
.sheet-footer {
  position: sticky; bottom:0; background:#fff;
  padding: 12px 0 8px; border-top: 1px solid var(--line);
  margin-top: 12px;
}

/* Long press logo area */
.long-press-area {
  position: fixed; top:0; left:0;
  width: 56px; height: 56px;
  z-index: 30;
}

/* Notificaciones — banner de pedidos perdidos */
.miss-banner {
  background: linear-gradient(135deg, var(--terracota) 0%, #e0593d 100%);
  color: #fff;
  padding: 14px 16px;
  border-radius: 14px;
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  box-shadow: 0 8px 24px rgba(193, 74, 42, 0.35);
  animation: missBannerIn .4s cubic-bezier(0.34, 1.56, 0.64, 1);
}
@keyframes missBannerIn {
  from { opacity: 0; transform: translateY(-12px) scale(0.95); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
.miss-banner .icon {
  font-size: 24px;
  animation: missBell 1.5s ease-in-out infinite;
  flex-shrink: 0;
}
@keyframes missBell {
  0%, 100% { transform: rotate(0); }
  10%, 30% { transform: rotate(-15deg); }
  20%, 40% { transform: rotate(12deg); }
}
.miss-banner .info { flex: 1; min-width: 0; }
.miss-banner .info strong { font-size: 15px; font-weight: 800; display: block; }
.miss-banner .info span { font-size: 12px; opacity: 0.9; }
.miss-banner button {
  background: #fff;
  color: var(--terracota);
  padding: 8px 14px;
  border-radius: 999px;
  font-weight: 800;
  font-size: 13px;
  white-space: nowrap;
}
.miss-banner .close {
  background: rgba(255,255,255,0.2);
  color: #fff;
  width: 30px; height: 30px;
  border-radius: 50%;
  font-size: 14px;
  padding: 0;
}

/* Indicador de estado en cabecera cocina/barra */
.live-status {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(0,0,0,0.04);
  padding: 4px 10px 4px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
}
.live-status .dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  display: inline-block;
}
.live-status.listening .dot {
  background: #1e7d3f;
  animation: liveBlink 1.5s ease-in-out infinite;
}
.live-status.listening { color: #1e7d3f; }
.live-status.background .dot { background: #d28a00; }
.live-status.background { color: #7a4d00; }
.live-status.offline .dot { background: #c4302b; animation: liveBlink 0.8s ease-in-out infinite; }
.live-status.offline { color: #c4302b; }
@keyframes liveBlink {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* Onboarding */
#onboarding {
  position: fixed; inset: 0;
  background: #fff;
  z-index: 9998;
  display: none;
  flex-direction: column;
  overflow-y: auto;
}
#onboarding.open { display: flex; }
.onb-progress {
  display: flex; justify-content: center; gap: 8px;
  padding: 18px 20px 8px;
  padding-top: calc(18px + env(safe-area-inset-top));
}
.onb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #e0e0e0;
  transition: all .2s ease;
}
.onb-dot.active { background: #111; transform: scale(1.2); }
.onb-dot.done { background: #1e7d3f; }
.onb-body {
  flex: 1;
  padding: 14px 20px 100px;
  max-width: 480px;
  margin: 0 auto;
  width: 100%;
  animation: onbSlideIn .35s ease;
}
@keyframes onbSlideIn { from { transform: translateX(20px); opacity: 0; } to { transform: translateX(0); opacity: 1; } }
.onb-title { font-size: 24px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.2; margin: 12px 0 4px; }
.onb-sub { font-size: 13px; color: var(--text-2); margin: 0 0 18px; }
.onb-skip { background: transparent; color: var(--text-2); font-size: 12px; padding: 8px; text-decoration: underline; }
.onb-footer {
  position: sticky; bottom: 0;
  background: #fff; padding: 14px 20px;
  padding-bottom: calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  display: flex; gap: 8px; align-items:center; justify-content: space-between;
}
.onb-color-grid {
  display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px;
  margin: 6px 0 10px;
}
.onb-color-swatch {
  aspect-ratio: 1/1; border-radius: 50%; cursor: pointer;
  border: 3px solid transparent;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
}
.onb-color-swatch.selected { border-color: #111; transform: scale(1.1); }
.onb-chip {
  display: inline-block;
  padding: 6px 12px; border-radius: 999px;
  background: var(--soft); color: var(--text);
  font-size: 12px; font-weight: 700;
  margin: 2px;
  cursor: pointer;
}
.onb-chip.active { background: #111; color: #fff; }

/* Splash screen */
#splash {
  position: fixed; inset: 0;
  background: #111;
  color: #fff;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  opacity: 1;
  transition: opacity .3s ease;
}
#splash.fade-out { opacity: 0; pointer-events: none; }
#splash .splash-logo {
  width: 96px; height: 96px;
  border-radius: 24px;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.12);
  display: flex; align-items: center; justify-content: center;
  font-size: 48px;
  overflow: hidden;
  opacity: 0;
  transform: scale(0.85);
  animation: splashIn .35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  box-shadow: 0 20px 50px rgba(0,0,0,0.5);
}
#splash .splash-logo img { width: 100%; height: 100%; object-fit: cover; border-radius: 24px; }
#splash .splash-logo .initials {
  font-family: 'Plus Jakarta Sans', sans-serif;
  font-size: 40px; font-weight: 800; letter-spacing: -0.04em;
  text-transform: uppercase;
}
#splash .splash-name {
  font-size: 22px; font-weight: 800; letter-spacing: -0.02em;
  opacity: 0;
  animation: splashIn .35s ease .12s forwards;
}
@keyframes splashIn {
  to { opacity: 1; transform: scale(1); }
}

/* Photo carousel in dish modal */
.dish-modal-carousel {
  position: relative;
  height: 200px;
  margin: 0 -20px 16px;
  background-color: var(--soft);
  overflow: hidden;
}
.dish-modal-carousel .carousel-track {
  display: flex;
  height: 100%;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}
.dish-modal-carousel .carousel-track::-webkit-scrollbar { display: none; }
.dish-modal-carousel .carousel-slide {
  min-width: 100%;
  height: 100%;
  scroll-snap-align: start;
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
}
.dish-modal-carousel .carousel-dots {
  position: absolute;
  bottom: 12px; left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  background: rgba(0,0,0,0.4);
  padding: 6px 10px;
  border-radius: 999px;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.dish-modal-carousel .carousel-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  transition: all .2s ease;
}
.dish-modal-carousel .carousel-dot.active {
  background: #fff;
  width: 18px;
  border-radius: 999px;
}
.dish-modal-carousel .carousel-arrow {
  position: absolute;
  top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.4);
  color: #fff;
  display: none;
  align-items: center; justify-content: center;
  font-size: 20px; font-weight: 700;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  cursor: pointer;
  z-index: 2;
}
@media (hover: hover) {
  .dish-modal-carousel .carousel-arrow { display: flex; }
}
.dish-modal-carousel .carousel-arrow.prev { left: 12px; }
.dish-modal-carousel .carousel-arrow.next { right: 12px; }
.dish-modal-carousel .carousel-arrow:hover { background: rgba(0,0,0,0.6); }

/* Heart button (favoritos) */
.fav-btn {
  position: absolute;
  top: -6px; right: -6px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: rgba(255,255,255,0.95);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px;
  cursor: pointer;
  z-index: 3;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
  border: 1px solid rgba(0,0,0,0.05);
  transition: transform .2s ease;
  color: #c4302b;
  line-height: 1;
}
.fav-btn:active { transform: scale(0.85); }
.fav-btn.fav-on {
  animation: favPop .4s ease;
}
@keyframes favPop {
  0% { transform: scale(1); }
  50% { transform: scale(1.35); }
  100% { transform: scale(1); }
}
.dish-thumb { overflow: visible !important; }
.dish-thumb img { border-radius: 10px; width:100%; height:100%; object-fit: cover; }

/* Favoritos section */
.favs-section {
  margin: 12px 0;
  padding: 0 16px;
}
.favs-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 8px;
}
.favs-title {
  font-size: 13px; font-weight: 800;
  text-transform: uppercase; letter-spacing: 0.06em;
  color: var(--text);
}
.favs-edit {
  font-size: 12px; font-weight: 600;
  color: var(--text-2);
  background: var(--soft);
  padding: 5px 12px; border-radius: 999px;
}
.favs-scroll {
  display: flex; gap: 10px;
  overflow-x: auto;
  padding: 4px 0 8px;
  margin: 0 -16px;
  padding-left: 16px;
  padding-right: 16px;
  scroll-snap-type: x mandatory;
}
.favs-scroll::-webkit-scrollbar { display: none; }
.fav-card {
  flex: 0 0 140px;
  background: #fff;
  border-radius: 12px;
  border: 1px solid var(--line);
  padding: 8px;
  scroll-snap-align: start;
  cursor: pointer;
  position: relative;
}
.fav-card .fav-img {
  width: 100%; aspect-ratio: 1/1;
  border-radius: 8px;
  background: var(--soft);
  background-size: cover; background-position: center;
  display: flex; align-items: center; justify-content: center;
  font-size: 32px;
  margin-bottom: 6px;
  overflow: hidden;
}
.fav-card .fav-img img { width: 100%; height: 100%; object-fit: cover; }
.fav-card .fav-name {
  font-size: 12px; font-weight: 700;
  line-height: 1.2;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.fav-card .fav-price { font-size: 12px; font-weight: 800; }
.fav-card .fav-remove {
  position: absolute; top: 4px; right: 4px;
  width: 22px; height: 22px;
  border-radius: 50%;
  background: rgba(0,0,0,0.7);
  color: #fff;
  display: none;
  align-items: center; justify-content: center;
  font-size: 11px;
  cursor: pointer;
}
.favs-section.editing .fav-remove { display: flex; }
.favs-section.editing .fav-card { animation: wobble .35s ease-in-out infinite; }
@keyframes wobble {
  0%, 100% { transform: rotate(0); }
  25% { transform: rotate(-1deg); }
  75% { transform: rotate(1deg); }
}

/* Compartir mesa pill */
.share-pill {
  display: inline-flex; align-items: center; gap: 6px;
  background: var(--soft);
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  color: var(--text);
}
.share-pill .name { color: var(--accent-2); }

/* Stock badges */
.badge.agotado {
  background: #fee; color: #c4302b;
  font-weight: 800;
}
.badge.stock-low {
  background: #fef3c7; color: #92400e;
  font-weight: 700;
}

/* Stock controls in editor */
.stock-row {
  display: flex; align-items: center; gap: 6px;
}
.stock-row input {
  width: 60px; padding: 8px; text-align: center;
  border: 1.5px solid var(--line); border-radius: 8px;
  font-size: 14px; font-weight: 700;
}
.stock-row button {
  width: 32px; height: 32px; border-radius: 8px;
  background: var(--crema); color: var(--panel-text);
  font-size: 16px; font-weight: 700;
}

/* ============================================================
   UTILIDADES Y AJUSTES POST-REFACTOR
   ============================================================ */

/* Sustituye style="display:none" inline */
.is-hidden { display: none !important; }

/* Indicador de mesa (antes inline en index.html) */
.mesa-indicator {
  padding: 6px 16px;
  font-size: 12px;
  color: var(--text-2);
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
}

/* Botón "Volver" del PIN (antes inline) */
.pin-back {
  margin-top: 12px;
  color: var(--panel-text-2);
  font-size: 13px;
  background: transparent;
  border: 0;
  cursor: pointer;
}
.pin-back:hover { opacity: .8; }

/* Foco visible para accesibilidad */
button:focus-visible,
[data-action]:focus-visible,
.tap:focus-visible {
  outline: 2px solid var(--accent-2, #c14a2a);
  outline-offset: 2px;
}

/* El canvas de confetti no debe interactuar */
#confetti-canvas { pointer-events: none; }


/* ============================================================
   BARRA DE ERROR FATAL (solo modo admin)
   ============================================================ */
.fatal-error-bar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 99999;
  background: #c4302b; color: #fff;
  padding: 12px 16px;
  font: 600 13px/1.4 system-ui, Arial, sans-serif;
  box-shadow: 0 2px 10px rgba(0,0,0,.2);
  max-height: 40vh; overflow: auto;
}
.fatal-error-row { display: flex; align-items: flex-start; gap: 8px; }
.fatal-error-icon { font-size: 16px; }
.fatal-error-msg { flex: 1; }
.fatal-error-close {
  background: rgba(0,0,0,.2); color: #fff; border: 0;
  padding: 4px 10px; border-radius: 6px;
  cursor: pointer; font-weight: 700;
}

/* ============================================================
   FIX: FAB camarero se solapaba con el banner de cookies.
   Cuando el banner está visible (.cookie-banner.show), subimos el FAB
   por encima del banner para que ambos sean visibles y pulsables.
   ============================================================ */
body:has(.cookie-banner.show) .waiter-fab {
  bottom: 170px;
  bottom: calc(170px + env(safe-area-inset-bottom));
}

/* ============================================================
   AJUSTES ADICIONALES @media print (ticket 80mm)
   ============================================================ */
@media print {
  @page { size: 80mm auto; margin: 0; }
  html, body { background: #fff !important; }
  #print-area hr { border: 0; border-top: 1px dashed #000; margin: 2mm 0; }
  /* Fuerza color negro (descarta acentos del tema) */
  #print-area, #print-area * { color: #000 !important; }
}

/* ============================================================
   ZONAS DE MESAS (panel) — encabezado y agrupación visual
   ============================================================ */
.mesa-zone { margin-bottom: 18px; }
.mesa-zone-title {
  display: flex; align-items: center; gap: 10px;
  font-size: 13px; font-weight: 800;
  letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--panel-text-2);
  margin: 14px 4px 8px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--panel-line);
}
.mesa-zone-count {
  display: inline-flex; align-items: center; justify-content: center;
  min-width: 22px; height: 20px;
  padding: 0 6px;
  background: var(--crema); color: var(--panel-text);
  border-radius: 999px;
  font-size: 11px; font-weight: 700;
  letter-spacing: 0;
}

/* ============================================================
   AVISO localStorage (hub admin)
   ============================================================ */
.ls-warning {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px 14px;
  background: linear-gradient(135deg, #fff7d6 0%, #ffe6a3 100%);
  border: 1px solid #d4a017;
  color: #6b4e00;
  border-radius: 12px;
  margin-bottom: 14px;
  font-size: 12.5px; line-height: 1.4;
}
.ls-warning-icon { font-size: 18px; flex-shrink: 0; }
.ls-warning-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.ls-warning-text strong { font-weight: 800; font-size: 13px; }
.ls-warning-close {
  background: transparent; border: 0; color: #6b4e00;
  font-size: 16px; font-weight: 700; cursor: pointer;
  padding: 2px 6px; line-height: 1;
}

/* ============================================================
   EDITOR DE ZONAS DE MESA
   ============================================================ */
.mesa-edit-bar {
  display: flex; justify-content: flex-end;
  margin-bottom: 10px;
}
.btn-sm { padding: 6px 12px; font-size: 12px; font-weight: 700; }

.zone-row {
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius: 12px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
.zone-row-head {
  display: flex; align-items: center; gap: 8px;
  margin-bottom: 8px;
}
.zone-row-tag {
  display: inline-flex; align-items: center; justify-content: center;
  width: 22px; height: 22px;
  background: var(--crema); color: var(--panel-text);
  border-radius: 999px;
  font-size: 11px; font-weight: 800;
  flex-shrink: 0;
}
.zone-input-label,
.zone-input-tables {
  flex: 1;
  background: var(--panel-bg, #fff);
  color: var(--panel-text);
  border: 1px solid var(--panel-line);
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  font-family: inherit;
}
.zone-input-tables { font-family: 'SF Mono','Menlo','Consolas',monospace; font-size: 13px; }
.zone-tables-label {
  display: block;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.04em;
  color: var(--panel-text-2);
  margin: 6px 0 4px;
}
.zone-del {
  background: transparent;
  border: 0;
  font-size: 18px;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 8px;
  color: var(--panel-text-2);
}
.zone-del:hover { background: rgba(196, 48, 43, 0.1); color: #c4302b; }

/* ============================================================
   UNIÓN DE MESAS — chip, borde y editor
   ============================================================ */
.mesa-card.joined {
  outline: 2px dashed var(--terracota, #c14a2a);
  outline-offset: -2px;
  box-shadow: 0 0 0 1px rgba(193, 74, 42, 0.15);
}
.join-chip {
  position: absolute; left: 8px; bottom: 8px;
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 8px;
  background: var(--terracota, #c14a2a);
  color: #fff;
  border-radius: 999px;
  font-size: 10px; font-weight: 800;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.mesa-card { position: relative; }

.join-banner {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 14px;
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border: 1px solid #d4a017;
  color: #6b4e00;
  border-radius: 12px;
  margin-bottom: 12px;
  font-size: 13px;
}
.join-banner strong { font-weight: 800; }
.join-banner-btn {
  margin-left: auto;
  background: #6b4e00; color: #fff;
  border: 0;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12px; font-weight: 800;
  cursor: pointer;
}
.join-banner-row { margin-bottom: 12px; }

.join-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  margin-top: 8px;
}
.join-pick {
  display: flex; align-items: center; gap: 6px;
  padding: 10px 12px;
  background: var(--panel-surface);
  border: 1px solid var(--panel-line);
  border-radius: 10px;
  cursor: pointer;
  font-size: 13px;
  transition: background 0.15s ease, border-color 0.15s ease;
}
.join-pick:has(input:checked) {
  border-color: var(--terracota, #c14a2a);
  background: rgba(193, 74, 42, 0.08);
}
.join-pick input[type=checkbox] {
  width: 16px; height: 16px;
  accent-color: var(--terracota, #c14a2a);
  margin: 0;
}
.join-pick-num {
  font-weight: 800; font-size: 15px;
  color: var(--panel-text);
  min-width: 24px;
}
.join-pick-status {
  font-size: 11px;
  color: var(--panel-text-2);
  margin-left: auto;
}

/* ============================================================
   BADGE DE SINCRONIZACIÓN (esquina inferior izquierda)
   ============================================================ */
.sync-badge {
  position: fixed;
  left: 12px;
  bottom: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom));
  z-index: 9998;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 10px;
  background: rgba(17, 17, 17, 0.85);
  color: #fff;
  border-radius: 999px;
  font: 600 11px/1 system-ui, Arial, sans-serif;
  letter-spacing: 0.02em;
  cursor: pointer;
  user-select: none;
  backdrop-filter: blur(6px);
  box-shadow: 0 2px 10px rgba(0,0,0,0.18);
  transition: opacity .2s ease;
}
.sync-badge:hover { opacity: 0.85; }
.sync-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: #999;
  flex-shrink: 0;
}
.sync-idle      .sync-dot { background: #999; }
.sync-uploading .sync-dot { background: #f5d139; animation: pulse 1s ease-in-out infinite; }
.sync-ok        .sync-dot { background: #2a9b54; }
.sync-error     .sync-dot { background: #c4302b; }
.sync-offline   .sync-dot { background: #888; }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.4; }
}

/* ============================================================
   CLOUD LOGIN — overlay de Supabase Auth (Fase 3)
   ============================================================ */
.cloud-login-overlay {
  position: fixed;
  inset: 0;
  z-index: 99997;
  background: linear-gradient(135deg, #111111 0%, #2a1a14 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.cloud-login-box {
  background: #fff;
  color: #111;
  width: 100%;
  max-width: 380px;
  padding: 32px 26px;
  border-radius: 20px;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
  text-align: center;
}
.cloud-login-icon {
  font-size: 42px;
  margin-bottom: 12px;
}
.cloud-login-title {
  font-size: 22px;
  font-weight: 800;
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
.cloud-login-sub {
  font-size: 13px;
  color: #666;
  margin: 0 0 22px;
  line-height: 1.4;
}
.cloud-login-form {
  display: flex;
  flex-direction: column;
  gap: 12px;
  text-align: left;
}
.cloud-login-label {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 12px;
  font-weight: 700;
  color: #444;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
.cloud-login-label input {
  font-size: 15px;
  padding: 11px 14px;
  border: 1px solid #d4d4d4;
  border-radius: 10px;
  background: #fafafa;
  font-family: inherit;
  text-transform: none;
  letter-spacing: 0;
  color: #111;
}
.cloud-login-label input:focus {
  outline: none;
  border-color: #c14a2a;
  background: #fff;
}
.cloud-login-error {
  color: #c4302b;
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
  text-align: center;
  margin-top: 4px;
}
.cloud-login-btn {
  margin-top: 6px;
  background: #111;
  color: #fff;
  border: 0;
  padding: 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
  transition: background 0.15s ease;
}
.cloud-login-btn:hover:not(:disabled) { background: #c14a2a; }
.cloud-login-btn:disabled { opacity: 0.6; cursor: not-allowed; }
.cloud-login-hint {
  margin: 18px 0 0;
  font-size: 11px;
  color: #888;
  line-height: 1.4;
}


/* Chip de sesion cloud en el selector de rol */
.cloud-chip {
  display: flex; align-items: center; gap: 8px;
  background: rgba(46, 158, 86, 0.12);
  border: 1px solid rgba(46, 158, 86, 0.4);
  padding: 6px 10px 6px 12px;
  border-radius: 999px;
  margin: 0 auto 18px;
  max-width: 360px;
  font-size: 12px;
  color: var(--panel-text);
}
.cloud-chip-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #2a9b54; flex-shrink: 0;
  box-shadow: 0 0 0 4px rgba(42,155,84,0.18);
}
.cloud-chip-email {
  flex: 1; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-weight: 600;
}
.cloud-chip-out {
  background: transparent;
  border: 0;
  font-size: 11px; font-weight: 700;
  color: var(--panel-text-2);
  cursor: pointer;
  padding: 2px 8px;
  border-radius: 8px;
}
.cloud-chip-out:hover { color: #c4302b; background: rgba(196,48,43,0.1); }

/* ============================================================
   CLOUD LOGIN - boton switch login/signup
   ============================================================ */
.cloud-login-switch {
  background: transparent;
  border: 0;
  color: #c14a2a;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  padding: 12px;
  margin-top: 8px;
  text-decoration: underline;
}
.cloud-login-switch:hover { color: #111; }

/* ============================================================
   ONBOARDING WIZARD
   ============================================================ */
.onb-wizard {
  position: fixed;
  inset: 0;
  z-index: 99998;
  background: linear-gradient(135deg, #c14a2a 0%, #6b1e0c 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  padding-bottom: calc(20px + env(safe-area-inset-bottom));
  overflow-y: auto;
}
.onb-card {
  background: #fff;
  width: 100%;
  max-width: 440px;
  padding: 36px 30px;
  border-radius: 24px;
  box-shadow: 0 30px 80px rgba(0,0,0,.5);
  text-align: center;
}
.onb-step {
  display: inline-block;
  background: #f5e6df;
  color: #c14a2a;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 999px;
  margin-bottom: 18px;
}
.onb-icon { font-size: 56px; margin-bottom: 8px; line-height: 1; }
.onb-title {
  font-size: 26px;
  font-weight: 800;
  margin: 0 0 8px;
  letter-spacing: -.02em;
  color: #111;
}
.onb-sub {
  font-size: 14px;
  color: #666;
  margin: 0 0 24px;
  line-height: 1.45;
}
.onb-input {
  width: 100%;
  font-size: 17px;
  padding: 14px 16px;
  border: 1.5px solid #d4d4d4;
  border-radius: 12px;
  background: #fafafa;
  font-family: inherit;
  color: #111;
  text-align: center;
}
.onb-input:focus {
  outline: none;
  border-color: #c14a2a;
  background: #fff;
}
.onb-invalid { border-color: #c4302b !important; background: #fff5f5 !important; }
.onb-slug-row {
  display: flex; align-items: stretch;
  border: 1.5px solid #d4d4d4;
  border-radius: 12px;
  overflow: hidden;
  background: #fafafa;
}
.onb-slug-row:focus-within { border-color: #c14a2a; background: #fff; }
.onb-slug-prefix {
  display: flex; align-items: center;
  padding: 0 12px;
  background: #f0f0f0;
  color: #888;
  font-size: 13px;
  font-family: 'SF Mono', Menlo, monospace;
  white-space: nowrap;
}
.onb-slug-row .onb-input {
  border: 0;
  border-radius: 0;
  background: transparent;
  text-align: left;
  font-family: 'SF Mono', Menlo, monospace;
  font-size: 15px;
}
.onb-error {
  color: #c4302b;
  font-size: 13px;
  font-weight: 600;
  min-height: 18px;
  margin-top: 8px;
}
.onb-actions {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}
.onb-actions button { flex: 1; }
.onb-btn-primary {
  background: #c14a2a; color: #fff;
  border: 0; padding: 14px 18px;
  border-radius: 12px;
  font-size: 15px; font-weight: 800;
  cursor: pointer;
  transition: background .15s ease;
}
.onb-btn-primary:hover:not(:disabled) { background: #6b1e0c; }
.onb-btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.onb-btn-secondary {
  background: #f0f0f0; color: #444;
  border: 0; padding: 14px 18px;
  border-radius: 12px;
  font-size: 14px; font-weight: 700;
  cursor: pointer;
}
.onb-btn-secondary:hover { background: #e0e0e0; }
.onb-summary {
  background: #f8f8f8;
  border-radius: 12px;
  padding: 14px 16px;
  margin: 4px 0 12px;
  text-align: left;
}
.onb-row {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 14px;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}
.onb-row:last-child { border-bottom: 0; }
.onb-row span { color: #888; }
.onb-row strong { color: #111; }
.onb-row code {
  background: #fff;
  border: 1px solid #ddd;
  padding: 2px 8px;
  border-radius: 6px;
  font-size: 13px;
  font-family: 'SF Mono', Menlo, monospace;
  color: #c14a2a;
}
