/* ============================================================
   BÉ BIỂN SEAFOOD MENU — Premium Bright Mobile-First Design
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@300;400;500;600;700;800&display=swap');

/* ── Design Tokens ── */
:root {
  --bg:           #f4f7f6;
  --bg-card:      #ffffff;
  --primary:      #0077b6;
  --primary-light:#cae9ff;
  --accent:       #f97316;
  --accent-light: #ffedd5;
  --text:         #1e293b;
  --text-muted:   #64748b;
  --border:       #e2e8f0;
  
  --card-radius:  16px;
  --pill-radius:  50px;
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.04);
  --shadow:       0 10px 25px rgba(0,0,0,0.08);
  --ease:         cubic-bezier(.4,0,.2,1);
  --font:         'Be Vietnam Pro', 'Noto Sans SC', 'Noto Sans KR', 'Noto Sans JP', system-ui, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

img {
  -webkit-user-drag: none;
  pointer-events: none;
}

/* ── Header ─────────────────────────────────────────── */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .75rem 1rem;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow-sm);
}

.header__brand { display: flex; align-items: center; gap: .6rem; }
.header__logo { width: 36px; height: 36px; border-radius: 8px; object-fit: cover; }
.header__name { font-size: 1.1rem; font-weight: 700; color: var(--primary); letter-spacing: -.02em;}

.lang-bar { display: flex; gap: .4rem; align-items: center;}
.lang-btn {
  background: none; border: none; padding: .2rem;
  cursor: pointer; opacity: 0.5;
  transition: all .2s var(--ease);
  display: flex; align-items: center; justify-content: center;
  border-radius: 4px; position: relative;
}
.lang-btn img { width: 24px; border-radius: 3px; box-shadow: 0 1px 3px rgba(0,0,0,0.1); }
.lang-btn:hover { opacity: 0.8; }
.lang-btn.active { opacity: 1; }
.lang-btn.active::after {
  content: ''; position: absolute; bottom: -4px; left: 50%;
  transform: translateX(-50%); width: 14px; height: 3px;
  background: var(--primary); border-radius: 2px;
}

/* ── Hero ───────────────────────────────────────────── */
.hero {
  padding: 2.5rem 1.5rem;
  text-align: center;
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg) 100%);
  border-bottom: 1px solid var(--border);
}

.hero__title {
  font-size: 1.75rem; font-weight: 800; color: var(--primary);
  margin-bottom: .4rem;
}

.hero__sub { font-size: .95rem; color: var(--text-muted); font-weight: 500; }

/* ── Categories ─────────────────────────────────────── */
.cats-bar {
  position: sticky; top: 61px; z-index: 90;
  background: rgba(244, 247, 246, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  padding: .75rem 0;
}

.cats-scroll {
  display: flex; gap: .6rem; padding: .25rem 1rem; /* Bổ sung khoảng đệm dọc để bóng đổ không bị cắt */
  overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: none;
  overscroll-behavior-x: contain; /* CỨU TINH MOBILE: Ngăn tình trạng vuốt ở mép bị back/forward trang trình duyệt */
}
.cats-scroll::-webkit-scrollbar { display: none; }
.cats-scroll::after {
  content: ''; padding-right: 1px; /* Đảm bảo item cuối cùng không bị sát mép màn hình */
}

.cat-pill {
  flex-shrink: 0; display: flex; align-items: center; gap: .5rem;
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--pill-radius); padding: .65rem 1.25rem; /* Tăng tap-target bấm dễ hơn trên mobile */
  color: var(--text-muted); font-family: var(--font); font-size: .9rem; font-weight: 600;
  cursor: pointer; transition: all .2s var(--ease);
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
  white-space: nowrap; /* Không cho rớt dòng */
  -webkit-tap-highlight-color: transparent; /* Bỏ vệt xám highlight khó chịu của Android/iOS khi chạm vào */
}

.cat-pill:hover { border-color: var(--primary-light); color: var(--primary); }
.cat-pill.active {
  background: var(--primary); border-color: var(--primary); color: #fff;
  box-shadow: 0 4px 12px rgba(0, 119, 182, 0.3);
}

/* ── Search ─────────────────────────────────────────── */
.search-wrap { position: relative; margin: 1rem 1rem .5rem; }
.search-icon { position: absolute; left: 1rem; top: 50%; transform: translateY(-50%); font-size: 1rem; opacity: 0.5;}
.search-input {
  width: 100%; background: var(--bg-card); border: 1px solid var(--border);
  border-radius: var(--pill-radius); padding: .8rem 1rem .8rem 2.6rem;
  color: var(--text); font-family: var(--font); font-size: .95rem;
  outline: none; transition: border-color .2s; box-shadow: var(--shadow-sm);
  -webkit-appearance: none; appearance: none; user-select: text; -webkit-user-select: text;
}
.search-input::placeholder { color: #94a3b8; }
.search-input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-light); }

/* ── Dishes List ────────────────────────────────────── */
.dishes-wrap { padding: 1rem 1rem 3rem; min-height: 60vh; }
.dishes-grid { display: flex; flex-direction: column; gap: 1rem; }

.loading-state, .empty-state {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 4rem 0; color: var(--text-muted);
}
.spinner {
  width: 40px; height: 40px; border: 3px solid var(--border);
  border-top-color: var(--primary); border-radius: 50%;
  animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.empty-state__icon { font-size: 3rem; margin-bottom: 1rem; }
.hidden { display: none !important; }

/* ── Dish Card (Horizontal List View) ───────────────── */
.dish-card {
  background: var(--bg-card); border: none;
  border-radius: var(--card-radius); padding: 1.25rem 1rem;
  display: flex; gap: 1.25rem; align-items: center;
  cursor: pointer; transition: transform .2s var(--ease), box-shadow .2s var(--ease);
  position: relative; overflow: visible;
  box-shadow: 0 6px 20px rgba(0,0,0,0.05); /* Softer premium shadow */
}
.dish-card:hover, .dish-card:active { transform: translateY(-3px); box-shadow: 0 12px 25px rgba(0,0,0,0.08); }
.dish-card--unavailable { opacity: .6; filter: grayscale(50%); }

.dish-card--featured::after {
  content: '⭐ Nổi Bật'; position: absolute; top: -12px; right: 15px; left: auto;
  font-size: .75rem; font-weight: 700; background: linear-gradient(135deg, #f97316, #ea580c); color: white;
  padding: .3rem .75rem; border-radius: 20px; z-index: 2;
  box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
}

.dish-card__img-wrap {
  width: 100px; height: 100px; flex-shrink: 0;
  border-radius: 50%; overflow: hidden; background: transparent;
}
.dish-card__img { width: 100%; height: 100%; object-fit: contain; }

.dish-card__content {
  flex: 1; display: flex; flex-direction: column; justify-content: space-between;
  min-width: 0; /* allows text truncation */
}

.dish-card__name {
  font-size: 1.1rem; font-weight: 800; color: var(--text); line-height: 1.35;
  margin-bottom: .3rem; letter-spacing: -0.01em;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.dish-card__desc {
  font-size: .85rem; color: var(--text-muted); line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  margin-bottom: .75rem;
}

.dish-card__footer { display: flex; align-items: center; justify-content: space-between; margin-top: auto;}

.dish-card__price { font-size: 1.15rem; font-weight: 800; color: var(--accent); }

.dish-card__tag {
  font-size: .65rem; font-weight: 700; text-transform: uppercase;
  padding: .2rem .5rem; border-radius: 6px;
  background: var(--accent-light); color: var(--accent);
}
.dish-card__tag--sold { background: var(--border); color: var(--text-muted); }

/* ── Modal (dish detail) ──────────────────────────── */
.modal-backdrop {
  position: fixed; inset: 0; background: rgba(0,0,0,.5);
  z-index: 200; backdrop-filter: blur(4px); -webkit-backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: fadein .2s ease;
}
@keyframes fadein { from { opacity: 0; } to { opacity: 1; } }

.modal {
  background: var(--bg-card); border-radius: 24px 24px 0 0;
  width: 100%; max-width: 520px; max-height: 90vh; overflow-y: auto;
  animation: slideup .3s var(--ease); scrollbar-width: none;
  box-shadow: 0 -10px 40px rgba(0,0,0,0.1);
}
.modal::-webkit-scrollbar { display: none; }
@keyframes slideup {
  from { transform: translateY(100%); opacity: 0; }
  to   { transform: translateY(0);    opacity: 1; }
}

.modal__img {
  width: 100%;
  aspect-ratio: 1 / 1;
  max-width: 240px; /* Nhỏ lại một xíu để thoáng mắt hơn */
  object-fit: contain;
  margin: 2rem auto 0;
  display: block;
  filter: drop-shadow(0 15px 25px rgba(0,0,0,0.08)); /* Bóng đổ nhẹ đĩa nổi lên */
}

.modal__body { padding: 1.25rem 1.5rem 2rem; text-align: center; }

.modal__name { font-size: 1.5rem; font-weight: 800; color: var(--text); margin-bottom: .85rem; letter-spacing: -0.02em; }

.modal__desc { color: var(--text-muted); font-size: .95rem; line-height: 1.65; margin-bottom: 1.5rem; text-align: justify; }

.modal__price { font-size: 1.6rem; font-weight: 800; color: var(--accent); margin-bottom: 2rem; }

.modal__close {
  display: flex; align-items: center; justify-content: center; gap: .5rem;
  width: 100%; background: var(--bg); border: 1px solid var(--border);
  border-radius: var(--pill-radius); padding: 1rem;
  color: var(--text); font-family: var(--font); font-size: 1rem; font-weight: 600;
  cursor: pointer; transition: background .2s;
}
.modal__close:hover { background: var(--border); }

/* ── Footer ─────────────────────────────────────────── */
.footer {
  text-align: center; padding: 2rem 1rem 3rem; color: var(--text-muted); font-size: .85rem; line-height: 2;
}
.footer__name { font-weight: 700; color: var(--text); font-size: 1rem; }
.footer__phone { display: inline-block; color: var(--primary); text-decoration: none; font-weight: 700; }
.footer__copy { color: #94a3b8; font-size: .75rem; }

/* ── Desktop Grids ────────────────────────────────────── */
@media (min-width: 600px) {
  .dishes-grid { display: grid; grid-template-columns: repeat(2, 1fr); align-items: stretch; gap: 1.5rem; }
  .hero { padding: 3rem 2rem; }
  /* Make card bigger on desktop */
  .dish-card__img-wrap { width: 120px; height: 120px; }
}
