/* Menú digital: categorías, tarjetas de platos, pedido deslizable y animaciones. Usa variables de styles.css. */

[hidden] { display: none !important; } /* hidden debe ganar a display de .field, .btn, etc. */

.menu-intro { align-items: end; }
.intro-side { display: grid; gap: 10px; justify-items: start; }

/* Herramientas: categorías (desplazables) + búsqueda y filtros */
.menu-tools { display: grid; gap: 12px; padding: 12px 0; }
.chips-scroll { overflow-x: auto; scrollbar-width: thin; margin-inline: -4px; padding: 2px 4px 6px; }
.chips { display: flex; gap: 8px; width: max-content; }
.chip {
  min-height: 42px; padding: 8px 16px; border-radius: 999px; cursor: pointer; font-weight: 650; font-size: 0.9rem; white-space: nowrap;
  border: 1px solid var(--line-strong); background: rgba(11, 22, 48, 0.6); color: var(--muted);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s var(--ease);
}
.chip:hover { border-color: var(--cyan); color: var(--text); }
.chip[aria-pressed='true'] { background: linear-gradient(135deg, var(--blue), var(--blue-deep)); color: #fff; border-color: transparent; }
.chip .n { opacity: 0.7; font-weight: 500; margin-left: 4px; }

/* Secciones y tarjetas */
.menu-section { margin-top: 18px; scroll-margin-top: 76px; }
.menu-section > h2 { font-size: 1.25rem; margin-bottom: 12px; display: flex; align-items: baseline; gap: 10px; }
.menu-section > h2 small { font-size: 0.8rem; color: var(--muted); font-weight: 500; }
.dish-grid { list-style: none; margin: 0; padding: 0; display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }
.dish {
  position: relative; display: flex; flex-direction: column; height: 100%; overflow: hidden; border-radius: 18px;
  border: 1px solid var(--line); background: linear-gradient(180deg, rgba(16, 32, 74, 0.6), rgba(11, 22, 48, 0.85));
  transition: transform 0.3s var(--ease), border-color 0.3s, box-shadow 0.3s var(--ease);
}
.dish:hover { transform: translateY(-3px); border-color: var(--line-strong); box-shadow: 0 18px 40px -22px rgba(0, 0, 0, 0.8); }
.dish-art { aspect-ratio: 16 / 10; display: block; width: 100%; }
.dish-art svg { width: 100%; height: 100%; display: block; }
/* Celular: tarjeta horizontal compacta (ilustración a la izquierda) para ver más platos */
@media (max-width: 599px) {
  .dish { display: grid; grid-template-columns: 96px 1fr; align-items: start; }
  .dish-art { width: 84px; aspect-ratio: 1; margin: 12px 0 0 12px; border-radius: 14px; overflow: hidden; }
  .dish-body { padding: 12px; gap: 4px; }
  .dish h3 { font-size: 1rem; padding-right: 26px; }
  .dish-desc { font-size: 0.84rem; }
  .dish-foot { margin-top: 6px; }
  .dish-actions { width: 100%; }
  .dish-actions .btn { flex: 1; padding-inline: 8px; }
  .in-order { top: 8px; right: 8px; min-width: 26px; height: 26px; font-size: 0.8rem; }
}
.dish-body { display: flex; flex-direction: column; gap: 6px; padding: 14px 16px 16px; flex: 1; }
.dish h3 { font-size: 1.08rem; }
.dish-desc { color: var(--muted); font-size: 0.9rem; flex: 1; }
.dish-foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.dish-price, .dish .price { font-size: 1.2rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.dish-actions { display: flex; gap: 6px; }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag-veg, .tag-hot {
  display: inline-flex; align-items: center; gap: 4px; padding: 2px 9px; border-radius: 999px; font-size: 0.74rem; font-weight: 700;
}
.tag-veg { color: var(--ok); background: rgba(52, 211, 153, 0.12); border: 1px solid rgba(52, 211, 153, 0.35); }
.tag-hot { color: #fb923c; background: rgba(251, 146, 60, 0.12); border: 1px solid rgba(251, 146, 60, 0.4); }
.in-order {
  position: absolute; top: 10px; right: 10px; min-width: 30px; height: 30px; padding: 0 8px; display: grid; place-items: center;
  border-radius: 999px; background: var(--cyan); color: var(--bg); font-weight: 800; font-size: 0.85rem;
  box-shadow: 0 6px 16px -6px rgba(34, 211, 238, 0.8);
}

/* Animación al seleccionar un plato */
.dish.picked { animation: picked 0.6s var(--ease); }
@keyframes picked {
  30% { transform: scale(1.025); border-color: var(--cyan); box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.25), 0 20px 40px -20px rgba(34, 211, 238, 0.6); }
}
.plus-one {
  position: absolute; top: 40%; left: 50%; z-index: 2; pointer-events: none; font-weight: 900; font-size: 1.4rem; color: var(--cyan);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6); animation: plus-one 0.8s var(--ease) forwards;
}
@keyframes plus-one { from { opacity: 0; transform: translate(-50%, 10px) scale(0.8); } 30% { opacity: 1; } to { opacity: 0; transform: translate(-50%, -40px) scale(1.1); } }

/* Botón flotante del pedido */
.order-fab {
  position: fixed; z-index: 30; right: 16px; bottom: 16px; display: inline-flex; align-items: center; gap: 10px;
  min-height: 54px; padding: 10px 20px; border: 0; border-radius: 999px; cursor: pointer; font-weight: 700; color: #fff;
  background: linear-gradient(135deg, var(--blue), var(--blue-deep)); box-shadow: 0 16px 40px -12px rgba(47, 107, 255, 0.85);
  transition: transform 0.25s var(--ease);
}
.order-fab:hover { transform: translateY(-2px); }
.order-fab b { font-variant-numeric: tabular-nums; }
.fab-count { min-width: 26px; height: 26px; padding: 0 7px; display: grid; place-items: center; border-radius: 999px; background: #fff; color: var(--blue-deep); font-size: 0.85rem; font-weight: 800; }
.order-fab.bump { animation: fab-bump 0.5s var(--ease); }
@keyframes fab-bump { 35% { transform: scale(1.08); } 70% { transform: scale(0.97); } }
@media (max-width: 599px) { .order-fab { left: 16px; justify-content: space-between; } }
main.wrap { padding-bottom: 96px; } /* espacio para el botón flotante */
body .tour { bottom: 84px; } /* la guía queda sobre el botón flotante */

/* Detalle de plato */
dialog.dish-dlg { width: min(520px, calc(100% - 24px)); }
dialog.dish-dlg form { padding: 0; gap: 0; }
.dish-art-lg { aspect-ratio: 16 / 9; }
.dish-art-lg svg { width: 100%; height: 100%; display: block; }
.dish-dlg-body { display: grid; gap: 12px; padding: 18px 20px 20px; }
.dish-dlg-body > p:not(.dish-tags):not(.dish-price) { color: var(--muted); }
.dish-qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dish-qty .label { font-weight: 600; color: var(--muted); font-size: 0.9rem; }

.qty { display: inline-flex; align-items: center; border: 1px solid var(--line-strong); border-radius: 12px; overflow: hidden; }
.qty button { width: 44px; height: 44px; border: 0; background: rgba(16, 32, 74, 0.7); color: var(--text); font-size: 1.15rem; font-weight: 700; cursor: pointer; }
.qty button:hover { background: var(--surface-2); }
.qty button:disabled { opacity: 0.4; cursor: not-allowed; }
.qty output, .qty .q { min-width: 44px; text-align: center; font-weight: 800; font-variant-numeric: tabular-nums; }

/* Pedido: cajón inferior en celular, lateral en computadora */
dialog.drawer {
  width: 100%; max-width: 100%; height: auto; max-height: 88vh; margin: auto 0 0; padding: 0;
  border-radius: 22px 22px 0 0; border: 1px solid var(--line-strong); border-bottom: 0;
  flex-direction: column; overflow: hidden;
}
dialog.drawer[open] { display: flex; animation: sheet-up 0.4s var(--ease); }
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (min-width: 760px) {
  dialog.drawer { width: 440px; height: 100%; max-height: 100%; margin: 0 0 0 auto; border-radius: 0; border: 0; border-left: 1px solid var(--line-strong); }
  dialog.drawer[open] { animation-name: sheet-left; }
  @keyframes sheet-left { from { transform: translateX(100%); } }
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--line); }
.drawer-head h2 { font-size: 1.2rem; }
.drawer-body { flex: 1; overflow-y: auto; overscroll-behavior: contain; display: grid; align-content: start; gap: 14px; padding: 16px 18px 20px; }
.drawer-body > div { display: grid; gap: 14px; }
.cart-empty { color: var(--muted); font-size: 0.92rem; padding: 18px; border: 1px dashed var(--line-strong); border-radius: 12px; text-align: center; }
.order-lines { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.order-line {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 4px 12px; align-items: center;
  padding: 10px; border-radius: 14px; border: 1px solid var(--line); background: rgba(5, 11, 26, 0.55);
  animation: line-in 0.35s var(--ease) both;
}
@keyframes line-in { from { opacity: 0; transform: translateX(12px); } }
.order-line .mini { grid-row: span 2; width: 56px; height: 56px; border-radius: 10px; overflow: hidden; }
.order-line .mini svg { width: 100%; height: 100%; display: block; }
.order-line .ol-name { font-weight: 650; font-size: 0.95rem; overflow-wrap: anywhere; }
.order-line .ol-note { display: block; font-size: 0.8rem; color: var(--cyan); font-style: italic; }
.order-line .ol-unit { display: block; font-size: 0.78rem; color: var(--muted); }
.order-line .ol-sub { font-weight: 800; text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.order-line .ol-controls { grid-column: 2 / -1; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.order-line .qty button { width: 38px; height: 38px; }
.order-line .qty .q { min-width: 36px; }
.ol-remove { background: none; border: 0; color: var(--danger); font-weight: 600; font-size: 0.85rem; min-height: 40px; cursor: pointer; }
.ol-remove:hover { text-decoration: underline; }
.totals-box { display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; margin: 0; padding: 12px 14px; border-radius: 12px; background: rgba(5, 11, 26, 0.6); border: 1px solid var(--line); }
.totals-box dt { color: var(--muted); }
.totals-box dd { margin: 0; text-align: right; font-weight: 650; font-variant-numeric: tabular-nums; }
.totals-box .grand { font-size: 1.25rem; font-weight: 800; color: var(--text); padding-top: 6px; border-top: 1px solid var(--line); }
.totals-box dd.grand { color: var(--cyan); }
.drawer-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.drawer-actions .btn { flex: 1 1 140px; min-height: 48px; }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; }

/* Resumen del pedido */
.sim-banner { padding: 12px 14px; border-radius: 12px; border: 1px solid rgba(251, 191, 36, 0.5); background: rgba(251, 191, 36, 0.08); font-size: 0.9rem; }
.sim-banner strong { color: var(--warn); }
.summary-ticket { padding: 16px; border-radius: 14px; background: var(--bg-2); border: 1px dashed var(--line-strong); display: grid; gap: 10px; animation: fade-in 0.35s var(--ease); }
.summary-ticket h3 { font-size: 1.05rem; }
.summary-ticket .meta { color: var(--muted); font-size: 0.88rem; }
.summary-ticket ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.summary-ticket li { display: flex; justify-content: space-between; gap: 12px; font-size: 0.93rem; }
.summary-ticket li em { display: block; color: var(--cyan); font-size: 0.8rem; }
.summary-ticket li span:last-child { white-space: nowrap; font-variant-numeric: tabular-nums; }
.summary-ticket .s-total { display: flex; justify-content: space-between; padding-top: 10px; border-top: 1px solid var(--line); font-size: 1.15rem; font-weight: 800; }
.summary-ticket .s-total span:last-child { color: var(--cyan); }
