:root {
  --bg: #07090d;
  --panel: #121820;
  --text: #f4f1ea;
  --muted: #9aa3b2;
  --red: #e4392e;
  --red-deep: #9f1d18;
  --gold: #d4894a;
  --gold-soft: #e8b892;
  --line: rgba(232, 220, 190, 0.12);
  --line-strong: rgba(212, 137, 74, 0.5);
  --radius: 18px;
  --font: 'Manrope', Candara, 'Segoe UI', sans-serif;
  --display: 'Cormorant Garamond', Constantia, Georgia, serif;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --safe-b: env(safe-area-inset-bottom, 0px);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  min-height: 100%;
  color: var(--text);
  font-family: var(--font);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

body {
  overflow-x: hidden;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

/* —— Atmosphere / full-bleed —— */
.atmosphere {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}

.atmosphere-photo {
  position: absolute;
  inset: -4%;
  background:
    radial-gradient(ellipse 80% 55% at 70% 18%, rgba(228, 57, 46, 0.28), transparent 58%),
    radial-gradient(ellipse 70% 50% at 12% 88%, rgba(212, 137, 74, 0.18), transparent 55%),
    radial-gradient(circle at 50% 40%, rgba(40, 28, 22, 0.35), transparent 50%),
    linear-gradient(165deg, #1a120e 0%, #0a0d12 42%, #05070b 100%);
  transform: scale(1.04);
  animation: ken 18s ease-in-out infinite alternate;
}

@keyframes ken {
  from {
    transform: scale(1.02) translate3d(0, 0, 0);
  }
  to {
    transform: scale(1.08) translate3d(-1.5%, -1%, 0);
  }
}

.atmosphere-veil {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(5, 7, 11, 0.35) 0%, rgba(5, 7, 11, 0.55) 45%, rgba(5, 7, 11, 0.92) 100%),
    radial-gradient(ellipse at 50% 0%, rgba(228, 57, 46, 0.12), transparent 45%);
}

.atmosphere-grain {
  position: absolute;
  inset: 0;
  opacity: 0.28;
  mix-blend-mode: soft-light;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.5'/%3E%3C/svg%3E");
}

.shell {
  position: relative;
  z-index: 1;
  max-width: 540px;
  min-height: 100dvh;
  margin: 0 auto;
  padding: 20px 18px calc(36px + var(--safe-b));
  /* Só opacity — transform quebra position:fixed do carrinho */
  animation: fadeIn 0.55s var(--ease) both;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

body.cart-open {
  overflow: hidden;
}

.top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  margin-bottom: 8px;
  transition: margin 0.35s var(--ease);
}

body.is-gate .top {
  justify-content: center;
  text-align: center;
  margin-bottom: 18px;
}

body.is-gate .brand-block {
  width: 100%;
}

body.is-gate .mesa-line {
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-size: 0.72rem;
  font-weight: 600;
  color: rgba(232, 184, 146, 0.72);
}

body.is-gate .cart-fab {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
  box-shadow: none;
  pointer-events: none;
}

.back-bar {
  width: 100%;
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 4px 0 14px;
  padding: 12px 14px;
  border-radius: 14px;
  border: 1px solid rgba(212, 137, 74, 0.45);
  background:
    linear-gradient(135deg, rgba(212, 137, 74, 0.18), rgba(212, 137, 74, 0.06));
  color: var(--gold-soft);
  font-weight: 700;
  letter-spacing: 0.02em;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.22);
  transition:
    transform 0.15s var(--ease),
    filter 0.2s ease;
}

.back-bar:hover {
  filter: brightness(1.08);
}

.back-bar:active {
  transform: scale(0.985);
}

.back-bar-icon {
  width: 36px;
  height: 36px;
  border-radius: 11px;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(212, 137, 74, 0.35);
  flex: 0 0 auto;
}

.back-bar-icon svg {
  width: 20px;
  height: 20px;
}

.back-bar-text {
  font-size: 0.95rem;
}

.eyebrow {
  margin: 0 0 2px;
  font-size: 0.68rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.brand {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(2.8rem, 12vw, 3.7rem);
  font-weight: 700;
  letter-spacing: 0.07em;
  line-height: 0.9;
  background: linear-gradient(180deg, #fff8f0 8%, var(--gold-soft) 52%, var(--gold) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 10px 28px rgba(212, 137, 74, 0.22));
}

.mesa-line {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.02em;
}

.cart-fab {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(150deg, #f0483c, var(--red-deep));
  box-shadow:
    0 14px 30px rgba(228, 57, 46, 0.38),
    inset 0 1px 0 rgba(255, 255, 255, 0.18);
  transition: transform 0.2s var(--ease);
}

.cart-fab:active {
  transform: scale(0.96);
}

.cart-fab svg {
  width: 22px;
  height: 22px;
}

.cart-fab span {
  position: absolute;
  top: -7px;
  right: -7px;
  min-width: 22px;
  height: 22px;
  padding: 0 6px;
  border-radius: 999px;
  background: linear-gradient(180deg, var(--gold-soft), var(--gold));
  color: #1a120c;
  font-size: 0.72rem;
  font-weight: 700;
  display: grid;
  place-items: center;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.35);
}

/* —— Gate / hero —— */
.hero-gate {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: calc(100dvh - 168px);
  padding: 8px 0 12px;
  animation: rise 0.85s var(--ease) 0.04s both;
}

.hero-copy {
  margin-bottom: 20px;
  text-align: center;
}

.hero-kicker {
  margin: 0 0 8px;
  font-size: 0.68rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--gold);
  font-weight: 600;
}

.hero-gate h2 {
  margin: 0 auto;
  max-width: 14ch;
  font-family: var(--display);
  font-size: clamp(1.85rem, 7.2vw, 2.35rem);
  font-weight: 600;
  letter-spacing: 0.01em;
  line-height: 1.12;
  color: #f7f2ea;
  text-shadow: 0 10px 32px rgba(0, 0, 0, 0.4);
}

.hero-sub {
  margin: 10px auto 0;
  color: var(--muted);
  line-height: 1.45;
  max-width: 28ch;
  font-size: 0.92rem;
}

.mesa-panel {
  position: relative;
  margin-bottom: 4px;
  padding: 12px;
  border-radius: 20px;
  border: 1px solid rgba(232, 220, 190, 0.1);
  background:
    linear-gradient(180deg, rgba(255, 248, 240, 0.035), rgba(255, 248, 240, 0.01)),
    rgba(8, 11, 16, 0.55);
  box-shadow:
    inset 0 1px 0 rgba(255, 248, 240, 0.05),
    0 18px 40px rgba(0, 0, 0, 0.28);
  animation: rise 0.7s var(--ease) 0.12s both;
}

.mesa-pad {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  max-height: min(38vh, 320px);
  overflow-y: auto;
  padding: 2px 4px 2px 2px;
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 137, 74, 0.4) transparent;
}

.mesa-pad::-webkit-scrollbar {
  width: 3px;
}

.mesa-pad::-webkit-scrollbar-track {
  background: transparent;
}

.mesa-pad::-webkit-scrollbar-thumb {
  background: rgba(212, 137, 74, 0.38);
  border-radius: 99px;
}

.mesa-pad button {
  --i: 0;
  aspect-ratio: 1;
  border-radius: 14px;
  border: 1px solid rgba(232, 220, 190, 0.14);
  background:
    linear-gradient(160deg, rgba(255, 248, 240, 0.06), transparent 55%),
    rgba(14, 18, 24, 0.72);
  color: var(--text);
  font-family: var(--display);
  font-weight: 600;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  padding: 8px 4px;
  animation: rise 0.5s var(--ease) both;
  animation-delay: calc(0.14s + var(--i) * 18ms);
  transition:
    border-color 0.2s ease,
    background 0.2s ease,
    transform 0.15s var(--ease),
    opacity 0.2s ease,
    box-shadow 0.2s ease;
}

.mesa-pad button .mesa-label {
  font-family: var(--font);
  font-size: 0.55rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 700;
  color: rgba(232, 184, 146, 0.7);
  line-height: 1;
}

.mesa-pad button .mesa-num {
  font-size: 1.45rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.mesa-pad button .mesa-tag {
  font-family: var(--font);
  font-size: 0.55rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  font-weight: 700;
  opacity: 0.95;
}

.mesa-pad button:hover:not(:disabled) {
  border-color: rgba(212, 137, 74, 0.55);
  background:
    linear-gradient(160deg, rgba(212, 137, 74, 0.16), transparent 60%),
    rgba(18, 22, 28, 0.85);
  box-shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
  transform: translateY(-1px);
}

.mesa-pad button.is-on {
  color: #1a120c;
  border-color: transparent;
  background: linear-gradient(145deg, var(--gold-soft), var(--gold));
  box-shadow: 0 10px 22px rgba(212, 137, 74, 0.28);
}

.mesa-pad button.is-on .mesa-label {
  color: rgba(26, 18, 12, 0.7);
}

.mesa-pad button.is-mine:not(.is-on) {
  border-color: rgba(212, 137, 74, 0.55);
  background: rgba(212, 137, 74, 0.14);
  color: var(--gold-soft);
}

.mesa-pad button.is-busy,
.mesa-pad button:disabled {
  opacity: 0.58;
  cursor: not-allowed;
  color: #c9a8a4;
  border-color: rgba(228, 57, 46, 0.32);
  background: rgba(60, 20, 18, 0.5);
  transform: none;
  box-shadow: none;
}

.mesa-pad button.is-busy .mesa-label {
  color: rgba(240, 162, 154, 0.75);
}

.mesa-pad button.is-busy .mesa-tag {
  color: #f0a29a;
}

.mesa-pad button:active:not(:disabled) {
  transform: scale(0.96);
}

.gate-manual {
  margin-top: 18px;
  animation: rise 0.65s var(--ease) 0.22s both;
}

.gate-divider {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
  color: rgba(154, 163, 178, 0.75);
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  font-weight: 600;
}

.gate-divider::before,
.gate-divider::after {
  content: '';
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(232, 220, 190, 0.18), transparent);
}

.gate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.gate-row input,
.note-field input {
  width: 100%;
  padding: 15px 16px;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: rgba(10, 13, 18, 0.72);
  outline: none;
}

.gate-row input {
  text-align: center;
  letter-spacing: 0.04em;
}

.gate-row input:focus,
.note-field input:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(212, 137, 74, 0.12);
}

.gate-row .btn-main {
  min-width: 112px;
}

.btn-main {
  padding: 15px 22px;
  border-radius: 14px;
  background: linear-gradient(145deg, #f0483c, var(--red-deep));
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.03em;
  box-shadow: 0 12px 26px rgba(228, 57, 46, 0.32);
  transition:
    transform 0.2s var(--ease),
    filter 0.2s ease;
}

.btn-main:hover {
  filter: brightness(1.06);
}

.btn-main:active {
  transform: scale(0.98);
}

.btn-main:disabled {
  opacity: 0.5;
  cursor: not-allowed;
  filter: none;
}

.btn-wide {
  width: 100%;
}

.gate-status {
  margin: 16px 2px 0;
  min-height: 1.2em;
  color: rgba(154, 163, 178, 0.72);
  font-size: 0.75rem;
  text-align: center;
  letter-spacing: 0.04em;
}

.gate-status.is-ok {
  color: #9dcea8;
}

.gate-status.is-bad {
  color: #f0a29a;
}

/* —— Menu stage —— */
.menu-stage {
  animation: rise 0.55s var(--ease) both;
  padding-bottom: 24px;
}

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

.cats {
  position: sticky;
  top: 0;
  z-index: 8;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 8px 2px 14px;
  margin: 0 -4px 8px;
  background: linear-gradient(180deg, rgba(7, 9, 13, 0.92), rgba(7, 9, 13, 0.72) 70%, transparent);
  backdrop-filter: blur(8px);
  scrollbar-width: none;
}

.cats::-webkit-scrollbar {
  display: none;
}

.cats button {
  flex: 0 0 auto;
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  white-space: nowrap;
  background: rgba(12, 16, 22, 0.55);
}

.cats button.is-on {
  color: #1a120c;
  background: linear-gradient(135deg, var(--gold-soft), var(--gold));
  border-color: transparent;
  box-shadow: 0 8px 18px rgba(212, 137, 74, 0.25);
}

.menu {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.item {
  padding: 16px 16px 14px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background:
    linear-gradient(145deg, rgba(32, 24, 20, 0.55), transparent 40%),
    linear-gradient(180deg, rgba(22, 28, 38, 0.96), rgba(12, 16, 22, 0.98));
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.22);
  animation: rise 0.5s var(--ease) both;
}

.item h3 {
  margin: 0 0 4px;
  font-family: var(--display);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.item p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.4;
  min-height: 1.2em;
}

.item-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: -2px 0 12px;
}

.item-meta span {
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--gold-soft);
  border: 1px solid rgba(212, 137, 74, 0.28);
  background: rgba(212, 137, 74, 0.08);
  border-radius: 999px;
  padding: 4px 8px;
}

.opts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 12px;
}

.opts button {
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.8rem;
  background: rgba(0, 0, 0, 0.2);
}

.opts button.is-on {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(212, 137, 74, 0.14);
}

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

.item-foot strong {
  font-size: 1.1rem;
  color: var(--gold-soft);
}

.add-btn {
  padding: 11px 15px;
  border-radius: 12px;
  background: rgba(228, 57, 46, 0.16);
  border: 1px solid rgba(228, 57, 46, 0.4);
  color: #ffd4d0;
  font-weight: 700;
  font-size: 0.86rem;
  transition: background 0.15s ease, transform 0.15s var(--ease);
}

.add-btn:active {
  transform: scale(0.97);
  background: rgba(228, 57, 46, 0.28);
}

.menu-empty {
  text-align: center;
  padding: 40px 18px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: rgba(12, 16, 22, 0.5);
}

.menu-empty strong {
  display: block;
  font-family: var(--display);
  font-size: 1.6rem;
  margin-bottom: 8px;
}

.menu-empty p {
  margin: 0 0 18px;
  color: var(--muted);
}

/* —— Cart sheet —— */
.sheet {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
}

.sheet[hidden] {
  display: none !important;
}

.sheet-bg {
  position: absolute;
  inset: 0;
  background: rgba(4, 6, 10, 0.78);
  animation: fade 0.25s ease both;
}

@keyframes fade {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.sheet-panel {
  position: relative;
  z-index: 1;
  width: min(540px, 100%);
  max-height: min(90vh, 760px);
  overflow: auto;
  margin: 0 auto;
  padding: 20px 18px calc(22px + var(--safe-b));
  border-radius: 24px 24px 0 0;
  background: linear-gradient(180deg, #1a1512, #0d1117 38%);
  border-top: 1px solid var(--line);
  box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.45);
  animation: sheetIn 0.34s var(--ease) both;
}

@keyframes sheetIn {
  from {
    transform: translateY(28%);
    opacity: 0.4;
  }
  to {
    transform: none;
    opacity: 1;
  }
}

.sheet-panel header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 14px;
}

.sheet-panel h2 {
  margin: 4px 0 0;
  font-family: var(--display);
  font-size: 1.9rem;
}

.linkish {
  color: var(--gold-soft);
  font-weight: 600;
  margin-top: 8px;
}

.cart-list {
  display: flex;
  flex-direction: column;
  gap: 4px;
  margin-bottom: 14px;
}

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

.cart-row strong {
  display: block;
  margin-bottom: 2px;
}

.cart-row span {
  color: var(--muted);
  font-size: 0.85rem;
}

.qty {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
}

.qty button {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(0, 0, 0, 0.25);
}

.note-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
  margin-bottom: 14px;
}

.note-field span {
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

.cart-total {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 14px;
  font-size: 1.05rem;
}

.cart-total strong {
  font-size: 1.4rem;
  color: var(--gold-soft);
}

.hint {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  text-align: center;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(22px + var(--safe-b));
  transform: translateX(-50%);
  z-index: 60;
  max-width: min(92vw, 420px);
  padding: 12px 16px;
  border-radius: 14px;
  background: #1a2118;
  border: 1px solid rgba(212, 137, 74, 0.45);
  color: var(--text);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.45);
  animation: rise 0.28s var(--ease) both;
}

[hidden] {
  display: none !important;
}

@media (min-width: 700px) {
  .shell {
    padding-top: 36px;
  }

  .hero-gate {
    min-height: calc(100dvh - 200px);
  }

  body.is-gate .brand {
    font-size: clamp(3.2rem, 8vw, 4rem);
  }
}

@media (prefers-reduced-motion: reduce) {
  .atmosphere-photo,
  .shell,
  .hero-gate,
  .mesa-panel,
  .gate-manual,
  .mesa-pad button {
    animation: none !important;
  }
}
