* { margin: 0; padding: 0; box-sizing: border-box; }

:root {
  --purple: #5d1674;
  --orange: #ff3d10;
  --bg: #f6f4f8;
  --card: #ffffff;
  --text: #2b2333;
  --muted: #7a7186;
  --border: #e7e2ee;
  --green: #16a34a;
  --red: #dc2626;
}

html, body { height: 100%; }

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

.hidden { display: none !important; }

/* Telas centrais (loading / erro) */
.dv-center-screen {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: var(--muted);
  padding: 24px;
  text-align: center;
}

.dv-spinner {
  width: 38px; height: 38px;
  border: 4px solid var(--border);
  border-top-color: var(--orange);
  border-radius: 50%;
  animation: dv-spin 0.8s linear infinite;
}
@keyframes dv-spin { to { transform: rotate(360deg); } }

/* Header */
.dv-header {
  background: linear-gradient(135deg, rgba(93,22,116,0.97), rgba(255,61,16,0.92));
  color: #fff;
  padding: 26px 18px 20px;
  text-align: center;
}
.dv-header h1 { font-size: 1.5rem; letter-spacing: 0.3px; }
.dv-loja-info { font-size: 0.83rem; opacity: 0.9; margin-top: 4px; }
.dv-badges { display: flex; justify-content: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.dv-badge {
  background: rgba(255,255,255,0.16);
  border: 1px solid rgba(255,255,255,0.35);
  border-radius: 20px;
  padding: 4px 12px;
  font-size: 0.76rem;
  font-weight: 600;
}
.dv-badge.aberto { background: rgba(22,163,74,0.85); border-color: transparent; }
.dv-badge.fechado { background: rgba(220,38,38,0.85); border-color: transparent; }
.dv-horario { font-size: 0.75rem; opacity: 0.85; margin-top: 8px; }

.dv-fechado {
  background: #fef2f2;
  color: var(--red);
  border: 1px solid #fecaca;
  margin: 14px;
  padding: 12px;
  border-radius: 10px;
  text-align: center;
  font-weight: 600;
  font-size: 0.9rem;
}

/* Categorias */
.dv-cats {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 14px;
  position: sticky;
  top: 0;
  background: var(--bg);
  z-index: 5;
  scrollbar-width: none;
}
.dv-cats::-webkit-scrollbar { display: none; }
.dv-cat-btn {
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--text);
  border-radius: 20px;
  padding: 7px 15px;
  font-size: 0.82rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.dv-cat-btn.active { background: var(--purple); border-color: var(--purple); color: #fff; }

/* Cardapio */
.dv-cardapio { padding: 0 14px 110px; }
.dv-grupo-titulo {
  font-size: 1.02rem;
  font-weight: 700;
  color: var(--purple);
  margin: 18px 2px 10px;
}
.dv-prod {
  display: flex;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px;
  margin-bottom: 10px;
  align-items: center;
}
.dv-prod-img {
  width: 64px; height: 64px;
  border-radius: 10px;
  object-fit: cover;
  background: var(--bg);
  flex-shrink: 0;
}
.dv-prod-img.placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 1.4rem;
}
.dv-prod-info { flex: 1; min-width: 0; }
.dv-prod-nome { font-weight: 600; font-size: 0.92rem; }
.dv-prod-preco { color: var(--orange); font-weight: 700; margin-top: 4px; font-size: 0.95rem; }
.dv-prod-qtd { display: flex; align-items: center; gap: 10px; }
.dv-qtd-btn {
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--purple);
  color: #fff;
  font-size: 1.1rem;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.dv-qtd-btn.menos { background: var(--border); color: var(--text); }
.dv-qtd-num { min-width: 18px; text-align: center; font-weight: 700; }

/* Barra do carrinho */
.dv-cart-bar {
  position: fixed;
  left: 14px; right: 14px; bottom: 16px;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 14px;
  padding: 15px 18px;
  font-size: 1rem;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  box-shadow: 0 8px 22px rgba(255,61,16,0.4);
  z-index: 20;
}
.dv-cart-qtd {
  background: rgba(255,255,255,0.25);
  border-radius: 50%;
  width: 26px; height: 26px;
  display: flex; align-items: center; justify-content: center;
  font-size: 0.85rem;
}

/* Rodape */
.dv-footer { text-align: center; padding: 20px 0 120px; color: var(--muted); font-size: 0.78rem; }
.dv-footer strong { color: var(--purple); }

/* Modal */
.dv-modal-overlay {
  position: fixed; inset: 0;
  background: rgba(30,15,40,0.55);
  z-index: 50;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
.dv-modal {
  background: var(--card);
  width: 100%;
  max-width: 520px;
  max-height: 92vh;
  overflow-y: auto;
  border-radius: 18px 18px 0 0;
  padding: 18px 18px 26px;
}
@media (min-width: 560px) {
  .dv-modal-overlay { align-items: center; }
  .dv-modal { border-radius: 18px; }
}
.dv-modal-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.dv-modal-head h2 { font-size: 1.1rem; color: var(--purple); }
.dv-close {
  border: none; background: var(--bg);
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 0.9rem; cursor: pointer; color: var(--muted);
}

/* Carrinho lista */
.dv-cart-list { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }
.dv-cart-item {
  display: flex; align-items: center; gap: 10px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
}
.dv-cart-item-info { flex: 1; min-width: 0; }
.dv-cart-item-nome { font-size: 0.88rem; font-weight: 600; }
.dv-cart-item-preco { font-size: 0.82rem; color: var(--muted); margin-top: 2px; }
.dv-cart-obs {
  width: 100%;
  border: 1px dashed var(--border);
  border-radius: 8px;
  padding: 6px 8px;
  font-size: 0.78rem;
  margin-top: 6px;
  color: var(--text);
}
.dv-cart-vazio { text-align: center; color: var(--muted); padding: 20px 0; }

.dv-cart-resumo {
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-bottom: 16px;
  display: flex; flex-direction: column; gap: 6px;
}
.dv-linha { display: flex; justify-content: space-between; font-size: 0.9rem; color: var(--muted); }
.dv-linha strong { color: var(--text); }
.dv-linha-total { font-size: 1.05rem; }
.dv-linha-total span, .dv-linha-total strong { color: var(--orange); font-weight: 800; }

/* Botoes e formulario */
.dv-btn {
  width: 100%;
  background: var(--orange);
  color: #fff;
  border: none;
  border-radius: 12px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  margin-top: 8px;
}
.dv-btn:disabled { opacity: 0.6; cursor: default; }
.dv-btn-sec { background: var(--bg); color: var(--text); }

#dv-step-dados { display: flex; flex-direction: column; gap: 12px; }
#dv-step-dados label {
  display: flex; flex-direction: column; gap: 5px;
  font-size: 0.83rem; font-weight: 600; color: var(--muted);
}
#dv-step-dados input, #dv-step-dados select {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 11px 12px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
}
#dv-step-dados input:focus, #dv-step-dados select:focus {
  outline: none; border-color: var(--purple);
}
#dv-endereco-wrap { display: flex; flex-direction: column; gap: 12px; }

.dv-toggle { display: flex; gap: 8px; }
.dv-toggle-btn {
  flex: 1;
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 10px;
  padding: 11px;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  color: var(--muted);
}
.dv-toggle-btn.active { background: var(--purple); border-color: var(--purple); color: #fff; }

.dv-erro {
  background: #fef2f2; color: var(--red);
  border: 1px solid #fecaca;
  border-radius: 8px; padding: 10px;
  font-size: 0.85rem; text-align: center;
}

/* Sucesso */
.dv-ok { text-align: center; padding: 16px 0; }
.dv-ok-icon {
  width: 64px; height: 64px;
  margin: 0 auto 14px;
  background: var(--green);
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2rem;
}
.dv-ok h3 { font-size: 1.2rem; margin-bottom: 8px; }
.dv-ok p { color: var(--muted); font-size: 0.9rem; }
.dv-ok-zap { margin-top: 6px; font-weight: 600; color: var(--green) !important; }
