/* Café Doces Memórias — Delivery
   Tema escuro + dourado, no estilo do app de pedidos de referência.
   Layout: coluna central de largura mobile (igual no PC, com laterais escuras). */

:root {
  --bg-pagina: #121212;      /* laterais (PC) */
  --bg: #1c1c1c;             /* fundo da coluna */
  --painel: #242424;         /* faixas/section */
  --card: #2c2c2c;           /* cards de produto */
  --card-hover: #333333;
  --borda: #3a3a3a;
  --texto: #f2f2f2;
  --texto-2: #a8a8a8;
  --gold: #c9913d;
  --gold-escuro: #a97a30;
  --verde: #79c87d;
  --vermelho: #f26060;
  --raio: 12px;
  --coluna: 520px;
  --nav-altura: 58px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }
body {
  background: var(--bg-pagina);
  color: var(--texto);
  font-family: 'Nunito', system-ui, sans-serif;
  font-size: 15px;
  -webkit-tap-highlight-color: transparent;
}
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea, select { font-family: inherit; font-size: 15px; }
img { max-width: 100%; display: block; }

.coluna {
  max-width: var(--coluna);
  margin: 0 auto;
  min-height: 100dvh;
  background: var(--bg);
  padding-bottom: calc(var(--nav-altura) + 74px);
}
.carregando { padding: 60px 20px; text-align: center; color: var(--texto-2); }
.oculto { display: none !important; }

/* ---------- topo: capa + logo + status ---------- */
.hero { position: relative; }
.hero-capa {
  width: 100%; height: 210px; object-fit: cover;
  background: linear-gradient(120deg, #3a2c1a, #241b10 60%, #191919);
}
.hero-logo {
  position: absolute; left: 24px; bottom: -34px;
  width: 92px; height: 92px; border-radius: 50%;
  border: 3px solid var(--gold);
  background: #f7f3ea center/78% no-repeat;
  box-shadow: 0 4px 14px rgba(0,0,0,.5);
  display: flex; align-items: center; justify-content: center;
  font-weight: 800; color: #6b4b23; text-align: center; font-size: 12px;
  overflow: hidden;
}
.hero-logo img { width: 100%; height: 100%; object-fit: cover; }

.status-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 44px 20px 12px;
}
.status { font-weight: 800; }
.status.aberta { color: var(--verde); }
.status.fechada { color: var(--vermelho); }
.status::before { content: '● '; }
.btn-info { color: var(--texto); font-weight: 700; font-size: 15px; }

.aviso-fechada {
  margin: 6px 16px 4px; padding: 14px 16px;
  background: #3a1f1f; color: #f0b9b9;
  border-radius: var(--raio); font-size: 14px;
}

/* ---------- destaques (carrossel horizontal) ---------- */
.secao-titulo { font-size: 17px; font-weight: 800; padding: 18px 16px 10px; }
.carrossel {
  display: flex; gap: 12px; overflow-x: auto; padding: 2px 16px 6px;
  scroll-snap-type: x mandatory; scrollbar-width: none;
}
.carrossel::-webkit-scrollbar { display: none; }
.dcard {
  flex: 0 0 168px; scroll-snap-align: start;
  background: var(--card); border-radius: var(--raio); overflow: hidden;
  display: flex; flex-direction: column;
}
.dcard:active { background: var(--card-hover); }
.dcard .foto { width: 100%; height: 118px; object-fit: cover; }
.dcard-info { padding: 10px 12px 12px; text-align: left; flex: 1; display: flex; flex-direction: column; }
.dcard-nome { font-weight: 800; font-size: 14.5px; line-height: 1.25; }
.dcard-desc {
  color: var(--texto-2); font-size: 12.5px; margin-top: 4px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.dcard-preco { color: var(--verde); font-weight: 800; margin-top: 8px; }

/* foto placeholder quando o produto não tem imagem */
.foto.sem-foto {
  display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, #33281a, #241d12); font-size: 34px;
}

/* ---------- seletor de categoria + busca ---------- */
.filtros { display: flex; justify-content: space-between; gap: 10px; padding: 14px 16px 4px; }
.sel-categoria {
  border: 1.5px solid var(--gold); color: var(--gold);
  background: var(--bg); border-radius: 10px; padding: 9px 14px;
  font-weight: 800; font-size: 14px; max-width: 60%;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.busca-box { display: flex; align-items: center; gap: 6px; }
.busca-box input {
  background: var(--painel); border: 1px solid var(--borda); color: var(--texto);
  border-radius: 10px; padding: 9px 12px; width: 130px; outline: none;
  transition: width .15s;
}
.busca-box input:focus { width: 170px; border-color: var(--gold); }

/* menu de categorias (dropdown) */
.menu-cats {
  position: fixed; z-index: 60; inset: 0; background: rgba(0,0,0,.45);
}
.menu-cats-lista {
  position: absolute; left: 50%; transform: translateX(-50%);
  bottom: calc(var(--nav-altura) + 20px);
  width: min(320px, 86vw); max-height: 60vh; overflow-y: auto;
  background: #2e2e2e; border-radius: var(--raio); box-shadow: 0 8px 30px rgba(0,0,0,.6);
}
.menu-cats-lista button {
  display: block; width: 100%; text-align: left; padding: 14px 18px;
  font-weight: 700; font-size: 15px; border-bottom: 1px solid #383838;
}
.menu-cats-lista button:active { background: #3a3a3a; }

/* ---------- grupos de categoria + produto em linha ---------- */
.grupo { background: var(--painel); border-radius: var(--raio); margin: 12px 16px; overflow: hidden; }
.grupo-head {
  width: 100%; display: flex; justify-content: space-between; align-items: center;
  padding: 14px 16px; text-align: left;
}
.grupo-head .nome { font-weight: 800; font-size: 16px; }
.grupo-head .seta { color: var(--texto-2); transition: transform .15s; }
.grupo.fechado .seta { transform: rotate(180deg); }
.grupo.fechado .grupo-corpo { display: none; }
.grupo-corpo { padding: 0 10px 10px; }

.prod {
  width: 100%; display: flex; gap: 12px; align-items: stretch;
  background: var(--card); border-radius: 10px; padding: 12px;
  margin-bottom: 8px; text-align: left;
}
.prod:active { background: var(--card-hover); }
.prod-texto { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.prod-nome { font-weight: 800; font-size: 15px; }
.prod-desc {
  color: var(--texto-2); font-size: 13px; margin-top: 3px; flex: 1;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.prod-preco { color: var(--verde); font-weight: 800; margin-top: 6px; }
.prod .foto { flex: 0 0 96px; height: 96px; border-radius: 8px; object-fit: cover; }

.sem-resultado { text-align: center; color: var(--texto-2); padding: 30px 16px; }

/* ---------- barra do carrinho + nav inferior ---------- */
.cartbar {
  position: fixed; z-index: 40; bottom: var(--nav-altura);
  left: 50%; transform: translateX(-50%);
  width: min(var(--coluna), 100%);
  display: flex; align-items: center; gap: 12px;
  background: var(--gold); color: #221a0d;
  padding: 13px 18px; font-weight: 800; cursor: pointer;
}
.cartbar-icone { position: relative; }
.cartbar-icone b {
  position: absolute; top: -7px; right: -10px;
  background: #221a0d; color: var(--gold); border-radius: 50%;
  font-size: 11px; min-width: 17px; height: 17px; line-height: 17px; text-align: center;
}
.cartbar-texto { flex: 1; text-align: center; }

.bottomnav {
  position: fixed; z-index: 50; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(var(--coluna), 100%); height: var(--nav-altura);
  background: #202020; border-top: 1px solid var(--borda);
  display: flex;
}
.bottomnav button {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; font-size: 12px; color: var(--texto-2); font-weight: 700;
}
.bottomnav button.ativo { color: var(--texto); }
.bn-icone { font-size: 17px; }

/* ---------- overlays (produto, carrinho, checkout, auth) ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 70; background: rgba(0,0,0,.55);
  display: flex; justify-content: center;
}
.folha {
  width: min(var(--coluna), 100%); background: var(--bg);
  display: flex; flex-direction: column; max-height: 100dvh; height: 100dvh;
}
.folha-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 16px; font-size: 18px; font-weight: 800;
}
.folha-body { flex: 1; overflow-y: auto; }
.folha-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); background: var(--painel); }
.btn-fechar { font-size: 20px; color: var(--texto); padding: 4px 8px; }

/* tela de produto */
.pr-foto { width: 100%; height: 260px; object-fit: cover; }
.pr-topo { position: relative; }
.pr-voltar, .pr-share {
  position: absolute; top: 14px; width: 38px; height: 38px; border-radius: 8px;
  background: rgba(20,20,20,.75); color: #fff; font-size: 17px;
}
.pr-voltar { left: 14px; }
.pr-share { right: 14px; }
.pr-info { padding: 16px; background: var(--painel); }
.pr-nome { font-size: 20px; font-weight: 800; color: #d9d9d9; }
.pr-desc { color: var(--texto-2); margin-top: 8px; line-height: 1.45; }
.pr-obs { padding: 16px; }
.pr-obs label { font-weight: 800; display: block; }
.pr-obs .dica { color: var(--texto-2); font-size: 13.5px; margin: 3px 0 10px; }
.pr-obs textarea {
  width: 100%; min-height: 44px; resize: vertical;
  background: var(--bg); border: 1px solid var(--borda); border-radius: 8px;
  color: var(--texto); padding: 10px; outline: none;
}
.pr-obs textarea:focus { border-color: var(--gold); }

.pr-barra { display: flex; gap: 12px; align-items: stretch; }
.stepper {
  display: flex; align-items: center; gap: 14px;
  background: var(--card); border-radius: 10px; padding: 0 12px; font-weight: 800;
}
.stepper button { font-size: 20px; color: var(--texto); padding: 8px 6px; }
.btn-gold {
  flex: 1; display: flex; justify-content: space-between; align-items: center; gap: 10px;
  background: var(--gold); color: #221a0d; font-weight: 800; font-size: 15.5px;
  border-radius: 10px; padding: 14px 16px;
}
.btn-gold:active { background: var(--gold-escuro); }
.btn-gold.centro { justify-content: center; }
.btn-gold[disabled] { opacity: .55; cursor: default; }

/* carrinho */
.cart-item {
  display: flex; gap: 12px; background: var(--card); border-radius: 10px;
  padding: 12px; margin: 0 16px 10px;
}
.cart-item .foto { flex: 0 0 64px; height: 64px; border-radius: 8px; object-fit: cover; }
.ci-meio { flex: 1; min-width: 0; }
.ci-nome { font-weight: 800; }
.ci-obs { color: var(--texto-2); font-size: 12.5px; margin-top: 2px; }
.ci-acoes { display: flex; gap: 16px; margin-top: 10px; font-size: 13.5px; }
.ci-acoes button { color: var(--texto); font-weight: 700; }
.ci-preco { color: var(--texto); font-weight: 800; align-self: flex-end; }
.btn-outline {
  display: block; margin: 8px auto; padding: 10px 18px;
  border: 1.5px solid var(--gold); color: var(--gold);
  border-radius: 10px; font-weight: 800;
}
.total-row {
  display: flex; justify-content: space-between; font-weight: 800; font-size: 16px;
  padding: 4px 2px 12px;
}

/* checkout + auth (formulários) */
.form { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.form label { font-weight: 800; font-size: 14px; display: block; margin-bottom: 6px; }
.form input, .form textarea, .form select {
  width: 100%; background: var(--painel); border: 1px solid var(--borda);
  border-radius: 8px; color: var(--texto); padding: 11px 12px; outline: none;
}
.form input:focus, .form textarea:focus { border-color: var(--gold); }
.chips { display: flex; gap: 8px; flex-wrap: wrap; }
.chip {
  border: 1.5px solid var(--borda); color: var(--texto-2);
  border-radius: 20px; padding: 8px 16px; font-weight: 800; font-size: 14px;
}
.chip.ativo { border-color: var(--gold); color: var(--gold); background: rgba(201,145,61,.08); }
.erro-msg { color: var(--vermelho); font-size: 14px; min-height: 18px; }
.link-troca { text-align: center; color: var(--texto-2); padding: 8px 0 16px; }
.link-troca button { color: var(--gold); font-weight: 800; }

/* histórico */
.ped-card { background: var(--card); border-radius: var(--raio); margin: 0 16px 12px; padding: 14px 16px; }
.ped-head { display: flex; justify-content: space-between; font-weight: 800; }
.ped-status { font-size: 13px; font-weight: 800; padding: 3px 10px; border-radius: 12px; }
.st-recebido { background: rgba(201,145,61,.15); color: var(--gold); }
.st-em_preparo { background: rgba(100,160,255,.15); color: #7db2ff; }
.st-saiu_entrega { background: rgba(100,160,255,.15); color: #7db2ff; }
.st-concluido { background: rgba(121,200,125,.15); color: var(--verde); }
.st-cancelado { background: rgba(242,96,96,.15); color: var(--vermelho); }
.ped-itens { color: var(--texto-2); font-size: 13.5px; margin-top: 8px; line-height: 1.5; }
.ped-foot { display: flex; justify-content: space-between; margin-top: 10px; font-size: 13.5px; color: var(--texto-2); }
.ped-foot b { color: var(--verde); font-size: 15px; }

/* perfil / telas simples */
.tela-titulo { font-size: 20px; font-weight: 800; padding: 22px 16px 6px; }
.perfil-box { background: var(--card); border-radius: var(--raio); margin: 12px 16px; padding: 16px; }
.perfil-box p { margin: 6px 0; color: var(--texto-2); }
.perfil-box p b { color: var(--texto); }
.vazio { text-align: center; color: var(--texto-2); padding: 50px 20px; }

/* aviso "loja fechada" (folha inferior) */
.sheet-aviso {
  position: fixed; z-index: 80; bottom: 0; left: 50%; transform: translateX(-50%);
  width: min(var(--coluna), 100%);
  background: #2e2e2e; border-radius: 14px 14px 0 0; padding: 20px 16px;
}
.sheet-aviso h3 { display: flex; gap: 10px; align-items: center; margin-bottom: 6px; }
.sheet-aviso p { color: var(--texto-2); margin-bottom: 16px; }

/* toast */
.toast {
  position: fixed; z-index: 90; bottom: calc(var(--nav-altura) + 80px);
  left: 50%; transform: translateX(-50%);
  background: #333; color: var(--texto); padding: 11px 20px;
  border-radius: 24px; font-weight: 700; font-size: 14px;
  box-shadow: 0 4px 18px rgba(0,0,0,.5);
  animation: toastin .2s;
}
@keyframes toastin { from { opacity: 0; transform: translate(-50%, 8px); } }
