/* ---------- App do cliente ---------- */
body { background: var(--bg); padding-bottom: env(safe-area-inset-bottom); }

.hero {
  position: relative; color: #fff; overflow: hidden;
  background: linear-gradient(135deg, #1c1917 0%, #292524 55%, var(--brand-700) 100%);
}
.hero::after {
  content: ''; position: absolute; left: -10%; right: -10%; bottom: -46px; height: 90px;
  background: var(--bg); border-radius: 50% 50% 0 0 / 100% 100% 0 0;
}
.hero-wave { position: absolute; right: -40px; top: 26px; width: 340px; height: 120px; opacity: .18; pointer-events: none; }
.hero-inner { position: relative; z-index: 1; max-width: 1180px; margin: 0 auto; padding: 18px 16px 64px; }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.hero-brand { display: flex; align-items: center; gap: 14px; }
.hero-brand img { width: 74px; height: 74px; border-radius: 50%; box-shadow: 0 0 0 3px rgba(255,255,255,.9), 0 8px 24px rgba(0,0,0,.18); }
.hero-brand h1 { font-size: 24px; font-weight: 700; letter-spacing: -.01em; }
.hero-brand p { margin: 2px 0 0; opacity: .9; font-size: 14px; }
.hero-link { color: #fff; background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.3); }
.hero-link:hover { background: rgba(255,255,255,.26) !important; }
.hero-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 13px; border-radius: 999px;
  background: rgba(255,255,255,.16); border: 1px solid rgba(255,255,255,.28); font-size: 13px; font-weight: 500; backdrop-filter: blur(4px);
}
.chip.open .dot { color: #7dffb0; box-shadow: 0 0 0 3px rgba(125,255,176,.25); }
.chip.closed .dot { color: #ffb4a0; }
.chip.paused { background: rgba(240,80,30,.85); border-color: transparent; }
@media (max-width: 560px) {
  .hero-brand img { width: 58px; height: 58px; }
  .hero-brand h1 { font-size: 20px; }
}

.page { max-width: 1180px; margin: -30px auto 0; padding: 0 16px 120px; position: relative; z-index: 2; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 22px; align-items: start; }
@media (max-width: 1023px) { .layout { grid-template-columns: minmax(0, 1fr); } .cart-side { display: none; } }
.layout > *, .checkout > *, .track > * { min-width: 0; }

.notices { display: flex; flex-direction: column; gap: 10px; margin-bottom: 14px; }

.menu-tools { position: sticky; top: 0; z-index: 20; background: var(--bg); padding: 10px 0 8px; margin: 0 -2px; }
.search { position: relative; }
.search input { padding-left: 42px; border-radius: 999px; min-height: 46px; box-shadow: var(--shadow-sm); }
.search .search-icon { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--faint); pointer-events: none; }
.cat-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 10px 2px 2px; scrollbar-width: none; scroll-behavior: smooth; }
.cat-tabs::-webkit-scrollbar { display: none; }
.cat-tab {
  flex: none; border: 1px solid var(--border); background: var(--surface); border-radius: 999px; padding: 8px 14px;
  font-size: 14px; font-weight: 600; cursor: pointer; color: var(--muted); white-space: nowrap;
}
.cat-tab.active { background: var(--text); color: #fff; border-color: var(--text); }

.cat-section { scroll-margin-top: 130px; margin-top: 22px; }
.cat-title { display: flex; align-items: center; gap: 10px; font-size: 19px; font-weight: 700; margin-bottom: 12px; }
.cat-title .cat-ico { width: 38px; height: 38px; border-radius: 12px; background: var(--brand-50); display: grid; place-items: center; font-size: 20px; }
.products { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
@media (max-width: 720px) { .products { grid-template-columns: 1fr; } }

.product {
  display: flex; gap: 14px; text-align: left; padding: 14px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); cursor: pointer; transition: box-shadow .15s, transform .15s, border-color .15s; width: 100%;
}
.product:hover { box-shadow: var(--shadow); border-color: var(--brand-100); transform: translateY(-1px); }
.product:focus-visible { outline: 3px solid var(--brand-100); }
.product .p-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.product h4 { font-size: 15px; font-weight: 600; }
.product .p-desc { font-size: 13px; color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product .p-price { margin-top: auto; padding-top: 6px; display: flex; flex-wrap: wrap; gap: 4px 12px; align-items: baseline; }
.product .p-price strong { color: var(--brand-700); font-size: 16px; }
.product .p-price small { color: var(--muted); font-size: 12px; }
.product .p-img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; flex: none; background: var(--brand-50); display: grid; place-items: center; font-size: 36px; }
.product.soldout { opacity: .55; cursor: not-allowed; }
.product .p-serves { font-size: 12px; color: var(--accent-600); font-weight: 600; }

/* Carrinho lateral */
.cart-side { position: sticky; top: 12px; margin-top: 10px; }
.cart-side .card-body { max-height: calc(100dvh - 260px); overflow-y: auto; }
.cart-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px dashed var(--border); }
.cart-item:last-child { border-bottom: 0; }
.cart-item .ci-name { font-weight: 600; font-size: 14px; }
.cart-item .ci-sub { font-size: 12px; color: var(--muted); }
.totals { display: flex; flex-direction: column; gap: 6px; font-size: 14px; }
.totals .row { justify-content: space-between; }
.totals .grand { font-size: 18px; font-weight: 700; padding-top: 6px; border-top: 1px solid var(--border); }

/* Barra do carrinho (celular) */
.cart-bar {
  position: fixed; left: 12px; right: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50;
  display: none; align-items: center; gap: 12px; padding: 10px 10px 10px 18px; border-radius: 999px; border: 0;
  background: var(--brand-700); color: #fff; box-shadow: var(--shadow-lg); cursor: pointer; font-weight: 600; animation: up .2s ease;
}
.cart-bar .cb-count { background: #fff; color: var(--brand-700); border-radius: 999px; min-width: 28px; height: 28px; display: grid; place-items: center; font-size: 14px; }
.cart-bar .cb-total { margin-left: auto; background: rgba(255,255,255,.16); padding: 8px 14px; border-radius: 999px; }
@media (max-width: 1023px) { .cart-bar.show { display: flex; } }

/* Modal de produto */
.pm-img { width: 100%; height: 200px; object-fit: cover; border-radius: 14px; margin-bottom: 14px; }
.pm-section { margin-top: 18px; }
.pm-section h4 { font-size: 14px; margin-bottom: 8px; display: flex; justify-content: space-between; }
.opt-list { display: flex; flex-direction: column; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.opt-list label { display: flex; align-items: center; gap: 12px; padding: 12px 14px; cursor: pointer; border-bottom: 1px solid var(--border); }
.opt-list label:last-child { border-bottom: 0; }
.opt-list label:hover { background: var(--surface-2); }
.opt-list input { width: 20px; height: 20px; accent-color: var(--brand); }
.opt-list .opt-price { margin-left: auto; color: var(--muted); font-size: 14px; }

/* Checkout */
.checkout { max-width: 720px; margin: 0 auto; }
.ck-section { margin-bottom: 14px; }
.ck-section .card-head h3 { display: flex; align-items: center; gap: 10px; }
.ck-section .step { width: 26px; height: 26px; border-radius: 50%; background: var(--brand); color: var(--on-brand); display: grid; place-items: center; font-size: 13px; }
.type-cards { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.type-card {
  border: 2px solid var(--border); border-radius: 14px; padding: 14px; cursor: pointer; background: var(--surface); text-align: left;
  display: flex; flex-direction: column; gap: 4px;
}
.type-card .tc-ico { font-size: 26px; }
.type-card.active { border-color: var(--brand); background: var(--brand-50); }
.type-card:disabled { opacity: .5; cursor: not-allowed; }
.pay-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.pay-opt { border: 2px solid var(--border); border-radius: 12px; padding: 12px; cursor: pointer; background: var(--surface); font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pay-opt.active { border-color: var(--brand); background: var(--brand-50); }
.estimate-box { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; background: var(--brand-50); color: var(--brand-700); }
.estimate-box .eb-ico { font-size: 28px; }
.estimate-box strong { font-size: 20px; display: block; color: var(--text); }
.estimate-box.high { background: var(--warn-50); color: #8a4b05; }
.ck-footer { position: sticky; bottom: 0; background: linear-gradient(transparent, var(--bg) 22%); padding: 22px 0 calc(14px + env(safe-area-inset-bottom)); }

/* Acompanhamento */
.track { max-width: 720px; margin: 0 auto; }
.track-head { text-align: center; padding: 20px 16px; }
.track-head .big { font-size: 48px; }
.track-head h2 { font-size: 22px; margin-top: 6px; }
.timeline { display: flex; flex-direction: column; gap: 0; padding: 4px 0; }
.tl-step { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before { content: ''; position: absolute; left: 15px; top: 32px; bottom: 0; width: 2px; background: var(--border); }
.tl-step:last-child::before { display: none; }
.tl-dot { width: 32px; height: 32px; border-radius: 50%; background: var(--surface-2); color: var(--faint); display: grid; place-items: center; flex: none; font-size: 15px; z-index: 1; }
.tl-step.done .tl-dot { background: var(--brand); color: var(--on-brand); }
.tl-step.done::before { background: var(--brand); }
.tl-step.current .tl-dot { background: var(--accent); color: #fff; box-shadow: 0 0 0 6px var(--accent-50); animation: pulse 1.6s infinite; }
.tl-step .tl-label { font-weight: 600; padding-top: 5px; }
.tl-step:not(.done):not(.current) .tl-label { color: var(--faint); font-weight: 500; }
@keyframes pulse { 50% { box-shadow: 0 0 0 10px rgba(240,80,30,.08); } }
.pix-box { display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.pix-box img { width: 220px; height: 220px; image-rendering: pixelated; border: 1px solid var(--border); border-radius: 12px; padding: 6px; background: #fff; }
.pix-code { width: 100%; font-family: ui-monospace, monospace; font-size: 12px; word-break: break-all; background: var(--surface-2); border-radius: 10px; padding: 10px; }

.footer { text-align: center; color: var(--muted); font-size: 13px; padding: 30px 16px 10px; }
.footer a { color: var(--muted); }
.conn { position: fixed; top: 10px; left: 50%; transform: translateX(-50%); z-index: 90; background: var(--warn); color: #fff; padding: 6px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; box-shadow: var(--shadow); }
/* Pix: valor e chave em destaque */
.pix-label { font-size: 13px; color: var(--muted); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.pix-amount { font-size: 34px; font-weight: 800; line-height: 1.1; color: var(--text); }
.pix-key { width: 100%; font-size: 20px; font-weight: 700; word-break: break-all; background: var(--brand-50); border: 2px dashed var(--brand); border-radius: 14px; padding: 14px 12px; user-select: all; }
/* Avisos no topo da tela no site do cliente: não cobrem a barra "Ver carrinho" e nunca bloqueiam toques */
.toasts { top: calc(12px + env(safe-area-inset-top, 0px)); bottom: auto; }
.toasts .toast { pointer-events: none; animation: down .2s ease; }
@keyframes down { from { transform: translateY(-16px); opacity: .4; } }

/* Confirmação do pedido e Pix pendente */
.placed-ok { font-size: 15px; }
.pix-code { max-height: 96px; overflow: auto; user-select: all; }
.pix-qr { width: 100%; }
.pix-qr summary { cursor: pointer; color: var(--brand-700); font-weight: 600; padding: 6px; }
.pix-qr img { display: block; margin: 8px auto 0; }
.pix-pending { margin: 0; font-size: 13px; color: #7c4a03; background: var(--warn-50); border-radius: 10px; padding: 10px 12px; text-align: left; }

/* Cliente identificado pelo telefone */
.cust-box { border: 1px dashed var(--border); background: var(--surface-2); border-radius: 12px; padding: 12px 14px; font-size: 14px; }
.cust-box.ok { border-style: solid; border-color: rgba(22, 163, 74, .3); background: var(--ok-50); color: #14532d; }
.cust-box .spinner { display: inline-block; vertical-align: middle; width: 16px; height: 16px; border-width: 2px; margin-right: 6px; }

/* Ingrediente em falta (aviso, não bloqueia) */
.p-warn { margin-top: 6px; font-size: 12px; font-weight: 600; color: #8a4b00; background: var(--warn-50); border-radius: 8px; padding: 3px 8px; display: inline-block; }
