/* ============================================================
   TOTEM MARMITA FIT — visual apetitoso (laranja) + animações
   ============================================================ */

:root {
  --brand: #f4751e;
  --brand-dark: #d65a12;
  --brand-deep: #b8470c;
  --brand-soft: #fff0e3;
  --brand-tint: #fff8f1;
  --gold: #f7a32b;
  --ink: #2e2018;
  --muted: #8a7763;
  --bg: #fff9f4;
  --card: #ffffff;
  --line: #f0e2d4;
  --danger: #c0392b;
  --radius: 24px;
  --shadow: 0 10px 34px rgba(180, 90, 20, 0.14);
  --shadow-sm: 0 4px 16px rgba(180, 90, 20, 0.08);
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
  height: 100%;
  width: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

input, select { font-family: inherit; }

/* ---------------- Animações ---------------- */
@keyframes screenIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes riseIn {
  from { opacity: 0; transform: translateY(22px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes popIn {
  0%   { opacity: 0; transform: scale(0.4); }
  60%  { transform: scale(1.12); }
  100% { opacity: 1; transform: scale(1); }
}
@keyframes floaty {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-10px); }
}
@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 100% 50%; }
}

/* ---------------- Telas ---------------- */
.screen {
  position: fixed;
  inset: 0;
  display: none;
  flex-direction: column;
  padding: env(safe-area-inset-top) env(safe-area-inset-right) env(safe-area-inset-bottom) env(safe-area-inset-left);
}
.screen.active {
  display: flex;
  animation: screenIn 0.3s ease both;
}

/* conteúdo entra subindo, com leve escalonamento */
.screen.active .screen-body > *,
.screen.active .home-content > *,
.screen.active .ok-content > * {
  animation: riseIn 0.42s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.screen.active .screen-body > *:nth-child(1),
.screen.active .home-content > *:nth-child(1),
.screen.active .ok-content > *:nth-child(1) { animation-delay: 0.04s; }
.screen.active .screen-body > *:nth-child(2),
.screen.active .home-content > *:nth-child(2),
.screen.active .ok-content > *:nth-child(2) { animation-delay: 0.10s; }
.screen.active .screen-body > *:nth-child(3),
.screen.active .home-content > *:nth-child(3),
.screen.active .ok-content > *:nth-child(3) { animation-delay: 0.16s; }
.screen.active .screen-body > *:nth-child(4),
.screen.active .ok-content > *:nth-child(4) { animation-delay: 0.22s; }
.screen.active .screen-body > *:nth-child(n+5) { animation-delay: 0.28s; }

.screen-body {
  flex: 1;
  padding: 34px 42px 42px;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.screen-body--scroll { overflow-y: auto; -webkit-overflow-scrolling: touch; }

.screen-body h2 { font-size: 40px; font-weight: 800; letter-spacing: -0.6px; }
.screen-body h3 { font-size: 24px; font-weight: 700; }

/* ---------------- Topbar ---------------- */
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 22px 32px;
  border-bottom: 1px solid var(--line);
  background: var(--card);
}
.btn-back {
  border: none;
  background: none;
  font-size: 22px;
  font-weight: 700;
  color: var(--brand-dark);
  padding: 10px 16px;
  border-radius: 14px;
}
.btn-back:active { background: var(--brand-soft); }
.step {
  font-size: 15px; color: var(--brand-dark); font-weight: 700;
  background: var(--brand-soft); padding: 8px 16px; border-radius: 999px;
}

/* ---------------- Botões ---------------- */
.btn {
  border: none;
  border-radius: var(--radius);
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.1s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}
.btn:active { transform: scale(0.96); }
.btn:disabled,
.btn:disabled:active {
  background: #ece4da !important;
  color: #b3a392 !important;
  box-shadow: none !important;
  cursor: not-allowed;
  transform: none;
  animation: none !important;
}

.btn--giant {
  background: linear-gradient(135deg, var(--gold) 0%, var(--brand) 55%, var(--brand-dark) 100%);
  background-size: 180% 180%;
  color: #fff;
  font-size: 36px;
  padding: 42px 64px;
  box-shadow: 0 16px 40px rgba(214, 90, 18, 0.36);
  animation: shimmer 5s ease-in-out infinite alternate;
}
.btn--primary {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff; font-size: 24px; padding: 24px 32px;
  box-shadow: 0 8px 22px rgba(214, 90, 18, 0.28);
}
.btn--ghost { background: var(--brand-soft); color: var(--brand-deep); font-size: 20px; padding: 20px 28px; }
.btn--danger { background: #fdecea; color: var(--danger); }
.btn--block { width: 100%; margin-top: auto; }
.btn--sm { font-size: 16px; padding: 12px 18px; border-radius: 14px; }
.btn--finish { background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%); color: #fff; }
.btn--addmore {
  width: 100%;
  border: 2px dashed var(--brand);
  background: var(--brand-tint);
  color: var(--brand-deep);
  font-size: 19px;
  padding: 18px 24px;
}

/* ---------------- Tela início ---------------- */
.screen--home {
  background:
    radial-gradient(circle at 20% 15%, rgba(247, 163, 43, 0.18), transparent 45%),
    radial-gradient(circle at 85% 85%, rgba(244, 117, 30, 0.16), transparent 50%),
    linear-gradient(165deg, #fffdfb 0%, var(--brand-soft) 100%);
}
.home-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
  text-align: center;
}
.brand-logo {
  font-size: 110px;
  width: 190px; height: 190px;
  display: flex; align-items: center; justify-content: center;
  background: #fff;
  border-radius: 50%;
  box-shadow: 0 18px 44px rgba(214, 90, 18, 0.22);
  margin-bottom: 6px;
  object-fit: contain;
  animation: floaty 4s ease-in-out infinite !important;
}
img.brand-logo { padding: 26px; }
.brand-logo--banner,
img.brand-logo--banner {
  width: auto;
  height: auto;
  max-width: 80vw;
  max-height: 26vh;
  background: transparent;
  border-radius: 0;
  box-shadow: none;
  padding: 0;
  margin-bottom: 14px;
  animation: none !important;
}
.brand-name {
  font-size: 56px; font-weight: 900; letter-spacing: -1.2px;
  background: linear-gradient(120deg, var(--brand-dark), var(--brand), var(--gold));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.brand-sub { font-size: 22px; color: var(--muted); margin-top: 2px; font-weight: 600; }
.home-hint { font-size: 18px; color: var(--brand-dark); margin-top: 4px; font-weight: 600; opacity: 0.7; }
.secret-corner {
  position: absolute;
  bottom: 0; right: 0;
  width: 90px; height: 90px;
  background: transparent;
  border: none;
}

/* ---------------- Campos ---------------- */
.field { display: flex; flex-direction: column; gap: 10px; }
.field span { font-size: 18px; font-weight: 700; color: var(--muted); }
.field input, .field select {
  font-size: 24px;
  padding: 22px 24px;
  border: 2px solid var(--line);
  border-radius: 18px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.field input:focus, .field select:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 4px rgba(244, 117, 30, 0.14);
}

/* ---------------- Categoria ---------------- */
.cat-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}
.cat-card {
  position: relative;
  border: none;
  border-radius: var(--radius);
  overflow: hidden;
  height: 280px;
  cursor: pointer;
  background: var(--brand-soft);
  box-shadow: var(--shadow-sm);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.cat-card:active { transform: scale(0.97); box-shadow: var(--shadow); }
.cat-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.cat-card::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(25,12,0,0.66) 0%, rgba(25,12,0,0.18) 45%, transparent 70%);
}
.cat-label {
  position: absolute;
  left: 0; right: 0; bottom: 24px;
  text-align: center;
  font-size: 28px; font-weight: 800;
  color: #fff;
  z-index: 2;
  text-shadow: 0 2px 10px rgba(0,0,0,0.45);
}
.cat-emoji { display: none; }
/* fallback quando não há foto (ex: Bebidas sem imagem ainda) */
.cat-card--noimg { background: linear-gradient(160deg, var(--brand-soft), #ffe1c5); }
.cat-card--noimg::after { display: none; }
.cat-card--noimg .cat-emoji {
  display: flex; align-items: center; justify-content: center;
  position: absolute; left: 0; right: 0; top: 0; bottom: 56px;
  font-size: 92px;
}
.cat-card--noimg .cat-label { color: var(--brand-deep); text-shadow: none; }

/* ---------------- Cardápio (grade estilo totem) ---------------- */
.menu-list {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding-bottom: 8px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}
.menu-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  animation: riseIn 0.4s ease both;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.menu-card--in {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(244, 117, 30, 0.18), var(--shadow);
}
.menu-card-photo {
  width: 100%;
  height: 150px;
  background: var(--brand-soft);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.menu-card-photo .item-photo {
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 0;
  box-shadow: none;
}
.menu-card-photo .menu-item-emoji { font-size: 64px; }
.menu-card-body {
  padding: 14px 16px 16px;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.menu-card-name { font-size: 17px; font-weight: 800; line-height: 1.25; }
.menu-card-price { font-size: 18px; color: var(--brand-dark); font-weight: 800; }
.menu-card-ctrl { margin-top: auto; padding-top: 12px; }
.menu-card-ctrl .menu-item-add { width: 100%; font-size: 16px; padding: 14px; }
.menu-card-ctrl .stepper { justify-content: center; gap: 12px; }
.menu-card-ctrl .stepper button { width: 44px; height: 44px; font-size: 24px; }

/* ---- Bebidas: lista compacta (foto pequena) ---- */
.menu-list.menu-list--rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
}
.menu-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  animation: riseIn 0.35s ease both;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.menu-row--in {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(244, 117, 30, 0.18), var(--shadow-sm);
}
.menu-row-visual {
  flex-shrink: 0;
  width: 58px; height: 58px;
  display: flex; align-items: center; justify-content: center;
}
.menu-row-visual .item-photo {
  width: 58px; height: 58px;
  border-radius: 10px;
}
.menu-row-visual .menu-item-emoji { font-size: 32px; }
.menu-row-info { flex: 1; min-width: 0; }
.menu-row-name { font-size: 17px; font-weight: 700; line-height: 1.25; }
.menu-row-price { font-size: 16px; color: var(--brand-dark); font-weight: 800; margin-top: 2px; }
.menu-row-ctrl { flex-shrink: 0; }
.menu-row-ctrl .menu-item-add { font-size: 15px; padding: 12px 18px; }
.menu-row-ctrl .stepper { gap: 10px; }
.menu-row-ctrl .stepper button { width: 40px; height: 40px; font-size: 22px; }

/* base da imagem / emoji (reutilizado no carrinho) */
.menu-item-visual { display: flex; align-items: center; justify-content: center; }
.menu-item-emoji { display: flex; align-items: center; justify-content: center; }
.item-photo {
  object-fit: cover;
  border-radius: 16px;
  background: var(--brand-soft);
}

/* carrinho: imagem pequena */
.cart-visual { flex-shrink: 0; }
.cart-visual .item-photo { width: 64px; height: 64px; border-radius: 12px; box-shadow: var(--shadow-sm); }
.cart-visual .menu-item-emoji { width: 64px; height: 64px; border-radius: 12px; font-size: 34px; }

.stepper { display: flex; align-items: center; gap: 14px; }
.stepper button {
  width: 54px; height: 54px;
  border-radius: 50%;
  border: 2px solid var(--brand);
  background: var(--card);
  color: var(--brand-dark);
  font-size: 28px;
  font-weight: 700;
  display: flex; align-items: center; justify-content: center;
  transition: transform 0.1s ease, background 0.15s ease;
}
.stepper button:active { background: var(--brand); color: #fff; transform: scale(0.9); }
.stepper .qty { font-size: 24px; font-weight: 800; min-width: 30px; text-align: center; }
.menu-item-add {
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 14px;
  font-size: 18px;
  font-weight: 700;
  padding: 16px 24px;
  transition: transform 0.1s ease;
}
.menu-item-add:active { transform: scale(0.93); }

/* ---------------- Barra carrinho ---------------- */
.cart-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 32px;
  background: var(--card);
  border-top: 1px solid var(--line);
  box-shadow: 0 -8px 24px rgba(180, 90, 20, 0.1);
  animation: riseIn 0.3s ease both;
}
.cart-bar-info { display: flex; flex-direction: column; }
.cart-bar-info span { font-size: 15px; color: var(--muted); font-weight: 600; }
.cart-bar-info strong { font-size: 26px; color: var(--brand-dark); }
.cart-bar-actions { display: flex; gap: 12px; }
.cart-bar .btn { font-size: 19px; padding: 18px 26px; white-space: nowrap; }
.cart-bar .btn--ghost { background: var(--brand-soft); }

/* ---------------- Carrinho ---------------- */
.cart-items { display: flex; flex-direction: column; gap: 14px; }
.cart-row {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 20px;
  display: flex;
  align-items: center;
  gap: 14px;
  box-shadow: var(--shadow-sm);
  animation: riseIn 0.35s ease both;
}
.cart-row-info { flex: 1; }
.cart-row-name { font-size: 18px; font-weight: 700; }
.cart-row-sub { font-size: 16px; color: var(--muted); margin-top: 2px; }
.cart-row-remove {
  border: none; background: #fdecea; color: var(--danger);
  border-radius: 12px; padding: 12px 16px; font-size: 16px; font-weight: 700;
}
.cart-empty { color: var(--muted); font-size: 19px; text-align: center; padding: 40px 0; }

.cart-total-row {
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 4px; border-top: 2px dashed var(--line);
  font-size: 22px; font-weight: 700;
}
.cart-total-row strong { font-size: 32px; color: var(--brand-dark); }

/* ---------------- Pagamento ---------------- */
.pay-title { margin-top: 10px; }
.pay-note { font-size: 16px; color: var(--muted); margin-top: -8px; }
.pay-options { display: flex; flex-direction: column; gap: 14px; }
.pay-opt {
  background: var(--card);
  border: 2px solid var(--line);
  border-radius: 18px;
  padding: 24px 26px;
  font-size: 22px;
  font-weight: 700;
  display: flex; align-items: center; gap: 16px;
  cursor: pointer;
  transition: transform 0.12s ease, border-color 0.15s ease, background 0.15s ease;
}
.pay-opt:active { transform: scale(0.98); }
.pay-opt .pay-emoji { font-size: 30px; }
.pay-opt.selected {
  border-color: var(--brand);
  background: var(--brand-soft);
  color: var(--brand-deep);
  box-shadow: 0 0 0 4px rgba(244, 117, 30, 0.12);
}
.pay-opt--destaque {
  border-color: var(--brand);
  border-width: 2px;
  position: relative;
}
.pay-tag {
  margin-left: auto;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 999px;
  letter-spacing: 0.3px;
}
.pay-opt--destaque.selected .pay-tag { background: var(--brand-deep); }

/* ---------------- Confirmação ---------------- */
.screen--ok {
  background:
    radial-gradient(circle at 30% 20%, rgba(247, 163, 43, 0.5), transparent 55%),
    linear-gradient(165deg, var(--brand) 0%, var(--brand-deep) 100%);
  color: #fff;
}
.ok-content {
  flex: 1;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  gap: 14px; text-align: center; padding: 40px;
}
.ok-logo {
  width: auto; height: auto;
  max-width: 300px; max-height: 88px;
  margin-bottom: 6px;
  opacity: 0.96;
}
.ok-check {
  width: 130px; height: 130px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 78px; font-weight: 800;
  margin-bottom: 6px;
  animation: popIn 0.55s cubic-bezier(0.22, 1, 0.36, 1) both !important;
}
.ok-content h2 { font-size: 44px; font-weight: 900; }
.ok-thanks { font-size: 30px; font-weight: 800; margin-top: 2px; }
.ok-msg { font-size: 23px; opacity: 0.95; }
.ok-name { font-size: 20px; opacity: 0.85; margin-top: 4px; }
.ok-redirect { font-size: 17px; opacity: 0.7; margin-top: 20px; }
.screen--ok .btn--ghost { background: rgba(255,255,255,0.22); color: #fff; margin-top: 14px; }

/* ---------------- Modal admin ---------------- */
.modal {
  position: fixed; inset: 0;
  background: rgba(60,30,10,0.5);
  display: flex; align-items: center; justify-content: center;
  z-index: 50; padding: 30px;
  animation: screenIn 0.25s ease both;
}
.modal-box {
  background: var(--card);
  border-radius: var(--radius);
  padding: 36px;
  width: 100%; max-width: 640px;
  max-height: 86vh; overflow-y: auto;
  position: relative;
  animation: popIn 0.35s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.modal-box h3 { font-size: 26px; margin-bottom: 8px; }
.modal-box p { color: var(--muted); font-size: 17px; margin-bottom: 18px; }
.modal-close {
  position: absolute; top: 18px; right: 20px;
  border: none; background: none; font-size: 26px; color: var(--muted);
}
#admin-pin {
  width: 100%; font-size: 30px; text-align: center; letter-spacing: 10px;
  padding: 20px; border: 2px solid var(--line); border-radius: 14px;
  margin-bottom: 16px; outline: none;
}
#admin-pin:focus { border-color: var(--brand); }
.admin-error { color: var(--danger); font-weight: 600; text-align: center; }
.admin-actions { display: flex; gap: 12px; margin-bottom: 18px; }
.admin-orders { display: flex; flex-direction: column; gap: 14px; }
.admin-order {
  border: 1px solid var(--line); border-radius: 14px; padding: 16px 18px;
}
.admin-order-head { display: flex; justify-content: space-between; font-size: 15px; color: var(--muted); margin-bottom: 6px; }
.admin-order-name { font-size: 19px; font-weight: 700; }
.admin-order-items { font-size: 16px; color: var(--ink); margin-top: 6px; line-height: 1.5; }
.admin-order-foot { display: flex; justify-content: space-between; margin-top: 8px; font-size: 16px; }
.admin-order-foot strong { color: var(--brand-dark); }
.admin-empty { color: var(--muted); text-align: center; padding: 30px 0; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; }
}

[hidden] { display: none !important; }

/* ============================================================
   CELULAR — vira página rolável (o iPad/kiosk continua tela fixa)
   ============================================================ */
@media (max-width: 560px) {
  html, body {
    overflow-y: auto;
    overflow-x: hidden;
    height: auto;
    min-height: 100%;
    -webkit-user-select: none;
  }
  .screen {
    position: relative;
    inset: auto;
    min-height: 100dvh;
    height: auto;
  }
  .screen-body {
    padding: 22px 18px 36px;
    gap: 16px;
  }
  .screen-body--scroll { overflow: visible; }
  .screen-body h2 { font-size: 25px; }
  .screen-body h3 { font-size: 20px; }
  .topbar { padding: 14px 16px; }
  .btn-back { font-size: 18px; }
  .step { font-size: 13px; }

  /* tela inicial */
  .brand-logo--banner { max-width: 76vw; max-height: 18vh; }
  .brand-name { font-size: 36px; }
  .brand-sub { font-size: 16px; }
  .home-hint { font-size: 15px; }
  .btn--giant { font-size: 24px; padding: 26px 30px; border-radius: 18px; }
  .home-content { gap: 22px; }

  /* campos */
  .field span { font-size: 16px; }
  .field input, .field select { font-size: 18px; padding: 16px 16px; }

  /* categoria */
  .cat-card { height: 200px; }
  .cat-label { font-size: 22px; }

  /* cardápio em grade */
  .menu-list, .menu-list.menu-list--rows { max-width: 100%; gap: 12px; }
  .menu-card-photo { height: 130px; }
  .menu-card-body { padding: 12px 12px 14px; }
  .menu-card-name { font-size: 15px; }
  .menu-card-price { font-size: 16px; }
  .menu-card-ctrl .menu-item-add { font-size: 14px; padding: 12px; }

  /* botões / pagamento / carrinho */
  .btn--primary { font-size: 19px; padding: 18px 22px; }
  .btn--block { margin-top: 18px; }
  .pay-opt { font-size: 18px; padding: 18px 18px; }
  .pay-opt .pay-emoji { font-size: 24px; }
  .cart-bar { padding: 14px 14px; }
  .cart-bar-actions { gap: 8px; }
  .cart-bar .btn { font-size: 16px; padding: 14px 16px; }
  .cart-total-row { font-size: 19px; }
  .cart-total-row strong { font-size: 24px; }

  /* confirmação */
  .ok-content { padding: 30px 22px; gap: 12px; }
  .ok-logo { max-width: 220px; max-height: 64px; }
  .ok-check { width: 100px; height: 100px; font-size: 56px; }
  .ok-content h2 { font-size: 30px; }
  .ok-thanks { font-size: 22px; }
  .ok-msg { font-size: 18px; }
}
