/* ==========================================================================
   pedido.css — pedido pela mesa: mesa no topo, "Meu pedido", item esgotado,
   cozinha fechada, confirmar e acompanhar o pedido.
   Só usa as variáveis de base.css (vale para qualquer cor de restaurante).
   ========================================================================== */

/* ---------- Topo: mesa e "Meu pedido" ---------- */
.mesa-chip {
  margin-left: auto;
  display: inline-flex; align-items: center; height: 32px; padding: 0 12px;
  border-radius: 999px; border: 1px solid var(--line-strong);
  font-size: 0.8125rem; font-weight: 700; color: var(--text-2); white-space: nowrap;
}
.orders-btn {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 12px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--text);
  font-weight: 700; font-size: 0.875rem; white-space: nowrap;
}
.orders-btn:hover { border-color: var(--accent); color: var(--accent); }
.orders-btn__label { display: none; }
.orders-btn__dot { position: absolute; top: 6px; right: 6px; width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 2px var(--bg); }
.mesa-chip:not([hidden]) ~ .orders-btn, .mesa-chip:not([hidden]) ~ .cart-btn { margin-left: 0; }
.mesa-chip[hidden] + .orders-btn:not([hidden]) { margin-left: auto; }
.orders-btn:not([hidden]) + .cart-btn { margin-left: 0; }
@media (min-width: 640px) {
  .orders-btn { padding: 0 16px; }
  .orders-btn__label { display: inline; }
  .orders-btn__dot { position: static; box-shadow: none; }
}
@media (min-width: 900px) { .header__nav + .mesa-chip { margin-left: 8px; } }
/* celular: logo + mesa + "meu pedido" + carrinho cabem sem espremer os botões */
.mesa-chip, .orders-btn, .cart-btn { flex: none; }
.header__inner .brand { min-width: 0; }
@media (max-width: 639px) {
  .header__inner { gap: 8px; }
  .orders-btn { width: 44px; padding: 0; justify-content: center; }
}
@media (max-width: 400px) {
  .header__inner .brand { font-size: 1.0625rem; gap: 8px; }
  .header__inner .brand__mark { width: 30px; height: 30px; }
  .mesa-chip { padding: 0 9px; font-size: 0.75rem; height: 30px; }
  .orders-btn, .cart-btn { width: 40px; height: 40px; }
}
/* celular bem estreito com mesa + "meu pedido": fica só o símbolo (o nome grande aparece logo abaixo) */
@media (max-width: 359px) {
  .header__inner:has(.mesa-chip:not([hidden])):has(.orders-btn:not([hidden])) .brand__name { display: none; }
}

/* ---------- Item esgotado ---------- */
.card.is-out, .feature.is-out { cursor: default; }
.card.is-out .card__img, .feature.is-out .feature__img { filter: grayscale(1); opacity: 0.45; }
.card.is-out .add-btn, .feature.is-out .add-btn { background: var(--surface-2); color: var(--muted); pointer-events: none; }
.card.is-out .card__title, .feature.is-out .feature__title { color: var(--text-2); }
.badge--out { background: rgba(0, 0, 0, 0.78); color: var(--text); }
.badge--out::before { background: var(--muted); }

/* ---------- Cozinha fechada ---------- */
.closed-bar { background: var(--surface-2); border-bottom: 1px solid var(--line-strong); }
.closed-bar__inner { display: flex; flex-wrap: wrap; gap: 4px 12px; padding-block: 12px; font-size: 0.875rem; color: var(--text-2); line-height: 1.45; }
.closed-bar__inner strong { color: var(--accent); }

/* ---------- Confirmar pedido ---------- */
.oform { display: grid; gap: 18px; padding: 16px 0 8px; }
.ofield { display: grid; gap: 6px; }
.ofield__label { font-weight: 700; font-size: 0.9375rem; }
.ofield__label small { font-weight: 500; color: var(--muted); }
.ofield__input {
  width: 100%; height: 50px; padding: 0 14px;
  border-radius: 12px; background: var(--surface); border: 1px solid var(--line-strong);
  color: var(--text); font: inherit; font-size: 16px;   /* 16px evita zoom no iPhone */
}
.ofield__input::placeholder { color: var(--muted); }
.ofield__input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.ofield__input--mesa { max-width: 160px; font-size: 1.375rem; font-weight: 800; letter-spacing: 0.02em; }
.ofield__hint { font-size: 0.8125rem; color: var(--muted); line-height: 1.4; }
.oform__error { padding: 10px 12px; border-radius: 12px; background: rgba(220, 38, 38, 0.14); border: 1px solid rgba(248, 113, 113, 0.35); color: #fecaca; font-size: 0.875rem; font-weight: 600; }
.oform__back { margin-top: 10px !important; }

.osum { list-style: none; border-top: 1px solid var(--line); }
.osum li { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 0.9375rem; }
.osum li small { display: block; color: var(--muted); font-size: 0.8125rem; line-height: 1.4; }
.osum li .price { color: var(--text-2); }
.osum__total { padding: 14px 0 6px; }

/* ---------- Acompanhar pedido ---------- */
.otrack { display: grid; justify-items: center; text-align: center; gap: 6px; padding: 22px 8px 18px; }
.otrack__icon { width: 60px; height: 60px; border-radius: 50%; display: grid; place-items: center; background: var(--accent-soft); color: var(--accent); margin-bottom: 6px; }
.otrack--entregue .otrack__icon { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
.otrack--cancelado .otrack__icon { background: rgba(220, 38, 38, 0.14); color: #f87171; }
.otrack h3 { font-size: 1.5rem; }
.otrack p { color: var(--text-2); font-size: 0.9375rem; max-width: 34ch; }
.otrack--em_preparo .otrack__icon { animation: pulse 1.6s ease-in-out infinite; }
@keyframes pulse { 50% { transform: scale(1.08); } }

.osteps { list-style: none; padding: 0; margin: 4px 0 18px; display: grid; gap: 0; counter-reset: step; }
.osteps li { position: relative; display: flex; align-items: center; gap: 12px; padding: 9px 0; color: var(--muted); font-weight: 600; font-size: 0.9375rem; }
.osteps li + li::before { content: ''; position: absolute; left: 11px; top: -9px; height: 18px; width: 2px; background: var(--line-strong); }
.osteps li.is-done + li::before, .osteps li.is-done + li.is-now::before { background: var(--accent); }
.osteps__dot { width: 24px; height: 24px; flex: none; border-radius: 50%; border: 2px solid var(--line-strong); display: grid; place-items: center; background: var(--bg-deep); }
.osteps li.is-done { color: var(--text-2); }
.osteps li.is-done .osteps__dot { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.osteps li.is-now { color: var(--text); }
.osteps li.is-now .osteps__dot { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-soft); }
.osteps li.is-now .osteps__dot:empty::after { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--accent); }

/* ---------- Meus pedidos ---------- */
.olist { list-style: none; padding: 8px 0; display: grid; gap: 8px; }
.olist button { width: 100%; display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--line); text-align: left; }
.olist button:hover { border-color: var(--line-strong); }
.olist small { display: block; color: var(--muted); font-size: 0.8125rem; }
.opill { flex: none; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; background: var(--accent-soft); color: var(--accent); }
.opill--entregue { background: rgba(34, 197, 94, 0.14); color: #4ade80; }
.opill--cancelado { background: rgba(220, 38, 38, 0.14); color: #f87171; }
