/* public/cliente/style.css */

.cliente-body {
  padding-bottom: 70px;  /* espaço pro bottom nav */
}

.cliente-main {
  max-width: 720px;
  margin: 0 auto;
  padding: 16px;
}

.app-header {
  position: relative;
  background: var(--primary);
  color: #fff;
  padding: 14px 16px;
  text-align: center;
}
.app-header h1 {
  margin: 0;
  font-size: 20px;
  font-weight: 700;
}
.app-header .sub {
  font-size: 13px;
  opacity: 0.9;
  margin-top: 2px;
}
.btn-voltar {
  position: absolute;
  left: 6px;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.18);
  color: #fff;
  border: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  font-size: 22px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.btn-voltar.hidden { display: none; }

/* === Bottom Nav === */
.bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: var(--surface);
  border-top: 1px solid var(--border);
  display: flex;
  z-index: 50;
  padding-bottom: env(safe-area-inset-bottom);
  box-shadow: 0 -2px 8px rgba(0,0,0,0.04);
}
.bn-item {
  flex: 1;
  background: transparent;
  border: 0;
  padding: 10px 4px 8px;
  cursor: pointer;
  color: var(--muted);
  font-family: inherit;
}
.bn-item.ativo {
  color: var(--primary);
}
.bn-icone {
  font-size: 22px;
  line-height: 1;
}
.bn-label {
  font-size: 11px;
  margin-top: 4px;
  font-weight: 600;
}

/* === EVENTOS HOME === */
.eventos-lista {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.evento-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.1s, box-shadow 0.1s;
}
.evento-card:active {
  transform: scale(0.98);
}
.evento-card-banner {
  height: 100px;
  background-size: cover;
  background-position: center;
}
.evento-card-conteudo {
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.evento-card-logo {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  background: #fff;
  margin-top: -34px;
  border: 3px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.evento-card-info {
  flex: 1;
  min-width: 0;
}
.evento-card-nome {
  font-weight: 700;
  font-size: 16px;
}
.evento-card-local {
  font-size: 13px;
}
.evento-card-datas {
  font-size: 12px;
  margin-top: 2px;
}

/* === CARDÁPIO === */
.barraca-secao {
  margin-bottom: 18px;
}
.barraca-titulo {
  display: inline-block;
  color: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 8px;
}
.item-card {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 10px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
}
.item-emoji {
  font-size: 32px;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.item-emoji img {
  width: 100%;
  height: 100%;
  border-radius: 8px;
  object-fit: cover;
}
.item-info { flex: 1; min-width: 0; }
.item-nome { font-weight: 600; font-size: 15px; }
.item-desc { font-size: 12px; margin-top: 2px; }
.item-preco { font-weight: 700; color: var(--primary); margin-top: 4px; }
.item-qtd {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
}
.btn-qtd {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--surface);
  font-size: 18px;
  font-weight: 700;
  cursor: pointer;
  color: var(--primary);
}
.btn-qtd:active { background: var(--primary); color: #fff; }
.qtd-valor {
  min-width: 24px;
  text-align: center;
  font-weight: 700;
}

#carrinho-resumo {
  position: fixed;
  bottom: 64px;
  left: 0;
  right: 0;
  background: var(--primary);
  color: #fff;
  padding: 12px 16px;
  display: flex;
  gap: 12px;
  align-items: center;
  box-shadow: 0 -4px 16px rgba(0,0,0,0.15);
  z-index: 40;
}
#carrinho-resumo.hidden { display: none; }
#carrinho-resumo .resumo-info {
  flex: 1;
  display: flex;
  justify-content: space-between;
  font-size: 14px;
}
#carrinho-resumo .btn {
  background: var(--accent);
  color: #fff;
  border: 0;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
}

/* === TICKETS === */
.ticket {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 12px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  align-items: center;
}
.ticket.retirado { opacity: 0.55; }
.ticket-info { flex: 1; min-width: 0; }
.ticket-emoji { font-size: 28px; }
.ticket-item { font-weight: 600; font-size: 15px; margin-top: 2px; }
.ticket-barraca {
  display: inline-block;
  color: #fff;
  font-size: 11px;
  padding: 2px 10px;
  border-radius: 999px;
  margin-top: 4px;
  font-weight: 600;
}
.ticket-qr {
  width: 120px; height: 120px;
  flex-shrink: 0;
  position: relative;
  cursor: pointer;
}
.ticket-qr svg {
  display: block;
  width: 100%;
  height: 100%;
}
.ticket-qr-zoom {
  position: absolute;
  bottom: -4px;
  right: -4px;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary, #5e3023);
  color: #fff;
  border: 2px solid #fff;
  font-size: 16px;
  font-weight: 700;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  padding: 0;
}
.ticket-qr-zoom:active { transform: scale(0.92); }
.ticket-status { font-size: 11px; text-transform: uppercase; font-weight: 700; }

.barraca-grupo { margin-bottom: 14px; }

/* Modo agrupar */
.agrupar-bar {
  position: sticky;
  top: 56px;
  z-index: 4;
  background: var(--accent);
  color: #fff;
  padding: 10px 12px;
  border-radius: 8px;
  margin-bottom: 12px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  box-shadow: var(--shadow);
}
.agrupar-bar strong { font-size: 14px; }
.agrupar-bar .muted { color: rgba(255,255,255,0.85) !important; }

.ticket.selecionavel { cursor: pointer; user-select: none; }
.ticket.selecionavel:hover { border-color: var(--accent); }
.ticket.selecionado {
  border-color: var(--accent);
  background: #fff7ed;
  box-shadow: 0 0 0 2px var(--accent);
}
.ticket .check-mark {
  display: none;
  width: 24px; height: 24px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 14px;
}
.ticket.selecionado .check-mark { display: flex; }

.btn-agrupar-barraca {
  font-size: 12px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 999px;
  cursor: pointer;
  font-weight: 600;
  white-space: nowrap;
}
.btn-agrupar-barraca:hover {
  background: var(--accent);
  color: #fff;
}
.btn-desfazer-lote {
  font-size: 12px;
  padding: 4px 10px;
  background: transparent;
  border: 1px solid var(--muted);
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
}

.lote-card {
  background: #fef3c7;
  border: 2px solid #fbbf24;
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  gap: 12px;
  align-items: center;
}
.lote-card.retirado { opacity: 0.5; }
.lote-card .lote-info { flex: 1; }
.lote-card .lote-titulo { font-weight: 700; font-size: 16px; }
.lote-card .lote-detalhes { font-size: 13px; color: var(--muted); margin-top: 2px; }

/* Modal QR */
.qr-modal {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
.qr-modal-bg { position: absolute; inset: 0; background: rgba(0,0,0,0.85); }
.qr-modal-card {
  position: relative;
  background: #fff;
  border-radius: 12px;
  padding: 20px;
  max-width: 92vw;
  max-height: 92vh;
  overflow: auto;
  text-align: center;
  z-index: 1;
  box-shadow: 0 20px 60px rgba(0,0,0,0.4);
}
.qr-modal-fechar {
  position: absolute;
  top: 6px; right: 10px;
  background: transparent;
  border: none;
  font-size: 32px;
  font-weight: 700;
  color: var(--muted);
  cursor: pointer;
  line-height: 1;
}
.qr-modal-card svg { display: block; max-width: 100%; height: auto; }
.qr-modal-corpo .nome-grande {
  font-size: 22px;
  font-weight: 700;
  margin: 6px 0 4px;
}
.qr-modal-corpo .barraca-grande {
  display: inline-block;
  font-size: 14px;
  padding: 4px 12px;
  border-radius: 999px;
  color: #fff;
  margin-bottom: 12px;
}
.qr-modal-corpo .codigo-grande {
  font-family: monospace;
  font-size: 14px;
  letter-spacing: 1px;
  margin-top: 10px;
  color: var(--muted);
}

/* PIX copia-cola */
.copia-cola {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}
.copia-cola code {
  flex: 1;
  background: #f3f4f6;
  padding: 8px;
  border-radius: 6px;
  font-size: 11px;
  word-break: break-all;
  text-align: left;
}

/* Pedidos */
.pedido-card {
  display: flex;
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px;
  margin-bottom: 8px;
  box-shadow: var(--shadow);
  cursor: pointer;
  gap: 12px;
}
.pedido-card:active { transform: scale(0.99); }
.pedido-info { flex: 1; min-width: 0; }
.pedido-evento { font-weight: 600; font-size: 15px; }
.pedido-seta {
  font-size: 24px;
  color: var(--muted);
}

/* Conta */
.conta-campo {
  display: flex;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14px;
}
.conta-campo:last-child { border-bottom: 0; }
.conta-campo strong { color: var(--muted); font-weight: 500; }

.btn-link {
  background: none;
  border: 0;
  color: var(--primary);
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
  font-size: 14px;
  padding: 0;
}

.badge {
  display: inline-block;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 999px;
  font-weight: 600;
}
.badge.ok { background: #dcfce7; color: #166534; }
.badge.warn { background: #fef3c7; color: #92400e; }
.badge.err { background: #fee2e2; color: #991b1b; }

/* QR do PIX na tela de pagamento — limita largura em mobile */
#pagamento-qr {
  display: flex;
  justify-content: center;
  margin: 16px 0;
}
#pagamento-qr svg,
#pagamento-qr img {
  display: block;
  width: 100%;
  max-width: 280px;
  height: auto;
}

/* ========== Botão "Trocar item" no card de ticket ========== */
.ticket-btn-trocar {
  margin-top: 6px;
  padding: 5px 10px;
  font-size: 12px;
  background: transparent;
  border: 1px solid var(--border);
  color: var(--muted);
  border-radius: 6px;
  cursor: pointer;
  transition: all 0.12s;
}
.ticket-btn-trocar:hover {
  background: var(--bg);
  border-color: var(--primary);
  color: var(--primary);
}

/* ========== Modal: trocar item ========== */
.troca-modal-card {
  max-width: 560px !important;
  max-height: 85vh;
  overflow-y: auto;
}
.troca-header {
  border-bottom: 1px solid var(--border);
  padding-bottom: 14px;
  margin-bottom: 14px;
}
.troca-titulo {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
}
.troca-atual {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 16px;
  margin: 6px 0;
}
.troca-info {
  font-size: 13px;
  margin-top: 8px;
}
.troca-opcoes-titulo {
  font-size: 14px;
  font-weight: 600;
  color: var(--muted);
  margin: 14px 0 6px;
}
.troca-barraca-titulo {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 14px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px dashed var(--border);
}
.troca-itens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
  gap: 8px;
}
.troca-item {
  background: #fff;
  border: 2px solid var(--border);
  border-radius: 10px;
  padding: 10px 8px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
  transition: all 0.12s;
}
.troca-item:hover {
  border-color: var(--primary);
  background: rgba(13, 110, 253, 0.04);
}
.troca-item:active { transform: scale(0.97); }
.troca-item-emoji { font-size: 28px; line-height: 1; }
.troca-item-nome {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.2;
}
.troca-item-preco {
  font-size: 13px;
  color: var(--muted);
}
.troca-item-perda {
  font-size: 11px;
  font-weight: 700;
  color: var(--warn, #d97706);
  background: rgba(217, 119, 6, 0.1);
  padding: 1px 6px;
  border-radius: 8px;
  margin-top: 2px;
}
.troca-item-igual {
  font-size: 11px;
  font-weight: 600;
  color: var(--success, #16a34a);
  margin-top: 2px;
}
