/* Hallmark · macrostructure: Component Playground · tone: acolhedor e direto · anchor hue: dourado
 * Hallmark · pre-emit critique: P5 H5 E4 S5 R4 V5
 * audience: clientes locais no celular · use: comparar formas de pedir · theme: Magnata noturno
 * contrast: pass (40–41) · honest: pass (46) · tokens: pass (48) · mobile: pass (34, 49–57)
 */
@import url("./tokens.css");

@font-face {
  font-family: "Magnata Display";
  src: url("../../fontes/bebas-neue.woff2") format("woff2");
  font-display: swap;
}
@font-face {
  font-family: "Magnata Body";
  src: url("../../fontes/plus-jakarta-sans-vf.woff2") format("woff2");
  font-display: swap;
}

* { box-sizing: border-box; }
html, body { overflow-x: clip; }
html { color-scheme: dark; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-ink);
  font: 400 var(--text-base)/1.6 var(--font-body);
}
button, input, select, textarea { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.shell { width: min(1120px, calc(100% - 32px)); margin-inline: auto; }
.topbar {
  position: sticky;
  top: 0;
  z-index: var(--z-sticky);
  background: color-mix(in oklch, var(--color-bg) 92%, transparent);
  border-bottom: var(--rule);
  backdrop-filter: blur(14px);
}
.topbar-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
}
.brand {
  font: 400 1.5rem/1 var(--font-display);
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.brand span { color: var(--color-gold); }
.back {
  color: var(--color-muted);
  font-size: var(--text-sm);
  text-decoration: none;
  white-space: nowrap;
}
.back:hover { color: var(--color-ink); }
.back:active, .brand:active { opacity: 0.72; }

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: clamp(32px, 7vw, 88px);
  align-items: end;
  padding: var(--space-7) 0 var(--space-8);
}
.hero-copy { min-width: 0; }
.kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 0 var(--space-3);
  border: var(--rule);
  border-radius: var(--radius-pill);
  color: var(--color-gold);
  font-size: var(--text-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
h1, h2, h3 { text-wrap: balance; overflow-wrap: anywhere; }
h1 {
  margin: var(--space-4) 0 var(--space-4);
  max-width: 12ch;
  font: 400 var(--text-display)/1.02 var(--font-display);
  letter-spacing: 0.01em;
  text-transform: uppercase;
}
.hero p { max-width: 62ch; margin: 0; color: var(--color-muted); }
.hero-photo {
  min-height: 360px;
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: var(--color-surface);
}
.hero-photo img { width: 100%; height: 100%; min-height: 360px; object-fit: cover; }

.choice-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--space-4);
  padding-bottom: var(--space-8);
}
.choice {
  display: flex;
  min-width: 0;
  min-height: 320px;
  flex-direction: column;
  padding: var(--space-6);
  border-top: 3px solid var(--color-gold);
  background: var(--color-surface);
}
.choice:nth-child(2) { border-color: var(--color-red); }
.choice:nth-child(3) { border-color: var(--color-green); }
.choice-index { color: var(--color-muted); font-size: var(--text-xs); }
.choice h2 {
  margin: var(--space-3) 0;
  font: 400 var(--text-xl)/1 var(--font-display);
  letter-spacing: 0.02em;
  text-transform: uppercase;
}
.choice p { color: var(--color-muted); margin: 0 0 var(--space-5); }
.choice ul { padding-left: 1.2rem; margin: 0 0 var(--space-6); color: var(--color-muted); }
.choice .button { margin-top: auto; }

.button {
  min-height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: 0 var(--space-5);
  border: 0;
  border-radius: var(--radius-pill);
  background: var(--color-gold);
  color: var(--color-accent-ink);
  font-weight: 800;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: transform var(--dur-micro) var(--ease-out), opacity var(--dur-micro) var(--ease-out);
}
.button:hover { transform: translateY(-1px); }
.button:active { transform: translateY(0); }
.button:focus-visible, .back:focus-visible, .brand:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}
.button.secondary { background: var(--color-surface-2); color: var(--color-ink); }
.button:disabled { opacity: 0.55; cursor: not-allowed; transform: none; }

.demo-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, 0.8fr);
  gap: var(--space-6);
  align-items: start;
  padding: var(--space-7) 0 var(--space-8);
}
.demo-intro { grid-column: 1 / -1; max-width: 760px; }
.demo-intro h1 { max-width: 15ch; }
.demo-intro p { color: var(--color-muted); max-width: 65ch; }
.demo-label {
  display: inline-flex;
  min-height: 30px;
  align-items: center;
  padding: 0 var(--space-3);
  border-radius: var(--radius-pill);
  background: var(--color-surface-2);
  color: var(--color-gold);
  font-size: var(--text-xs);
  font-weight: 700;
}
.product-list { display: grid; gap: var(--space-3); }
.product {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  gap: var(--space-4);
  align-items: center;
  padding: var(--space-3);
  border-bottom: var(--rule);
}
.product img { width: 88px; height: 88px; aspect-ratio: 1; object-fit: cover; border-radius: var(--radius-sm); }
.product h2 { margin: 0; font-size: var(--text-lg); }
.product p { margin: var(--space-1) 0 0; color: var(--color-muted); font-size: var(--text-sm); }
.product strong { display: block; margin-top: var(--space-2); color: var(--color-gold); }
.product .button { padding-inline: var(--space-4); }

.panel {
  position: sticky;
  top: 96px;
  padding: var(--space-5);
  background: var(--color-surface);
  border-radius: var(--radius-md);
}
.panel h2 { margin: 0 0 var(--space-4); font: 400 var(--text-xl)/1 var(--font-display); text-transform: uppercase; }
.cart-items { display: grid; gap: var(--space-3); margin-bottom: var(--space-5); }
.cart-empty { color: var(--color-muted); }
.cart-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-3); }
.cart-line small { color: var(--color-muted); }
.total {
  display: flex;
  justify-content: space-between;
  gap: var(--space-4);
  margin: var(--space-5) 0;
  padding-top: var(--space-4);
  border-top: var(--rule);
  font-size: var(--text-lg);
}
.panel .button { width: 100%; }

.chat {
  min-height: 540px;
  display: flex;
  flex-direction: column;
  background: var(--color-surface);
  border-radius: var(--radius-md);
  overflow: hidden;
}
.chat-head { padding: var(--space-4) var(--space-5); border-bottom: var(--rule); }
.chat-head strong { display: block; }
.chat-head small { color: var(--color-green); }
.messages { flex: 1; display: flex; flex-direction: column; gap: var(--space-3); padding: var(--space-5); }
.message { max-width: 82%; padding: var(--space-3) var(--space-4); border-radius: var(--radius-md); background: var(--color-surface-2); }
.message.bot { align-self: flex-start; }
.message.user { align-self: flex-end; background: var(--color-gold); color: var(--color-bg); }
.chat-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: var(--space-2); padding: var(--space-4); border-top: var(--rule); }
.field, .select, .textarea {
  width: 100%;
  min-height: 48px;
  border: var(--rule);
  border-radius: var(--radius-sm);
  background: var(--color-bg);
  color: var(--color-ink);
  padding: var(--space-3) var(--space-4);
}
.textarea { min-height: 96px; resize: vertical; }
.field::placeholder, .textarea::placeholder { color: var(--color-muted); opacity: 1; }
.field:hover, .select:hover, .textarea:hover { border-color: var(--color-muted); }
.field:focus-visible, .select:focus-visible, .textarea:focus-visible {
  outline: 2px solid var(--color-focus);
  outline-offset: 1px;
}
.field:disabled, .select:disabled, .textarea:disabled {
  opacity: 0.55;
  cursor: not-allowed;
  background: var(--color-surface-2);
}
.field[aria-invalid="true"], .select[aria-invalid="true"], .textarea[aria-invalid="true"] {
  outline: 2px solid var(--color-danger);
  outline-offset: 1px;
}

.checkout { display: grid; gap: var(--space-5); }
.checkout section { padding: var(--space-5); background: var(--color-surface); border-radius: var(--radius-md); }
.checkout h2 { margin: 0 0 var(--space-4); font: 400 var(--text-xl)/1 var(--font-display); text-transform: uppercase; }
.order-options { display: grid; gap: var(--space-2); }
.option-group + .option-group { margin-top: var(--space-5); }
.option-group h3 { margin: 0 0 var(--space-2); color: var(--color-muted); font-size: var(--text-base); }
.order-option {
  min-height: 64px;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-3);
  border-bottom: var(--rule);
  cursor: pointer;
}
.order-option input { width: 20px; height: 20px; accent-color: var(--color-gold); }
.order-option small { display: block; color: var(--color-muted); }
.order-option b { color: var(--color-gold); white-space: nowrap; }
.order-option:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.order-option:has(input:checked) { background: var(--color-surface-2); }
.order-option.compact { min-height: 52px; }
.form-error { color: var(--color-danger); font-weight: 700; }
.pizza-builder { display: grid; gap: var(--space-5); }
.addon-fieldset { margin: 0; padding: 0; border: 0; }
.addon-fieldset legend { margin-bottom: var(--space-2); color: var(--color-muted); font-size: var(--text-sm); }
.addon-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-2); }
.addon-check {
  min-height: 48px;
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-3);
  background: var(--color-bg);
  border-radius: var(--radius-sm);
  cursor: pointer;
}
.addon-check input { width: 20px; height: 20px; accent-color: var(--color-gold); }
.addon-check span { display: flex; min-width: 0; flex: 1; justify-content: space-between; gap: var(--space-2); }
.addon-check small { color: var(--color-gold); white-space: nowrap; }
.addon-check:has(input:focus-visible) { outline: 2px solid var(--color-focus); outline-offset: 1px; }
.addon-check:has(input:checked) { background: var(--color-surface-2); }
.builder-action { display: flex; align-items: center; justify-content: space-between; gap: var(--space-4); }
.builder-action p { margin: 0; color: var(--color-gold); font-weight: 800; }
.stepper {
  min-height: 48px;
  display: inline-grid;
  grid-template-columns: 44px 44px 44px;
  align-items: center;
  border: var(--rule);
  border-radius: var(--radius-pill);
  overflow: hidden;
}
.stepper button {
  width: 44px;
  height: 44px;
  border: 0;
  background: var(--color-surface-2);
  color: var(--color-ink);
  font-size: var(--text-lg);
  cursor: pointer;
}
.stepper button:hover { background: var(--color-gold); color: var(--color-accent-ink); }
.stepper button:active { opacity: 0.72; }
.stepper button:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -3px; }
.stepper output { text-align: center; font-weight: 800; }
.drink-list { display: grid; gap: var(--space-2); }
.drink-row {
  min-height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  padding: var(--space-3) 0;
  border-bottom: var(--rule);
}
.drink-row span { min-width: 0; }
.drink-row small { display: block; color: var(--color-muted); }
.cart-line-editable { align-items: start; }
.remove-line {
  border: 0;
  background: transparent;
  color: var(--color-danger);
  padding: 0;
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 700;
}
.remove-line:hover { color: var(--color-ink); }
.remove-line:active { opacity: 0.72; }
.remove-line:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; }
.form-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-4); }
.form-grid label { display: grid; gap: var(--space-2); color: var(--color-muted); font-size: var(--text-sm); }
.form-grid .full { grid-column: 1 / -1; }
.website-field {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
.notice { padding: var(--space-4); background: color-mix(in oklch, var(--color-gold) 12%, var(--color-surface)); color: var(--color-ink); border-radius: var(--radius-sm); }
.success { padding: var(--space-6); background: color-mix(in oklch, var(--color-green) 9%, var(--color-surface)); }
.success h2 { margin-top: 0; color: var(--color-green); }

.site-footer { padding: var(--space-6) 0; border-top: var(--rule); color: var(--color-muted); font-size: var(--text-sm); }
.site-footer .shell { display: flex; justify-content: space-between; gap: var(--space-4); flex-wrap: wrap; }

@media (max-width: 860px) {
  .hero, .demo-layout { grid-template-columns: 1fr; }
  .hero-photo { min-height: 280px; }
  .hero-photo img { min-height: 280px; }
  .choice-grid { grid-template-columns: 1fr; }
  .choice { min-height: auto; }
  .panel { position: static; }
}
@media (max-width: 560px) {
  .shell { width: min(100% - 24px, 1120px); }
  .topbar-inner { min-height: 64px; }
  .brand { font-size: 1.25rem; }
  .hero { padding-top: var(--space-7); }
  h1 { font-size: clamp(2.7rem, 15vw, 4.4rem); }
  .product { grid-template-columns: 72px minmax(0, 1fr); }
  .product img { width: 72px; height: 72px; }
  .product .button { grid-column: 1 / -1; width: 100%; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid .full { grid-column: auto; }
  .addon-grid { grid-template-columns: 1fr; }
  .builder-action { align-items: stretch; flex-direction: column; }
  .builder-action .button { width: 100%; }
  .chat-form { grid-template-columns: 1fr; }
  .chat-form .button { width: 100%; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 150ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 150ms !important;
    scroll-behavior: auto !important;
  }
}
