/* Public menu semantic tokens: gastronomic, premium-lite, mobile-first. */
:root {
  --surface-app: #faf7f2;
  --surface-raised: #ffffff;
  --surface-hover: #f4f0e8;
  --text-primary: #221f1a;
  --text-muted: #7a7268;
  --border: #e7e0d3;
  --accent: var(--menu-accent, #9a3e28);
  --accent-strong: var(--menu-accent-strong, #7c3220);
  --accent-soft: #f6e9e3;
  --accent-contrast: #ffffff;
  --focus-color: var(--menu-accent, #9a3e28);
}

.public-header {
  position: sticky; top: 0; z-index: 30; background: var(--surface-raised);
  border-bottom: 1px solid var(--border); box-shadow: var(--shadow-sm);
}
.public-header-inner { max-width: var(--public-content-width, 44rem); margin: 0 auto; padding: var(--space-4); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-3); }
.public-identity { display: flex; align-items: center; gap: var(--space-3); }
.public-logo { width: 3rem; height: 3rem; border-radius: var(--radius-md); object-fit: cover; background: var(--accent-soft); flex: none; }
.public-logo-fallback { width: 3rem; height: 3rem; border-radius: var(--radius-md); background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; font-size: var(--text-lg); flex: none; }
.public-name { font-size: var(--text-xl); font-weight: 800; }
.public-status-row { display: flex; align-items: center; gap: var(--space-2); font-size: var(--text-sm); color: var(--text-muted); }
.public-search { position: relative; }
.public-search input { padding-left: 2.5rem; }
.public-search-icon { position: absolute; left: var(--space-3); top: 50%; transform: translateY(-50%); color: var(--text-muted); }

.category-nav-wrap { position: relative; }
.category-nav {
  display: flex; gap: var(--space-2); overflow-x: auto; padding-bottom: var(--space-1); scrollbar-width: none;
  scroll-snap-type: x proximity; scroll-padding-inline: var(--space-4);
}
.category-nav::-webkit-scrollbar { display: none; }
.category-chip {
  flex: none; padding: var(--space-2) var(--space-4); border-radius: var(--radius-full); border: 1px solid var(--border);
  font-size: var(--text-sm); font-weight: 600; color: var(--text-primary); background: var(--surface-raised); scroll-snap-align: start;
}
.category-chip[aria-current="true"] { background: var(--accent); color: #fff; border-color: var(--accent); }
.category-nav-wrap::after {
  content: ''; position: absolute; top: 0; right: 0; bottom: var(--space-1); width: 2.5rem; pointer-events: none;
  background: linear-gradient(to right, transparent, var(--surface-raised));
}
[dir="rtl"] .category-nav-wrap::after { right: auto; left: 0; background: linear-gradient(to left, transparent, var(--surface-raised)); }
.category-nav-wrap.is-at-end::after { display: none; }

.public-main { max-width: var(--public-content-width, 44rem); margin: 0 auto; padding: var(--space-5) var(--space-4) var(--space-8); }
.menu-category { scroll-margin-top: 9rem; margin-bottom: var(--space-6); }
.menu-category-title { font-size: var(--text-xl); margin-bottom: var(--space-1); }
.menu-category-desc { color: var(--text-muted); margin-bottom: var(--space-2); }
.menu-category-items { display: block; }

.back-to-top { position: fixed; bottom: calc(var(--space-5) + env(safe-area-inset-bottom, 0px)); right: var(--space-5); width: 3rem; height: 3rem; border-radius: 50%; background: var(--accent); color: #fff; display: none; align-items: center; justify-content: center; box-shadow: var(--shadow-lg); z-index: 20; }
.back-to-top.is-visible { display: flex; }

.public-footer { max-width: var(--public-content-width, 44rem); margin: 0 auto; padding: var(--space-6) var(--space-4) calc(var(--space-8) + env(safe-area-inset-bottom, 0px)); color: var(--text-muted); font-size: var(--text-sm); display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--space-2); border-top: 1px solid var(--border); }

/* Desktop: a centered, generously proportioned container (~1100px) instead of a
   narrow mobile-width column stranded on the left with empty space beside it. */
@media (min-width: 64rem) {
  :root { --public-content-width: 68.75rem; }
  .public-search { max-width: 26rem; }
  .menu-category-items { display: grid; grid-template-columns: repeat(2, 1fr); column-gap: var(--space-6); }
  .menu-category-items .product-card { border-bottom: 1px solid var(--border); }
  .menu-category-items .product-card:nth-last-child(-n+2) { border-bottom: none; }
}

.product-card { cursor: pointer; }
.product-card-unavailable-badge { margin-left: auto; }

/* RTL support (Arabic) */
[dir="rtl"] .product-card { flex-direction: row-reverse; }
[dir="rtl"] .drawer { right: auto; left: 0; transform: translateX(-100%); }
[dir="rtl"] .drawer-backdrop.is-open .drawer { transform: translateX(0); }
[dir="rtl"] .public-search-icon { left: auto; right: var(--space-3); }
[dir="rtl"] .public-search input { padding-left: var(--space-3); padding-right: 2.5rem; }
[dir="rtl"] .back-to-top { right: auto; left: var(--space-5); }

@media print { .public-header, .lang-select, .back-to-top { display: none; } }
