/* ============================================================
   BASE — solo estructura compartida (carrito, botón flotante,
   stepper por defecto). El LOOK de header+menú lo pone cada
   plantilla en templates/*.js, scopeado bajo body[data-tpl="..."].
   Paleta disponible: --marca --tinta --crema --acento
   ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "Segoe UI", Roboto, system-ui, sans-serif;
  max-width: 520px; margin: 0 auto; padding-bottom: 92px;
  background: #fff; color: var(--tinta);
}
img { display: block; }
.oculto { display: none !important; }
#app { min-height: 60vh; }

/* ---- Stepper estándar (las plantillas pueden re-estilarlo) ---- */
.stepper { display: inline-flex; align-items: center; }
.stepper .st-min, .stepper .st-q { display: none; }
.stepper.has-qty .st-min, .stepper.has-qty .st-q { display: inline-flex; }
.st-btn {
  border: none; cursor: pointer; width: 32px; height: 32px; border-radius: 9px;
  font-size: 18px; font-weight: 800; display: inline-flex; align-items: center; justify-content: center;
  background: var(--marca); color: var(--tinta);
}
.st-min { background: rgba(0,0,0,.07); color: inherit; }
.st-q { min-width: 26px; justify-content: center; font-size: 15px; font-weight: 800; }

/* ---- Botón flotante ---- */
#cart-fab {
  position: fixed; bottom: 16px; left: 50%; transform: translateX(-50%);
  width: calc(100% - 32px); max-width: 488px; z-index: 30;
  background: var(--tinta); color: #fff; border: none; border-radius: 16px;
  padding: 15px 18px; font-size: 16px; font-weight: 800; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  box-shadow: 0 10px 28px rgba(0,0,0,.28);
}
#cart-fab .fab-l { display: flex; align-items: center; gap: 10px; }
#cart-fab.oculto { transform: translateX(-50%) translateY(140%); }
#fab-cant {
  background: var(--marca); color: var(--tinta); border-radius: 999px;
  min-width: 24px; height: 24px; padding: 0 7px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px;
}

/* ---- Panel del carrito (compartido) ---- */
#overlay { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 40; }
#cart {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; z-index: 50;
  background: #f6f5f3; border-radius: 22px 22px 0 0; display: flex; flex-direction: column;
}
.cart-head {
  position: sticky; top: 0; background: #f6f5f3; z-index: 1;
  display: flex; align-items: center; justify-content: space-between; padding: 18px 16px 12px;
}
.cart-head h2 { font-size: 19px; }
#cart-cerrar { background: none; border: none; font-size: 24px; cursor: pointer; color: #999; line-height: 1; }
#cart-items { padding: 0 16px; }
.cart-row {
  display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 12px;
  background: #fff; border: 1px solid #ececec; border-radius: 12px; padding: 10px 12px; margin-bottom: 10px;
}
.cart-row-nom { font-weight: 600; font-size: 14px; }
.cart-row-pre { font-size: 12px; color: #999; }
.cart-row-sub { font-weight: 800; font-size: 14px; min-width: 58px; text-align: right; }
.stepper.compact .st-btn { width: 28px; height: 28px; font-size: 16px; }
.stepper.compact .st-min, .stepper.compact .st-q { display: inline-flex; } /* en el carrito siempre visible */
#cart-vacio { text-align: center; color: #999; padding: 36px 16px; }

.cart-foot { padding: 14px 16px 18px; }
.campo { display: block; font-size: 12px; font-weight: 700; color: #777; margin-bottom: 11px; text-transform: uppercase; letter-spacing: .03em; }
.campo input, .campo select {
  width: 100%; margin-top: 6px; padding: 12px; border: 1px solid #e2e0dc;
  border-radius: 11px; font-size: 15px; background: #fff; color: var(--tinta); font-family: inherit;
}
.cart-total {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 0; margin-top: 2px; border-top: 1px dashed #d8d6d2; font-size: 16px; font-weight: 600;
}
.cart-total strong { font-size: 24px; color: var(--tinta); }
#enviar {
  width: 100%; background: #25D366; color: #fff; border: none; border-radius: 14px;
  padding: 16px; font-size: 16px; font-weight: 800; cursor: pointer; margin-top: 6px;
}
#enviar:disabled { opacity: .45; }

/* ---- Botón de ubicación GPS (delivery) ---- */
.ubic-btn {
  width: 100%; margin: -2px 0 11px; padding: 12px; border-radius: 11px;
  border: 1.5px dashed var(--marca); background: rgba(0,0,0,.02); color: var(--tinta);
  font-size: 13.5px; font-weight: 700; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.ubic-btn.ok { border-style: solid; background: var(--marca); color: #fff; }
.ubic-ok { font-size: 12px; font-weight: 800; color: #16a34a; margin: -6px 0 11px; }

/* ---- Factura ---- */
.fact-toggle {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  font-size: 14px; font-weight: 700; color: var(--tinta); margin-bottom: 11px;
  text-transform: none; letter-spacing: 0;
}
.fact-toggle input { width: 18px; height: 18px; accent-color: var(--marca); cursor: pointer; }

/* ---- MODO EDICIÓN: botón 📷 sobre cada plato (overlay, no se recorta) ---- */
.foto-btn {
  position: absolute; inset: 0; z-index: 6;
  display: flex; align-items: center; justify-content: center;
  border: none; cursor: pointer; padding: 0; margin: 0;
  background: rgba(0,0,0,.30); color: #fff;
  font-size: 21px; line-height: 1; border-radius: inherit;
  transition: background .12s ease;
}
.foto-btn:active { background: rgba(0,0,0,.5); }
.foto-btn.cargando { background: rgba(0,0,0,.55); }

/* ---- Vista de UNA categoría a la vez (oculta el resto) ---- */
body.cat-unica [id^="cat-"] { display: none !important; }
body.cat-unica [id^="cat-"].cat-activa { display: block !important; }
body.cat-unica .sm-drip { display: none !important; }   /* separadores sueltos del Queso Redondo */

/* ---- Aviso de modo edición (toast inferior, no tapa el header) ---- */
.edit-banner {
  position: fixed; bottom: 86px; left: 50%; transform: translateX(-50%);
  z-index: 60; width: calc(100% - 32px); max-width: 488px;
  background: #111; color: #fff; text-align: center;
  font: 600 12.5px/1.35 system-ui, sans-serif;
  padding: 11px 14px; border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.5);
}
