/* ===========================================================
   DH Pet · Cardápio — Vai de Pedido
   =========================================================== */
:root {
  --bg: #F4F7F6;
  --surface: #FFFFFF;
  --ink: #14312C;
  --ink-2: #6B857E;
  --line: #E4EBE8;
  --teal: #0F766E;
  --teal-2: #14B8A6;
  --coral: #FF6B5E;
  --coral-ink: #E14B3D;
  --amber: #F59E0B;
  --ok: #1F9D6B;
  --zap: #1FAF57;
  --r-lg: 20px;
  --r-md: 14px;
  --r-sm: 10px;
  --shadow: 0 1px 2px rgba(20,49,44,.05), 0 10px 30px -14px rgba(20,49,44,.22);
  --f-display: "Baloo 2", system-ui, sans-serif;
  --f-body: "Inter", "Segoe UI", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--f-body); color: var(--ink);
  background: var(--bg); min-height: 100dvh; padding-bottom: 96px;
}

/* ---------- topo ---------- */
.topo {
  position: sticky; top: 0; z-index: 30;
  background: var(--surface); border-bottom: 1px solid var(--line);
  box-shadow: 0 2px 12px rgba(20,49,44,.04);
}
.topo-in {
  max-width: 640px; margin: 0 auto; padding: 12px 16px 8px;
  display: flex; align-items: center; justify-content: space-between;
}
.marca { display: flex; align-items: center; gap: 11px; }
.marca-logo {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--teal), var(--teal-2));
  display: grid; place-items: center; font-size: 23px;
}
.marca-tx { display: flex; flex-direction: column; line-height: 1.05; }
.marca-tx strong { font-family: var(--f-display); font-size: 20px; }
.marca-tx span { font-size: 10.5px; color: var(--ink-2); letter-spacing: 1.8px; text-transform: uppercase; }
.badge-aberto {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 600; color: var(--ok);
  background: #E4F5EC; border: 1px solid #C7E9D6; padding: 6px 10px; border-radius: 999px;
}
.badge-aberto .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.busca-wrap { max-width: 640px; margin: 0 auto; padding: 0 16px 12px; }
#busca {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px;
  padding: 11px 13px; font-size: 14.5px; font-family: inherit; color: inherit;
  background: var(--bg); outline: none; transition: border-color .15s;
}
#busca:focus { border-color: var(--teal-2); }

/* ---------- chips de seção ---------- */
.chips {
  position: sticky; top: 113px; z-index: 20;
  display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none;
  max-width: 640px; margin: 0 auto; padding: 10px 16px;
  background: var(--bg);
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: 0 0 auto; border: 1.5px solid var(--line); background: var(--surface);
  border-radius: 999px; padding: 8px 14px; font-size: 13px; font-weight: 600;
  color: var(--ink-2); cursor: pointer; font-family: inherit; white-space: nowrap;
  transition: all .15s;
}
.chip.ativo { background: var(--teal); border-color: var(--teal); color: #fff; }

/* ---------- cardápio ---------- */
.cardapio { max-width: 640px; margin: 0 auto; padding: 6px 16px 20px; }
.secao { margin-bottom: 26px; scroll-margin-top: 170px; }
.secao-titulo { font-family: var(--f-display); font-size: 21px; margin-bottom: 12px; }
.produtos { display: grid; gap: 11px; }
.produto {
  display: flex; gap: 13px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--r-md);
  padding: 12px; box-shadow: var(--shadow); align-items: center;
}
.produto-foto {
  width: 76px; height: 76px; flex: 0 0 76px; border-radius: 12px;
  display: grid; place-items: center; font-size: 38px;
  background: #fff; overflow: hidden;
}
.produto-foto img { width: 100%; height: 100%; object-fit: contain; }
.produto-tx { flex: 1; min-width: 0; }
.produto-tx h3 { font-size: 15px; font-weight: 700; letter-spacing: -.2px; }
.produto-tx p { font-size: 12.5px; color: var(--ink-2); margin: 2px 0 6px; line-height: 1.35; }
.produto-preco { font-size: 15px; font-weight: 800; color: var(--teal); }
.produto-preco .apartir { font-size: 11px; font-weight: 500; color: var(--ink-2); display: block; }
.produto-add {
  align-self: stretch; display: flex; align-items: center; justify-content: center;
}
.btn-add {
  width: 38px; height: 38px; border-radius: 11px; border: none;
  background: var(--teal); color: #fff; font-size: 22px; font-weight: 700;
  cursor: pointer; display: grid; place-items: center; transition: transform .06s, background .15s;
}
.btn-add:active { transform: scale(.9); }
/* stepper quando já tem no carrinho */
.stepper { display: flex; align-items: center; gap: 8px; }
.stepper button {
  width: 32px; height: 32px; border-radius: 9px; border: none; cursor: pointer;
  background: var(--bg); color: var(--teal); font-size: 19px; font-weight: 800;
  display: grid; place-items: center;
}
.stepper button.mais { background: var(--teal); color: #fff; }
.stepper .n { min-width: 20px; text-align: center; font-weight: 800; font-size: 15px; }
.vazio-busca { text-align: center; color: var(--ink-2); padding: 40px 20px; font-size: 14px; }

/* ---------- barra do carrinho ---------- */
.cart-bar {
  position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%);
  z-index: 40; width: calc(100% - 32px); max-width: 608px;
  display: flex; align-items: center; gap: 12px;
  background: var(--teal); color: #fff; border: none; cursor: pointer;
  border-radius: 15px; padding: 14px 18px; font-family: inherit;
  box-shadow: 0 8px 24px -6px rgba(15,118,110,.5);
  transition: transform .3s, opacity .3s;
}
.cart-bar[data-state="hidden"] { transform: translateX(-50%) translateY(120%); opacity: 0; pointer-events: none; }
.cart-qtd {
  background: rgba(255,255,255,.25); min-width: 26px; height: 26px; border-radius: 8px;
  display: grid; place-items: center; font-weight: 800; font-size: 14px; padding: 0 6px;
}
.cart-label { flex: 1; text-align: left; font-weight: 700; font-size: 15px; }
.cart-total { font-weight: 800; font-size: 16px; font-family: var(--f-display); }

/* ---------- sheet ---------- */
.sheet-bg { position: fixed; inset: 0; background: rgba(20,49,44,.45); z-index: 50; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translateX(-50%);
  z-index: 60; width: 100%; max-width: 640px; max-height: 92dvh;
  background: var(--surface); border-radius: 22px 22px 0 0;
  display: flex; flex-direction: column; overflow: hidden;
  animation: sobe .28s ease;
}
@keyframes sobe { from { transform: translateX(-50%) translateY(100%); } }
.sheet-head {
  display: flex; align-items: center; gap: 10px; padding: 16px 18px 12px;
  border-bottom: 1px solid var(--line); flex-shrink: 0;
}
.sheet-head h2 { font-family: var(--f-display); font-size: 19px; flex: 1; text-align: center; }
.sheet-back, .sheet-x {
  border: none; background: var(--bg); border-radius: 9px; cursor: pointer;
  font-family: inherit; font-size: 14px; font-weight: 600; color: var(--ink-2);
  padding: 8px 11px; min-width: 40px;
}
.sheet-x { font-size: 15px; }
.sheet-body { padding: 16px 18px; overflow-y: auto; flex: 1; }

/* itens no carrinho */
.ci {
  display: flex; align-items: center; gap: 12px; padding: 11px 0;
  border-bottom: 1px solid var(--line);
}
.ci-foto { width: 46px; height: 46px; flex: 0 0 46px; border-radius: 10px; background: #fff; display: grid; place-items: center; font-size: 24px; overflow: hidden; }
.ci-foto img { width: 100%; height: 100%; object-fit: contain; }
.ci-tx { flex: 1; min-width: 0; }
.ci-tx h4 { font-size: 14px; font-weight: 700; }
.ci-tx span { font-size: 13px; color: var(--teal); font-weight: 700; }
.add-mais {
  width: 100%; margin-top: 14px; border: 1.5px dashed var(--line); background: none;
  border-radius: 12px; padding: 12px; font-family: inherit; font-size: 13.5px;
  font-weight: 600; color: var(--ink-2); cursor: pointer;
}

/* campos do checkout */
.campo { display: block; margin-bottom: 14px; }
.campo > span { display: block; font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.campo input {
  width: 100%; border: 1.5px solid var(--line); border-radius: 11px;
  padding: 12px 13px; font-size: 15px; font-family: inherit; color: inherit;
  background: var(--surface); outline: none; transition: border-color .15s;
}
.campo input:focus { border-color: var(--teal-2); }
.campo-hint { display: block; font-size: 11.5px; color: var(--ink-2); margin-top: 5px; }
.opts2, .opts3 { display: grid; gap: 8px; }
.opts2 { grid-template-columns: 1fr 1fr; }
.opts3 { grid-template-columns: 1fr 1fr 1fr; }
.opts-hora { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.opt {
  border: 1.5px solid var(--line); background: var(--surface); border-radius: 11px;
  padding: 11px 6px; font-family: inherit; font-size: 13.5px; font-weight: 600;
  color: var(--ink); cursor: pointer; text-align: center; transition: all .15s;
}
.opt.sel { border-color: var(--teal); background: #E7F5F3; color: var(--teal); }
.opt:disabled { opacity: .4; cursor: not-allowed; text-decoration: line-through; }

/* melhoria do troco */
.troco-box { background: #FFF8EC; border: 1.5px solid #F5E2BD; border-radius: var(--r-md); padding: 13px; margin-bottom: 14px; }
.troco-total {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 11px; margin-bottom: 11px; border-bottom: 1px dashed #EBD5A8;
}
.troco-total span { font-size: 13px; color: var(--ink-2); font-weight: 600; }
.troco-total strong { font-size: 20px; font-family: var(--f-display); color: var(--coral-ink); }
.troco-box .campo { margin-bottom: 0; }
.troco-msg { font-size: 12.5px; font-weight: 700; margin-top: 8px; }
.troco-msg.ok { color: var(--ok); }
.troco-msg.erro { color: var(--coral-ink); }

/* confirmação */
.confirma-card { background: var(--bg); border-radius: var(--r-md); padding: 14px 16px; }
.confirma-linha { display: flex; justify-content: space-between; gap: 12px; font-size: 13.5px; padding: 5px 0; }
.confirma-linha dt { color: var(--ink-2); }
.confirma-linha dd { font-weight: 600; text-align: right; }
.confirma-sec { margin-top: 12px; padding-top: 10px; border-top: 1px solid var(--line); }
.confirma-sec h5 { font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--ink-2); margin-bottom: 6px; }
.confirma-item { display: flex; justify-content: space-between; font-size: 13.5px; padding: 3px 0; }
.confirma-total { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 2px solid var(--line); font-family: var(--f-display); font-size: 18px; }
.confirma-total strong:last-child { color: var(--teal); }
.confirma-aviso { font-size: 12px; color: var(--ink-2); text-align: center; margin-top: 14px; line-height: 1.5; }

/* rodapé do sheet */
.sheet-foot {
  display: flex; align-items: center; gap: 14px; padding: 14px 18px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); flex-shrink: 0; background: var(--surface);
}
.foot-total { display: flex; flex-direction: column; line-height: 1.15; min-width: 84px; }
.foot-total span { font-size: 11px; color: var(--ink-2); font-weight: 600; }
.foot-total strong { font-size: 19px; font-family: var(--f-display); }
.btn-principal {
  flex: 1; border: none; border-radius: 13px; padding: 15px; cursor: pointer;
  background: var(--teal); color: #fff; font-family: inherit; font-size: 15.5px; font-weight: 700;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  transition: background .15s, transform .06s;
}
.btn-principal:active { transform: scale(.98); }
.btn-principal.zap { background: var(--zap); }
.btn-principal:disabled { background: #C6D3CF; cursor: not-allowed; }

.rodape { text-align: center; padding: 8px 16px 20px; color: var(--ink-2); font-size: 11.5px; line-height: 1.7; }
.rodape strong { color: var(--teal); }

@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
