*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

:root {
  --orange: #e85d04;
  --orange-dark: #d45203;
  --text-dark: #1a1a1a;
  --text-muted: #888;
  --text-light: #aaa;
  --bg: #f5f5f5;
  --white: #ffffff;
  --border: #e8e8e8;
  --shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  --radius: 8px;
  --font: 'Noto Sans', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--text-dark);
  min-height: 100vh;
  max-width: 480px;
  margin: 0 auto;
  overflow-x: hidden;
}

/* ── Top Bar ── */
.top-bar {
  background: var(--orange);
  height: 6px;
  position: sticky;
  top: 0;
  z-index: 100;
}

/* ── Hero Section ── */
.hero {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(2px) brightness(0.7);
  transform: scale(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(0,0,0,0.3));
}

.hero-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 90px;
  height: 90px;
  background: var(--white);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
  overflow: hidden;
  padding: 14px;
}

.hero-logo .site-logo-text {
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: var(--text-dark);
  text-transform: lowercase;
  line-height: 1;
}

.hero-logo:has(img) {
  padding: 0;
}

.hero-logo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 50%;
}

/* ── Restaurant Info ── */
.restaurant-info {
  background: var(--white);
  padding: 20px 16px 16px;
  text-align: center;
}

.restaurant-name {
  font-size: 1.25rem;
  font-weight: 700;
  margin-bottom: 6px;
}

.restaurant-location {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  color: var(--text-muted);
  font-size: 0.875rem;
  margin-bottom: 14px;
}

.restaurant-location i {
  font-size: 14px;
  color: var(--text-muted);
}

.social-link i {
  font-size: 18px;
  color: var(--text-dark);
  line-height: 1;
}

.social-links {
  display: flex;
  justify-content: center;
  gap: 12px;
}

.social-link {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--bg);
  display: flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  transition: background 0.2s;
}

.social-link:hover {
  background: #e8e8e8;
}

/* ── Category Grid (Home) ── */
.category-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  padding: 6px;
  background: var(--white);
}

.category-card {
  position: relative;
  aspect-ratio: 1 / 1.05;
  overflow: hidden;
  cursor: pointer;
  text-decoration: none;
  display: block;
  border-radius: 6px;
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s;
}

.category-card:hover img {
  transform: scale(1.05);
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.55) 0%, rgba(0,0,0,0.15) 60%, rgba(0,0,0,0.05) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-card-name {
  color: var(--white);
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: 0.8px;
  text-align: center;
  padding: 10px;
  text-shadow: 0 1px 4px rgba(0,0,0,0.5);
}

/* ── Menu Page Header ── */
.menu-header {
  background: var(--white);
  position: sticky;
  top: 6px;
  z-index: 90;
  border-bottom: 1px solid var(--border);
  overflow: visible;
}

.menu-header .theme-default-toolbar {
  position: static;
  border-bottom: none;
  padding: 8px 12px 0;
}

.menu-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
}

.back-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  font-size: 0.95rem;
  color: var(--text-dark);
  cursor: pointer;
  padding: 6px 8px;
  border-radius: var(--radius);
  text-decoration: none;
  font-family: var(--font);
}

.back-btn:hover {
  background: var(--bg);
}

.back-btn i {
  font-size: 14px;
}

.view-toggle {
  display: flex;
  gap: 4px;
}

.view-btn {
  width: 36px;
  height: 36px;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: color 0.2s, background 0.2s;
}

.view-btn.active {
  color: var(--text-dark);
  background: var(--bg);
}

.view-btn i {
  font-size: 16px;
}

/* ── Category Tabs (Horizontal Scroll) ── */
.category-tabs {
  display: flex;
  gap: 8px;
  padding: 10px 12px 12px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  position: relative;
  width: 100px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.2s;
  text-decoration: none;
}

.category-tab.active {
  border-color: var(--orange);
}

.category-tab img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-tab-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
}

.category-tab.active .category-tab-overlay {
  background: rgba(232, 93, 4, 0.35);
}

.category-tab-name {
  color: var(--white);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-align: center;
  line-height: 1.2;
  padding: 4px;
  text-shadow: 0 1px 3px rgba(0,0,0,0.6);
}

/* ── Category Title ── */
.category-title {
  padding: 12px 16px 8px;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.5px;
  background: var(--bg);
}

/* ── Items Grid ── */
.items-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 8px;
  background: var(--bg);
}

.items-grid.list-view {
  grid-template-columns: 1fr;
}

.item-card {
  background: var(--white);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
}

.items-grid.list-view .item-card {
  flex-direction: row;
}

.item-image-wrap {
  position: relative;
  overflow: hidden;
}

.items-grid:not(.list-view) .item-image-wrap {
  aspect-ratio: 4 / 3;
}

.items-grid.list-view .item-image-wrap {
  width: 120px;
  flex-shrink: 0;
}

.item-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.item-body {
  padding: 10px 10px 12px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.items-grid.list-view .item-body {
  padding: 12px;
}

.item-name {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  line-height: 1.3;
  margin-bottom: 6px;
}

.item-description {
  font-size: 0.68rem;
  color: var(--text-muted);
  line-height: 1.45;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-meta-badges {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px;
  margin: 4px 0 8px;
}

.item-meta-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 7px 3px 3px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: #fff;
  font-size: 0.6rem;
  font-weight: 600;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.item-meta-badge-icon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.item-meta-badge-icon i {
  font-size: 0.65rem;
  line-height: 1;
}

.item-meta-badge-label {
  padding-right: 1px;
  white-space: nowrap;
}

.item-meta-alcohol {
  border-color: #ddd6fe;
  background: #faf5ff;
}

.item-meta-alcohol .item-meta-badge-icon {
  background: #ede9fe;
  color: #7c3aed;
}

.item-meta-alcohol .item-meta-badge-label {
  color: #5b21b6;
}

.item-meta-allergen {
  border-color: #fde68a;
  background: #fffbeb;
}

.item-meta-allergen .item-meta-badge-icon {
  background: #fef3c7;
  color: #d97706;
}

.item-meta-allergen .item-meta-badge-label {
  color: #92400e;
}

.item-meta-spicy {
  border-color: #fecaca;
  background: #fef2f2;
}

.item-meta-spicy .item-meta-badge-icon {
  background: #fee2e2;
  color: #dc2626;
}

.item-meta-spicy .item-meta-badge-label {
  color: #b91c1c;
}

.item-meta-calories {
  border-color: #e7e5e4;
  background: #fafaf9;
}

.item-meta-calories .item-meta-badge-icon {
  background: #f5f5f4;
  color: #ea580c;
}

.item-meta-calories .item-meta-badge-label {
  color: #44403c;
}

.modal-meta {
  margin-bottom: 10px;
}

.modal-meta .item-meta-badges {
  margin: 0;
}

.items-grid.list-view .item-description {
  -webkit-line-clamp: 3;
}

.item-footer {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  margin-top: 8px;
  gap: 6px;
}

.item-price {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-dark);
}

.item-info-btn {
  width: 22px;
  height: 22px;
  border: 1.5px solid var(--border);
  border-radius: 4px;
  background: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  flex-shrink: 0;
}

.item-info-btn i {
  font-size: 11px;
}

/* ── Item Detail Modal ── */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  z-index: 200;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s, visibility 0.3s;
}

.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--white);
  border-radius: 16px 16px 0 0;
  width: 100%;
  max-width: 480px;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.3s;
}

.modal-overlay.open .modal {
  transform: translateY(0);
}

.modal-image {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.modal-content {
  padding: 20px 16px 32px;
}

.modal-name {
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 8px;
}

.modal-description {
  font-size: 0.875rem;
  color: var(--text-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.modal-price {
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--orange);
}

.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  z-index: 10;
}

.modal-image-wrap {
  position: relative;
}

/* ── Theme credit ── */
.theme-credit {
  text-align: center;
  padding: 14px 16px 20px;
  font-size: 0.68rem;
  line-height: 1.4;
  color: var(--text-muted);
}

.theme-credit a {
  color: inherit;
  text-decoration: none;
  transition: color 0.2s;
}

.theme-credit a:hover {
  color: var(--orange);
  text-decoration: underline;
}

/* ── Responsive ── */
@media (min-width: 481px) {
  body {
    box-shadow: 0 0 40px rgba(0,0,0,0.1);
  }
}
