:root {
  --bg: #f5f5f5;
  --card: #ffffff;
  --text: #1a1a1a;
  --muted: #6b7280;
  --border: #e5e7eb;
  --primary: #111111;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  padding: 20px 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.brand-title {
  font-weight: 700;
  font-size: 24px;
  line-height: 1.2;
  color: #ffffff;
  text-align: center;
  letter-spacing: 0.5px;
}

.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 16px;
}

.status {
  margin: 6px 0 14px;
  color: var(--muted);
  font-size: 13px;
}

/* Categorias: barra horizontal com scroll (igual ao app) */
.categories {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 0;
  margin: 0 -16px 8px;
  padding: 0 16px;
  height: 50px;
  align-items: center;
  scrollbar-width: none;
  -ms-overflow-style: none;
  -webkit-overflow-scrolling: touch;
}
.categories::-webkit-scrollbar {
  display: none;
}

.category-item {
  padding: 0 24px 0 0;
  cursor: pointer;
  user-select: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: border-color 0.2s;
  height: 50px;
  display: flex;
  align-items: center;
}
.category-item.active {
  border-bottom-color: #000;
}
.category-item span {
  font-size: 13px;
  font-weight: 500;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}
.category-item.active span {
  font-weight: 700;
  color: #000;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 0 0 8px;
  border: none;
}

/* Seção de Categoria (igual ao app) */
.category-section {
  margin-bottom: 16px;
  background: var(--card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.05);
}

.category-header {
  background: linear-gradient(135deg, #1a1a1a 0%, rgba(26, 26, 26, 0.9) 100%);
  padding: 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.category-name {
  font-size: 18px;
  font-weight: 700;
  color: #ffffff;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  flex: 1;
}

.category-count {
  padding: 6px 12px;
  background: rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  font-size: 14px;
  font-weight: 700;
  color: #ffffff;
  margin-left: 12px;
}

.category-products {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

/* Produtos: layout horizontal (igual ao app) */
.product-card {
  background: #f9fafb;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 12px;
  transition: border-color 0.2s;
}
.product-card:hover {
  border-color: #c7c7c7;
}

.product-info {
  flex: 1;
  min-width: 0;
}

.product-name {
  font-size: 16px;
  font-weight: 700;
  margin: 0 0 4px;
  color: var(--text);
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-desc {
  font-size: 12px;
  color: #6b7280;
  margin: 0 0 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price {
  font-weight: 900;
  font-size: 16px;
  color: var(--text);
  margin: 8px 0 0;
}

.product-image {
  width: 80px;
  height: 80px;
  border-radius: 8px;
  background: #f3f4f6;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.product-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.product-image .icon {
  width: 40px;
  height: 40px;
  color: #9ca3af;
}

/* Produtos compostos */
.product-composite {
  border-color: #d1d5db;
}

.composite-badge {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  background: #e5e7eb;
  border-radius: 6px;
  font-size: 11px;
  font-weight: 600;
  color: #6b7280;
}

/* Modal de Variações */
.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}
.modal.show {
  display: flex;
}

.modal-content {
  background: #fff;
  border-radius: 20px;
  width: 90%;
  max-width: 500px;
  max-height: 80vh;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #e5e7eb;
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.modal-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 700;
  color: #1a1a1a;
}

.modal-close {
  background: none;
  border: none;
  font-size: 28px;
  color: #6b7280;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s;
}
.modal-close:hover {
  background: #f3f4f6;
}

.modal-variations {
  padding: 20px;
  overflow-y: auto;
  flex: 1;
}

.variations-label {
  font-size: 13px;
  font-weight: 600;
  color: #6b7280;
  margin-bottom: 12px;
}

.variations-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.variation-item {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px;
  background: #f9fafb;
  border-radius: 12px;
  font-size: 14px;
}

.variation-content {
  flex: 1;
  min-width: 0;
}

.variation-name {
  color: #374151;
  font-weight: 500;
  display: block;
  margin-bottom: 4px;
}

.variation-desc {
  color: #6b7280;
  font-size: 12px;
  font-style: italic;
  display: block;
  line-height: 1.4;
}

.variation-price {
  color: #1a1a1a;
  font-weight: 700;
  font-size: 14px;
  margin-left: 12px;
  flex-shrink: 0;
}

.footer {
  border-top: 1px solid var(--border);
  background: var(--card);
  padding: 14px 16px;
  text-align: center;
  color: var(--muted);
  font-size: 12px;
}
.footer a {
  color: var(--muted);
  text-decoration: underline;
  transition: color 0.2s;
}
.footer a:hover {
  color: var(--text);
}
