/* ============================
   CSS Variables & Reset
   ============================ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg:        #ffffff;
  --surface:   #ffffff;
  --surface2:  #ffffff;
  --border:    rgba(0,0,0,0.1);
  --accent:    #c0392b;
  --accent2:   #e8436a;
  --text:      #1a1a1a;
  --muted:     #888888;
  --radius:    16px;
  --radius-sm: 10px;
  --shadow:    0 8px 32px rgba(0,0,0,0.12);
  --transition: 0.25s cubic-bezier(0.4,0,0.2,1);
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans Thai', 'Sarabun', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ============================
   Banner
   ============================ */
.banner {
  background: #ffffff;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 24px;
}

.banner-logo {
  width: min(200px, 50vw);
  height: auto;
  display: block;
}

/* ============================
   Hero
   ============================ */
.hero {
  position: relative;
  min-height: 340px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background: linear-gradient(135deg, #1a0533 0%, #0d1b45 40%, #0a3d2e 100%);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(245,166,35,0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 20%, rgba(232,67,106,0.15) 0%, transparent 55%),
    radial-gradient(ellipse at 60% 80%, rgba(39,174,96,0.12) 0%, transparent 50%);
  animation: heroGlow 6s ease-in-out infinite alternate;
}

@keyframes heroGlow {
  from { opacity: 0.8; }
  to   { opacity: 1; }
}

.hero-content {
  position: relative;
  text-align: center;
  padding: 48px 24px 72px;
  z-index: 1;
}

.hero-logo {
  width: min(280px, 70vw);
  height: auto;
  border-radius: 20px;
  animation: floatBadge 3s ease-in-out infinite;
  filter: drop-shadow(0 8px 32px rgba(0,0,0,0.5));
}

.navbar-logo {
  height: 34px;
  width: auto;
  border-radius: 6px;
  flex-shrink: 0;
  display: block;
}

.logo-badge {
  font-size: 64px;
  display: inline-block;
  animation: floatBadge 3s ease-in-out infinite;
  filter: drop-shadow(0 4px 20px rgba(245,166,35,0.6));
}

@keyframes floatBadge {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-10px); }
}

.hero-title {
  font-size: clamp(2rem, 6vw, 3.5rem);
  font-weight: 700;
  letter-spacing: -0.5px;
  margin-top: 12px;
  background: linear-gradient(135deg, #f5a623, #f7d28a, #f5a623);
  background-size: 200% 200%;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  animation: shimmer 3s linear infinite;
}

@keyframes shimmer {
  0%   { background-position: 0% 50%; }
  100% { background-position: 200% 50%; }
}

.hero-subtitle {
  font-size: 1.05rem;
  color: rgba(255,255,255,0.65);
  margin-top: 8px;
  letter-spacing: 0.5px;
}

.hero-tags {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 20px;
}

.tag {
  background: rgba(255,255,255,0.1);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 50px;
  padding: 6px 16px;
  font-size: 0.82rem;
  color: rgba(255,255,255,0.8);
}

.wave-divider {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  height: 80px;
  line-height: 0;
}
.wave-divider svg { width: 100%; height: 80px; }

/* ============================
   Controls (Search + Tabs)
   ============================ */
.controls-wrapper {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  padding: 14px 24px 0;
  backdrop-filter: blur(20px);
}

.top-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  max-width: 720px;
  margin: 0 auto 14px;
}

.search-bar {
  position: relative;
  flex: 1;
}

.search-icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 1rem;
  pointer-events: none;
}

#search-input {
  width: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 11px 44px 11px 42px;
  font-size: 0.95rem;
  font-family: inherit;
  color: var(--text);
  outline: none;
  transition: border-color var(--transition), box-shadow var(--transition);
}

#search-input:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(245,166,35,0.15);
}

.clear-btn {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--surface2);
  border: none;
  color: var(--muted);
  width: 24px; height: 24px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.75rem;
  transition: all var(--transition);
}
.clear-btn:hover { background: var(--accent2); color: white; }

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.category-tabs::-webkit-scrollbar { display: none; }

.tab-btn {
  flex-shrink: 0;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 7px 18px;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.tab-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tab-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0f1117;
  font-weight: 600;
  box-shadow: 0 4px 16px rgba(245,166,35,0.35);
}

/* Language Switcher */
.lang-switcher {
  display: flex;
  gap: 4px;
  flex-shrink: 0;
}

.lang-btn {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 7px 14px;
  font-size: 0.8rem;
  font-family: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  font-weight: 500;
}

.lang-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.lang-btn.active {
  background: var(--surface2);
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 700;
}

/* ============================
   Menu Section
   ============================ */
.menu-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 32px 24px 120px;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-header h2 {
  font-size: 1.4rem;
  font-weight: 600;
}

.item-count {
  background: var(--surface2);
  border-radius: 50px;
  padding: 3px 12px;
  font-size: 0.82rem;
  color: var(--muted);
}

/* ============================
   Menu Grid & Cards
   ============================ */
.menu-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 20px;
}

.menu-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
  animation: fadeUp 0.4s ease both;
  position: relative;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.menu-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  border-color: rgba(245,166,35,0.3);
}

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

.card-image-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  position: relative;
  background: var(--surface2);
}

.card-img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.5s cubic-bezier(0.4,0,0.2,1);
  display: block;
}

.card-img-placeholder {
  width: 100%; height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--muted);
}

.card-cat-badge {
  position: absolute;
  top: 10px; left: 10px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  border-radius: 50px;
  padding: 3px 10px;
  font-size: 0.72rem;
  color: rgba(255,255,255,0.85);
  border: 1px solid rgba(255,255,255,0.1);
}

.card-add-btn {
  position: absolute;
  bottom: 10px; right: 10px;
  width: 34px; height: 34px;
  background: var(--accent);
  border: none;
  border-radius: 50%;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  opacity: 0;
  transform: scale(0.7);
  transition: all var(--transition);
  box-shadow: 0 4px 12px rgba(245,166,35,0.5);
}

.menu-card:hover .card-add-btn {
  opacity: 1;
  transform: scale(1);
}

.card-add-btn:hover {
  transform: scale(1.1) !important;
  background: #f7c244;
}

.card-body {
  padding: 14px 14px 16px;
}

.card-name {
  font-size: 0.92rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-name-sub {
  display: block;
  font-size: 0.75rem;
  color: var(--muted);
  margin-top: 3px;
  line-height: 1.3;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}



/* ============================
   No Results
   ============================ */
.no-results {
  text-align: center;
  padding: 80px 20px;
}
.no-results-icon { font-size: 4rem; margin-bottom: 12px; }
.no-results p { color: var(--muted); font-size: 1.1rem; }

/* ============================
   Cart FAB
   ============================ */
.cart-fab {
  position: fixed;
  bottom: 28px; right: 28px;
  width: 62px; height: 62px;
  background: linear-gradient(135deg, var(--accent), #e8943a);
  border: none;
  border-radius: 50%;
  font-size: 1.5rem;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(245,166,35,0.5);
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
  z-index: 200;
  animation: popIn 0.3s cubic-bezier(0.34,1.56,0.64,1) both;
}

@keyframes popIn {
  from { transform: scale(0); }
  to   { transform: scale(1); }
}

.cart-fab:hover {
  transform: scale(1.1);
  box-shadow: 0 12px 36px rgba(245,166,35,0.65);
}

.cart-badge {
  position: absolute;
  top: -4px; right: -4px;
  background: var(--accent2);
  color: white;
  font-size: 0.7rem;
  font-weight: 700;
  width: 20px; height: 20px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid var(--bg);
}

/* ============================
   Cart Drawer
   ============================ */
.cart-overlay {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(4px);
  z-index: 300;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}

.cart-overlay.show { opacity: 1; pointer-events: all; }

.cart-drawer {
  position: fixed;
  top: 0; right: 0;
  width: min(400px, 100vw);
  height: 100vh;
  background: var(--surface);
  border-left: 1px solid var(--border);
  z-index: 400;
  display: flex; flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4,0,0.2,1);
  box-shadow: -16px 0 48px rgba(0,0,0,0.4);
}

.cart-drawer.open {
  transform: translateX(0);
}

.cart-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  font-size: 1.1rem;
  font-weight: 600;
}

.close-cart {
  background: var(--surface2);
  border: none;
  color: var(--text);
  width: 34px; height: 34px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all var(--transition);
}
.close-cart:hover { background: var(--accent2); color: white; }

.cart-items {
  flex: 1;
  overflow-y: auto;
  padding: 16px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.cart-item {
  display: flex;
  gap: 12px;
  align-items: center;
  background: var(--surface2);
  border-radius: var(--radius-sm);
  padding: 12px;
  animation: fadeUp 0.3s ease;
}

.cart-item-img {
  width: 56px; height: 56px;
  border-radius: 8px;
  object-fit: cover;
  flex-shrink: 0;
}

.cart-item-info { flex: 1; min-width: 0; }
.cart-item-name { font-size: 0.88rem; font-weight: 500; line-height: 1.3; }
.cart-item-qty-label { font-size: 0.82rem; color: var(--muted); margin-top: 4px; }

.cart-item-controls {
  display: flex; align-items: center; gap: 8px; flex-shrink: 0;
}

.qty-ctrl {
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text);
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  display: flex; align-items: center; justify-content: center;
  transition: all var(--transition);
}
.qty-ctrl:hover { border-color: var(--accent); color: var(--accent); }
.cart-item-qty { min-width: 20px; text-align: center; font-weight: 600; font-size: 0.9rem; }

.cart-footer {
  padding: 20px 24px;
  border-top: 1px solid var(--border);
}

.order-btn {
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #e8943a);
  border: none;
  border-radius: 50px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #0f1117;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 8px 24px rgba(245,166,35,0.4);
}
.order-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(245,166,35,0.55);
}

.cart-empty {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  font-size: 3rem;
  color: var(--muted);
  gap: 12px;
}
.cart-empty p { font-size: 1rem; }

/* ============================
   Lightbox
   ============================ */
.lightbox {
  position: fixed; inset: 0;
  z-index: 500;
  display: flex; align-items: center; justify-content: center;
  padding: 20px;
  opacity: 0; pointer-events: none;
  transition: opacity var(--transition);
}
.lightbox.show { opacity: 1; pointer-events: all; }

.lightbox-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.85);
  backdrop-filter: blur(8px);
}

.lightbox-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 24px;
  max-width: 480px;
  width: 100%;
  overflow: hidden;
  box-shadow: 0 32px 80px rgba(0,0,0,0.7);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34,1.56,0.64,1);
}
.lightbox.show .lightbox-card { transform: scale(1); }

.lightbox-close {
  position: absolute;
  top: 14px; right: 14px;
  background: rgba(0,0,0,0.6);
  backdrop-filter: blur(8px);
  border: none;
  color: white;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 0.85rem;
  z-index: 10;
  transition: all var(--transition);
}
.lightbox-close:hover { background: var(--accent2); }

.lightbox-image-wrap {
  width: 100%;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--surface2);
}
.lightbox-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
  display: block;
}

.lightbox-info {
  padding: 24px;
}

.lightbox-info h2 {
  font-size: 1.25rem;
  font-weight: 700;
  line-height: 1.35;
}

#lb-sub-names { margin-top: 6px; }

.lb-sub {
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.4;
  margin-top: 2px;
}

.lightbox-qty {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 18px;
}

.qty-btn {
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  width: 40px; height: 40px;
  border-radius: 50%;
  font-size: 1.4rem;
  cursor: pointer;
  transition: all var(--transition);
  display: flex; align-items: center; justify-content: center;
}
.qty-btn:hover { border-color: var(--accent); color: var(--accent); }

#lb-qty {
  font-size: 1.4rem;
  font-weight: 700;
  min-width: 32px;
  text-align: center;
}

.add-to-cart-btn {
  margin-top: 20px;
  width: 100%;
  background: linear-gradient(135deg, var(--accent), #e8943a);
  border: none;
  border-radius: 50px;
  padding: 14px;
  font-size: 1rem;
  font-weight: 700;
  font-family: inherit;
  color: #0f1117;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 8px 24px rgba(245,166,35,0.35);
}
.add-to-cart-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 32px rgba(245,166,35,0.5);
}

/* ============================
   Toast
   ============================ */
.toast {
  position: fixed;
  bottom: 100px; left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 50px;
  padding: 12px 24px;
  font-size: 0.9rem;
  font-weight: 500;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transition: all 0.35s cubic-bezier(0.4,0,0.2,1);
  white-space: nowrap;
  z-index: 600;
}

.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ============================
   Footer
   ============================ */
.site-footer {
  text-align: center;
  padding: 24px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.85rem;
  background: var(--surface);
}

/* ============================
   Scrollbar
   ============================ */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--surface2); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--muted); }

/* ============================
   Loading Overlay
   ============================ */
.loading-overlay {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 20px;
}

.loading-spinner {
  width: 48px;
  height: 48px;
  border: 4px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.loading-text {
  color: var(--muted);
  font-size: 1rem;
  animation: pulse 1.5s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.5; }
  50% { opacity: 1; }
}

/* Error / Retry */
.load-error {
  text-align: center;
  padding: 80px 20px;
  grid-column: 1 / -1;
}

.load-error p {
  color: var(--muted);
  font-size: 1.1rem;
  margin-bottom: 20px;
}

.retry-btn {
  background: linear-gradient(135deg, var(--accent), #e8943a);
  border: none;
  border-radius: 50px;
  padding: 12px 28px;
  font-size: 0.95rem;
  font-weight: 600;
  font-family: inherit;
  color: #0f1117;
  cursor: pointer;
  transition: all var(--transition);
  box-shadow: 0 4px 16px rgba(245,166,35,0.35);
}

.retry-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(245,166,35,0.5);
}

/* ============================
   Responsive
   ============================ */
@media (max-width: 640px) {
  .menu-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
  .menu-section { padding: 24px 16px 100px; }
  .controls-wrapper { padding: 12px 16px 0; }
  .hero-content { padding: 48px 20px 80px; }
  .top-bar { flex-wrap: wrap; }
  .search-bar { min-width: 0; }
  .lang-btn { padding: 6px 10px; font-size: 0.75rem; }
}
