/* ============================================================================
   Amanti — app de entregas

   Folha própria, sobre os mesmos tokens da carta (tokens.css), por isso o tema
   claro e escuro continua a funcionar sem trabalho extra.

   A carta usa o azul do Instagram. Aqui a acção é comprar, e o azul de rede
   social não pertence a um botão que gasta dinheiro. As acções levam o vermelho
   da casa — uma linha, trocável.
   ========================================================================= */

:root {
  --shop-accent:      #C8102E;
  --shop-accent-ink:  #FFFFFF;
  --shop-accent-soft: rgba(200, 16, 46, .10);
  --shop-radius:      14px;
  --shop-gutter:      16px;
  --shop-max:         560px;   /* mais largo que a carta: aqui lê-se em linha */
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --shop-accent:      #FF4D5F;
    --shop-accent-soft: rgba(255, 77, 95, .14);
  }
}
:root[data-theme="dark"] {
  --shop-accent:      #FF4D5F;
  --shop-accent-soft: rgba(255, 77, 95, .14);
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }

html { -webkit-text-size-adjust: 100%; }

body.shop, body.gatebody {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 15px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}
body.shop { padding-bottom: 96px; }   /* folga para a barra do carrinho */

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--shop-accent); outline-offset: 2px; border-radius: 6px; }

.muted { color: var(--text-2); }

/* ---------------------------------------------------------------- cabeçalho */

.shead {
  position: sticky; top: 0; z-index: 50;
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}
.shead__top {
  max-width: var(--shop-max); margin: 0 auto;
  padding: 10px var(--shop-gutter);
  display: flex; align-items: center; gap: 12px;
}
.shead__brand { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.shead__name {
  font-size: 17px; font-weight: 700; letter-spacing: -.02em;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
/* O estado abre com um ponto: verde aberto, cinzento fechado. A cor não é a
   única portadora — o texto diz sempre "Aberto" ou "Fechado". */
.shead__state {
  display: flex; align-items: center; gap: 6px;
  font-size: 12px; color: var(--text-2);
}
.shead__state::before {
  content: ''; width: 7px; height: 7px; border-radius: 50%;
  background: var(--text-2); flex: none;
}
.shead__state.is-open::before { background: #2E9E4F; }

.shead__acts { margin-left: auto; display: flex; align-items: center; gap: 4px; }

.icon-btn {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 50%; color: var(--text);
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }

.shead__cart { position: relative; }
.shead__badge {
  position: absolute; top: 2px; right: 0;
  min-width: 17px; height: 17px; padding: 0 4px;
  display: grid; place-items: center;
  background: var(--shop-accent); color: var(--shop-accent-ink);
  font-size: 10px; font-weight: 700; line-height: 1;
  border-radius: 9px;
}

/* selector de idioma — herda a forma da carta */
.lang { position: relative; }
.lang__current {
  height: 30px; padding: 0 10px;
  display: flex; align-items: center; gap: 5px;
  border: 1px solid var(--border); border-radius: 15px;
  font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .04em;
}
.lang__current svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2.2; }
.lang__menu {
  position: absolute; top: calc(100% + 8px); right: 0; z-index: 60;
  min-width: 150px; padding: 6px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--shop-radius);
  box-shadow: 0 6px 24px rgba(0,0,0,.18);
}
.lang__menu a { display: flex; justify-content: space-between; padding: 9px 10px; border-radius: 8px; }
.lang__menu a:hover { background: var(--surface-2); }
.lang__menu a[aria-current="true"] { font-weight: 600; color: var(--shop-accent); }

/* ---------------------------------------------------------------- conteúdo */

.shop__main { max-width: var(--shop-max); margin: 0 auto; padding: 0 var(--shop-gutter); }

.snotice {
  margin: 14px 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--shop-radius);
  font-size: 13px;
  display: flex; flex-direction: column; gap: 2px;
}
.snotice--warn { background: var(--shop-accent-soft); }
.snotice strong { font-size: 14px; }

/* ---- entrega ou balcão ---- */

.stoggle {
  display: flex; gap: 8px;
  margin: 14px 0;
}
.stoggle button {
  flex: 1;
  padding: 11px 10px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  border: 1px solid var(--border); border-radius: var(--shop-radius);
  font-size: 14px; font-weight: 600;
}
.stoggle button.is-active {
  border-color: var(--shop-accent);
  background: var(--shop-accent-soft);
  color: var(--shop-accent);
}
.stoggle__eta { font-size: 11px; font-weight: 500; color: var(--text-2); }
.stoggle button.is-active .stoggle__eta { color: inherit; opacity: .8; }

/* ---- pesquisa ---- */

.ssearch {
  position: relative;
  margin: 4px 0 12px;
}
.ssearch svg {
  position: absolute; left: 13px; top: 50%; transform: translateY(-50%);
  width: 18px; height: 18px; pointer-events: none;
  fill: none; stroke: var(--text-2); stroke-width: 1.9; stroke-linecap: round;
}
.ssearch input {
  width: 100%; padding: 12px 14px 12px 40px;
  background: var(--surface-2); color: var(--text);
  border: 1px solid transparent; border-radius: 12px;
  font: inherit;
}
.ssearch input:focus { outline: none; border-color: var(--shop-accent); background: var(--surface); }
.ssearch input::-webkit-search-cancel-button { cursor: pointer; }

/* ---- separadores de categoria ---- */

.stabs {
  position: sticky; top: 59px; z-index: 40;
  margin: 0 calc(var(--shop-gutter) * -1);
  padding: 6px 0;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  overflow-x: auto;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}
.stabs::-webkit-scrollbar { display: none; }
.stabs__track { display: flex; gap: 6px; padding: 0 var(--shop-gutter); width: max-content; }
.stabs a {
  flex: none;
  padding: 8px 14px;
  border-radius: 18px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  color: var(--text-2);
  background: var(--surface-2);
}
.stabs a.is-active { background: var(--shop-accent); color: var(--shop-accent-ink); }

.snoresults { padding: 40px 0; text-align: center; color: var(--text-2); }

/* ---- secções e linhas ---- */

.scat { scroll-margin-top: 108px; }   /* para o cabeçalho fixo não tapar o título */
.scat__title {
  margin: 26px 0 6px;
  font-size: 19px; font-weight: 700; letter-spacing: -.02em;
}

.srows { list-style: none; margin: 0; padding: 0; }

/* A linha: miniatura à esquerda, texto corrido, preço, botão de juntar.
   É o padrão das apps de entrega e existe por uma razão — cabem seis pratos
   num ecrã em vez de um, e o olho percorre-os em coluna. */
.srow {
  position: relative;
  display: flex; align-items: stretch;
  border-bottom: 1px solid var(--border);
}
.srow:last-child { border-bottom: 0; }

.srow__open {
  flex: 1; min-width: 0;
  display: flex; gap: 13px; align-items: flex-start;
  padding: 14px 44px 14px 0;   /* folga à direita para o botão de juntar */
  text-align: left;
}

.srow__thumb { flex: none; width: 88px; height: 88px; }
.srow__thumb img {
  width: 88px; height: 88px;
  object-fit: cover;
  border-radius: 10px;
  background: var(--surface-2);
}
/* Sem fotografia: a cor da categoria e a inicial. Os 16 pratos sem foto não
   podem ser dezasseis buracos cinzentos numa lista de setenta e sete. */
.srow__noimg {
  width: 88px; height: 88px;
  display: grid; place-items: center;
  border-radius: 10px;
  background: var(--dc-bg, var(--surface-2));
  color: var(--dc-ink, var(--text-2));
  font-size: 30px; font-weight: 700;
}

.srow__body { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.srow__name { font-size: 15px; font-weight: 600; line-height: 1.3; }

/* Duas linhas de descrição e corta. Três começam a competir com a fotografia
   e a lista deixa de se percorrer de relance. */
.srow__desc {
  font-size: 13px; line-height: 1.4; color: var(--text-2);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
}
.srow__price {
  margin-top: 2px;
  font-size: 15px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.srow__add {
  position: absolute; right: 0; bottom: 16px;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 50%;
  background: var(--surface);
  color: var(--shop-accent);
  transition: background .15s ease, color .15s ease, transform .15s ease;
}
.srow__add svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2.4; stroke-linecap: round; }
.srow__add:hover { background: var(--shop-accent-soft); }
.srow__add.is-added {
  background: var(--shop-accent); color: var(--shop-accent-ink);
  border-color: var(--shop-accent);
  transform: scale(1.12);
}

/* ---------------------------------------------------------- ficha do prato */

.isheet { position: fixed; inset: 0; z-index: 100; }
.isheet__backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.isheet__panel {
  position: absolute; left: 0; right: 0; bottom: 0;
  max-width: var(--shop-max); margin: 0 auto;
  max-height: 90vh; overflow-y: auto;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  animation: isheet-up .22s ease;
}
@keyframes isheet-up { from { transform: translateY(100%); } }
@media (prefers-reduced-motion: reduce) { .isheet__panel { animation: none; } }

.isheet__x {
  position: absolute; top: 12px; right: 12px; z-index: 2;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: var(--surface); color: var(--text);
  box-shadow: 0 1px 6px rgba(0,0,0,.2);
}
.isheet__x svg { width: 18px; height: 18px; }

.isheet__media img { width: 100%; aspect-ratio: 4/3; object-fit: cover; }
.isheet__body { padding: 18px var(--shop-gutter) 0; }
.isheet__body h2 { margin: 0 0 6px; font-size: 20px; letter-spacing: -.02em; }
.isheet__desc { margin: 0 0 16px; color: var(--text-2); }

.isheet__notes { display: flex; flex-direction: column; gap: 6px; }
.isheet__notes span { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.isheet__notes input {
  width: 100%; padding: 11px 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font: inherit;
}
.isheet__notes input:focus { outline: 2px solid var(--shop-accent); outline-offset: 1px; border-color: transparent; }

.isheet__foot {
  position: sticky; bottom: 0;
  display: flex; align-items: center; gap: 12px;
  padding: 16px var(--shop-gutter);
  padding-bottom: calc(16px + env(safe-area-inset-bottom));
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 18px;
}
.isheet__add { flex: 1; }

.qty { display: flex; align-items: center; gap: 2px; flex: none; }
.qty button {
  width: 36px; height: 36px;
  display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 9px;
  font-size: 18px; line-height: 1;
}
.qty button:hover { background: var(--surface-2); }
.qty span { min-width: 28px; text-align: center; font-weight: 600; font-variant-numeric: tabular-nums; }

/* --------------------------------------------------------- barra do pedido

   Duas metades, porque são duas intenções: ver o que já se escolheu, ou ir
   direito ao fim sem passar pela lista. A linha entre elas é o que diz que são
   dois alvos e não um. */

.cartbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  max-width: var(--shop-max); margin: 0 auto;
  display: flex; align-items: stretch;
  padding: 0 var(--shop-gutter);
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--shop-accent); color: var(--shop-accent-ink);
  font-weight: 700;
  border-radius: var(--shop-radius) var(--shop-radius) 0 0;
  box-shadow: 0 -3px 18px rgba(0,0,0,.18);
}

.cartbar__see {
  flex: 1;
  display: flex; align-items: center; gap: 12px;
  /* Alvo alto: isto toca-se com o polegar, muitas vezes em andamento. */
  min-height: 56px;
  padding: 8px 0;
  color: inherit;
}
.cartbar__n {
  min-width: 24px; height: 24px; padding: 0 6px;
  display: grid; place-items: center;
  background: rgba(255,255,255,.25);
  border-radius: 12px; font-size: 13px;
}
.cartbar__label { flex: 1; }
.cartbar__total { font-variant-numeric: tabular-nums; }

.cartbar__go,
.cartbar__falta {
  display: flex; align-items: center;
  margin-left: 14px; padding: 8px 0 8px 14px;
  border-left: 1px solid rgba(255,255,255,.3);
  color: inherit; white-space: nowrap;
}
.cartbar__go { text-decoration: underline; text-underline-offset: 4px; }
.cartbar__go:active { opacity: .7; }

/* Abaixo do mínimo não há atalho: no lugar dele fica o que falta. */
.cartbar__falta {
  font-weight: 600; font-size: 13px;
  opacity: .85;
  font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------- mínimo por atingir

   Não é um erro: é uma conta que ainda não fecha, e tem de dizer o que falta e
   como sair dali. Por isso não usa o vermelho de `.form__error`. */

.minbox {
  margin-top: 14px;
  padding: 14px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 12px;
}
.minbox__falta {
  margin: 0;
  font-size: 16px; font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.minbox__diz {
  margin: 5px 0 0;
  font-size: 13.5px; color: var(--text-2); line-height: 1.45;
}
.minbox__acts {
  display: flex; flex-wrap: wrap; gap: 9px;
  margin-top: 12px;
}
.minbox__acts .btn { flex: 1 1 auto; padding: 11px 16px; font-size: 14px; }

.shop__foot {
  max-width: var(--shop-max); margin: 0 auto;
  padding: 28px var(--shop-gutter) 40px;
  text-align: center;
}
.shop__foot a { font-size: 13px; color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }

/* ---------------------------------------------------------- ecrã de escolha */

body.gatebody { min-height: 100dvh; display: flex; flex-direction: column; }
.gate__top { display: flex; justify-content: flex-end; gap: 4px; padding: 12px 16px; }

.gate {
  flex: 1;
  max-width: 420px; width: 100%; margin: 0 auto;
  padding: 0 20px 40px;
  display: flex; flex-direction: column; justify-content: center; gap: 34px;
}
.gate__brand { text-align: center; }
.gate__brand h1 { margin: 0 0 6px; font-size: 27px; letter-spacing: -.03em; line-height: 1.15; }
.gate__brand p { margin: 0; color: var(--text-2); }

.gate__doors { display: flex; flex-direction: column; gap: 12px; }
.gate__door {
  display: flex; flex-direction: column; gap: 3px;
  padding: 20px;
  border: 1px solid var(--border); border-radius: 18px;
  background: var(--surface);
  transition: border-color .15s ease, transform .15s ease;
}
.gate__door svg {
  width: 26px; height: 26px; margin-bottom: 6px;
  fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round;
}
.gate__door strong { font-size: 17px; }
.gate__door span { font-size: 13px; color: var(--text-2); }
.gate__door:hover { border-color: var(--text-2); }
.gate__door:active { transform: scale(.99); }

.gate__door--primary {
  border-color: var(--shop-accent);
  background: var(--shop-accent);
  color: var(--shop-accent-ink);
}
.gate__door--primary span { color: rgba(255,255,255,.85); }
.gate__door--primary:hover { border-color: var(--shop-accent); }

/* ------------------------------------------------- carrinho e finalização */

.cart, .order { padding: 16px 0 20px; }
.page-title h1 { margin: 6px 0 16px; font-size: 23px; letter-spacing: -.02em; }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--shop-radius);
  padding: 18px;
  margin-bottom: 14px;
  display: flex; flex-direction: column; gap: 16px;
}

.notice { padding: 14px; border-radius: var(--shop-radius); background: var(--surface-2); margin-bottom: 14px; }
.notice--warn { background: var(--shop-accent-soft); }
.notice p { margin: 4px 0 0; font-size: 13px; }
.small { font-size: 12px; }

.cartlist { list-style: none; margin: 0; padding: 0; }
.cartline { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.cartline:last-child { border-bottom: 0; }
.cartline__info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.cartline__note { font-size: 12px; color: var(--text-2); }
.cartline__total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }

.totals { margin: 6px 0 0; padding-top: 12px; border-top: 1px solid var(--border); }
.totals > div { display: flex; justify-content: space-between; padding: 3px 0; }
.totals dt { color: var(--text-2); }
.totals dd { margin: 0; font-variant-numeric: tabular-nums; }
.totals__grand { margin-top: 6px; padding-top: 8px; border-top: 1px solid var(--border); }
.totals__grand dt, .totals__grand dd { font-size: 17px; font-weight: 700; color: var(--text); }

.form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field__label { font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: .05em; color: var(--text-2); }
.field__hint { font-size: 12px; color: var(--text-2); }
.field input {
  width: 100%; padding: 12px;
  background: var(--bg); color: var(--text);
  border: 1px solid var(--border); border-radius: 10px;
  font: inherit;
}
.field input:focus { outline: 2px solid var(--shop-accent); outline-offset: 1px; border-color: transparent; }
.field-row { display: flex; gap: 10px; }
.field-row .field { flex: 1; min-width: 0; }

.seg { border: 0; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; }
.seg legend { padding: 0; margin-bottom: 2px; }
.seg__opt {
  display: flex; align-items: center; gap: 10px;
  padding: 13px 14px;
  border: 1px solid var(--border); border-radius: 12px;
  cursor: pointer;
}
.seg__opt input { width: 18px; height: 18px; flex: none; accent-color: var(--shop-accent); }
.seg__opt:has(input:checked) { border-color: var(--shop-accent); background: var(--shop-accent-soft); }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px;
  border-radius: 12px;
  font-weight: 700; font-size: 15px;
  transition: opacity .15s ease;
}
.btn--primary { background: var(--shop-accent); color: var(--shop-accent-ink); }
.btn--ghost { border: 1px solid var(--border); color: var(--text); }
.btn--full { width: 100%; }
.btn:disabled { opacity: .45; cursor: not-allowed; }

.form__error {
  margin: 0; padding: 11px 13px;
  background: var(--shop-accent-soft); color: var(--shop-accent);
  border-radius: 10px; font-size: 13px;
}
.sheet__empty { padding: 30px 0; text-align: center; color: var(--text-2); }
.sheet__notice { padding: 16px 0; text-align: center; }
.honeypot { position: absolute; left: -9999px; }

/* ---- estado da encomenda ---- */

.order__ref { margin: 0; font-size: 15px; }
.order__ref strong { font-size: 20px; letter-spacing: .07em; }
.order__eta { margin: 0; color: var(--text-2); }

.steps { list-style: none; display: flex; margin: 6px 0; padding: 0; }
.steps li { flex: 1; position: relative; text-align: center; font-size: 11px; color: var(--text-2); }
.steps li span {
  display: block; width: 14px; height: 14px; margin: 0 auto 7px;
  border: 2px solid var(--border); border-radius: 50%;
  background: var(--surface); position: relative; z-index: 1;
}
.steps li::before {
  content: ''; position: absolute; top: 7px; left: -50%; width: 100%; height: 2px;
  background: var(--border);
}
.steps li:first-child::before { display: none; }
.steps li.is-done span { border-color: var(--shop-accent); background: var(--shop-accent); }
.steps li.is-done::before { background: var(--shop-accent); }
.steps li.is-now { color: var(--text); font-weight: 700; }

/* Prato que nao sai da casa no modo escolhido. Fica visivel, mas apagado e
   sem botao: escondê-lo faria o cliente pensar que nao ha gelados e telefonar
   a perguntar. */
.srow.is-off .srow__thumb,
.srow.is-off .srow__name,
.srow.is-off .srow__desc,
.srow.is-off .srow__price { opacity: .45; }

.srow__flag {
  display: inline-block;
  margin-top: 4px;
  padding: 2px 8px;
  border-radius: 10px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 11px; font-weight: 600;
}

.isheet__flag {
  flex: 1; margin: 0;
  font-size: 13px; font-weight: 600;
  color: var(--text-2); text-align: center;
}

/* Encomendas em curso deste aparelho. Fica no topo porque quem tem uma
   encomenda a caminho abre a app para saber dela, nao para encomendar outra. */
.smine { display: flex; flex-direction: column; gap: 8px; margin: 14px 0; }
.smine__row {
  display: flex; align-items: center; gap: 10px;
  padding: 12px 14px;
  border: 1px solid var(--shop-accent);
  background: var(--shop-accent-soft);
  border-radius: var(--shop-radius);
}
.smine__ref { font-weight: 700; letter-spacing: .05em; }
.smine__state { flex: 1; font-size: 13px; color: var(--text-2); }
.smine__go { color: var(--shop-accent); font-size: 20px; line-height: 1; }

/* Saudacao a quem ja encomendou neste aparelho. Discreta: e para confirmar
   dados, nao para celebrar o regresso. */
.welcome {
  margin: 0;
  padding: 11px 13px;
  background: var(--shop-accent-soft);
  border-radius: 10px;
  font-size: 13px;
}
