/* fluxo.css — micro-interações do fluxo de pedido (06/11/2026, frente H4).
   Só transform/opacity. Tudo desligado em prefers-reduced-motion (bloco no fim). */

/* ── 8. troca de tela: fade + 12px / 180 ms. A subida vai nos FILHOS (exceto a
   barra fixa) para o transform não virar bloco de contenção dos elementos fixos. */
.mkt #mktView.is-enter { animation: fxFade .18s ease-out; }
.mkt #mktView.is-enter > *:not(.cartbar):not(.foot-cta):not(.hdr) { animation: fxSobe .18s ease-out; }
@keyframes fxFade { from { opacity: .35; } to { opacity: 1; } }
@keyframes fxSobe { from { transform: translate3d(0, 12px, 0); } to { transform: none; } }

/* ── 5. pressionar + ripple ── */
.mkt .btn-main, .mkt .btn-add, .mkt .cartbar, .mkt .item, .mkt a.store, .mkt .pay-opt, .mkt .opt-row, .mkt .addr-pick, .mkt .card-fav, .mkt .qty button, .mkt .stepmini button {
  transition: transform .12s ease-out; -webkit-tap-highlight-color: transparent;
}
.mkt .btn-main:active, .mkt .btn-add:active, .mkt .item:active, .mkt a.store:active, .mkt .pay-opt:active, .mkt .opt-row:active, .mkt .addr-pick:active { transform: scale(.97); }
.mkt .cartbar:active { transform: translateX(-50%) scale(.97); }
.mkt .card-fav:active, .mkt .qty button:active, .mkt .stepmini button:active { transform: scale(.88); }
.fx-rw { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; pointer-events: none; z-index: 2; }
.fx-rw i { position: absolute; border-radius: 50%; background: rgba(120, 120, 120, .22); transform: scale(0); opacity: 1; animation: fxRip .55s ease-out forwards; }
.mkt .btn-main .fx-rw i, .mkt .btn-add .fx-rw i, .mkt .cartbar .fx-rw i { background: rgba(255, 255, 255, .28); }
@keyframes fxRip { to { transform: scale(1); opacity: 0; } }

/* ── 1. voo da miniatura + ✓ no card + pop/bump ── */
.fx-fly { position: fixed; left: 0; top: 0; width: 56px; height: 56px; border-radius: 50%; background: var(--brand, #F9D515) center / cover no-repeat; box-shadow: 0 6px 18px rgba(0, 0, 0, .3); z-index: 99999; pointer-events: none; will-change: transform; border: 2px solid #fff; }
.fx-pop { animation: fxPop .42s cubic-bezier(.3, 1.6, .5, 1); }
@keyframes fxPop { 0% { transform: scale(1); } 40% { transform: scale(1.45); } 100% { transform: scale(1); } }
.mkt .cartbar.fx-bump { animation: fxBump .38s ease-out; }
@keyframes fxBump { 0% { transform: translateX(-50%) scale(1); } 40% { transform: translateX(-50%) scale(1.04); } 100% { transform: translateX(-50%) scale(1); } }
.mkt .item.fx-added::after { content: "✓"; position: absolute; right: 12px; bottom: 12px; width: 28px; height: 28px; border-radius: 50%; background: var(--ok, #12A150); color: #fff; font-size: 16px; font-weight: 900; display: grid; place-items: center; z-index: 3; animation: fxPop .5s cubic-bezier(.3, 1.6, .5, 1) both; pointer-events: none; }
.mkt .item { position: relative; }

/* ── 2. barra Ver sacola: sobe com mola; total em contagem ── */
.mkt .cartbar.fx-rise { animation: fxRise .6s cubic-bezier(.2, 1.4, .4, 1); }
@keyframes fxRise { from { transform: translate3d(-50%, 90px, 0); opacity: 0; } to { transform: translate3d(-50%, 0, 0); opacity: 1; } }
.fx-tick { font-variant-numeric: tabular-nums; }

/* ── 3. número do stepper rolando ── */
.fx-up { animation: fxRolaCima .28s ease-out; display: inline-block; }
.fx-down { animation: fxRolaBaixo .28s ease-out; display: inline-block; }
@keyframes fxRolaCima { from { transform: translate3d(0, 70%, 0); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fxRolaBaixo { from { transform: translate3d(0, -70%, 0); opacity: 0; } to { transform: none; opacity: 1; } }

/* ── 4. faíscas do favorito ── */
.fx-sparks { position: absolute; left: 50%; top: 50%; width: 0; height: 0; pointer-events: none; }
.fx-sparks i { position: absolute; left: -3px; top: -3px; width: 6px; height: 6px; border-radius: 50%; background: #E5484D; opacity: 0; animation: fxFaisca .55s ease-out forwards; }
.fx-sparks i:nth-child(even) { background: #F9B115; width: 5px; height: 5px; }
@keyframes fxFaisca { 0% { transform: translate3d(0, 0, 0) scale(.4); opacity: 1; } 100% { transform: translate3d(var(--dx), var(--dy), 0) scale(1); opacity: 0; } }

/* ── 6. sombra do cabeçalho fixo ao rolar ── */
.mkt .hdr, .mkt .topbar, .mkt .storetabs { transition: box-shadow .2s ease-out; }
body.mkt.fx-scrolled .hdr, body.mkt.fx-scrolled .topbar, body.mkt.fx-scrolled .storetabs { box-shadow: 0 6px 16px -8px rgba(11, 15, 25, .35); }
.mkt .menutabs .mt { transition: background-color .2s ease-out, color .2s ease-out; }

/* ── 7. entrada em cascata ── */
.fx-rv { opacity: 0; transform: translate3d(0, 14px, 0); }
.fx-rv.fx-in { animation: fxEntra .38s cubic-bezier(.2, .7, .2, 1) var(--fx-d, 0ms) both; }
@keyframes fxEntra { from { opacity: 0; transform: translate3d(0, 14px, 0); } to { opacity: 1; transform: none; } }

/* ── 9. acompanhamento ── */
.mkt .track-steps { position: relative; }
.mkt .tdot { position: relative; z-index: 1; }
.mkt .tdot.fx-ck { animation: fxPop .5s cubic-bezier(.3, 1.6, .5, 1) both; }
.mkt .tstep.now .tdot.pulse { animation: pu 1.6s ease-in-out infinite; }
.fx-fill { position: absolute; left: 13px; width: 2px; border-radius: 2px; background: var(--ok, #12A150); transform-origin: top; z-index: 0; pointer-events: none; will-change: transform; }
.fx-moto { position: absolute; left: 1px; top: 0; width: 26px; height: 26px; object-fit: contain; z-index: 2; pointer-events: none; will-change: transform; }
.fx-moto.fx-ride { animation: fxBalanca 1.2s ease-in-out infinite; }
@keyframes fxBalanca { 50% { opacity: .85; } }
.mkt .pix-timer .fx-cd { font-variant-numeric: tabular-nums; font-weight: 800; color: var(--ink); }
.mkt .pix-timer.fx-urgente .fx-cd { color: var(--danger, #D93025); animation: fxPisca 1s ease-in-out infinite; }
@keyframes fxPisca { 50% { opacity: .45; } }
.mkt .pix-copy b.fx-copiado { color: var(--ok, #12A150); animation: fxPop .45s cubic-bezier(.3, 1.6, .5, 1); }
.fx-okpop { animation: fxOkpop .6s cubic-bezier(.2, 1.3, .4, 1) both; }
@keyframes fxOkpop { from { opacity: 0; transform: scale(.88); } to { opacity: 1; transform: none; } }

/* ── 10. checkout: passos + botão de pagar ── */
.fx-steps { position: relative; display: flex; justify-content: space-between; padding: 14px 18px 10px; background: var(--surface, #fff); font-size: 11.5px; font-weight: 800; color: var(--ink-3, #8A8F98); }
.fx-steps span { flex: 1; text-align: center; padding-top: 12px; transition: color .25s; }
.fx-steps span.on { color: var(--ink, #0B0F19); }
.fx-steps span.ok { color: var(--ok, #12A150); }
.fx-steps .fx-bar { position: absolute; left: 18px; right: 18px; top: 12px; height: 4px; border-radius: 4px; background: var(--line, #E6E8EC); overflow: hidden; }
.fx-steps .fx-bar b { display: block; height: 100%; width: 100%; background: var(--brand, #F9D515); border-radius: 4px; transform-origin: left; transform: scaleX(.34); transition: transform .5s cubic-bezier(.4, 0, .2, 1), background-color .3s; }
.fx-steps[data-step="2"] .fx-bar b { transform: scaleX(.67); }
.fx-steps[data-step="3"] .fx-bar b { transform: scaleX(1); background: var(--ok, #12A150); }
.mkt .btn-main.fx-busy { position: relative; color: transparent !important; pointer-events: none; }
.mkt .btn-main.fx-busy::after { content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px; border-radius: 50%; border: 3px solid rgba(11, 15, 25, .25); border-top-color: var(--ink, #0B0F19); animation: fxGira .7s linear infinite; }
@keyframes fxGira { to { transform: rotate(360deg); } }

/* ── 11. pino cai e quica (propriedade `translate`: não briga com o transform do Leaflet) ── */
.leaflet-marker-icon.fx-drop { animation: fxQueda .65s cubic-bezier(.3, 0, .6, 1) both; }
@keyframes fxQueda {
  0% { translate: 0 -46px; opacity: 0; }
  45% { translate: 0 0; opacity: 1; }
  62% { translate: 0 -14px; }
  78% { translate: 0 0; }
  90% { translate: 0 -5px; }
  100% { translate: 0 0; }
}

/* ── alinhamento: "OBRIGATÓRIO · 1" e "a partir de" ── */
.mkt .grp-h .req { flex: 0 0 auto; white-space: nowrap; line-height: 1; display: inline-flex; align-items: center; }
.mkt .grp-h b { min-width: 0; line-height: 1.25; }
.mkt .pbody .from { display: flex; align-items: baseline; flex-wrap: wrap; column-gap: 6px; }
.mkt .pbody .from small { flex: 0 0 100%; line-height: 1.2; }
.mkt .pbody .from s { margin-left: 0; }

/* ── movimento reduzido: desliga tudo ── */
@media (prefers-reduced-motion: reduce) {
  .mkt #mktView.is-enter, .mkt #mktView.is-enter > * { animation: none !important; }
  .fx-rv { opacity: 1 !important; transform: none !important; }
  .fx-rv.fx-in, .fx-pop, .fx-up, .fx-down, .fx-okpop, .mkt .cartbar.fx-rise, .mkt .cartbar.fx-bump,
  .mkt .tdot.fx-ck, .fx-moto.fx-ride, .leaflet-marker-icon.fx-drop, .mkt .item.fx-added::after,
  .fx-sparks i, .fx-rw i { animation: none !important; }
  .fx-fly, .fx-sparks, .fx-rw { display: none !important; }
  .mkt .btn-main:active, .mkt .btn-add:active, .mkt .item:active, .mkt a.store:active, .mkt .pay-opt:active,
  .mkt .opt-row:active, .mkt .addr-pick:active, .mkt .card-fav:active { transform: none; }
  .fx-steps .fx-bar b { transition: none; }
}
