/* Página de pedidos (lista de produtos) — mobile. */
:root {
  --color-secondary: #FFB347;
  --color-secondary-light: #FFD27A;
  --color-secondary-dark: #F28C3A;
  --color-secondary-glow: rgba(255, 179, 71, 0.35);
  --sobre-secundaria: #2a0f3d; /* texto/ícone sobre o âmbar (contraste) */
  --violeta-noite: 22 9 36;
  --texto: #fff;
  --texto-2: rgba(255, 255, 255, 0.74);
  --texto-3: rgba(255, 255, 255, 0.54);
  --borda: rgba(255, 255, 255, 0.12);
  --raio: 20px;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 108px; }
body {
  margin: 0;
  min-height: 100dvh;
  background: #1a0b2a;
  color: var(--texto);
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}
/* Background fornecido (página de pedidos), fixo e cobrindo a tela; overlay só em CSS. */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background:
    linear-gradient(180deg, rgba(14, 5, 24, 0.1) 0%, rgba(14, 5, 24, 0.35) 100%),
    url('/assets/img/fundos/fundo-pagina-pedidos.webp') center top / cover no-repeat;
}
/* Notebook/computador: fundo próprio (paisagem). */
@media (min-width: 701px) {
  body::before {
    background:
      linear-gradient(180deg, rgba(14, 5, 24, 0.1) 0%, rgba(14, 5, 24, 0.35) 100%),
      url('/assets/img/fundos/fundo-pedidos-notebook.webp') center / cover no-repeat;
  }
}
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--color-secondary); outline-offset: 2px; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}

.tela { position: relative; max-width: 480px; margin: 0 auto; padding-bottom: calc(32px + env(safe-area-inset-bottom)); }

/* ---------- Barra de status (visual) ---------- */
.status {
  height: 44px;
  padding: 0 26px 0 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
}
.status__icones { display: flex; align-items: center; gap: 6px; }
.status__icones svg { fill: currentColor; }

/* ---------- Topo ---------- */
/* O nome fica só para leitores de tela; o carrinho mora no cabeçalho fixo. */
.topo { position: absolute; }
.topo__marca { display: flex; align-items: center; gap: 12px; min-width: 0; }
.topo__logo { width: 44px; height: 44px; border-radius: 50%; object-fit: contain; }
.sr { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.topo__ola { margin: 0; font-size: 13px; color: var(--texto-2); }
.topo__nome { margin: 1px 0 0; font-size: 24px; line-height: 1.15; font-weight: 800; letter-spacing: -0.01em; }
.btn-circ {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--borda);
  background: rgba(var(--violeta-noite) / 0.45);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.12);
  cursor: pointer;
}

/* ---------- Cabeçalho fixo (status + categorias) ----------
   Uma só faixa de cor cobrindo a barra de status e as abas. */
.cabecalho {
  position: sticky;
  top: 0;
  z-index: 4;
  background: linear-gradient(180deg, rgba(74, 24, 118, 0.92) 0%, rgba(58, 17, 96, 0.92) 100%);
  -webkit-backdrop-filter: blur(18px);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.12);
  box-shadow: 0 8px 24px rgba(10, 3, 20, 0.25);
}
/* Linha do cabeçalho: logo à esquerda + abas. */
.cabecalho__linha { display: flex; align-items: center; gap: 4px; padding-left: 16px; }
.cabecalho__inicio { flex: none; display: block; margin-bottom: 4px; border-radius: 50%; transition: transform 0.15s; }
.cabecalho__inicio:active { transform: scale(0.94); }
.cabecalho__logo { display: block; width: 38px; height: 38px; object-fit: contain; }
/* Carrinho à direita das abas, sempre visível ao rolar. */
.cabecalho__carrinho { margin: 0 8px 4px 0; }
/* Abas de texto, sem cápsula: a ativa fica em âmbar com um traço afastado do pé do cabeçalho. */
.cats {
  display: flex;
  flex: 1;
  min-width: 0;
  gap: 22px;
  padding: 0 20px 0 12px;
  overflow-x: auto;
  scrollbar-width: none;
}
.cats::-webkit-scrollbar { display: none; }
.cat {
  position: relative;
  flex: none;
  height: 52px;
  padding-bottom: 10px;
  display: inline-flex;
  align-items: center;
  font-size: 14.5px;
  font-weight: 600;
  color: var(--texto-2);
  white-space: nowrap;
  transition: color 0.15s;
}
.cat::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 10px;
  height: 3px;
  border-radius: 3px;
  background: var(--color-secondary);
  transform: scaleX(0);
  transition: transform 0.2s;
}
.cat:hover { color: var(--texto); }
.cat--ativa { color: var(--texto); } /* âmbar só no traço da aba ativa */
.cat--ativa::after { transform: scaleX(1); }

/* ---------- Seções ---------- */
.secao { padding: 22px 0 4px; }
.secao__titulo { margin: 0 20px 12px; font-size: 19px; font-weight: 800; letter-spacing: -0.01em; }
.lista { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.carrossel {
  display: flex;
  gap: 10px;
  padding: 2px 16px 6px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-padding: 0 16px;
  scrollbar-width: none;
}
.carrossel::-webkit-scrollbar { display: none; }

/* ---------- Card do produto: vidro fosco sobre o background ----------
   Fundo bem translúcido + blur forte: o background aparece embaçado por trás do card. */
.item {
  position: relative;
  display: flex;
  align-items: stretch;
  gap: 12px;
  min-height: 128px;
  padding: 14px 14px 14px 16px;
  border-radius: var(--raio);
  border: 1px solid rgba(255, 255, 255, 0.24);
  /* Vidro transparente: quase sem preenchimento; o fundo aparece por trás só levemente desfocado. */
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 55%, rgba(255, 255, 255, 0.01) 100%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  backdrop-filter: blur(10px) saturate(130%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.32),
    inset 0 -1px 0 rgba(255, 255, 255, 0.06),
    0 10px 30px rgba(8, 2, 16, 0.18);
  transition: transform 0.15s, border-color 0.15s;
  overflow: hidden; /* o halo do copo não vaza do card */
  isolation: isolate;
}
a.item { cursor: pointer; }
a.item:active { transform: scale(0.985); }
a.item:hover { border-color: rgba(255, 179, 71, 0.45); }
.item--destaque { flex: none; width: 84%; scroll-snap-align: start; }

.item__texto { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.item__nome { margin: 0; font-size: 15.5px; line-height: 1.3; font-weight: 600; }
.item__desc {
  margin: 6px 0 0;
  font-size: 13px;
  line-height: 1.4;
  color: var(--texto-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item__preco { margin: auto 0 0; padding-top: 10px; font-size: 13px; color: var(--texto-3); }
.item__preco strong { font-size: 16px; font-weight: 700; color: var(--texto); }
.item__preco strong.promo { color: var(--color-secondary); }
.item__preco s { margin-left: 4px; text-decoration-color: var(--color-secondary); text-decoration-thickness: 1.5px; }

/* Miniatura do copo + halo âmbar atrás dele (só CSS; a imagem não é alterada).
   Duas camadas: ::before = centro luminoso; ::after = dispersão ampla que se mistura ao roxo. */
.item__miniatura {
  position: relative;
  z-index: 2;
  flex: none;
  width: 92px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.item__miniatura::before {
  content: '';
  position: absolute;
  z-index: -1;
  left: 50%;
  top: 58%;
  transform: translate(-50%, -50%);
  /* Luz forte e larga na cor de destaque (175 % do copo): tem que aparecer nitidamente sobre o fundo escuro. Não enfraqueça. */
  width: 175%;
  height: 130%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 210, 122, 0.78) 0%,
    rgba(255, 179, 71, 0.52) 28%,
    rgba(242, 140, 58, 0.24) 50%,
    rgba(242, 140, 58, 0.07) 67%,
    rgba(242, 140, 58, 0) 80%
  );
  filter: blur(18px);
  pointer-events: none;
}
.item__miniatura::after {
  content: '';
  position: absolute;
  z-index: -2;
  left: 50%;
  top: 62%;
  transform: translate(-50%, -50%);
  /* Halo externo (230 % do copo). */
  width: 230%;
  height: 170%;
  background: radial-gradient(
    ellipse at center,
    rgba(255, 179, 71, 0.34) 0%,
    rgba(242, 140, 58, 0.16) 42%,
    rgba(242, 140, 58, 0) 74%
  );
  filter: blur(30px);
  pointer-events: none;
}
.item__foto {
  position: relative;
  z-index: 2;
  height: 108px;
  width: auto;
  object-fit: contain;
  filter:
    drop-shadow(0 16px 12px rgba(29, 5, 42, 0.38))
    drop-shadow(0 3px 5px rgba(255, 179, 71, 0.06));
}

/* Sem foto ainda: mesmo espaço da miniatura, com ícone de foto. */
.item__miniatura--vazia {
  align-self: center;
  height: 92px;
  border-radius: 16px;
  border: 1px dashed rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.05);
  color: rgba(255, 255, 255, 0.45);
}
.item__miniatura--vazia::before,
.item__miniatura--vazia::after { content: none; }

/* ---------- Telas maiores (tablet e notebook) ----------
   O celular continua igual. A partir de 720px a página usa a largura: cabeçalho de ponta a ponta,
   conteúdo centralizado até 1200px e cards em grade (listas 2 × 2; destaques em 3 colunas no notebook). */
@media (min-width: 720px) {
  .tela { max-width: 1200px; padding: 0 32px calc(48px + env(safe-area-inset-bottom)); }
  .status { display: none; }

  /* Cabeçalho ocupa a largura toda; o conteúdo dele acompanha a coluna central. */
  .cabecalho { margin: 0 calc(50% - 50vw); }
  .cabecalho__linha { max-width: 1200px; margin: 0 auto; padding: 0 32px; gap: 8px; }
  .cabecalho__logo { width: 44px; height: 44px; }
  .cabecalho__inicio { margin-bottom: 0; }
  .cats { gap: 32px; padding: 0 0 0 16px; overflow: visible; }
  .cat { height: 72px; padding-bottom: 0; font-size: 16px; }
  .cat::after { bottom: 14px; }

  .cabecalho__carrinho { margin: 0 -10px 0 0; }
  .btn-circ { width: 48px; height: 48px; }

  .secao { padding: 32px 0 8px; scroll-margin-top: 80px; }
  .secao__titulo { margin: 0 0 18px; font-size: 24px; }
  .lista,
  .carrossel {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
    padding: 0;
    overflow: visible;
  }
  .item--destaque { width: auto; }
  .item { min-height: 150px; padding: 18px 18px 18px 20px; }
  .item__nome { font-size: 16.5px; }
  .item__desc { font-size: 14px; }
  .item__preco strong { font-size: 17px; }
  .item__miniatura { width: 104px; }
  .item__foto { height: 124px; }
}
/* Destaques (3 itens) em 3 colunas; as listas de 4 itens ficam em 2 × 2, sem card sobrando sozinho. */
@media (min-width: 1100px) {
  .carrossel { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

/* ---------- Janela do produto (notebook) ----------
   Abre sobre o cardápio escurecido; dentro dela, a própria tela do produto em modo janela. */
.janela {
  width: min(820px, calc(100vw - 64px));
  height: min(880px, calc(100vh - 64px));
  max-width: none;
  max-height: none;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 28px;
  overflow: hidden;
  background: #1a0b2a;
  color: var(--texto);
  box-shadow: 0 30px 80px rgba(8, 2, 16, 0.55), inset 0 1px 0 rgba(255, 255, 255, 0.32);
}
.janela::backdrop {
  background: rgba(14, 5, 24, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.janela[open] { animation: janela-entra 0.22s ease-out; }
@keyframes janela-entra { from { opacity: 0; transform: translateY(14px) scale(0.98); } to { opacity: 1; transform: none; } }
.janela__quadro { display: block; width: 100%; height: 100%; border: 0; background: #1a0b2a; }
/* Fechar: botão redondo com o mesmo vidro dos cards. */
.janela__fechar {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  padding: 0;
  border-radius: 50%;
  cursor: pointer;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  background: linear-gradient(135deg, rgba(255, 255, 255, 0.14) 0%, rgba(255, 255, 255, 0.05) 100%);
  -webkit-backdrop-filter: blur(10px) saturate(130%);
  backdrop-filter: blur(10px) saturate(130%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.32), 0 8px 20px rgba(8, 2, 16, 0.3);
}
.janela__fechar:hover { border-color: rgba(255, 179, 71, 0.45); }
.com-janela { overflow: hidden; } /* o cardápio não rola por trás da janela */
@media (prefers-reduced-motion: reduce) { .janela[open] { animation: none; } }

/* Celular: rolagem sem barra visível (o dedo/roda continuam rolando). */
@media (max-width: 900px) {
  html { scrollbar-width: none; }
  html::-webkit-scrollbar { display: none; }
}

/* ---------- Carrinho: contador, "+" das bebidas, barra "Ver pedido" e aviso ---------- */
.btn-circ { position: relative; color: inherit; }
.btn-circ__badge {
  position: absolute;
  top: -3px;
  right: -3px;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--color-secondary);
  color: var(--sobre-secundaria);
  font-size: 11px;
  font-weight: 800;
  line-height: 18px;
  text-align: center;
}
.item__add {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  color: var(--sobre-secundaria);
  background: linear-gradient(135deg, #FFD27A 0%, #FFB347 58%, #F5A13C 100%);
  box-shadow: 0 6px 14px rgba(255, 179, 71, 0.25);
  transition: transform 0.15s;
}
.item__add:active { transform: scale(0.92); }

.barra-pedido {
  position: fixed;
  left: 50%;
  bottom: calc(14px + env(safe-area-inset-bottom));
  z-index: 6;
  transform: translateX(-50%);
  width: min(calc(100% - 32px), 520px);
  min-height: 56px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 22px;
  border-radius: 999px;
  font-size: 15.5px;
  font-weight: 700;
  color: var(--sobre-secundaria);
  background: linear-gradient(135deg, #FFD27A 0%, #FFB347 58%, #F5A13C 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.35), 0 10px 28px rgba(10, 3, 20, 0.45);
}
.barra-pedido[hidden] { display: none; }
.com-barra .tela { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

.aviso {
  position: fixed;
  left: 50%;
  top: 18px;
  z-index: 50;
  transform: translate(-50%, -20px);
  max-width: calc(100% - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  background: rgba(42, 15, 61, 0.92);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow: 0 10px 28px rgba(8, 2, 16, 0.45);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s, transform 0.2s;
}
.aviso--visivel { opacity: 1; transform: translate(-50%, 0); }

/* Carrinho sem o círculo de fundo: só o ícone (com sombra leve para ler sobre qualquer fundo) e o contador. */
.btn-circ:has([data-carrinho-qtd]) {
  border: 0;
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.btn-circ:has([data-carrinho-qtd]) svg { width: 26px; height: 26px; filter: drop-shadow(0 2px 4px rgba(10, 3, 20, 0.45)); }
.btn-circ:has([data-carrinho-qtd]) .btn-circ__badge { top: 1px; right: 0; }
