/* ===== RESET & BASE ===== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  min-height: 100vh;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  text-decoration: none;
  color: inherit;
}

/* ===== LOADING SCREEN ===== */
.loading-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  z-index: 9999;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

.loading-screen.fade-out {
  opacity: 0;
  visibility: hidden;
}

.spinner {
  width: 44px;
  height: 44px;
  border: 3px solid #e0e0e0;
  border-top-color: #667eea;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.loading-text {
  margin-top: 16px;
  font-size: 15px;
  color: #888;
  font-weight: 500;
}

/* ===== ERROR SCREEN ===== */
.error-screen {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: #fff;
  padding: 32px;
  text-align: center;
  z-index: 9998;
}

.error-icon {
  color: #ccc;
  margin-bottom: 24px;
}

.error-title {
  font-size: 22px;
  font-weight: 700;
  color: #333;
  margin-bottom: 8px;
}

.error-desc {
  font-size: 15px;
  color: #888;
  max-width: 300px;
  line-height: 1.5;
}

/* ===== HIDDEN UTILITY ===== */
.hidden {
  display: none !important;
}

/* ===== LANGUAGE TOGGLE ===== */
.lang-toggle {
  position: absolute;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  border-radius: 20px;
  overflow: hidden;
  border: 1px solid rgba(128, 128, 128, 0.25);
}

.lang-btn {
  padding: 5px 12px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  border: none;
  outline: none;
  background: transparent;
  color: rgba(128, 128, 128, 0.7);
  transition: all 0.2s ease;
  font-family: 'Inter', sans-serif;
  letter-spacing: 0.5px;
  -webkit-tap-highlight-color: transparent;
}

.lang-btn.active {
  background: rgba(128, 128, 128, 0.15);
  color: inherit;
}

/* Theme-specific language toggle */
.theme-classic .lang-toggle {
  border-color: #ddd;
}

.theme-classic .lang-btn {
  color: #999;
}

.theme-classic .lang-btn.active {
  background: #333;
  color: #fff;
}

.theme-dark .lang-toggle {
  border-color: #2a2a4a;
}

.theme-dark .lang-btn {
  color: #666;
}

.theme-dark .lang-btn.active {
  background: #667eea;
  color: #fff;
}

.theme-warm .lang-toggle {
  border-color: #D7CCC8;
}

.theme-warm .lang-btn {
  color: #8D6E63;
}

.theme-warm .lang-btn.active {
  background: #8D6E63;
  color: #fff;
}

.theme-modern .lang-toggle {
  border-color: rgba(255, 255, 255, 0.3);
}

.theme-modern .lang-btn {
  color: rgba(255, 255, 255, 0.5);
}

.theme-modern .lang-btn.active {
  background: rgba(255, 255, 255, 0.25);
  color: #fff;
}

/* ===== MENU HEADER ===== */
.menu-header {
  position: relative;
  padding: 48px 24px 32px;
  text-align: center;
  overflow: hidden;
}

.header-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.header-content {
  position: relative;
  z-index: 1;
}

.logo-wrapper {
  width: 88px;
  height: 88px;
  margin: 0 auto 16px;
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
}

.business-logo {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.business-name {
  font-size: 28px;
  font-weight: 700;
  margin-bottom: 6px;
  letter-spacing: -0.3px;
}

.business-desc {
  font-size: 15px;
  opacity: 0.75;
  max-width: 320px;
  margin: 0 auto;
}

/* ===== SOCIAL LINKS ===== */
.social-links {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 16px;
  flex-wrap: wrap;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  margin: 0 6px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.7;
}

.social-link:hover {
  transform: scale(1.15);
  opacity: 1;
}

.social-link:active {
  transform: scale(0.95);
}

.footer-social {
  margin-top: 0;
  margin-bottom: 16px;
}

/* Theme-specific social links */
.theme-classic .social-link {
  background: #f0f0f0;
  color: #555;
}

.theme-dark .social-link {
  background: #2a2a4a;
  color: #ccc;
}

.theme-warm .social-link {
  background: #EFEBE9;
  color: #5D4037;
}

.theme-modern .social-link {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

/* ===== WORKING HOURS ===== */
.working-hours {
  margin-top: 20px;
  padding: 16px 20px;
  border-radius: 14px;
  max-width: 320px;
  margin-left: auto;
  margin-right: auto;
  text-align: left;
}

.working-hours-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 10px;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  opacity: 0.7;
}

.working-hours-list {
  display: flex;
  flex-direction: column;
}

.working-hours-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 5px 0;
  font-size: 13px;
}

.working-hours-day {
  font-weight: 600;
}

.working-hours-time {
  font-weight: 500;
  opacity: 0.8;
}

.working-hours-time.closed {
  color: #f44336;
  font-weight: 600;
  opacity: 1;
}

/* Theme-specific working hours */
.theme-classic .working-hours {
  background: #f5f5f5;
  border: 1px solid #eee;
}

.theme-dark .working-hours {
  background: #22223a;
  border: 1px solid #2a2a4a;
}

.theme-warm .working-hours {
  background: #EFEBE9;
  border: 1px solid #D7CCC8;
}

.theme-modern .working-hours {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
}

/* ===== CATEGORY NAV ===== */
.category-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  overflow: hidden;
  transition: box-shadow 0.2s ease;
}

.category-nav.scrolled {
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.category-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 16px;
  overflow-x: auto;
  scroll-behavior: smooth;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.category-tab {
  flex-shrink: 0;
  padding: 8px 18px;
  border-radius: 24px;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s ease;
  white-space: nowrap;
  border: none;
  outline: none;
  user-select: none;
  -webkit-tap-highlight-color: transparent;
}

/* ===== MENU CONTENT ===== */
.menu-content {
  padding: 8px 16px 24px;
  max-width: 640px;
  margin: 0 auto;
}

/* ===== CATEGORY SECTION ===== */
.category-section {
  margin-bottom: 28px;
}

.category-title {
  font-size: 20px;
  font-weight: 700;
  padding: 16px 0 12px;
  position: sticky;
  top: 52px;
  z-index: 50;
  letter-spacing: -0.2px;
}

/* ===== MENU ITEM CARD ===== */
.menu-item {
  display: flex;
  gap: 14px;
  padding: 14px;
  border-radius: 14px;
  margin-bottom: 10px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  opacity: 0;
  transform: translateY(12px);
  animation: fadeInUp 0.45s ease forwards;
}

.menu-item:active {
  transform: scale(0.98);
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.item-image-wrapper {
  flex-shrink: 0;
  width: 90px;
  height: 90px;
  border-radius: 12px;
  overflow: hidden;
  position: relative;
}

.item-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.item-image.loading {
  opacity: 0;
}

.item-image-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.item-image-placeholder svg {
  opacity: 0.25;
}

.item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.item-name {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 3px;
  line-height: 1.3;
}

.item-desc {
  font-size: 13px;
  opacity: 0.6;
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.item-calories {
  font-size: 12px;
  opacity: 0.5;
  margin-bottom: 6px;
  font-weight: 500;
}

.item-bottom {
  display: flex;
  align-items: center;
  gap: 10px;
}

.item-price {
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.2px;
}

.item-badge-unavailable {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 6px;
  background: #f44336;
  color: #fff;
  text-transform: uppercase;
  letter-spacing: 0.3px;
}

/* ===== DISCOUNT STYLES ===== */
.item-discount-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.item-discount-badge {
  display: inline-block;
  background: #EF4444;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  margin-right: 6px;
}

.item-discount-label {
  display: inline-block;
  background: #F59E0B;
  color: #fff;
  font-size: 11px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: 6px;
  letter-spacing: 0.3px;
  margin-right: 6px;
}

.item-price-original {
  font-size: 14px;
  font-weight: 500;
  text-decoration: line-through;
  opacity: 0.45;
  margin-right: 8px;
}

.item-price-discounted {
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.2px;
  color: #10B981;
}

/* Theme-specific discount price colors */
.theme-classic .item-price-discounted {
  color: #16a34a;
}

.theme-dark .item-price-discounted {
  color: #34d399;
}

.theme-warm .item-price-discounted {
  color: #16a34a;
}

.theme-modern .item-price-discounted {
  color: #a7f3d0;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.theme-classic .item-price-original {
  color: #999;
}

.theme-dark .item-price-original {
  color: #666;
}

.theme-warm .item-price-original {
  color: #a1887f;
}

.theme-modern .item-price-original {
  color: rgba(255, 255, 255, 0.4);
}

.menu-item.unavailable {
  opacity: 0.5;
}

.menu-item.unavailable .item-image {
  filter: grayscale(100%);
}

/* ===== FOOTER ===== */
.menu-footer {
  padding: 28px 24px 36px;
  text-align: center;
}

.footer-info {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.footer-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  padding: 10px 20px;
  border-radius: 12px;
  transition: transform 0.2s ease, opacity 0.2s ease;
  font-weight: 500;
}

.footer-link:active {
  transform: scale(0.97);
  opacity: 0.8;
}

.footer-brand {
  font-size: 13px;
  opacity: 0.45;
  padding-top: 16px;
  border-top: 1px solid rgba(128, 128, 128, 0.15);
}

.footer-brand strong {
  font-weight: 700;
}

/* ========================================
   THEMES
   ======================================== */

/* --- CLASSIC --- */
.theme-classic body,
body.theme-classic {
  background: #ffffff;
  color: #333333;
}

.theme-classic .menu-header {
  background: #fafafa;
  border-bottom: 1px solid #eee;
}

.theme-classic .business-name {
  font-family: 'Playfair Display', Georgia, serif;
  color: #222;
}

.theme-classic .business-desc {
  color: #666;
}

.theme-classic .category-nav {
  background: #ffffff;
  border-bottom: 1px solid #f0f0f0;
}

.theme-classic .category-tab {
  background: #f5f5f5;
  color: #666;
}

.theme-classic .category-tab.active {
  background: #333;
  color: #fff;
}

.theme-classic .category-title {
  color: #222;
  background: #ffffff;
  font-family: 'Playfair Display', Georgia, serif;
}

.theme-classic .menu-item {
  background: #fafafa;
  border: 1px solid #f0f0f0;
}

.theme-classic .item-name {
  color: #222;
}

.theme-classic .item-price {
  color: #333;
}

.theme-classic .item-image-placeholder {
  background: #f0f0f0;
}

.theme-classic .footer-link {
  background: #f5f5f5;
  color: #444;
}

.theme-classic .menu-footer {
  background: #fafafa;
}

/* --- DARK --- */
.theme-dark body,
body.theme-dark {
  background: #1a1a2e;
  color: #eeeeee;
}

.theme-dark .loading-screen {
  background: #1a1a2e;
}

.theme-dark .loading-text {
  color: #aaa;
}

.theme-dark .spinner {
  border-color: #333;
  border-top-color: #667eea;
}

.theme-dark .error-screen {
  background: #1a1a2e;
}

.theme-dark .error-title {
  color: #eee;
}

.theme-dark .error-desc {
  color: #999;
}

.theme-dark .menu-header {
  background: linear-gradient(135deg, #16213e 0%, #1a1a2e 100%);
}

.theme-dark .business-name {
  color: #fff;
}

.theme-dark .business-desc {
  color: #aaa;
}

.theme-dark .category-nav {
  background: #1a1a2e;
  border-bottom: 1px solid #2a2a4a;
}

.theme-dark .category-tab {
  background: #2a2a4a;
  color: #999;
}

.theme-dark .category-tab.active {
  background: #667eea;
  color: #fff;
}

.theme-dark .category-title {
  color: #ddd;
  background: #1a1a2e;
}

.theme-dark .menu-item {
  background: #22223a;
  border: 1px solid #2a2a4a;
}

.theme-dark .item-name {
  color: #eee;
}

.theme-dark .item-desc {
  color: #999;
}

.theme-dark .item-price {
  color: #667eea;
}

.theme-dark .item-image-placeholder {
  background: #2a2a4a;
}

.theme-dark .footer-link {
  background: #22223a;
  color: #ccc;
}

.theme-dark .menu-footer {
  background: #16213e;
  color: #888;
}

/* --- WARM --- */
.theme-warm body,
body.theme-warm {
  background: #FFF8F0;
  color: #5D4037;
}

.theme-warm .loading-screen {
  background: #FFF8F0;
}

.theme-warm .spinner {
  border-color: #e0d0c0;
  border-top-color: #8D6E63;
}

.theme-warm .error-screen {
  background: #FFF8F0;
}

.theme-warm .error-title {
  color: #5D4037;
}

.theme-warm .menu-header {
  background: linear-gradient(135deg, #EFEBE9 0%, #FFF8F0 100%);
}

.theme-warm .business-name {
  font-family: 'Playfair Display', Georgia, serif;
  color: #4E342E;
}

.theme-warm .business-desc {
  color: #8D6E63;
}

.theme-warm .category-nav {
  background: #FFF8F0;
  border-bottom: 1px solid #EFEBE9;
}

.theme-warm .category-tab {
  background: #EFEBE9;
  color: #8D6E63;
}

.theme-warm .category-tab.active {
  background: #8D6E63;
  color: #fff;
}

.theme-warm .category-title {
  color: #4E342E;
  background: #FFF8F0;
  font-family: 'Playfair Display', Georgia, serif;
}

.theme-warm .menu-item {
  background: #fff;
  border: 1px solid #EFEBE9;
  box-shadow: 0 2px 8px rgba(93, 64, 55, 0.06);
}

.theme-warm .item-name {
  color: #4E342E;
}

.theme-warm .item-price {
  color: #8D6E63;
}

.theme-warm .item-image-placeholder {
  background: #EFEBE9;
}

.theme-warm .footer-link {
  background: #EFEBE9;
  color: #5D4037;
}

.theme-warm .menu-footer {
  background: #EFEBE9;
  color: #8D6E63;
}

/* --- MODERN --- */
.theme-modern body,
body.theme-modern {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  color: #ffffff;
  min-height: 100vh;
}

.theme-modern .loading-screen {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.theme-modern .loading-text {
  color: rgba(255, 255, 255, 0.7);
}

.theme-modern .spinner {
  border-color: rgba(255, 255, 255, 0.2);
  border-top-color: #fff;
}

.theme-modern .error-screen {
  background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.theme-modern .error-icon {
  color: rgba(255, 255, 255, 0.5);
}

.theme-modern .error-title {
  color: #fff;
}

.theme-modern .error-desc {
  color: rgba(255, 255, 255, 0.7);
}

.theme-modern .menu-header {
  background: transparent;
  padding-top: 56px;
}

.theme-modern .business-name {
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.15);
}

.theme-modern .business-desc {
  color: rgba(255, 255, 255, 0.8);
}

.theme-modern .logo-wrapper {
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

.theme-modern .category-nav {
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
}

.theme-modern .category-tab {
  background: rgba(255, 255, 255, 0.15);
  color: rgba(255, 255, 255, 0.75);
}

.theme-modern .category-tab.active {
  background: #fff;
  color: #667eea;
}

.theme-modern .category-title {
  color: #fff;
  background: transparent;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.1);
}

.theme-modern .menu-item {
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.theme-modern .item-name {
  color: #fff;
}

.theme-modern .item-desc {
  color: rgba(255, 255, 255, 0.65);
}

.theme-modern .item-price {
  color: #fff;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}

.theme-modern .item-image-placeholder {
  background: rgba(255, 255, 255, 0.1);
}

.theme-modern .item-image-placeholder svg {
  color: rgba(255, 255, 255, 0.3);
}

.theme-modern .footer-link {
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
}

.theme-modern .menu-footer {
  color: rgba(255, 255, 255, 0.6);
}

.theme-modern .footer-brand {
  border-top-color: rgba(255, 255, 255, 0.1);
}

/* ===== RESPONSIVE ===== */
@media (min-width: 480px) {
  .menu-header {
    padding: 56px 32px 36px;
  }

  .logo-wrapper {
    width: 96px;
    height: 96px;
  }

  .business-name {
    font-size: 32px;
  }

  .menu-content {
    padding: 12px 24px 32px;
  }

  .item-image-wrapper {
    width: 100px;
    height: 100px;
  }
}

@media (min-width: 768px) {
  .menu-header {
    padding: 64px 40px 44px;
  }

  .business-name {
    font-size: 36px;
  }

  .menu-content {
    max-width: 680px;
  }

  .menu-item {
    padding: 18px;
    gap: 18px;
  }

  .item-image-wrapper {
    width: 110px;
    height: 110px;
  }

  .item-name {
    font-size: 17px;
  }

  .item-desc {
    font-size: 14px;
  }
}

/* ===== ANIMATION DELAYS ===== */
.menu-item:nth-child(1) { animation-delay: 0.05s; }
.menu-item:nth-child(2) { animation-delay: 0.1s; }
.menu-item:nth-child(3) { animation-delay: 0.15s; }
.menu-item:nth-child(4) { animation-delay: 0.2s; }
.menu-item:nth-child(5) { animation-delay: 0.25s; }
.menu-item:nth-child(6) { animation-delay: 0.3s; }
.menu-item:nth-child(7) { animation-delay: 0.35s; }
.menu-item:nth-child(8) { animation-delay: 0.4s; }
.menu-item:nth-child(9) { animation-delay: 0.45s; }
.menu-item:nth-child(10) { animation-delay: 0.5s; }

/* ===== PRINT ===== */
@media print {
  .category-nav,
  .menu-footer {
    display: none;
  }
}
