/* ═══════════════════════════════════════════════════════════════════════════
   cardapio.css — Estilos do cardápio online
   Usado em: templates/cardapio.html
   Mobile-first: projetado para celular, adaptado para desktop
   ═══════════════════════════════════════════════════════════════════════════ */


/* ── Reset e variáveis ───────────────────────────────────────────────────── */
* { box-sizing: border-box; margin: 0; padding: 0 }

:root {
  --or:  #D85A30;
  --orb: #b84520;
  --orl: #fff4ef;
  --bg:  #f7f7f6;
  --bd:  #e5e5e3;
  --tx:  #111;
  --t2:  #555;
  --t3:  #999;
  --green: #16a34a;
  --fn: "Inter", sans-serif;
}

body {
  font-family: var(--fn);
  background: var(--bg);
  color: var(--tx);
  font-size: 14px;
  padding-bottom: 90px; /* espaço para o botão do carrinho */
}


/* ── Header ──────────────────────────────────────────────────────────────── */
.header {
  background: #111;
  padding: 14px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: sticky;
  top: 0;
  z-index: 100;
}

.header-brand { display: flex; align-items: center; gap: 10px }
.header-ic    { width: 34px; height: 34px; background: var(--or); border-radius: 8px; display: flex; align-items: center; justify-content: center; font-size: 18px }
.header-nome  { font-size: 15px; font-weight: 700; color: #fff }
.header-sub   { font-size: 10px; color: #888; margin-top: 1px }
.header-status { display: flex; align-items: center; gap: 6px }
.status-dot   { width: 7px; height: 7px; background: #4ade80; border-radius: 50%; animation: pulse 2s infinite }
.status-txt   { font-size: 11px; color: #4ade80; font-weight: 600 }
@keyframes pulse { 0%,100%{opacity:1}50%{opacity:.4} }


/* ── Banner hero ─────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, #1a1a1a 0%, #2d1810 100%);
  padding: 24px 16px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url('https://images.unsplash.com/photo-1568901346375-23c9450c58cd?w=800&fit=crop') center/cover;
  opacity: .2;
}
.hero-content { position: relative; z-index: 1 }
.hero-title   { font-size: 22px; font-weight: 800; color: #fff; margin-bottom: 6px }
.hero-sub     { font-size: 13px; color: rgba(255,255,255,.7); margin-bottom: 14px }
.hero-pills   { display: flex; justify-content: center; gap: 8px; flex-wrap: wrap }
.hero-pill    { background: rgba(255,255,255,.12); color: #fff; padding: 5px 12px; border-radius: 20px; font-size: 11px; font-weight: 600 }
.hero-pill span { margin-right: 4px }


/* ── Categorias (tabs) ───────────────────────────────────────────────────── */
.cats-wrap {
  background: #fff;
  border-bottom: 1px solid var(--bd);
  position: sticky;
  top: 62px;
  z-index: 90;
  overflow-x: auto;
  scrollbar-width: none;
}
.cats-wrap::-webkit-scrollbar { display: none }
.cats {
  display: flex;
  gap: 4px;
  padding: 10px 12px;
  min-width: max-content;
}
.cat-btn {
  padding: 7px 16px;
  border: 1.5px solid var(--bd);
  background: #fff;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  transition: .15s;
  color: var(--t2);
}
.cat-btn:hover  { border-color: var(--or); color: var(--or) }
.cat-btn.on     { background: var(--or); border-color: var(--or); color: #fff }


/* ── Seção de itens ──────────────────────────────────────────────────────── */
.secao { padding: 16px 12px 8px }
.secao-titulo {
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .8px;
  color: var(--t2);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.secao-titulo::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--bd);
}


/* ── Cards de itens ──────────────────────────────────────────────────────── */
.itens-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 10px;
}

@media (min-width: 600px) {
  .itens-grid { grid-template-columns: 1fr 1fr }
}
@media (min-width: 900px) {
  .itens-grid { grid-template-columns: 1fr 1fr 1fr }
  .secao      { padding: 20px 20px 10px }
}

.item-card {
  border-radius: 14px;
  overflow: hidden;
  position: relative;
  transition: box-shadow .2s, transform .2s;
  background: #111;
}
.item-card:hover { box-shadow: 0 8px 24px rgba(0,0,0,.18); transform: translateY(-2px) }

.item-foto {
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  display: block;
}

.item-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  background: linear-gradient(to top, rgba(0,0,0,.88) 0%, rgba(0,0,0,.5) 55%, transparent 100%);
  padding: 36px 12px 12px;
}

.item-nome  { font-size: 14px; font-weight: 800; color: #fff; margin-bottom: 3px;
              text-shadow: 0 1px 4px rgba(0,0,0,.6) }
.item-desc  { font-size: 11px; color: rgba(255,255,255,.8); line-height: 1.4; margin-bottom: 6px }

.item-ingr-btn   { background: none; border: none; padding: 0; font-size: 11px;
                   color: rgba(255,255,255,.7); cursor: pointer; font-weight: 600;
                   margin-bottom: 4px; text-align: left }
.item-ingr-btn:hover { color: #fff }
.item-ingr-lista { display: none; font-size: 10px; color: rgba(255,255,255,.75); line-height: 1.5;
                   margin-bottom: 8px; padding: 8px; background: rgba(0,0,0,.45);
                   border-radius: 6px; border: 1px solid rgba(255,255,255,.12) }
.item-ingr-lista.aberto { display: block }

.item-foot  { display: flex; align-items: center; justify-content: space-between; margin-top: 4px }
.item-preco { font-size: 16px; font-weight: 800; color: #fff; text-shadow: 0 1px 4px rgba(0,0,0,.5) }

.btn-add {
  width: 32px; height: 32px;
  background: var(--or);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  line-height: 1;
  transition: .12s;
  flex-shrink: 0;
}
.btn-add:hover  { background: var(--orb) }
.btn-add:active { transform: scale(.92) }


/* ── Botão flutuante do carrinho ─────────────────────────────────────────── */
.cart-fab {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--or);
  color: #fff;
  border: none;
  border-radius: 30px;
  padding: 14px 28px;
  font-size: 14px;
  font-weight: 700;
  cursor: pointer;
  display: none;
  align-items: center;
  gap: 10px;
  box-shadow: 0 8px 24px rgba(216,90,48,.45);
  z-index: 200;
  transition: .15s;
  white-space: nowrap;
}
.cart-fab:hover   { background: var(--orb) }
.cart-fab.visible { display: flex }
.cart-badge       { background: #fff; color: var(--or); border-radius: 50%; width: 22px; height: 22px; font-size: 11px; font-weight: 800; display: flex; align-items: center; justify-content: center }


/* ── Drawer do carrinho ──────────────────────────────────────────────────── */
.overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 300;
  display: none;
}
.overlay.on { display: block }

.drawer {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  background: #fff;
  border-radius: 20px 20px 0 0;
  z-index: 400;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  transform: translateY(100%);
  transition: transform .3s ease;
}
.drawer.on { transform: translateY(0) }

@media (min-width: 600px) {
  .drawer {
    left: auto; right: 0; top: 0; bottom: 0;
    width: 380px;
    border-radius: 0;
    max-height: 100vh;
    transform: translateX(100%);
  }
  .drawer.on { transform: translateX(0) }
}

.drawer-header {
  padding: 16px 18px;
  border-bottom: 1px solid var(--bd);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.drawer-title  { font-size: 15px; font-weight: 700 }
.drawer-close  { width: 30px; height: 30px; border: none; background: var(--bg); border-radius: 50%; cursor: pointer; font-size: 14px }

.drawer-itens  { flex: 1; overflow-y: auto; padding: 12px 16px }
.drawer-empty  { text-align: center; padding: 40px 20px; color: var(--t3); font-size: 13px }

/* Linha de item no carrinho */
.ci-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f5f5f4;
}
.ci-foto  { width: 48px; height: 48px; border-radius: 8px; object-fit: cover; flex-shrink: 0 }
.ci-info  { flex: 1; min-width: 0 }
.ci-nome  { font-size: 12px; font-weight: 700; margin-bottom: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis }
.ci-preco { font-size: 11px; color: var(--t2) }
.ci-ctrl  { display: flex; align-items: center; gap: 6px; flex-shrink: 0 }
.ci-btn   { width: 26px; height: 26px; border: 1px solid var(--bd); background: #fff; border-radius: 50%; cursor: pointer; font-size: 14px; display: flex; align-items: center; justify-content: center }
.ci-qtd   { font-size: 13px; font-weight: 700; min-width: 16px; text-align: center }

.drawer-footer {
  padding: 14px 16px;
  border-top: 1px solid var(--bd);
  flex-shrink: 0;
}
.subtotal-row  { display: flex; justify-content: space-between; font-size: 12px; color: var(--t2); margin-bottom: 4px }
.total-row     { display: flex; justify-content: space-between; font-size: 16px; font-weight: 800; margin-bottom: 14px }
.btn-checkout  { width: 100%; padding: 14px; background: var(--or); color: #fff; border: none; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer }
.btn-checkout:hover { background: var(--orb) }


/* ── Modal de checkout ───────────────────────────────────────────────────── */
.modal-wrap {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.modal-wrap.on { display: flex }

@media (min-width: 600px) {
  .modal-wrap { align-items: center }
}

.modal {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 20px 18px;
}

@media (min-width: 600px) {
  .modal { border-radius: 16px }
}

.modal-titulo { font-size: 16px; font-weight: 800; margin-bottom: 16px }
.step         { display: none }
.step.on      { display: block }

/* Campos do formulário */
.fgrp       { margin-bottom: 14px }
.flabel     { font-size: 10px; font-weight: 700; color: var(--t2); display: block; margin-bottom: 5px; text-transform: uppercase; letter-spacing: .4px }
.finput     { width: 100%; padding: 11px 13px; border: 1.5px solid var(--bd); border-radius: 9px; font-size: 13px; font-family: var(--fn) }
.finput:focus { outline: none; border-color: var(--or) }
.frow       { display: grid; grid-template-columns: 1fr 1fr; gap: 10px }

/* Botões do modal */
.modal-btns { display: flex; gap: 8px; margin-top: 16px }
.btn-voltar { flex: 1; padding: 12px; background: var(--bg); border: 1px solid var(--bd); border-radius: 9px; font-size: 13px; font-weight: 600; cursor: pointer }
.btn-avancar{ flex: 2; padding: 12px; background: var(--or); color: #fff; border: none; border-radius: 9px; font-size: 13px; font-weight: 700; cursor: pointer }
.btn-avancar:hover { background: var(--orb) }


/* ── Tela de pagamento Pix ───────────────────────────────────────────────── */
.pix-box {
  background: #f0fdf4;
  border: 2px solid #bbf7d0;
  border-radius: 12px;
  padding: 20px;
  text-align: center;
  margin-bottom: 16px;
}
.pix-icon   { font-size: 36px; margin-bottom: 8px }
.pix-title  { font-size: 15px; font-weight: 700; color: var(--green); margin-bottom: 4px }
.pix-sub    { font-size: 12px; color: var(--t2); margin-bottom: 14px }
.pix-chave-label { font-size: 10px; font-weight: 700; color: var(--t3); text-transform: uppercase; letter-spacing: .4px; margin-bottom: 4px }
.pix-chave  { font-size: 13px; font-weight: 700; background: #fff; border: 1px solid #bbf7d0; border-radius: 8px; padding: 10px; word-break: break-all; margin-bottom: 10px }
.pix-valor  { font-size: 22px; font-weight: 800; color: var(--green) }
.btn-copiar { padding: 8px 20px; background: var(--green); color: #fff; border: none; border-radius: 7px; font-size: 12px; font-weight: 700; cursor: pointer; margin-top: 10px }


/* ── Tela de confirmado ──────────────────────────────────────────────────── */
.confirmado {
  text-align: center;
  padding: 10px 0 20px;
}
.conf-ic    { font-size: 52px; margin-bottom: 10px }
.conf-title { font-size: 18px; font-weight: 800; margin-bottom: 6px }
.conf-sub   { font-size: 13px; color: var(--t2); line-height: 1.6 }
.conf-num   { display: inline-block; margin-top: 12px; background: var(--orl); color: var(--or); padding: 6px 18px; border-radius: 20px; font-size: 13px; font-weight: 700 }


/* ── Modal de detalhe do item ────────────────────────────────────────────── */
.detalhe-wrap {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 500;
  display: none;
  align-items: flex-end;
  justify-content: center;
}
.detalhe-wrap.on { display: flex }

@media (min-width: 600px) {
  .detalhe-wrap { align-items: center }
}

.detalhe-modal {
  background: #fff;
  border-radius: 20px 20px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 92vh;
  overflow-y: auto;
  position: relative;
}

@media (min-width: 600px) {
  .detalhe-modal { border-radius: 16px }
}

.detalhe-close {
  position: absolute; top: 12px; right: 12px;
  background: rgba(0,0,0,.5); color: #fff;
  border: none; border-radius: 50%;
  width: 32px; height: 32px; font-size: 14px;
  cursor: pointer; z-index: 10;
  display: flex; align-items: center; justify-content: center;
}
.detalhe-close:hover { background: rgba(0,0,0,.75) }

.detalhe-foto {
  width: 100%; aspect-ratio: 3/2;
  object-fit: cover; display: block;
}

.detalhe-body { padding: 18px 18px 28px }

.detalhe-nome  { font-size: 20px; font-weight: 800; margin-bottom: 6px; color: var(--tx) }
.detalhe-preco { font-size: 22px; font-weight: 800; color: var(--or); margin-bottom: 12px }
.detalhe-desc  { font-size: 14px; color: var(--t2); line-height: 1.6; margin-bottom: 14px }

.detalhe-ingr-titulo {
  font-size: 10px; font-weight: 800; text-transform: uppercase;
  letter-spacing: .6px; color: var(--t3); margin-bottom: 6px;
}
.detalhe-ingr-lista {
  font-size: 13px; color: var(--t2); line-height: 1.7;
  padding: 12px; background: var(--bg);
  border-radius: 8px; margin-bottom: 16px;
}

.detalhe-ctrl {
  display: flex; align-items: center; gap: 12px; margin-top: 16px;
}
.det-qtd-ctrl {
  display: flex; align-items: center;
  border: 1.5px solid var(--bd); border-radius: 10px;
  overflow: hidden; flex-shrink: 0;
}
.det-qtd-ctrl button {
  width: 38px; height: 44px; border: none; background: #fff;
  font-size: 20px; cursor: pointer; color: var(--tx);
}
.det-qtd-ctrl button:hover { background: var(--bg) }
#det-qtd {
  width: 36px; text-align: center; font-size: 15px; font-weight: 700;
  border-left: 1px solid var(--bd); border-right: 1px solid var(--bd);
  height: 44px; line-height: 44px;
}
.det-btn-add {
  flex: 1; padding: 14px; background: var(--or); color: #fff;
  border: none; border-radius: 10px; font-size: 14px; font-weight: 700; cursor: pointer;
}
.det-btn-add:hover { background: var(--orb) }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 90px; left: 50%; transform: translateX(-50%);
  background: #111; color: #fff;
  padding: 10px 20px; border-radius: 20px;
  font-size: 12px; font-weight: 600;
  display: none; z-index: 999;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgba(0,0,0,.3);
}
.toast.show { display: block }
