/* Sistema de cores/tipografia da marca. --cor-principal continua a ser a
   cor ESCOLHIDA PELO RESTAURANTE (o menu.js substitui-a assim que o menu
   carrega) — o laranja aqui é só o valor por omissão antes disso acontecer. */
:root {
  --ink: #1c1a17;
  --ink-soft: #4a443c;
  --muted: #8a8072;
  --paper: #ffffff;
  --sand: #fbf3e6;
  --sand-deep: #f3e6d2;
  --line: #ecdfc9;
  --orange: #ff6a1a;
  --orange-deep: #e0530a;
  --orange-tint: #fff1e6;
  --radius-lg: 24px;
  --radius-md: 16px;
  --radius-sm: 10px;
  --shadow: 0 16px 32px -18px rgba(28, 26, 23, 0.35);
  --cor-principal: var(--orange);
}

/* Garante que o atributo "hidden" esconde SEMPRE o elemento, mesmo quando
   outra regra abaixo lhe define um "display" próprio (ex: "display: flex"
   em #escolha-pagamento) — sem isto, essa regra ganhava ao "hidden" e o
   elemento aparecia na mesma, apesar de tecnicamente escondido. */
[hidden] {
  display: none !important;
}

* {
  box-sizing: border-box;
}

body {
  font-family: 'Inter', system-ui, sans-serif;
  max-width: 480px;
  margin: 0 auto;
  padding: 1.1rem 1rem 2.5rem;
  background: var(--sand);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  font-family: 'Baloo 2', 'Inter', system-ui, sans-serif;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
}

#cabecalho-restaurante {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin-bottom: 1.25rem;
  padding-bottom: 1rem;
}

#logo-restaurante {
  width: 52px;
  height: 52px;
  object-fit: contain;
  border-radius: var(--radius-sm);
  background: var(--paper);
  box-shadow: 0 1px 0 var(--line);
}

#cabecalho-restaurante h1 {
  font-size: 1.5rem;
  flex: 1;
  color: var(--ink);
}

#seletor-idioma {
  padding: 0.4rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.82rem;
  font-weight: 600;
  background: var(--paper);
  color: var(--ink-soft);
}

.item {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  padding: 0.85rem;
  margin-bottom: 0.7rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 0 var(--line);
  transition: box-shadow 0.15s ease, transform 0.15s ease;
}

.item:hover {
  box-shadow: var(--shadow);
  transform: translateY(-1px);
}

.item-foto {
  width: 66px;
  height: 66px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  background: var(--sand-deep);
}

.item-info {
  flex: 1;
  min-width: 0;
}

.item-name {
  font-weight: 700;
  font-size: 1rem;
}

.item-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.item-price {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-top: 0.3rem;
  font-weight: 700;
}

.item-preco-original {
  text-decoration: line-through;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
}

.item-preco-promo {
  color: var(--orange-deep);
  font-weight: 800;
}

.promo-badge {
  display: inline-block;
  background: var(--orange-tint);
  color: var(--orange-deep);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  margin-top: 0.35rem;
}

.label-nota-pedido {
  display: block;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

#nota-pedido,
#nif-cliente {
  display: block;
  width: 100%;
  box-sizing: border-box;
  margin-bottom: 0.85rem;
  padding: 0.65rem 0.8rem;
  font-size: 0.9rem;
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  resize: vertical;
  min-height: 2.4rem;
}

#nota-pedido:focus,
#nif-cliente:focus {
  outline: none;
  border-color: var(--cor-principal);
}

#area-sugestoes {
  margin-bottom: 0.85rem;
}

.sugestao {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--orange-tint);
  border: 1px dashed var(--cor-principal);
  border-radius: var(--radius-md);
  padding: 0.7rem 0.9rem;
  margin-bottom: 0.55rem;
  font-size: 0.9rem;
}

.sugestao-texto {
  color: var(--ink-soft);
}

.sugestao-texto strong {
  color: var(--cor-principal);
}

.sugestao button {
  flex-shrink: 0;
  padding: 0.45rem 0.8rem;
  background: var(--cor-principal);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  cursor: pointer;
}

.qty-controls {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  flex-shrink: 0;
}

.qty-controls button {
  width: 2.1rem;
  height: 2.1rem;
  border: 1.5px solid var(--cor-principal);
  background: var(--paper);
  border-radius: 50%;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--cor-principal);
  transition: background 0.15s ease, color 0.15s ease;
}

.qty-controls button:hover {
  background: var(--cor-principal);
  color: white;
}

.qty-controls span {
  min-width: 1.3rem;
  text-align: center;
  font-weight: 700;
}

#resumo {
  position: sticky;
  bottom: 0;
  background: var(--sand);
  border-top: 1px solid var(--line);
  padding: 1.1rem 0 0.4rem;
  margin-top: 1.2rem;
}

#escolha-pagamento {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 0.85rem;
  font-size: 0.9rem;
}

#escolha-pagamento label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.6rem 0.8rem;
}

#total-linha {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  font-weight: 700;
  margin-bottom: 0.85rem;
  font-size: 1.05rem;
}

#total-valor {
  font-family: 'Baloo 2', 'Inter', sans-serif;
  font-size: 1.3rem;
  color: var(--cor-principal);
}

#btn-pedir {
  width: 100%;
  padding: 1rem;
  background: var(--cor-principal);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 1.02rem;
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 12px 24px -12px color-mix(in srgb, var(--cor-principal) 70%, transparent);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

#btn-pedir:not(:disabled):hover {
  transform: translateY(-1px);
}

#btn-pedir:disabled {
  background: var(--muted);
  box-shadow: none;
  cursor: not-allowed;
}

#mensagem {
  margin-top: 0.8rem;
  font-size: 0.9rem;
  font-weight: 600;
  text-align: center;
  color: var(--ink-soft);
}

.btn-chamar-empregado {
  display: block;
  width: 100%;
  margin-top: 1rem;
  padding: 0.55rem;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, color 0.15s ease;
}

.btn-chamar-empregado:hover {
  border-color: var(--cor-principal);
  color: var(--cor-principal);
}

.mensagem-chamar-empregado {
  margin-top: 0.4rem;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--cor-principal);
  text-align: center;
}

.combo-card {
  background: var(--paper);
  border-radius: var(--radius-md);
  box-shadow: 0 1px 0 var(--line);
  padding: 1rem;
  margin-bottom: 0.75rem;
  border: 1px solid var(--line);
  transition: box-shadow 0.15s ease;
}

.combo-card[open] {
  box-shadow: var(--shadow);
}

/* O card começa fechado — só o resumo (nome + preço) é visível até o
   cliente clicar para escolher as opções (ver criarCardDoCombo em menu.js). */
.combo-summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  cursor: pointer;
  list-style: none;
}

.combo-summary::-webkit-details-marker {
  display: none;
}

/* Seta que indica se o card está fechado (▸) ou aberto (▾) — feita só com
   CSS, sem precisar de JS extra para a atualizar. */
.combo-summary::after {
  content: '▸';
  color: var(--muted);
  font-size: 0.8rem;
  flex-shrink: 0;
}

.combo-card[open] .combo-summary::after {
  content: '▾';
  color: var(--cor-principal);
}

.combo-nome {
  font-weight: 700;
  font-size: 1.05rem;
}

.combo-desc {
  font-size: 0.85rem;
  color: var(--muted);
  margin-top: 0.1rem;
}

.combo-preco {
  font-size: 0.95rem;
  color: var(--cor-principal);
  font-weight: 800;
  white-space: nowrap;
}

.combo-conteudo {
  margin-top: 0.85rem;
  padding-top: 0.85rem;
  border-top: 1px dashed var(--line);
}

.combo-grupo {
  margin-top: 0.85rem;
}

.combo-grupo:first-child {
  margin-top: 0;
}

.combo-grupo-titulo {
  font-size: 0.78rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--muted);
  margin-bottom: 0.4rem;
}

.combo-opcao {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.92rem;
  padding: 0.4rem 0.1rem;
  border-radius: var(--radius-sm);
}

.item-opcao-preco {
  color: var(--muted);
  font-size: 0.8rem;
  font-weight: 600;
}

.btn-adicionar-combo {
  width: 100%;
  margin-top: 1rem;
  padding: 0.7rem;
  background: var(--cor-principal);
  color: white;
  border: none;
  border-radius: 999px;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
}

.combo-no-carrinho {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 0.55rem 0.8rem;
  margin-bottom: 0.45rem;
  font-size: 0.85rem;
}

.combo-no-carrinho-texto {
  color: var(--ink-soft);
}

.combo-no-carrinho button {
  flex-shrink: 0;
  width: 1.7rem;
  height: 1.7rem;
  border: none;
  border-radius: 50%;
  background: var(--sand-deep);
  color: var(--ink-soft);
  cursor: pointer;
  font-weight: 700;
}

.categoria-titulo {
  font-size: 1.2rem;
  font-weight: 700;
  margin: 1.6rem 0 0.6rem;
  color: var(--ink);
}

.categoria-titulo:first-child {
  margin-top: 0;
}
