/* ============================================================
   style.css — Cardápio público Lírios do Campo
   ============================================================ */

:root {
  --primary:       #2d6a4f;
  --primary-dark:  #1b4332;
  --primary-light: #74c69d;
  --accent:        #e07b54;
  --bg:            #f7f8f5;
  --white:         #ffffff;
  --text:          #1e2330;
  --muted:         #6b7280;
  --border:        #e5e7eb;
  --shadow-sm:     0 1px 4px rgba(0,0,0,.07);
  --shadow:        0 4px 16px rgba(0,0,0,.10);
  --radius:        10px;
  --header-h:      64px;
  --sidebar-w:     220px;
}

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

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
}

/* ── Header ─────────────────────────────────────── */
.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1.5rem;
  z-index: 100;
  box-shadow: 0 2px 8px rgba(0,0,0,.18);
}

.logo {
  display: flex;
  align-items: center;
  gap: .8rem;
  text-decoration: none;
  color: #fff;
}

.logo-icon {
  width: 42px; height: 42px;
  background: rgba(255,255,255,.18);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.35rem;
  flex-shrink: 0;
}

.logo-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -.02em;
  line-height: 1.2;
}

.logo-sub {
  font-size: .65rem;
  opacity: .75;
  text-transform: uppercase;
  letter-spacing: .07em;
}

.header-actions { display: flex; align-items: center; gap: .75rem; }

.btn-admin {
  display: inline-flex; align-items: center; gap: .4rem;
  background: rgba(255,255,255,.15);
  color: #fff;
  border: 1px solid rgba(255,255,255,.3);
  padding: .45rem 1.1rem;
  border-radius: 6px;
  text-decoration: none;
  font-size: .82rem;
  font-weight: 600;
  transition: background .2s;
}

.btn-admin:hover { background: rgba(255,255,255,.27); }

.cat-pill-conta {
  background: #f59e0b;
  border-color: #f59e0b;
  color: #fff;
  font-weight: 600;
}
.cat-pill-conta:hover {
  background: #d97706;
  border-color: #d97706;
  color: #fff;
}

/* ── Layout ──────────────────────────────────────── */
.layout {
  display: flex;
  margin-top: var(--header-h);
  min-height: calc(100vh - var(--header-h));
}

/* ── Sidebar ─────────────────────────────────────── */
.sidebar {
  position: fixed;
  top: var(--header-h);
  left: 0; bottom: 0;
  width: var(--sidebar-w);
  background: var(--white);
  border-right: 1px solid var(--border);
  padding: 1.5rem 0 2rem;
  overflow-y: auto;
}

.sidebar-title {
  font-size: .7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .09em;
  color: var(--muted);
  padding: 0 1.25rem;
  margin-bottom: .6rem;
}

.sidebar-menu { list-style: none; }

.sidebar-menu a {
  display: flex; align-items: center; gap: .75rem;
  padding: .7rem 1.25rem;
  text-decoration: none;
  color: var(--text);
  font-size: .88rem;
  font-weight: 500;
  border-right: 3px solid transparent;
  transition: all .15s;
}

.sidebar-menu a:hover,
.sidebar-menu a.ativo {
  background: #edf7f1;
  color: var(--primary);
  border-right-color: var(--primary);
}

.sidebar-menu a .ico { font-size: 1.1rem; width: 22px; text-align: center; }

.sidebar-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 1rem 1.25rem;
}

/* ── Main ────────────────────────────────────────── */
.main { margin-left: var(--sidebar-w); padding: 2rem; flex: 1; }

/* ── Section header ─────────────────────────────── */
/* ── Filtros de categoria (pills) ────────────────── */
.cat-pills {
  display: flex;
  gap: .3rem;
  flex-wrap: nowrap;
  justify-content: center;
  margin-bottom: 1.25rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.cat-pills::-webkit-scrollbar { display: none; }

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  padding: .35rem .65rem;
  border-radius: 999px;
  border: 1.5px solid var(--border);
  background: #fff;
  color: var(--text);
  font-size: .75rem;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background .15s, border-color .15s, color .15s;
}

.cat-pill:hover {
  border-color: var(--primary);
  color: var(--primary);
}

.cat-pill.ativo {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
  font-weight: 600;
}

.sec-header { margin-bottom: 1.5rem; }

.sec-title {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}

.sec-sub {
  color: var(--muted);
  font-size: .82rem;
  margin-top: .2rem;
}

/* ── Destaques badge ────────────────────────────── */
.badge {
  display: inline-block;
  font-size: .65rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: .2rem .55rem;
  border-radius: 4px;
  margin-bottom: .4rem;
}
.badge-destaque { background: var(--accent); color: #fff; }
.badge-cat      { background: #edf7f1;       color: var(--primary); }

/* ── Products grid ──────────────────────────────── */
.produtos-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 1.2rem;
}

/* ── Product card ───────────────────────────────── */
.card-produto {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: transform .2s, box-shadow .2s;
  display: flex; flex-direction: column;
}

.card-produto:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.card-img {
  width: 100%; height: 155px;
  overflow: hidden;
  background: #edf7f1;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}

.card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.card-img .no-img { font-size: 2.8rem; opacity: .25; }

.card-body { padding: 1rem; flex: 1; display: flex; flex-direction: column; }

.card-nome {
  font-size: .95rem;
  font-weight: 600;
  margin-bottom: .25rem;
}

.card-desc {
  font-size: .78rem;
  color: var(--muted);
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: .85rem;
}

.card-footer {
  display: flex; align-items: center; justify-content: space-between;
}

.card-preco {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--primary);
}

.btn-pedir {
  background: var(--accent);
  color: #fff;
  border: none;
  padding: .38rem 1rem;
  border-radius: 6px;
  font-size: .78rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity .15s;
}

.btn-pedir:hover { opacity: .88; }

/* ── Empty state ────────────────────────────────── */
.empty-state {
  grid-column: 1/-1;
  text-align: center;
  padding: 4rem 2rem;
  color: var(--muted);
}
.empty-state .ico { font-size: 3rem; margin-bottom: .75rem; }

/* ── Hamburger (mobile) ─────────────────────────── */
.hamburger {
  display: none;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.4rem;
  cursor: pointer;
  padding: .3rem;
  margin-right: .5rem;
}

.overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.4);
  z-index: 49;
}

/* ── Footer ─────────────────────────────────────── */
.footer-pub {
  text-align: center;
  padding: 2.5rem 1rem;
  color: var(--muted);
  font-size: .78rem;
  margin-left: var(--sidebar-w);
}

/* ── Cart button ─────────────────────────────────────── */
.btn-cart {
  position: fixed;
  bottom: 1.5rem; right: 1.5rem;
  width: 58px; height: 58px;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
  z-index: 200;
  transition: transform .2s, box-shadow .2s;
}
.btn-cart:hover { transform: scale(1.08); }
.cart-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: #fff;
  color: var(--accent);
  font-size: .68rem;
  font-weight: 800;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 1px 4px rgba(0,0,0,.2);
}
.cart-badge[data-count="0"] { display: none; }

.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.45);
  z-index: 299; display: none;
}
.cart-overlay.open { display: block; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0; bottom: 0;
  width: min(400px, 100vw);
  background: var(--white);
  box-shadow: -4px 0 24px rgba(0,0,0,.15);
  z-index: 300;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform .3s ease;
}
.cart-drawer.open { transform: translateX(0); }

.cart-header {
  display: flex; align-items: center; justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid var(--border);
  font-weight: 700; font-size: 1rem;
}
.cart-close { background: none; border: none; font-size: 1.3rem; cursor: pointer; color: var(--muted); }

.cart-items { flex: 1; overflow-y: auto; padding: .5rem 0; }
.cart-item {
  display: flex; align-items: center; gap: .85rem;
  padding: .7rem 1.25rem;
  border-bottom: 1px solid var(--border);
}
.cart-item-img {
  width: 46px; height: 46px; border-radius: 8px;
  background: #edf7f1; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.4rem; overflow: hidden;
}
.cart-item-img img { width:100%; height:100%; object-fit:cover; display:block; }
.cart-item-info { flex: 1; min-width: 0; }
.cart-item-nome { font-size: .875rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cart-item-preco { font-size: .78rem; color: var(--primary); font-weight: 700; }
.cart-item-ctrl { display: flex; align-items: center; gap: .4rem; flex-shrink: 0; }
.btn-qtd {
  width: 26px; height: 26px; border-radius: 50%;
  border: 1px solid var(--border); background: var(--white);
  font-size: .95rem; display: flex; align-items: center; justify-content: center;
  cursor: pointer; transition: background .15s;
}
.btn-qtd:hover { background: #f1f5f9; }
.qtd-num { font-size: .875rem; font-weight: 700; min-width: 18px; text-align: center; }

.cart-empty { text-align: center; padding: 3rem 1rem; color: var(--muted); }
.cart-empty .ico { font-size: 2.5rem; margin-bottom: .5rem; display: block; }

.cart-footer { padding: 1rem 1.25rem; border-top: 1px solid var(--border); }
.cart-total-row { display: flex; justify-content: space-between; font-size: 1rem; font-weight: 700; margin-bottom: .85rem; }
.btn-finalizar {
  width: 100%; padding: .72rem;
  background: var(--primary); color: #fff;
  border: none; border-radius: 8px;
  font-size: .92rem; font-weight: 700; cursor: pointer;
  transition: filter .15s;
}
.btn-finalizar:hover  { filter: brightness(.9); }
.btn-finalizar:disabled { opacity: .5; cursor: not-allowed; }

/* ── Modais ──────────────────────────────────────── */
.modal-full {
  position: fixed; inset: 0;
  background: rgba(0,0,0,.82);
  z-index: 400;
  display: none; align-items: center; justify-content: center;
  padding: 1rem;
}
.modal-full.open { display: flex; }
.modal-box {
  background: var(--white); border-radius: 14px; padding: 1.5rem;
  width: 100%; max-width: 400px; text-align: center;
}
.modal-title { font-size: 1.05rem; font-weight: 700; margin-bottom: .3rem; }
.modal-sub   { font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }

.scanner-wrap {
  position: relative; width: 100%; max-width: 280px;
  margin: 0 auto 1rem; border-radius: 12px;
  overflow: hidden; background: #000; aspect-ratio: 1;
}
.scanner-wrap video { width: 100%; display: block; }
.scanner-border {
  position: absolute; inset: 14%;
  border: 3px solid var(--primary-light);
  border-radius: 8px; pointer-events: none;
  animation: scanPulse 1.5s ease-in-out infinite;
}
@keyframes scanPulse { 0%,100%{opacity:1} 50%{opacity:.3} }

.confirm-mesa {
  background: #edf7f1; color: var(--primary);
  border-radius: 7px; padding: .55rem .85rem;
  font-size: .875rem; font-weight: 600; margin-bottom: .85rem;
}
.confirm-items {
  text-align: left; border: 1px solid var(--border); border-radius: 8px;
  margin-bottom: .85rem; max-height: 180px; overflow-y: auto;
}
.confirm-item {
  display: flex; justify-content: space-between;
  padding: .5rem .85rem; font-size: .83rem;
  border-bottom: 1px solid var(--border);
}
.confirm-item:last-child { border-bottom: none; }
.confirm-total { font-size: 1rem; font-weight: 700; color: var(--primary); text-align: right; margin-bottom: 1rem; }

.modal-btns { display: flex; gap: .6rem; }
.modal-btns button {
  flex: 1; padding: .65rem; border-radius: 7px;
  border: none; font-size: .875rem; font-weight: 600;
  cursor: pointer; transition: opacity .15s;
}
.modal-btns button:hover { opacity: .88; }
.btn-mp { background: var(--primary); color: #fff; }
.btn-ml { background: #f1f5f9; color: var(--text); }

/* ── Barra de acompanhamento de pedido ───────────── */
#trackBar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 300;
  padding: 0 1rem .6rem;
}
.track-bar {
  display: flex;
  align-items: center;
  gap: .75rem;
  background: var(--primary);
  color: #fff;
  padding: .75rem 1.1rem;
  border-radius: 12px;
  cursor: pointer;
  box-shadow: 0 -2px 16px rgba(0,0,0,.18);
  font-weight: 600;
  font-size: .95rem;
  transition: opacity .2s;
  user-select: none;
}
.track-bar:hover { opacity: .92; }

.track-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,.6);
  background: rgba(255,255,255,.5);
  flex-shrink: 0;
}
.track-dot.aguardando { background: #fbbf24; animation: pulseDot 1.2s ease-in-out infinite; }
.track-dot.aceito     { background: #60a5fa; }
.track-dot.preparando { background: #4ade80; animation: pulseDot 1.2s ease-in-out infinite; }
.track-dot.entregue   { background: #4ade80; }
.track-dot.cancelado  { background: #f87171; }
@keyframes pulseDot { 0%,100%{opacity:1;transform:scale(1)} 50%{opacity:.5;transform:scale(.7)} }

/* ── Steps de status ─────────────────────────────── */
.track-steps {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .25rem;
  margin-bottom: .25rem;
}
.track-step {
  display: flex; flex-direction: column; align-items: center;
  flex: 1; gap: .3rem; font-size: .7rem; color: #94a3b8; text-align: center;
}
.track-step .step-ico {
  width: 36px; height: 36px; border-radius: 50%;
  background: #f1f5f9; border: 2px solid #e2e8f0;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem; transition: all .3s;
}
.track-step.done .step-ico  { background: #dcfce7; border-color: #22c55e; }
.track-step.active .step-ico{ background: var(--primary); border-color: var(--primary); color:#fff; font-size:1.1rem; box-shadow:0 0 0 3px rgba(45,106,79,.2); }
.track-step.done  { color: #16a34a; }
.track-step.active{ color: var(--primary); font-weight:700; }
.track-step.cancel .step-ico{ background: #fee2e2; border-color: #ef4444; }
.track-step.cancel{ color: #ef4444; }
.track-line {
  flex: 1; height: 2px; background: #e2e8f0; border-radius: 2px; margin-bottom: 1rem;
}
.track-line.done { background: #22c55e; }

/* ── Modal foto ──────────────────────────────────── */
.foto-modal-box {
  position: relative;
  max-width: min(520px, 92vw);
  background: var(--white);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: 0 20px 60px rgba(0,0,0,.4);
  animation: zoomIn .18s ease;
}
@keyframes zoomIn { from { transform: scale(.88); opacity: 0; } to { transform: scale(1); opacity: 1; } }

.foto-modal-box img {
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
  display: block;
  background: #f0faf4;
}

.foto-modal-box p {
  padding: .75rem 1rem;
  font-size: .88rem;
  font-weight: 600;
  text-align: center;
  color: var(--text);
  border-top: 1px solid var(--border);
  margin: 0;
}

.foto-modal-close {
  position: absolute;
  top: .6rem; right: .6rem;
  width: 30px; height: 30px;
  border-radius: 50%;
  border: none;
  background: rgba(0,0,0,.45);
  color: #fff;
  font-size: .9rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  z-index: 1;
  transition: background .15s;
}
.foto-modal-close:hover { background: rgba(0,0,0,.7); }

/* ── Responsive ─────────────────────────────────── */
@media (max-width: 768px) {
  .hamburger { display: block; }

  .sidebar {
    transform: translateX(-100%);
    z-index: 50;
    transition: transform .28s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .overlay.open { display: block; }

  .main { margin-left: 0; padding: .75rem .5rem; }

  .produtos-grid {
    grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
    gap: .85rem;
  }

  .card-img { height: 120px; }
  .card-preco { font-size: .88rem; }
  .footer-pub { margin-left: 0; }
}
