:root {
  --background: #ffffff;
  --band: #f5f2ed;
  --ink: #1f1a16;
  --muted: #6f655c;
  --line: #ece6de;
  --line-strong: #d9d0c4;
  --brand: #8a3417;
  --brand-pressed: #6e2810;
  --brand-tint: #f7ece5;
  --ok: #2e7d4f;
  --ok-tint: #e3f1e8;
  --danger: #b3261e;
  --danger-tint: #f8e1de;
  --font: "Figtree", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --radius: 12px;
  --radius-control: 10px;
  --page-width: 600px;
  --gutter: 16px;
  color-scheme: light;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--background);
  color: var(--ink);
  font: 400 1rem/1.5 var(--font);
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
}

button, input { font: inherit; color: inherit; }

[hidden] { display: none !important; }

a { color: var(--brand); }

.icon-sprite { position: absolute; }

.app-bar,
.store,
.progress,
.page { max-width: var(--page-width); margin: 0 auto; }

.app-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px var(--gutter);
}

.app-bar__church {
  min-width: 0;
  overflow: hidden;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.app-bar__orders {
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: none;
  color: var(--brand);
  font-weight: 700;
  white-space: nowrap;
  cursor: pointer;
}

.store__cover { display: block; width: 100%; height: auto; }

.store__info { padding: 16px var(--gutter) 20px; }

.store__name { margin: 0 0 10px; font-size: 1.6rem; font-weight: 700; line-height: 1.15; letter-spacing: -0.01em; }

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

.info-list__row {
  display: grid;
  grid-template-columns: 20px 1fr auto;
  align-items: start;
  gap: 12px;
  padding: 6px 0;
  font-size: 0.95rem;
}

.info-list__row svg { margin-top: 2px; color: var(--brand); }

.info-list__action { font-weight: 700; text-decoration: none; white-space: nowrap; }

.progress {
  position: sticky;
  top: 0;
  z-index: 5;
  padding: 10px var(--gutter) 0;
  background: var(--background);
  border-top: 8px solid var(--band);
  border-bottom: 1px solid var(--line);
}

.progress__row { display: flex; align-items: center; gap: 6px; min-height: 32px; }

.progress__back {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  margin-left: -8px;
  border: 0;
  background: none;
  color: var(--brand);
  cursor: pointer;
}

.progress__label { margin: 0; font-size: 0.95rem; color: var(--muted); }

.progress__label strong { color: var(--ink); font-weight: 700; }

.progress__track { display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; padding: 8px 0 10px; }

.progress__track span { height: 4px; border-radius: 2px; background: var(--line); }

.progress__track span.is-reached { background: var(--brand); }

.page { padding: 0 var(--gutter) 24px; }

.step__title { margin: 20px 0 4px; font-size: 1.35rem; font-weight: 700; line-height: 1.2; }

.step__hint { margin: 0 0 4px; color: var(--muted); font-size: 0.95rem; }

.dish {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}

.dish:last-child { border-bottom: 0; }

.dish__name { margin: 0; font-size: 1.05rem; font-weight: 600; }

.dish__description { margin: 4px 0 10px; color: var(--muted); font-size: 0.92rem; }

.dish__price { margin: 0; font-weight: 600; }

.dish__photo {
  display: block;
  width: 120px;
  height: 120px;
  object-fit: cover;
  border-radius: var(--radius);
  background: var(--band);
}

.quantity {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 44px;
  margin-top: 8px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--background);
}

.quantity__button {
  display: grid;
  place-items: center;
  width: 44px;
  height: 100%;
  border: 0;
  background: none;
  color: var(--brand);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.quantity__button:disabled { color: var(--line-strong); }

.quantity__count { flex: 1; text-align: center; font-weight: 700; }

.quantity__add-label { display: none; }

.quantity--empty { border-color: var(--brand); background: var(--brand); }

.quantity--empty .quantity__minus,
.quantity--empty .quantity__count { display: none; }

.quantity--empty .quantity__plus {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  width: 100%;
  color: #fff;
}

.quantity--empty .quantity__add-label { display: inline; font-size: 0.95rem; font-weight: 700; }

.block-title { margin: 0 0 8px; font-size: 1.05rem; font-weight: 700; }

.card {
  margin: 16px 0 0;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--background);
}

.card__line { margin: 0 0 4px; }

.card__line--muted { color: var(--muted); font-size: 0.95rem; }

.customer-form { display: grid; gap: 14px; }

.page .customer-form { margin: 24px 0; }

.field { display: grid; gap: 6px; }

.field__label { font-size: 0.95rem; font-weight: 600; }

.field__input {
  width: 100%;
  height: 54px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-control);
  background: var(--background);
  font-size: 1.05rem;
}

.field__input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-tint); }

.field__input[aria-invalid="true"] { border-color: var(--danger); }

.field__error,
.form-error { margin: 0; color: var(--danger); font-size: 0.9rem; }

.field__error:empty,
.form-error:empty { display: none; }

.field--trap { position: absolute; left: -9999px; }

.summary__head { display: flex; justify-content: space-between; align-items: baseline; }

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

.summary__line {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
}

.summary__line-qty { display: inline-block; min-width: 30px; font-weight: 700; color: var(--brand); }

.summary__total { display: flex; justify-content: space-between; margin: 12px 0 0; font-size: 1.05rem; }

.summary__total strong { font-weight: 700; }

.summary__note { margin: 6px 0 0; color: var(--muted); font-size: 0.9rem; }

.link-button { padding: 0; border: 0; background: none; color: var(--brand); font-weight: 700; cursor: pointer; }

.button {
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  cursor: pointer;
}

.button:disabled { opacity: 0.5; cursor: default; }

.button--outline { border: 1px solid var(--line-strong); background: var(--background); color: var(--ink); }

.button--block { display: flex; align-items: center; justify-content: center; width: 100%; text-decoration: none; }

.checkout-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10;
  max-width: var(--page-width);
  margin: 0 auto;
  padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
  background: var(--background);
  border-top: 1px solid var(--line);
}

.checkout-bar__button {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  height: 58px;
  padding: 0 16px;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--brand);
  color: #fff;
  font-size: 1.05rem;
  font-weight: 700;
  cursor: pointer;
}

.checkout-bar__button:active:not(:disabled) { background: var(--brand-pressed); }

.checkout-bar__button:disabled { background: #cdc4b9; cursor: default; }

.checkout-bar__count {
  display: grid;
  place-items: center;
  min-width: 28px;
  height: 28px;
  padding: 0 6px;
  border-radius: 14px;
  background: rgb(255 255 255 / 0.22);
  font-size: 0.9rem;
}

.loading { padding: 32px 0; text-align: center; color: var(--muted); }

body.is-dedicated .store,
body.is-dedicated .progress,
body.is-dedicated .checkout-bar { display: none; }

body.is-dedicated { padding-bottom: env(safe-area-inset-bottom); }

.dedicated { padding: 0 0 32px; }

.dedicated__top { display: flex; align-items: center; gap: 4px; padding: 8px 0 4px; }

.dedicated__title { margin: 0; font-size: 1.35rem; font-weight: 700; }

.dedicated__actions { display: grid; gap: 10px; margin-top: 24px; }

.confirmation__hero { padding: 24px 0 8px; text-align: center; }

.confirmation__check { color: var(--ok); }

.confirmation__title { margin: 10px 0 2px; font-size: 1.5rem; font-weight: 700; }

.confirmation__ticket { margin: 0; color: var(--muted); }

.confirmation__ticket strong { display: block; font-size: 3rem; font-weight: 700; line-height: 1.1; color: var(--ink); }

.confirmation__text { margin: 10px auto 0; max-width: 30ch; color: var(--muted); }

.location__map {
  display: block;
  width: 100%;
  height: 200px;
  margin: 12px 0;
  border: 0;
  border-radius: var(--radius-control);
  background: var(--band);
}

.my-orders__status { margin: 16px 0 0; color: var(--muted); }

.my-orders__status:empty { display: none; }

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

.my-order__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }

.my-order__number { margin: 0; color: var(--muted); }

.my-order__number strong { margin-left: 4px; font-size: 1.3rem; font-weight: 700; color: var(--ink); }

.my-order__status {
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--brand-tint);
  color: var(--brand-pressed);
  font-size: 0.88rem;
  font-weight: 700;
}

.my-order[data-status="entregue"] .my-order__status { background: var(--ok-tint); color: var(--ok); }

.my-order[data-status="cancelado"] { opacity: 0.65; }

.my-order[data-status="cancelado"] .my-order__status { background: var(--danger-tint); color: var(--danger); }

.my-order__meta { margin-top: 2px; }

.my-orders__lookup-title { font-weight: 700; cursor: pointer; }

.my-orders__lookup .customer-form { margin-top: 12px; }

@media (min-width: 640px) {
  .store__cover { border-radius: var(--radius); }
  .store__name { font-size: 1.9rem; }
}
