/* Per-bar values (accent, background image) are injected from config.json as CSS variables. */
:root {
  --bg: #111111;
  --surface: rgba(20, 20, 20, 0.82);
  --surface-strong: #1b1b1b;
  --text: #ffffff;
  --muted: #c9c9c9;
  --accent: #ffea00;
  --accent-ink: #111111;
  --line: rgba(255, 255, 255, 0.12);
  --wa: #25d366;
  --bg-image: none;
  --font: "Montserrat", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image: var(--bg-image);
  background-size: cover;
  background-attachment: fixed;
  background-position: center;
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

img { max-width: 100%; display: block; }

.top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: calc(env(safe-area-inset-top, 0px) + 28px) max(16px, env(safe-area-inset-right, 0px)) 16px max(16px, env(safe-area-inset-left, 0px));
  text-align: center;
}
.logo { width: min(320px, 78vw); height: auto; }
.bar-name { margin: 0; font-size: 2rem; font-weight: 800; color: var(--accent); letter-spacing: 0.04em; }

.info {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px 18px;
  font-size: 0.88rem;
  color: var(--muted);
}
.info a { color: var(--muted); }
.info span, .info a { display: inline-flex; align-items: center; gap: 6px; }

/* Sticky category tabs */
.tabs {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: calc(env(safe-area-inset-top, 0px) + 10px) max(16px, env(safe-area-inset-right, 0px)) 10px max(16px, env(safe-area-inset-left, 0px));
  background: rgba(10, 10, 10, 0.92);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
  scrollbar-width: none;
}
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: 0 0 auto;
  font: 600 0.82rem var(--font);
  letter-spacing: 0.03em;
  color: var(--text);
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 14px;
  text-decoration: none;
  white-space: nowrap;
}
.tab[aria-current="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.tab:focus-visible, .item:focus-visible, .detail-close:focus-visible, .detail-wa:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.menu {
  max-width: 760px;
  margin: 0 auto;
  padding: 8px max(16px, env(safe-area-inset-right, 0px)) 96px max(16px, env(safe-area-inset-left, 0px));
  display: flex;
  flex-direction: column;
  gap: 28px;
}
.status { text-align: center; color: var(--muted); padding: 40px 0; }

.section { display: flex; flex-direction: column; gap: 10px; scroll-margin-top: 64px; }
.section h2 {
  margin: 0 0 4px;
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  color: var(--accent);
  text-transform: uppercase;
  border-bottom: 2px solid var(--accent);
  padding-bottom: 6px;
}

.item {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  width: 100%;
  text-align: left;
  font: inherit;
  color: inherit;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 12px;
  cursor: pointer;
}
.item.has-img { grid-template-columns: 72px minmax(0, 1fr) auto; }
.item-img { width: 72px; height: 72px; object-fit: cover; border-radius: 8px; background: #000; }
.item-text { min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.item-name { font-weight: 700; font-size: 1rem; }
.item-desc {
  font-size: 0.85rem;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.item-price { font-weight: 800; color: var(--accent); white-space: nowrap; font-variant-numeric: tabular-nums; }

.foot { text-align: center; color: var(--muted); font-size: 0.8rem; padding: 0 16px 100px; }

/* WhatsApp floating button */
.wa-float {
  position: fixed;
  right: calc(18px + env(safe-area-inset-right, 0px));
  bottom: calc(18px + env(safe-area-inset-bottom, 0px));
  z-index: 10;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: var(--wa);
  display: grid;
  place-items: center;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.45);
}
.wa-float svg { width: 30px; height: 30px; fill: #fff; }

/* Product detail */
.detail {
  width: min(520px, calc(100vw - 24px));
  max-height: calc(100vh - 24px);
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-strong);
  color: var(--text);
  overflow: auto;
}
.detail::backdrop { background: rgba(0, 0, 0, 0.7); }
.detail-close {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.6);
  color: #fff;
  font-size: 1.6rem;
  line-height: 1;
  cursor: pointer;
}
.detail-img { width: 100%; max-height: 60vh; object-fit: cover; }
.detail-body { padding: 18px 20px 22px; display: flex; flex-direction: column; gap: 10px; }
.detail-body h2 { margin: 0; font-size: 1.3rem; padding-right: 36px; }
.detail-desc { margin: 0; color: var(--muted); white-space: pre-line; }
.detail-price { margin: 0; font-size: 1.4rem; font-weight: 800; color: var(--accent); }
.detail-wa {
  align-self: flex-start;
  background: var(--wa);
  color: #fff;
  font-weight: 700;
  text-decoration: none;
  padding: 10px 16px;
  border-radius: 8px;
}
