/* =============================================
   Mochi Matcha — Cliente App Styles
   Estilos exclusivos de la interfaz del cliente final.
   Depende de mochi.css (tokens) cargado antes en cliente_base.html.
   ============================================= */

/* ---- Bottom Nav — barra de navegación inferior fija ---- */
/* position: fixed + width/max-width definidos en cliente_base.html para
   anclarlo al viewport visible y respetar el ancho del shell. */
.client-bottom-nav {
  height: 72px;
  /* añade espacio para el home indicator de iPhone */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  height: calc(72px + env(safe-area-inset-bottom, 0px));
  background: var(--mm-white);
  border-top: 1px solid var(--mm-border);
  display: flex;
  box-shadow: 0 -2px 8px rgba(0,0,0,.04);
}
.client-bottom-nav .nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  text-decoration: none;
  color: var(--mm-text-muted);
  font-size: .7rem;
  font-weight: 500;
  position: relative;
  transition: color .2s;
}
.client-bottom-nav .nav-item i { font-size: 1.25rem; }
.client-bottom-nav .nav-item.active { color: var(--mm-green); }
.client-bottom-nav .nav-item.active i {
  filter: drop-shadow(0 0 6px rgba(61,107,79,.4));
}
/* Badge numérico sobre el ícono del carrito en el nav inferior */
.nav-badge {
  position: absolute;
  top: 6px; right: calc(50% - 18px);
  background: var(--mm-gold);
  color: #fff;
  font-size: .6rem;
  font-weight: 700;
  min-width: 16px; height: 16px;
  border-radius: 99px;
  display: flex; align-items: center; justify-content: center;
  padding: 0 4px;
}

/* ---- Welcome Screen — pantalla de bienvenida por QR (bienvenida.html) ---- */
.welcome-hero {
  background: linear-gradient(160deg, var(--mm-green-dark) 0%, var(--mm-green) 100%);
  padding: 3rem 1.5rem 2rem;
  text-align: center;
  color: #fff;
}
.welcome-hero .logo-emoji { font-size: 3.5rem; line-height: 1; margin-bottom: .75rem; }
.welcome-hero h1 {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 600;
  margin-bottom: .25rem;
}
.welcome-hero .subtitle { font-size: .95rem; opacity: .85; }

/* Tarjeta blanca que "flota" sobre el hero verde con margen negativo */
.welcome-card {
  margin: -1.5rem 1rem 0;
  border-radius: var(--radius-xl);
  background: var(--mm-white);
  box-shadow: var(--shadow-lg);
  padding: 1.75rem 1.5rem;
  position: relative;
  z-index: 2;
}
/* Pill verde claro que muestra el número e identificador de la mesa */
.mesa-badge {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--mm-green-pale);
  color: var(--mm-green);
  border-radius: var(--radius-pill);
  padding: .35rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  margin-bottom: 1.25rem;
}

/* ---- Option Cards — tarjetas seleccionables (mesa ocupada: "Soy nuevo" / "Ya tengo cuenta") ---- */
.option-card {
  border: 2px solid var(--mm-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  cursor: pointer;
  transition: all .2s;
  text-align: center;
}
.option-card:hover, .option-card.selected {
  border-color: var(--mm-green);
  background: var(--mm-green-pale);
}
.option-card i { font-size: 1.75rem; color: var(--mm-green); margin-bottom: .5rem; }

/* ---- PIN display — cuadrícula de 4 dígitos para mostrar el PIN de la mesa ---- */
.pin-display {
  display: flex;
  justify-content: center;
  gap: .75rem;
  margin: 1rem 0;
}
.pin-digit {
  width: 52px; height: 62px;
  background: var(--mm-green-pale);
  border: 2px solid var(--mm-green);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.75rem;
  font-weight: 700;
  color: var(--mm-green-dark);
  font-family: var(--font-mono);
}

/* ---- Category Tabs — fila horizontal scrolleable de filtros de categoría (menu.html) ---- */
.category-tabs {
  display: flex;
  gap: .5rem;
  overflow-x: auto;
  padding: 1rem 1rem .5rem;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.category-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  white-space: nowrap;
  border: 1.5px solid var(--mm-border);
  background: var(--mm-white);
  color: var(--mm-text-muted);
  border-radius: var(--radius-pill);
  padding: .4rem .9rem;
  font-size: .8rem;
  font-weight: 600;
  cursor: pointer;
  transition: all .2s;
  text-decoration: none;
  display: inline-block;
}
.cat-tab:hover, .cat-tab.active {
  background: var(--mm-green);
  border-color: var(--mm-green);
  color: #fff;
}

/* ---- Product Card — tarjeta de producto en la cuadrícula del menú ---- */
.product-card {
  background: var(--mm-white);
  border-radius: var(--radius-md);
  border: 1px solid var(--mm-border);
  overflow: hidden;
  transition: box-shadow .2s, transform .2s;
  cursor: pointer;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.product-card.unavailable { opacity: .55; pointer-events: none; }

.product-img {
  width: 100%; aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--mm-cream-dark);
}
.product-img-placeholder {
  width: 100%; aspect-ratio: 4/3;
  background: var(--mm-cream-dark);
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  color: var(--mm-text-muted);
}
.product-body { padding: .75rem; }
.product-name { font-weight: 600; font-size: .9rem; margin-bottom: .2rem; }
.product-desc { font-size: .75rem; color: var(--mm-text-muted); margin-bottom: .5rem;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product-price { font-weight: 700; color: var(--mm-green); font-size: 1rem; }
.product-unavail { font-size: .7rem; color: var(--mm-danger); font-weight: 600; }

/* Botón circular "+" que abre el modal del producto sin navegar a otra página */
.add-btn {
  width: 32px; height: 32px;
  background: var(--mm-green);
  color: #fff;
  border: none; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  cursor: pointer; transition: background .2s;
  flex-shrink: 0;
}
.add-btn:hover { background: var(--mm-green-dark); }

/* ---- Product Modal — bottom sheet con imagen, modificadores, notas y cantidad ---- */
.modal-product-img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
}
.modifier-group { margin-bottom: 1.25rem; }
.modifier-group-title {
  font-weight: 700; font-size: .85rem;
  margin-bottom: .5rem;
  display: flex; align-items: center; gap: .4rem;
}
.modifier-option {
  display: flex; align-items: center; justify-content: space-between;
  padding: .6rem .75rem;
  border: 1.5px solid var(--mm-border);
  border-radius: var(--radius-sm);
  margin-bottom: .4rem;
  cursor: pointer;
  transition: all .15s;
}
.modifier-option:has(input:checked),
.modifier-option.selected {
  border-color: var(--mm-green);
  background: var(--mm-green-pale);
}
.modifier-option input { display: none; }
.modifier-extra { font-size: .75rem; color: var(--mm-gold); font-weight: 600; }

/* Control de cantidad: botones − y + con el valor numérico centrado */
.qty-control {
  display: flex; align-items: center; gap: .75rem;
}
.qty-btn {
  width: 36px; height: 36px;
  border: 2px solid var(--mm-border);
  background: var(--mm-white);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.1rem; font-weight: 700;
  cursor: pointer; transition: all .15s;
  color: var(--mm-text);
}
.qty-btn:hover { border-color: var(--mm-green); color: var(--mm-green); }
.qty-value { font-size: 1.1rem; font-weight: 700; min-width: 24px; text-align: center; }

/* ---- Cart — ítems y barra de total del carrito (carrito.html) ---- */
.cart-item {
  background: var(--mm-white);
  border: 1px solid var(--mm-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: .75rem;
}
.cart-item-name { font-weight: 600; font-size: .9rem; }
.cart-item-mods { font-size: .75rem; color: var(--mm-text-muted); margin-top: .25rem; }
.cart-item-price { font-weight: 700; color: var(--mm-green); }
.cart-total-bar {
  background: var(--mm-white);
  border: 1px solid var(--mm-border);
  border-radius: var(--radius-md);
  padding: 1rem 1.25rem;
}

/* ---- Order Tracking — tarjetas y badges de estado del pedido (pedidos.html) ---- */
.order-card {
  background: var(--mm-white);
  border: 1px solid var(--mm-border);
  border-radius: var(--radius-md);
  padding: 1rem;
  margin-bottom: .75rem;
}
.order-status-badge {
  border-radius: var(--radius-pill);
  padding: .25rem .75rem;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.status-recibido  { background: #EBF3FD; color: #2471A3; }
.status-preparando{ background: #FEF9E7; color: #CA8A04; }
.status-listo     { background: #EAFAF1; color: #1E8449; }
.status-entregado { background: #F2F3F4; color: #566573; }
.status-cancelado { background: #FDEDEC; color: #C0392B; }

/* ---- Progress Stepper — indicador visual de 3 etapas: recibido / preparando / listo ---- */
.order-steps {
  display: flex;
  align-items: center;
  gap: 0;
  margin: .75rem 0;
}
.step-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  border: 2px solid var(--mm-border);
  background: var(--mm-white);
  display: flex; align-items: center; justify-content: center;
  font-size: .7rem;
  font-weight: 700;
  color: var(--mm-text-muted);
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.step-dot.done {
  background: var(--mm-green);
  border-color: var(--mm-green);
  color: #fff;
}
.step-dot.current {
  border-color: var(--mm-green);
  color: var(--mm-green);
  box-shadow: 0 0 0 3px var(--mm-green-pale);
}
.step-line {
  flex: 1;
  height: 2px;
  background: var(--mm-border);
}
/* Línea completada: se colorea en verde cuando el estado siguiente ya fue alcanzado */
.step-line.done { background: var(--mm-green); }
