*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
img { display: block; max-width: 100%; }
a   { text-decoration: none; color: inherit; }
body {
  font-family: 'Inter', -apple-system, sans-serif;
  background: #f9fafb; color: #111827;
  -webkit-font-smoothing: antialiased;
}

.preview-bar {
  background: #fef3c7; color: #92400e;
  padding: 9px 16px; text-align: center;
  font-size: 0.8rem; font-weight: 500;
  border-bottom: 1px solid #fcd34d;
}
.preview-bar a { color: #92400e; font-weight: 700; text-decoration: underline; }

/* ── Header ── */
.pub-header {
  background: #fff; border-bottom: 1px solid #e5e7eb;
  padding: 28px 20px 20px; text-align: center;
}
.pub-logo { width: 72px; height: 72px; border-radius: 16px; object-fit: cover; margin: 0 auto 14px; }
.pub-logo-initial {
  width: 72px; height: 72px; border-radius: 16px;
  background: #fef3ed; color: #e85d26;
  font-size: 2rem; font-weight: 800;
  display: flex; align-items: center; justify-content: center;
  margin: 0 auto 14px;
}
.pub-header h1 { font-size: 1.4rem; font-weight: 800; margin-bottom: 6px; letter-spacing: -0.02em; }
.pub-desc { font-size: 0.875rem; color: #6b7280; max-width: 400px; margin: 0 auto 10px; }
.pub-meta { display: flex; gap: 14px; justify-content: center; font-size: 0.78rem; color: #6b7280; flex-wrap: wrap; }
.pub-meta a { color: #6b7280; }

/* ── Meal type selection ── */
.meal-select {
  padding: 32px 20px;
  max-width: 500px; margin: 0 auto;
  text-align: center;
}
.meal-select-label {
  font-size: 0.75rem; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.09em;
  color: #9ca3af; margin-bottom: 20px;
}
.meal-select-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
}
.meal-btn {
  display: flex; flex-direction: column; align-items: center;
  gap: 10px; padding: 28px 16px;
  background: #fff; border: 1.5px solid #e5e7eb;
  border-radius: 16px; cursor: pointer;
  font-family: inherit;
  transition: border-color 150ms, box-shadow 150ms, transform 150ms;
}
.meal-btn:hover {
  border-color: #e85d26;
  box-shadow: 0 4px 16px rgba(232,93,38,0.1);
  transform: translateY(-2px);
}
.meal-btn-icon { font-size: 2rem; }
.meal-btn-name { font-size: 1rem; font-weight: 700; color: #111827; }

/* ── Meal type view ── */
.mt-view-header {
  display: flex; align-items: center; gap: 12px;
  padding: 14px 20px;
  background: #fff; border-bottom: 1px solid #e5e7eb;
  position: sticky; top: 0; z-index: 10;
}
.back-btn {
  padding: 6px 12px; border-radius: 8px;
  font-size: 0.875rem; font-weight: 600;
  background: #f3f4f6; border: none; cursor: pointer;
  color: #374151; transition: background 150ms;
  font-family: inherit;
}
.back-btn:hover { background: #e5e7eb; }
.mt-view-title { font-size: 1rem; font-weight: 700; }

/* ── Category nav ── */
.cat-nav {
  background: #fff; border-bottom: 1px solid #e5e7eb;
  display: flex; gap: 0; overflow-x: auto;
  padding: 0 16px; scrollbar-width: none;
  position: sticky; top: 0; z-index: 9;
}
.cat-nav::-webkit-scrollbar { display: none; }
.cat-nav-link {
  padding: 12px 16px; white-space: nowrap;
  font-size: 0.875rem; font-weight: 600; color: #6b7280;
  border-bottom: 2px solid transparent;
  transition: color 150ms, border-color 150ms;
}
.cat-nav-link.active, .cat-nav-link:hover { color: #e85d26; border-bottom-color: #e85d26; }

/* ── Main content ── */
.pub-main {
  max-width: 680px; margin: 0 auto;
  padding: 8px 16px 60px;
}
.pub-cat { padding-top: 28px; }
.pub-cat-title {
  font-size: 1.05rem; font-weight: 800;
  letter-spacing: -0.01em; margin-bottom: 14px;
  padding-bottom: 10px; border-bottom: 2px solid #f3f4f6;
}
.pub-empty, .pub-empty-state {
  color: #9ca3af; font-size: 0.875rem;
  padding: 32px 16px; text-align: center;
}

/* ── Items ── */
.pub-items { display: flex; flex-direction: column; gap: 10px; }
.pub-item {
  background: #fff; border: 1px solid #e5e7eb;
  border-radius: 12px; overflow: hidden;
  display: flex; align-items: stretch;
  cursor: pointer;
  transition: box-shadow 150ms, border-color 150ms;
}
.pub-item:hover {
  border-color: #e85d26;
  box-shadow: 0 2px 12px rgba(232,93,38,0.08);
}
.pub-item-img {
  width: 96px; flex-shrink: 0;
  object-fit: cover;
}
.pub-item-body {
  flex: 1; padding: 14px;
  display: flex; flex-direction: column; gap: 5px;
}
.pub-item-top {
  display: flex; justify-content: space-between;
  align-items: flex-start; gap: 8px;
}
.pub-item-name  { font-size: 0.9375rem; font-weight: 700; }
.pub-item-price { font-size: 0.9375rem; font-weight: 800; color: #e85d26; flex-shrink: 0; }
.pub-item-desc  { font-size: 0.8125rem; color: #6b7280; line-height: 1.5; }
.pub-item-add-hint {
  display: flex; align-items: center; justify-content: center;
  width: 36px; flex-shrink: 0; align-self: stretch;
  font-size: 1.2rem; color: #d1d5db;
  border-left: 1px solid #f3f4f6;
  transition: color 150ms;
}
.pub-item:hover .pub-item-add-hint { color: #e85d26; }

/* ── Diet flag pills ── */
.pub-item-flags { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 4px; }
.pub-flag {
  font-size: 0.72rem; padding: 2px 7px; border-radius: 20px;
  background: #f3f4f6; color: #374151; font-weight: 600;
}
.pub-flag-vegan        { background: #d1fae5; color: #065f46; }
.pub-flag-vegetarian   { background: #dcfce7; color: #14532d; }
.pub-flag-gluten_free  { background: #fef9c3; color: #713f12; }
.pub-flag-spicy        { background: #fee2e2; color: #991b1b; }

/* ── Item modal ── */
.item-modal-overlay {
  display: none; position: fixed; inset: 0; z-index: 100;
  background: rgba(0,0,0,0.55); backdrop-filter: blur(2px);
  align-items: flex-end; justify-content: center;
}
.item-modal-overlay.open { display: flex; }
.item-modal {
  background: #fff; border-radius: 20px 20px 0 0;
  width: 100%; max-width: 600px;
  max-height: 90vh; overflow-y: auto;
  padding-bottom: 36px;
  animation: slideUp 200ms ease;
}
@keyframes slideUp {
  from { transform: translateY(40px); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}
.modal-img { width: 100%; height: 220px; object-fit: cover; border-radius: 20px 20px 0 0; }
.modal-img-wrap { position: relative; }
.modal-close {
  position: absolute; top: 14px; right: 14px;
  background: rgba(0,0,0,0.35); color: #fff;
  border: none; border-radius: 50%; width: 32px; height: 32px;
  font-size: 1rem; cursor: pointer; display: flex;
  align-items: center; justify-content: center;
}
.modal-body { padding: 20px 20px 0; }
.modal-name  { font-size: 1.2rem; font-weight: 800; margin-bottom: 4px; }
.modal-price { font-size: 1.1rem; font-weight: 800; color: #e85d26; margin-bottom: 10px; }
.modal-desc  { font-size: 0.875rem; color: #6b7280; line-height: 1.6; margin-bottom: 14px; }
.modal-allergens { margin-bottom: 14px; }
.modal-allergens-label {
  font-size: 0.7rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.07em; color: #9ca3af; margin-bottom: 6px;
}
.allergen-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.allergen-pill {
  font-size: 0.75rem; padding: 3px 9px; border-radius: 20px;
  background: #fef3c7; color: #92400e; font-weight: 600;
}
.modal-flags { display: flex; flex-wrap: wrap; gap: 5px; }

/* ── Footer ── */
.pub-footer {
  text-align: center; padding: 20px 16px 28px;
  font-size: 0.75rem; color: #9ca3af;
}
.pub-footer a { color: #9ca3af; }
.pub-footer strong { color: #6b7280; }
