/* ═══════════════════════════════════════════
   Menu — unified dark, card grid
   ═══════════════════════════════════════════ */

.menu-shell {
  background: var(--bg-card);
  border: 1px solid var(--border-hover);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow), var(--glow);
  max-width: 100%;
}

.menu-app {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 500px;
  min-width: 0;
}

/* ─── Sidebar ─── */
.menu-app__sidebar {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 16px 12px;
  border-left: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.15);
  max-height: 640px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  position: sticky;
  top: 0;
  align-self: start;
}

.menu-cat {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--text-muted);
  text-align: right;
  transition: all 0.25s var(--ease);
  border: 1px solid transparent;
}

.menu-cat:hover {
  color: var(--text);
  background: rgba(255, 255, 255, 0.04);
}

.menu-cat.is-active {
  color: var(--text);
  background: rgba(200, 130, 78, 0.1);
  border-color: rgba(200, 130, 78, 0.2);
  box-shadow: inset 3px 0 0 var(--accent);
}

.menu-cat.is-active .menu-cat__icon { opacity: 1; }

.menu-cat__icon {
  flex-shrink: 0;
}

.cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cat-icon--photo {
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-hover);
}

.cat-icon--photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.menu-cat__icon .cat-icon--nav,
.cat-icon--nav {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.menu-cat.is-active .cat-icon--photo {
  border-color: rgba(200, 130, 78, 0.45);
  box-shadow: 0 0 0 1px rgba(212, 168, 104, 0.15);
}

.cat-icon--sm {
  width: 22px;
  height: 22px;
  border-radius: 50%;
}

.cat-icon--md {
  width: 40px;
  height: 40px;
  border-radius: 10px;
}

.cat-icon--lg {
  width: 56px;
  height: 56px;
  border-radius: 12px;
}

.cat-icon--fallback,
.cat-icon.is-broken {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: rgba(200, 130, 78, 0.1);
  font-size: 1rem;
}

.cat-icon--sm.cat-icon--fallback {
  width: 22px;
  height: 22px;
  font-size: 0.75rem;
}

.menu-panel__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.2rem;
  font-weight: 900;
  color: var(--text);
}

.menu-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  min-height: 36px;
  padding: 7px 14px;
  border-radius: 100px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-2);
  border: 1px solid var(--border);
  transition: 0.25s;
  scroll-snap-align: start;
}

.menu-chip.is-active {
  color: var(--text);
  background: rgba(200, 130, 78, 0.12);
  border-color: rgba(200, 130, 78, 0.25);
}

.menu-chip.is-active .cat-icon--photo {
  border-color: rgba(200, 130, 78, 0.5);
}

.menu-cat__count {
  margin-right: auto;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text-dim);
  background: rgba(255, 255, 255, 0.04);
  padding: 2px 7px;
  border-radius: 100px;
}

.menu-cat.is-active .menu-cat__count {
  color: var(--gold);
  background: rgba(212, 168, 104, 0.1);
}

/* ─── Main area ─── */
.menu-app__body {
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

.menu-app__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border);
}

.search {
  flex: 1;
  max-width: 320px;
  position: relative;
}

.search svg {
  position: absolute;
  right: 13px;
  top: 50%;
  transform: translateY(-50%);
  width: 16px;
  height: 16px;
  color: var(--text-dim);
  pointer-events: none;
}

.search input {
  width: 100%;
  padding: 10px 38px 10px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  font-size: 0.88rem;
  color: var(--text);
  background: var(--bg-2);
  transition: border-color 0.25s;
}

.search input::placeholder { color: var(--text-dim); }

.search input:focus {
  outline: none;
  border-color: var(--border-hover);
  box-shadow: 0 0 0 3px rgba(200, 130, 78, 0.08);
}

.menu-app__count {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-dim);
  white-space: nowrap;
}

/* ─── Panel header ─── */
.menu-app__panel {
  flex: 1;
  padding: 20px;
  overflow-x: hidden;
  overflow-y: auto;
  max-height: 580px;
  min-width: 0;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) transparent;
  transition: opacity 0.35s var(--ease), transform 0.35s var(--ease);
}

.menu-app__panel.is-switching {
  opacity: 0;
  transform: translateY(8px);
}

.menu-panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--border);
}

.menu-panel__badge {
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  background: rgba(212, 168, 104, 0.08);
  border: 1px solid rgba(212, 168, 104, 0.15);
  padding: 5px 12px;
  border-radius: 100px;
}

/* ─── Dish grid cards ─── */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(220px, 100%), 1fr));
  gap: 14px;
  width: 100%;
  min-width: 0;
}

.menu-tile {
  background: var(--bg-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.3s, transform 0.3s var(--ease);
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.menu-tile:hover {
  border-color: var(--border-hover);
  transform: translateY(-3px);
  box-shadow: var(--shadow-sm);
}

.menu-tile.is-unavailable { opacity: 0.4; pointer-events: none; }

.menu-tile__img {
  aspect-ratio: 1;
  overflow: hidden;
  background: var(--bg-hover);
  cursor: pointer;
  position: relative;
  width: 100%;
  min-width: 0;
}

.menu-tile__img::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 55%, rgba(20,17,16,0.45) 100%);
  pointer-events: none;
}

.menu-tile__img img {
  width: 100%;
  height: 100%;
  max-width: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: cover;
  display: block;
  transition: transform 0.45s var(--ease);
}

.menu-tile:hover .menu-tile__img img { transform: scale(1.06); }

.menu-tile__img--empty {
  display: grid;
  place-items: center;
  cursor: default;
}

.menu-tile__price-tag {
  position: absolute;
  bottom: 8px;
  left: 8px;
  padding: 4px 10px;
  background: rgba(20, 17, 16, 0.85);
  backdrop-filter: blur(6px);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 800;
  color: var(--gold);
  border: 1px solid rgba(212, 168, 104, 0.2);
  display: inline-flex;
  align-items: center;
}

.menu-tile__price-tag small {
  display: none;
}

.menu-tile__body {
  padding: 14px 14px 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.menu-tile__name {
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1.4;
  margin-bottom: 4px;
}

.menu-tile__desc {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  flex: 1;
  margin-top: 2px;
}

.menu-tile__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: 8px;
}

.menu-tile__tag {
  font-size: 0.62rem;
  font-weight: 700;
  padding: 2px 7px;
  border-radius: 100px;
  background: rgba(200, 130, 78, 0.1);
  color: var(--accent);
}

.menu-tile__tag--warn {
  background: rgba(164, 56, 74, 0.1);
  color: var(--brand);
}

.menu-tile__tag--important {
  background: rgba(212, 168, 104, 0.15);
  color: var(--gold);
  border: 1px solid rgba(212, 168, 104, 0.25);
  font-size: 0.68rem;
}

.menu-tile__tag--allergen {
  background: rgba(142, 155, 90, 0.1);
  color: var(--olive);
}

.menu-tile__order {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: auto;
  padding-top: 12px;
}

.menu-qty {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0;
  background: var(--bg-hover);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
}

.menu-qty__btn {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text);
  background: transparent;
  transition: background 0.2s, color 0.2s;
}

.menu-qty__btn:hover {
  background: rgba(200, 130, 78, 0.12);
  color: var(--gold);
}

.menu-qty__val {
  flex: 1;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 800;
  min-width: 32px;
  user-select: none;
}

.menu-order-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  color: var(--text);
  background: rgba(200, 130, 78, 0.16);
  border: 1px solid rgba(200, 130, 78, 0.28);
  transition: background 0.25s, transform 0.2s, border-color 0.25s;
  text-align: center;
  line-height: 1.3;
}

.menu-order-btn:hover {
  background: rgba(200, 130, 78, 0.28);
  border-color: rgba(200, 130, 78, 0.45);
  transform: translateY(-1px);
}

.menu-qty--sm {
  flex: 0 0 auto;
  width: auto;
  min-width: 96px;
}

.menu-qty--sm .menu-qty__btn {
  width: 30px;
  height: 30px;
  font-size: 1rem;
}

.menu-empty {
  text-align: center;
  padding: 48px 20px;
  color: var(--text-muted);
  grid-column: 1 / -1;
}

/* ─── Mobile chips ─── */
.menu-chips {
  display: none;
  gap: 8px;
  overflow-x: auto;
  overflow-y: visible;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  scrollbar-width: none;
  max-width: 100%;
  flex-shrink: 0;
  align-items: center;
  -webkit-overflow-scrolling: touch;
  scroll-snap-type: x proximity;
  scroll-padding-inline: 16px;
}

.menu-chips::-webkit-scrollbar { display: none; }

@media (max-width: 768px) {
  .menu-shell {
    overflow: visible;
  }

  .menu-app {
    grid-template-columns: 1fr;
    min-height: auto;
  }

  .menu-app__sidebar { display: none; }

  .menu-app__body {
    overflow: visible;
  }

  .menu-chips {
    display: flex;
    flex-wrap: nowrap;
    position: sticky;
    top: var(--header);
    z-index: 90;
    background: var(--bg-card);
    box-shadow: 0 1px 0 var(--border);
  }

  .menu-app__toolbar {
    flex-wrap: wrap;
    flex-shrink: 0;
    padding: 12px 16px;
    gap: 10px;
    background: var(--bg-card);
  }

  .search {
    flex: 1 1 100%;
    max-width: none;
    min-width: 0;
  }

  .menu-app__count {
    flex: 1 1 100%;
    text-align: center;
  }

  .menu-app__panel {
    max-height: none;
    padding: 12px;
    width: 100%;
  }

  .menu-panel__head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .menu-panel__title {
    font-size: 1.05rem;
  }

  /* Mobile: two cards per row */
  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .menu-grid > * {
    min-width: 0;
  }
}

@media (max-width: 400px) {
  .menu-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }
}

/* ─── LTR (English) ─── */
html[dir="ltr"] .menu-cat.is-active { box-shadow: inset -3px 0 0 var(--accent); }
html[dir="ltr"] .menu-cat { text-align: left; }
html[dir="ltr"] .menu-cat__count { margin-right: 0; margin-left: auto; }
html[dir="ltr"] .search svg { right: auto; left: 13px; }
html[dir="ltr"] .search input { padding: 10px 14px 10px 38px; }
html[dir="ltr"] .menu-app__sidebar { border-left: none; border-right: 1px solid var(--border); }
