:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --border: #e0e2e6;
  --text: #1f2430;
  --text-soft: #6b7280;
  --primary: #0059ff;
  --primary-dark: #0044c7;
  --success: #0f883b;
  --danger: #ff0000;
  --warning: #b8860b;
  --radius: 14px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 8px 20px;
  background: var(--surface);
  border-bottom: 3px solid var(--primary);
}
.topbar::before {
  content: '';
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  background: url('/assets/marca/logo-azul.png') no-repeat center / contain;
}
.topbar .info { flex: 1; font-size: 14px; color: var(--text-soft); }
.topbar .info strong { color: var(--text); }

.btn {
  border: none;
  border-radius: 10px;
  padding: 12px 20px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background .15s, transform .05s;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-dark); }
.btn-outline { background: none; border: 1px solid var(--border); color: var(--text-soft); }
.btn-outline:hover { background: var(--bg); }
.btn-outline.selecionado { border-color: var(--danger); background: #fef2f2; color: var(--danger); }
.btn-danger { background: var(--danger); color: #fff; }
.btn-success { background: var(--success); color: #fff; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

.container { max-width: 900px; margin: 0 auto; padding: 24px 20px 80px; }

/* Menu principal: 2 botões grandes, pensado pra toque */
.menu-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 48px;
}
@media (max-width: 640px) {
  .menu-grid { grid-template-columns: 1fr; }
}
.menu-btn {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  padding: 48px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  cursor: pointer;
  transition: border-color .15s, transform .05s;
}
.menu-btn:hover { border-color: var(--primary); }
.menu-btn:active { transform: scale(0.98); }
.menu-btn .icone { font-size: 56px; }
.menu-btn .label { font-size: 24px; font-weight: 700; }

/* Grade de produtos (fotos clicáveis) */
.produtos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-top: 20px;
}
.produto-card {
  background: var(--surface);
  border: 2px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  text-align: center;
  transition: border-color .15s, transform .05s;
}
.produto-card:hover { border-color: var(--primary); }
.produto-card:active { transform: scale(0.98); }
.produto-card.sem-estoque { opacity: .4; cursor: not-allowed; }
.produto-card img, .produto-card .sem-foto {
  width: 100%; height: 120px; object-fit: cover; background: var(--bg);
  display: flex; align-items: center; justify-content: center; color: var(--text-soft); font-size: 13px;
}
.produto-card .info { padding: 10px; }
.produto-card .nome { font-weight: 600; font-size: 14px; }
.produto-card .preco { color: var(--primary); font-weight: 700; margin-top: 4px; }
.produto-card .saldo { font-size: 12px; color: var(--text-soft); margin-top: 2px; }

/* Cartões de tipo de ingresso */
.tipos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 16px; margin-top: 20px; }
.tipo-card { background: var(--surface); border: 2px solid var(--border); border-radius: var(--radius); padding: 20px; }
.tipo-card .nome { font-weight: 700; font-size: 16px; }
.tipo-card .preco { color: var(--primary); font-weight: 700; margin: 8px 0; }
.qtd-controle { display: flex; align-items: center; gap: 12px; justify-content: center; }
.qtd-controle button { width: 40px; height: 40px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); font-size: 20px; cursor: pointer; }
.qtd-controle .valor { font-size: 20px; font-weight: 700; min-width: 30px; text-align: center; }

/* Carrinho / fechamento */
.carrinho-item { display: flex; justify-content: space-between; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--border); }
.carrinho-total { display: flex; justify-content: space-between; font-size: 20px; font-weight: 700; margin-top: 16px; padding-top: 16px; border-top: 2px solid var(--border); }

.form-row { margin-bottom: 16px; }
.form-row label { display: block; font-size: 14px; font-weight: 600; margin-bottom: 6px; color: var(--text-soft); }
.form-row input, .form-row select {
  width: 100%; padding: 12px; border-radius: 8px; border: 1px solid var(--border); font-size: 16px;
}

.pagamento-opcoes { display: flex; gap: 12px; margin-bottom: 16px; }
.pagamento-opcoes button {
  flex: 1; padding: 16px; border-radius: 10px; border: 2px solid var(--border); background: var(--surface);
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.pagamento-opcoes button.selecionado { border-color: var(--primary); background: #eff6ff; color: var(--primary); }

.acoes-rodape { position: fixed; bottom: 0; left: 0; right: 0; background: var(--surface); border-top: 1px solid var(--border); padding: 16px 20px; display: flex; gap: 12px; justify-content: flex-end; }

.tela-confirmacao { text-align: center; margin-top: 80px; }
.tela-confirmacao .icone { font-size: 72px; color: var(--success); }
.tela-confirmacao h2 { font-size: 24px; margin: 16px 0; }

.erro { color: var(--danger); font-size: 14px; margin-top: 8px; }

/* Recibo térmico 80mm */
.recibo {
  width: 80mm;
  margin: 0 auto;
  background: #fff;
  color: #000;
  font-family: 'Courier New', monospace;
  font-size: 12px;
  padding: 8px;
}
.recibo .centro { text-align: center; }
.recibo hr { border: none; border-top: 1px dashed #000; margin: 8px 0; }
.recibo table { width: 100%; border-collapse: collapse; }
.recibo td { padding: 2px 0; }
@media print {
  @page {
    size: 80mm auto; /* largura fixa da bobina térmica; altura contínua, sem cortar em A4/páginas */
    margin: 0;
  }
  body * { visibility: hidden; }
  .recibo, .recibo * { visibility: visible; }
  .recibo { position: absolute; top: 0; left: 0; width: 80mm; margin: 0; padding: 4mm; }
  .no-print { display: none !important; }
}
