* { 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%; overflow-x: hidden; }

/* Trava o scroll do body enquanto um modal esta aberto no mobile,
   evitando que a barra de endereco/teclado faca o conteudo "pular". */
body.dv-scroll-locked {
  position: fixed;
  left: 0;
  right: 0;
  width: 100%;
  overflow: hidden;
}

body {
  font-family: 'Segoe UI', system-ui, -apple-system, sans-serif;
  background: #ffffff;
  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: var(--card);
  padding-bottom: 16px;
  text-align: center;
}

.dv-banner {
  height: 170px;
  background: linear-gradient(135deg, rgba(93,22,116,0.97), rgba(255,61,16,0.92));
  background-size: cover;
  background-position: center;
  border-radius: 0 0 22px 22px;
}

.dv-logo {
  position: relative;
  top: -64px;
  margin-bottom: -48px;
  margin-left: auto;
  margin-right: auto;
  width: 128px;
  height: 128px;
  border-radius: 50%;
  border: 5px solid #fff;
  box-shadow: 0 3px 10px rgba(43,20,54,0.22);
  background: var(--orange);
  background-size: cover;
  background-position: center;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-weight: 800;
  font-size: 2.6rem;
}

.dv-header h1 {
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1.65rem;
  color: var(--text);
  font-weight: 800;
  letter-spacing: -0.01em;
  padding: 0 16px;
}
.dv-badges { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 6px; flex-wrap: wrap; }
.dv-badge {
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  border-radius: 20px;
  padding: 5px 14px;
  font-size: 0.85rem;
  font-weight: 600;
}
.dv-badge.aberto { background: rgba(22,163,74,0.12); color: var(--green); }
.dv-badge.aberto::before { content: '●'; font-size: 0.6rem; margin-right: 5px; }
.dv-badge.fechado { background: rgba(220,38,38,0.12); color: var(--red); }
.dv-badge.fechado::before { content: '●'; font-size: 0.6rem; margin-right: 5px; }
.dv-badge:not(.aberto):not(.fechado) { background: var(--bg); color: var(--muted); }
.dv-horario { font-size: 0.75rem; color: var(--muted); margin: 10px 16px 0; }

/* Desktop: mesmo layout centralizado do celular, so com mais largura de conteudo */
@media (min-width: 641px) {
  .dv-header { max-width: 1300px; margin: 0 auto; padding-bottom: 16px; }
  .dv-banner { width: auto; margin-left: calc(-50vw + 50%); margin-right: calc(-50vw + 50%); }
  .dv-horario { margin-left: 32px; margin-right: 32px; }

  .dv-cats { max-width: 1300px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
  .dv-cardapio { max-width: 1300px; margin: 0 auto; padding: 0 32px 110px; }
}

.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: #ffffff;
  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: 22px;
  padding: 9px 18px;
  font-size: 0.92rem;
  font-weight: 600;
  white-space: nowrap;
  cursor: pointer;
}
.dv-cat-btn.active { background: var(--orange); border-color: var(--orange); color: #fff; }

/* Cardapio */
.dv-cardapio { padding: 0 14px 110px; }
.dv-grupo-titulo {
  font-family: 'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
  font-size: 1.28rem;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
  margin: 18px 2px 10px;
}
.dv-prod-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}
@media (max-width: 480px) {
  .dv-prod-grid { grid-template-columns: 1fr; }
}
.dv-prod {
  display: flex;
  align-items: stretch;
  height: 156px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 12px;
  overflow: hidden;
}
.dv-prod-info {
  flex: 1;
  min-width: 0;
  padding: 14px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}
.dv-prod-nome {
  font-weight: 600;
  font-size: 0.98rem;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.dv-prod-preco { color: var(--text); font-weight: 700; margin-top: 6px; font-size: 1.02rem; }
.dv-prod-img-wrap {
  position: relative;
  width: 140px;
  height: 154px;
  flex-shrink: 0;
  background: var(--bg);
}
.dv-prod-img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
}
.dv-prod-img.placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 2.1rem;
}
.dv-prod-add {
  position: absolute;
  right: 8px;
  bottom: 8px;
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--orange);
  font-size: 1.5rem;
  font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(43,20,54,0.25);
  padding: 0;
  line-height: 1;
}
.dv-prod-qtd { display: flex; align-items: center; justify-content: flex-end; gap: 8px; }
.dv-qtd-btn {
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--orange);
  color: #fff;
  font-size: 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 */
/* Modal */
.dv-modal-overlay {
  position: fixed; inset: 0;
  height: 100vh;
  height: 100dvh;
  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;
  max-height: 92dvh;
  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; }
}

/* Painel lateral de produto */
.dv-modal-overlay--lado {
  align-items: stretch;
  justify-content: flex-end;
}
.dv-modal--lado {
  position: relative;
  width: 100%;
  max-width: 420px;
  height: 100%;
  max-height: 100vh;
  max-height: 100dvh;
  border-radius: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.dv-produto-close {
  position: absolute;
  top: 12px; right: 12px;
  z-index: 2;
  background: #fff;
  box-shadow: 0 2px 6px rgba(43,20,54,0.25);
}
.dv-produto-img-wrap {
  width: 100%;
  height: 240px;
  flex-shrink: 0;
  background: var(--bg);
}
#dv-produto-img { width: 100%; height: 100%; object-fit: contain; display: block; }
.dv-produto-img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); font-size: 3rem;
}
.dv-produto-body { padding: 16px; flex: 1; overflow-y: auto; }
.dv-produto-body h3 { font-size: 1.12rem; color: var(--text); margin-bottom: 6px; }
.dv-produto-preco { color: var(--orange); font-weight: 700; font-size: 1rem; margin-bottom: 16px; }
#dv-produto-obs {
  width: 100%;
  min-height: 72px;
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 10px;
  font-family: inherit;
  font-size: 0.85rem;
  color: var(--text);
  resize: vertical;
}
.dv-produto-footer {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  border-top: 1px solid var(--border);
  flex-shrink: 0;
}
.dv-produto-footer .dv-prod-qtd { flex-shrink: 0; }
.dv-produto-adicionar { flex: 1; margin-top: 0; }
.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-row-2 { display: grid; grid-template-columns: 1fr 1.4fr; gap: 12px; }
.dv-cep-status {
  font-size: 0.78rem;
  font-weight: 600;
  min-height: 16px;
  margin-top: -6px;
}
.dv-cep-status.ok { color: var(--green); }
.dv-cep-status.erro { color: var(--red); }

.dv-loc-btn {
  align-self: flex-start;
  border: none;
  background: none;
  color: var(--purple);
  font-size: 0.8rem;
  font-weight: 700;
  cursor: pointer;
  padding: 2px 0 4px;
}
.dv-loc-btn:disabled { opacity: 0.55; cursor: default; }

.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(--orange); border-color: var(--orange); 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; }
