:root {
  --bg: #f7f7fb;
  --text: #151a2d;
  --muted: #5c6173;
  --primary: #2563eb;
  --primary-600: #103cb4;
  --danger: #e11d48;
  --border: #e6e7ee;
  --card: #ffffff;
  --badge-bg: #eef2ff;
  --badge-fg: #1e3a8a;

  --border-radius: 8px;
  --transition: all 0.5s ease-out;
}

/* Reset mínimo */
* {
  box-sizing: border-box;
}
html,
body {
  height: 100%;
}
body {
  margin: 0;
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Inter, Arial,
    sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.45;
}

/* Header */
header {
  background: linear-gradient(90deg, #0f172a, #1e293b);
  color: #fff;
  padding: 16px 20px;
}
header h1 {
  margin: 0;
  font-size: clamp(18px, 2.2vw, 24px);
}

/* Layout */
.wrap {
  max-width: 1000px;
  margin: 24px auto;
  padding: 0 16px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 860px) {
  .wrap {
    grid-template-columns: 1fr;
  }
}

/* Cartões */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  padding: 14px;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
}
.card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

/* Formulário de Produtos */
#productRegister {
  display: grid;
  grid-template-columns: 1fr 140px auto;
  gap: 6px;
  align-items: end;
  margin-bottom: 2px;
}
#productRegister label {
  grid-column: 1 / -1;
  font-size: 13px;
  color: var(--muted);
}
#productRegister input[type="text"],
#productRegister input[type="number"] {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--border-radius);
  font-size: 14px;
}
#productRegister button {
  height: 40px;
}
#registerError {
  grid-column: 1 / -1;
  min-height: 18px;
  color: #b91c1c;
  font-size: 13px;
}

#prodList {
  margin-top: 4px;
}

/* Listas */
ul {
  list-style: none;
  margin: 0;
  padding: 0;
}
li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--border);
}
li:last-child {
  border-bottom: 0;
}

.price {
  color: var(--muted);
  font-size: 14px;
  margin-top: 4px;
}
.right {
  display: flex;
  gap: 6px;
  align-items: center;
}

/* Botões */
button,
.btn {
  display: flex;
  align-items: center;
  border: 0;
  font-weight: 600;
  border-radius: var(--border-radius);
  padding: 10px 12px;
  background: var(--primary);
  color: #fff;
  cursor: pointer;
  font-size: 14px;
  transition: var(--transition);
}
button:hover,
.btn:hover {
  background-color: var(--primary-600);
}

button:active {
  transform: translateY(1px);
}
button:focus-visible {
  outline: 2px solid #93c5fd;
  outline-offset: 2px;
}

button.add {
  /* botão na lista de produtos */
  background: var(--primary);
}
button.sm {
  /* botões +, -, x no carrinho */
  background: #e9eefc;
  color: #0b1220;
  padding: 6px 10px;
  border: 1px solid #dbe3ff;
}
button.sm:hover {
  background: #dbe6ff;
}

.checkout {
  background: var(--danger);
  border: 1px solid #be123c;
  padding: 6px 10px;
  border-radius: 999px;
}
.checkout:hover {
  background: #be123c;
}

/* Footer do carrinho (totais) */
.cartFooter {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-top: 10px;
}
.badge {
  background: var(--badge-bg);
  color: var(--badge-fg);
  border: 1px solid #c7d2fe;
  padding: 6px 10px;
  border-radius: var(--border-radius);
  font-size: 13px;
}

/* Estados vazios */
.empty {
  color: var(--muted);
  font-style: italic;
  background: #f8fafc;
  border: 1px dashed var(--border);
  padding: 8px 10px;
  border-radius: var(--border-radius);
  margin-top: 8px;
}

/* Acessibilidade e seleções */
::selection {
  background: #c7d2fe;
  color: #0b1220;
}
