/* MSUPTECH_LOJA_FLUXO_V1 (26/09/2026)
   Destaque do que importa na loja (situacao aberta/fechada, Meus pedidos,
   WhatsApp) e o "Seu pedido" abrindo por cima no celular.
   Os temas empilham muitas regras sobre .cart e .status; por isso os
   seletores daqui partem de html/body e usam !important onde a posicao
   precisa vencer. Ver loja-fluxo-v1.js. */

/* ---------- topo ---------- */
/* O cliente nao escolhe tema: o seletor so confundia ("Luxury Bronze
   Premium" ao lado de "Meus pedidos"). O tema salvo continua valendo. */
html body .topbar .theme-switcher { display: none !important; }

html body #statusText {
  display: inline-flex !important;
  align-items: center;
  gap: 8px;
  padding: 10px 16px !important;
  border-radius: 999px !important;
  font-size: 14px !important;
  font-weight: 800 !important;
  letter-spacing: .01em;
  border: 1.5px solid rgba(74, 222, 128, .75) !important;
  background: rgba(22, 101, 52, .35) !important;
  color: #bbf7d0 !important;
}
html body #statusText::before {
  content: "" !important;
  width: 10px; height: 10px; flex: 0 0 10px;
  border-radius: 50%;
  background: #4ade80 !important;
  box-shadow: 0 0 0 4px rgba(74, 222, 128, .22);
  -webkit-mask: none !important; mask: none !important;
}
html body #statusText.closed {
  border-color: rgba(248, 113, 113, .85) !important;
  background: rgba(127, 29, 29, .45) !important;
  color: #fecaca !important;
}
html body #statusText.closed::before {
  background: #f87171 !important;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, .22);
}
body.theme-premium-light-contrast #statusText { color: #14532d !important; background: #dcfce7 !important; border-color: #16a34a !important; }
body.theme-premium-light-contrast #statusText.closed { color: #7f1d1d !important; background: #fee2e2 !important; border-color: #dc2626 !important; }

/* "Meus pedidos" do topo deixa de ser mais um contorno igual aos outros. */
html body .topbar .cli-entrada {
  background: linear-gradient(135deg, #efb66f, #c47a36) !important;
  border-color: transparent !important;
  color: #1a1009 !important;
  font-weight: 800 !important;
}

@media (max-width: 700px) {
  html body .topbar-controls {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 10px !important;
    width: 100%;
    align-items: stretch;
  }
  html body .topbar .cli-entrada,
  html body #statusText {
    width: 100% !important;
    min-height: 48px;
    justify-content: center;
    margin: 0 !important;
  }
}

/* ---------- botoes do inicio: cada um com a sua cor ---------- */
html body .hero-actions #quickWhats {
  border-color: rgba(37, 211, 102, .7) !important;
  color: #d1fae5 !important;
  background: rgba(37, 211, 102, .10) !important;
}
html body .hero-actions #quickWhats::before { background-color: #25d366 !important; color: #25d366 !important; }
html body .hero-actions .cli-hero-pedidos {
  border-color: rgba(239, 182, 111, .75) !important;
  background: rgba(239, 182, 111, .12) !important;
  color: #f6dcb8 !important;
}
body.theme-premium-light-contrast .hero-actions #quickWhats { color: #065f46 !important; }
body.theme-premium-light-contrast .hero-actions .cli-hero-pedidos { color: #6b4620 !important; }

/* ---------- formulario do pedido: maior e mais facil de digitar ---------- */
html body #cartAside .field label,
html body #cartAside .cash-change-title {
  font-size: 14px !important;
  margin-bottom: 6px;
}
html body #cartAside input:not([type="radio"]):not([type="checkbox"]),
html body #cartAside select,
html body #cartAside textarea {
  min-height: 52px !important;
  font-size: 16px !important; /* abaixo de 16px o iPhone da zoom no campo */
  padding: 12px 14px !important;
  border-radius: 12px !important;
  border-width: 1.5px !important;
}
html body #cartAside textarea { min-height: 84px !important; }
html body #cartAside input:focus,
html body #cartAside select:focus,
html body #cartAside textarea:focus {
  outline: none !important;
  border-color: #efb66f !important;
  box-shadow: 0 0 0 3px rgba(239, 182, 111, .25) !important;
}
html body #cartAside .send {
  min-height: 58px !important;
  font-size: 18px !important;
  border-radius: 14px !important;
}
/* Exigencia de quem fornece o mapa: fica, mas discreta. */
html body #deliveryGeocoderAttribution {
  font-size: 10px !important;
  opacity: .55;
  margin-top: 4px !important;
}

/* ---------- "Seu pedido" por cima da loja (celular) ---------- */
.fluxo-fechar { display: none; }

@media (max-width: 980px) {
  html.fluxo-pedido-aberto,
  html.fluxo-pedido-aberto body { overflow: hidden !important; }

  html.fluxo-pedido-aberto body #cartAside {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    top: max(6vh, 36px) !important;
    z-index: 26 !important;
    margin: 0 !important;
    max-width: none !important;
    width: auto !important;
    /* Algum tema fixa a altura do .cart; sem teto, top+bottom nao bastam
       e o painel passa da tela sem rolar. */
    height: auto !important;
    max-height: calc(100vh - max(6vh, 36px)) !important;
    max-height: calc(100dvh - max(6vh, 36px)) !important;
    overflow-y: auto !important;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    border-radius: 22px 22px 0 0 !important;
    padding: 12px 18px calc(28px + env(safe-area-inset-bottom, 0px)) !important;
    background: #17130f !important;
    box-shadow: 0 -18px 50px rgba(0, 0, 0, .55) !important;
    transform: none !important;
    animation: fluxo-sobe .22s ease-out;
  }
  html.fluxo-pedido-aberto body.theme-premium-light-contrast #cartAside { background: #fbf6ee !important; }

  html.fluxo-pedido-aberto .fluxo-fechar {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    position: sticky;
    top: -12px;
    z-index: 2;
    margin: -12px -18px 10px;
    width: calc(100% + 36px);
    padding: 14px 18px;
    border: 0;
    border-bottom: 1px solid rgba(239, 182, 111, .25);
    background: inherit;
    color: #efb66f;
    font: inherit;
    font-size: 15px;
    font-weight: 800;
    text-align: left;
    cursor: pointer;
  }
  .fluxo-fechar span { font-size: 24px; line-height: 1; }

  html.fluxo-pedido-aberto .mobile-cart-bar { display: none !important; }
}

.fluxo-fundo {
  position: fixed;
  inset: 0;
  z-index: 25;
  background: rgba(0, 0, 0, .6);
}
.fluxo-fundo[hidden] { display: none; }

@keyframes fluxo-sobe { from { transform: translateY(40px); opacity: .6; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  html.fluxo-pedido-aberto body #cartAside { animation: none; }
}

/* ---------- barra de baixo: o caminho para finalizar ---------- */
@media (max-width: 980px) {
  html body .mobile-cart-bar:not([hidden]) {
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px)) !important;
  }
  html body .mobile-cart-bar .mobile-cart-info strong { font-size: 15px !important; }
  html body .mobile-cart-bar .mobile-cart-info span { font-size: 18px !important; color: #efb66f !important; }
  html body .mobile-cart-bar button {
    min-height: 50px;
    padding: 0 26px !important;
    font-size: 16px !important;
  }
}

/* ---------- aviso depois de adicionar ---------- */
.fluxo-aviso {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(92px + env(safe-area-inset-bottom, 0px));
  z-index: 24;
  max-width: 520px;
  margin: 0 auto;
  padding: 14px;
  border-radius: 16px;
  border: 1px solid rgba(74, 222, 128, .55);
  background: #100e0b;
  box-shadow: 0 16px 40px rgba(0, 0, 0, .5);
  color: #fff;
  animation: fluxo-sobe .2s ease-out;
}
.fluxo-aviso[hidden] { display: none; }
.fluxo-aviso-texto { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 15px; margin-bottom: 12px; }
.fluxo-aviso-ok {
  display: inline-grid; place-items: center;
  width: 24px; height: 24px; border-radius: 50%;
  background: #22c55e; color: #052e16; font-size: 14px;
}
.fluxo-aviso-botoes { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.fluxo-aviso-botoes button {
  min-height: 48px;
  border-radius: 12px;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
.fluxo-aviso-mais { border: 1.5px solid rgba(239, 182, 111, .7); background: transparent; color: #f6dcb8; }
.fluxo-aviso-fim { border: 0; background: linear-gradient(135deg, #efb66f, #c47a36); color: #1a1009; }
@media (min-width: 981px) { .fluxo-aviso { display: none !important; } }
@media (prefers-reduced-motion: reduce) { .fluxo-aviso { animation: none; } }

/* ---------- categorias presas no topo ---------- */
.fluxo-categorias {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 19;
  display: flex;
  gap: 8px;
  padding: 10px 12px;
  overflow-x: auto;
  background: rgba(14, 12, 9, .96);
  border-bottom: 1px solid rgba(239, 182, 111, .3);
  box-shadow: 0 10px 24px rgba(0, 0, 0, .35);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
}
.fluxo-categorias[hidden] { display: none; }
.fluxo-categorias button {
  flex: 1 0 auto;
  min-height: 42px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1.5px solid rgba(239, 182, 111, .45);
  background: transparent;
  color: #f6dcb8;
  font: inherit;
  font-size: 15px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}
.fluxo-categorias button.is-active {
  background: linear-gradient(135deg, #efb66f, #c47a36);
  border-color: transparent;
  color: #1a1009;
}

/* ===== MSUPTECH_LOJA_FLUXO_V2 (26/09): ajustes pedidos pelo Marcus ===== */

/* Logo do topo maior e mais luminoso. */
html body .topbar .brand img[data-client-logo-slot="header"] {
  height: 72px !important;
  width: auto !important;
  filter: brightness(1.25) saturate(1.12) !important;
  border-radius: 12px;
}

/* "Meus pedidos" sozinho no topo, centralizado. */
html body .topbar-controls {
  display: flex !important;
  justify-content: center !important;
  width: 100%;
}
html body .topbar .cli-entrada {
  width: min(320px, 100%) !important;
  min-height: 50px;
  justify-content: center;
  margin: 0 auto !important;
  font-size: 16px !important;
  box-shadow: 0 8px 24px rgba(239, 182, 111, .25) !important;
}

/* Aberto/fechado dentro do quadro "Horario de hoje" (o JS muda o lugar). */
html body .store-hours #statusText {
  display: inline-flex !important;
  align-self: flex-start;
  margin: 0 0 10px !important;
  width: auto !important;
}

/* Abas Marmitas / Bebidas / Porcoes: maiores e com brilho. */
html body .menu-tabs {
  gap: 10px !important;
  padding: 6px !important;
  border-color: rgba(239, 182, 111, .35) !important;
  box-shadow: 0 0 24px rgba(239, 182, 111, .12), inset 0 1px 0 rgba(255, 255, 255, .06) !important;
}
html body .menu-tabs .menu-tab {
  min-height: 58px !important;
  font-size: 16px !important;
  font-weight: 800 !important;
  color: #fbe7cc !important;
  border-width: 1.5px !important;
  border-style: solid !important;
  /* Sem !important na cor da borda e na sombra: !important vence a animacao (V3). */
  border-color: rgba(239, 182, 111, .55);
  background: linear-gradient(160deg, rgba(239, 182, 111, .22), rgba(80, 50, 25, .55)) !important;
  box-shadow: 0 0 14px rgba(239, 182, 111, .18), inset 0 1px 0 rgba(255, 255, 255, .12);
}
html body .menu-tabs .menu-tab.is-active {
  color: #1a1009 !important;
  border-color: #ffd49a !important;
  background: linear-gradient(135deg, #ffd08a, #d88a3f) !important;
  box-shadow: 0 0 22px rgba(255, 190, 110, .55), 0 6px 18px rgba(0, 0, 0, .35);
}
html body .menu-tabs .menu-tab.is-active::before { background-color: #1a1009 !important; color: #1a1009 !important; }

/* ===== MSUPTECH_LOJA_FLUXO_V3 (26/09) ===== */
/* Aberto/fechado ao lado do horario, mesma altura, caixa menor. */
.fluxo-hoje-linha {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}
html body .store-hours .fluxo-hoje-linha #statusText {
  margin: 0 !important;
  padding: 5px 12px !important;
  min-height: 0 !important;
  font-size: 13px !important;
  gap: 7px;
  align-self: center;
}
html body .store-hours .fluxo-hoje-linha #statusText::before {
  width: 8px; height: 8px; flex-basis: 8px;
  box-shadow: 0 0 0 3px rgba(248, 113, 113, .2);
}

/* Abas: brilho claro que acende e apaga devagar, sem mexer nada de lugar
   (por isso roda mesmo com "reduzir movimento": so muda a luz). */
@keyframes fluxo-aba-brilho {
  0%, 100% { box-shadow: 0 0 8px rgba(255, 214, 160, .18), inset 0 1px 0 rgba(255, 255, 255, .12); border-color: rgba(239, 182, 111, .5); }
  50%      { box-shadow: 0 0 20px rgba(255, 224, 180, .55), inset 0 0 12px rgba(255, 230, 190, .18); border-color: rgba(255, 222, 170, .95); }
}
@keyframes fluxo-aba-brilho-ativa {
  0%, 100% { box-shadow: 0 0 14px rgba(255, 190, 110, .4), 0 6px 18px rgba(0, 0, 0, .35); }
  50%      { box-shadow: 0 0 30px rgba(255, 220, 160, .85), 0 6px 18px rgba(0, 0, 0, .35); }
}
html body .menu-tabs .menu-tab {
  animation: fluxo-aba-brilho 2.6s ease-in-out infinite !important;
}
html body .menu-tabs .menu-tab.is-active {
  animation: fluxo-aba-brilho-ativa 2.6s ease-in-out infinite !important;
}

/* ===== MSUPTECH_ENDERECO_GOOGLE_V1: lista de sugestoes do endereco ===== */
.endg-caixa { position: relative; }
.endg-lista {
  list-style: none;
  margin: 6px 0 0;
  padding: 4px;
  border-radius: 12px;
  border: 1.5px solid rgba(239, 182, 111, .55);
  background: #1d1813;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .5);
  max-height: 320px;
  overflow-y: auto;
  position: absolute;
  left: 0;
  right: 0;
  margin: 0;
  z-index: 30;
}
.endg-lista[hidden] { display: none; }
.endg-lista li[data-i] {
  display: grid;
  gap: 2px;
  padding: 12px 12px;
  border-radius: 9px;
  cursor: pointer;
  color: #fbe7cc;
}
.endg-lista li[data-i] + li[data-i] { border-top: 1px solid rgba(255, 255, 255, .06); }
.endg-lista li[data-i] strong { font-size: 15px; font-weight: 800; }
.endg-lista li[data-i] span { font-size: 13px; color: #c9b69c; }
.endg-lista li[data-i]:hover,
.endg-lista li[data-i].is-marcado { background: rgba(239, 182, 111, .16); }
.endg-google { padding: 6px 12px 4px; font-size: 10px; color: #8f8578; text-align: right; }
body.theme-premium-light-contrast .endg-lista { background: #fffaf3; }
body.theme-premium-light-contrast .endg-lista li[data-i] { color: #3b2a17; }
body.theme-premium-light-contrast .endg-lista li[data-i] span { color: #7a6650; }

/* MSUPTECH_ENDERECO_GOOGLE_V2: com o Google atendendo, a frase do
   OpenStreetMap sai; se o Google falhar (html.endg-osm), ela volta. */
html.endg-carregado:not(.endg-osm) #deliveryGeocoderAttribution { display: none !important; }
