/* ========================================
   MODERN MENU DESIGN SYSTEM
   Premium Food Delivery Experience
   ======================================== */

:root {
  --primary-color: #ff6247;
  --primary-light: #ff8a75;
  --primary-lighter: #ffb8a8;
  --secondary-color: #4caf50;
  --text-dark: #2d3748;
  --text-medium: #4a5568;
  --text-light: #718096;
  --text-lighter: #a0aec0;
  --background: #f8f9fa;
  --card-bg: #ffffff;
  --border-color: #e2e8f0;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
  --shadow-lg: 0 8px 24px rgba(0, 0, 0, 0.15);
  --shadow-primary: 0 8px 24px rgba(255, 98, 71, 0.25);
  --radius-sm: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
}

/* ========================================
   GLOBAL STYLES
   ======================================== */

.modern-menu-body {
  background: var(--background);
  padding-bottom: 90px; /* Extra space for bottom nav */
  min-height: 100vh;
  overflow-x: hidden; /* Prevent horizontal scroll */
}

/* ========================================
   MODERN HEADER
   ======================================== */

.modern-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: white;
  z-index: 1000;
  box-shadow: var(--shadow-sm);
  animation: slideDown 0.4s ease-out;
}

@keyframes slideDown {
  from {
    transform: translateY(-100%);
  }
  to {
    transform: translateY(0);
  }
}

.modern-header-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 12px 20px;
}

/* Top Bar with Logo and Actions */
.modern-header-top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
}

/* Restaurant Info Section */
.modern-restaurant-info {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
}

.modern-restaurant-logo {
  width: 56px;
  height: 56px;
  border-radius: 14px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  background: white;
  padding: 4px;
}

.modern-restaurant-logo img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.modern-restaurant-details {
  flex: 1;
  min-width: 0;
}

.modern-restaurant-name {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-dark);
  margin: 0 0 2px 0;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.3px;
}

.modern-restaurant-tagline {
  font-size: 12px;
  color: var(--text-light);
  margin: 0;
  font-weight: 500;
}

/* Header Actions (Right Side) */
.modern-header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  justify-content: flex-end;
}

/* Compact Search Bar in Header */
.modern-header-search-compact {
  position: relative;
  flex: 1;
  max-width: 280px;
  margin-right: 12px;
}

.modern-search-icon-compact {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  color: #9ca3af;
  font-size: 14px;
  pointer-events: none;
}

.modern-search-input-compact {
  width: 100%;
  padding: 8px 36px 8px 36px;
  border: 1.5px solid var(--border-color);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-dark);
  transition: all 0.3s ease;
  background: var(--background);
}

.modern-search-input-compact:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 3px rgba(255, 98, 71, 0.08);
}

.modern-search-input-compact::placeholder {
  color: var(--text-light);
  font-size: 13px;
}

.modern-search-clear-compact {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  width: 22px;
  height: 22px;
  border: none;
  background: #e2e8f0;
  border-radius: 50%;
  color: #64748b;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 11px;
}

.modern-search-clear-compact:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-50%) scale(1.15);
}

/* Language Selector */
.modern-language-selector {
  position: relative;
}

.modern-language-selector .goog-te-combo {
  background: var(--background);
  border: 2px solid var(--border-color);
  border-radius: var(--radius-sm);
  padding: 8px 32px 8px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-dark);
  cursor: pointer;
  transition: all 0.3s ease;
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%234a5568' d='M6 9L1 4h10z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
}

.modern-language-selector .goog-te-combo:hover {
  border-color: var(--primary-color);
  background-color: white;
}

.modern-language-selector .goog-te-combo:focus {
  outline: none;
  border-color: var(--primary-color);
  box-shadow: 0 0 0 3px rgba(255, 98, 71, 0.1);
}

/* Hide Google Translate branding */
.modern-language-selector .goog-logo-link,
.modern-language-selector .goog-te-gadget span {
  display: none !important;
}

.modern-language-selector .goog-te-gadget {
  color: transparent !important;
  font-size: 0 !important;
}

/* Style the language dropdown */
.modern-language-selector #google_translate_element {
  display: flex;
  align-items: center;
}

.modern-language-selector .goog-te-gadget-simple {
  background: transparent !important;
  border: none !important;
  padding: 0 !important;
  display: flex !important;
  align-items: center !important;
}

.modern-language-selector .goog-te-menu-value {
  color: var(--text-dark) !important;
  font-weight: 600 !important;
}

.modern-language-selector .goog-te-menu-value span {
  display: none !important;
}

.modern-language-selector .goog-te-menu-value::before {
  content: "🌐 ";
  font-size: 16px;
  margin-right: 4px;
}

/* Cart Icon (Header) */
.modern-cart-icon {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color) 0%,
    var(--primary-light) 100%
  );
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 18px;
  cursor: pointer;
  box-shadow: var(--shadow-primary);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.modern-cart-icon:hover {
  transform: scale(1.05);
  box-shadow: 0 10px 30px rgba(255, 98, 71, 0.3);
}

.modern-cart-icon:active {
  transform: scale(0.95);
}

.modern-cart-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  min-width: 20px;
  height: 20px;
  background: #dc2626;
  color: white;
  border-radius: 10px;
  font-size: 11px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 6px;
  border: 2px solid white;
  animation: bounceIn 0.5s ease-out;
}

@keyframes bounceIn {
  0% {
    transform: scale(0);
  }
  50% {
    transform: scale(1.2);
  }
  100% {
    transform: scale(1);
  }
}

/* Search Bar Section (Below Header) */
.modern-search-bar-section {
  position: fixed;
  top: 80px;
  left: 0;
  right: 0;
  background: white;
  z-index: 999;
  padding: 12px 0;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
  animation: slideDown 0.5s ease-out;
}

.modern-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
}

.modern-search-icon {
  position: absolute;
  left: 16px;
  color: var(--text-lighter);
  font-size: 17px;
  pointer-events: none;
  z-index: 2;
}

.modern-search-input {
  width: 100%;
  height: 52px;
  padding: 0 44px 0 48px;
  border: 2px solid var(--border-color);
  border-radius: var(--radius-md);
  font-size: 15px;
  color: var(--text-dark);
  background: var(--background);
  transition: all 0.3s ease;
  font-weight: 500;
}

.modern-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: white;
  box-shadow: 0 0 0 4px rgba(255, 98, 71, 0.08);
}

.modern-search-input::placeholder {
  color: var(--text-lighter);
  font-weight: 400;
}

.modern-search-clear {
  position: absolute;
  right: 12px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--text-lighter);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  font-size: 12px;
}

.modern-search-clear:hover {
  background: var(--text-medium);
  transform: rotate(90deg);
}

/* ========================================
   MODERN BOTTOM NAVIGATION
   ======================================== */

.modern-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  display: flex;
  justify-content: space-around;
  align-items: center;
  padding: 8px 0 max(8px, env(safe-area-inset-bottom));
  box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
  z-index: 1000;
  border-top: 1px solid var(--border-color);
}

.modern-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 8px 12px;
  text-decoration: none;
  color: var(--text-light);
  transition: all 0.3s ease;
  position: relative;
  flex: 1;
  max-width: 100px;
}

.modern-nav-item:hover {
  text-decoration: none;
}

.modern-nav-icon {
  position: relative;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  transition: all 0.3s ease;
}

.modern-nav-label {
  font-size: 11px;
  font-weight: 600;
  transition: all 0.3s ease;
}

.modern-nav-item.active {
  color: var(--primary-color);
}

.modern-nav-item.active .modern-nav-icon {
  transform: scale(1.1);
}

.modern-nav-item.active::before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--primary-color);
  border-radius: 0 0 4px 4px;
}

.modern-nav-badge {
  position: absolute;
  top: -4px;
  right: -8px;
  min-width: 18px;
  height: 18px;
  background: var(--primary-color);
  color: white;
  border-radius: 9px;
  font-size: 10px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5px;
  border: 2px solid white;
}

/* ========================================
   MODERN CART SIDEBAR
   ======================================== */

.modern-cart-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modern-cart-sidebar.active {
  pointer-events: auto;
}

.modern-cart-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.modern-cart-sidebar.active .modern-cart-overlay {
  opacity: 1;
}

.modern-cart-content {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 100%;
  max-width: 400px;
  background: white;
  transform: translateX(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.modern-cart-sidebar.active .modern-cart-content {
  transform: translateX(0);
}

.modern-cart-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px;
  border-bottom: 1px solid var(--border-color);
  background: white;
}

.modern-cart-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0;
}

.modern-cart-title i {
  color: var(--primary-color);
}

.modern-cart-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--background);
  color: var(--text-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modern-cart-close:hover {
  background: var(--border-color);
  transform: rotate(90deg);
}

.modern-cart-body {
  flex: 1;
  overflow-y: auto;
  padding: 20px;
}

/* ========================================
   MODERN PROFILE MODAL
   ======================================== */

.modern-profile-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2000;
  display: flex;
  align-items: flex-end;
  pointer-events: none;
  transition: all 0.3s ease;
}

.modern-profile-modal.active {
  pointer-events: auto;
}

.modern-profile-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  opacity: 0;
  transition: opacity 0.3s ease;
  backdrop-filter: blur(4px);
}

.modern-profile-modal.active .modern-profile-overlay {
  opacity: 1;
}

.modern-profile-content {
  position: relative;
  width: 100%;
  max-height: 90vh;
  background: white;
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
}

.modern-profile-modal.active .modern-profile-content {
  transform: translateY(0);
}

.modern-profile-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 20px;
  border-bottom: 1px solid var(--border-color);
}

.modern-profile-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0;
}

.modern-profile-close {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: var(--background);
  color: var(--text-medium);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modern-profile-close:hover {
  background: var(--border-color);
  transform: rotate(90deg);
}

.modern-profile-body {
  padding: 30px 20px;
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

/* Logged In User Profile */
.modern-profile-user {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 20px;
  background: linear-gradient(
    135deg,
    rgba(255, 98, 71, 0.05),
    rgba(255, 138, 117, 0.05)
  );
  border-radius: var(--radius-lg);
  margin-bottom: 24px;
}

.modern-profile-avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(
    135deg,
    var(--primary-color),
    var(--primary-light)
  );
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 32px;
  flex-shrink: 0;
  box-shadow: var(--shadow-primary);
}

.modern-profile-info {
  flex: 1;
}

.modern-profile-name {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 6px 0;
}

.modern-profile-email {
  font-size: 14px;
  color: var(--text-light);
  margin: 0;
  word-break: break-all;
}

.modern-profile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.modern-profile-logout {
  width: 100%;
  padding: 16px 24px;
  background: var(--card-bg);
  border: 2px solid var(--primary-color);
  border-radius: var(--radius-md);
  color: var(--primary-color);
  font-size: 16px;
  font-weight: 600;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.modern-profile-logout:hover {
  background: var(--primary-color);
  color: white;
  transform: translateY(-2px);
  box-shadow: var(--shadow-primary);
}

.modern-profile-logout i {
  font-size: 18px;
}

/* Guest User Profile */
.modern-profile-guest {
  text-align: center;
  padding: 40px 20px;
}

.modern-profile-guest-icon {
  width: 80px;
  height: 80px;
  margin: 0 auto 24px;
  border-radius: 50%;
  background: var(--background);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-lighter);
  font-size: 36px;
}

.modern-profile-guest-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-dark);
  margin: 0 0 12px 0;
}

.modern-profile-guest-text {
  font-size: 15px;
  color: var(--text-light);
  line-height: 1.6;
  margin: 0 0 30px 0;
}

.modern-profile-login-btn {
  width: 100%;
  padding: 16px 24px;
  background: white;
  border: 2px solid #dadce0;
  border-radius: var(--radius-md);
  font-size: 16px;
  font-weight: 600;
  color: #3c4043;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  cursor: pointer;
  transition: all 0.3s ease;
  box-shadow: var(--shadow-sm);
}

.modern-profile-login-btn:hover {
  background: #f8f9fa;
  border-color: #c6c9cc;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.modern-google-icon {
  flex-shrink: 0;
}

/* ========================================
   CONTENT SPACING
   ======================================== */

.modern-content-wrapper {
  padding-top: 160px; /* Space for fixed header + search bar */
  padding-bottom: 20px;
}

/* ========================================
   RESPONSIVE DESIGN
   ======================================== */

@media (max-width: 768px) {
  .modern-header-container {
    padding: 8px 14px;
  }

  .modern-header-top-bar {
    flex-direction: row;
    gap: 10px;
    align-items: center;
  }

  .modern-restaurant-info {
    gap: 10px;
    flex: 0 0 auto;
    min-width: 0;
  }

  .modern-restaurant-logo {
    width: 44px;
    height: 44px;
  }

  .modern-restaurant-details {
    display: flex;
    flex-direction: column;
    gap: 2px;
  }

  .modern-restaurant-name {
    font-size: 15px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 140px;
  }

  .modern-restaurant-tagline {
    display: none;
  }

  .modern-header-actions {
    gap: 8px;
    flex: 1;
    justify-content: flex-end;
  }

  .modern-header-search-compact {
    flex: 1;
    /*max-width: 180px;*/
    margin-right: 8px;
  }

  .modern-search-input-compact {
    font-size: 12px;
    padding: 7px 30px 7px 30px;
  }

  .modern-language-selector {
    flex-shrink: 0;
  }

  .modern-language-selector .goog-te-combo {
    padding: 6px 26px 6px 10px;
    font-size: 11px;
  }

  .modern-cart-icon {
    width: 40px;
    height: 40px;
  }

  .modern-cart-content {
    max-width: 100%;
  }

  .modern-content-wrapper {
    padding-top: 65px;
  }
}

@media (max-width: 480px) {
  .modern-header-container {
    padding: 6px 10px;
  }

  .modern-header-top-bar {
    flex-direction: row;
    gap: 8px;
    align-items: center;
  }

  .modern-restaurant-info {
    gap: 8px;
    flex: 0 0 auto;
    min-width: 0;
  }

  .modern-restaurant-logo {
    width: 40px;
    height: 40px;
  }

  .modern-restaurant-details {
    display: flex;
    flex-direction: column;
    gap: 0;
  }

  .modern-restaurant-name {
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 120px;
  }

  .modern-restaurant-tagline {
    display: none;
  }

  .modern-header-actions {
    gap: 6px;
    flex: 1;
    justify-content: flex-end;
  }

  .modern-header-search-compact {
    /* display: none; */
  }

  .modern-language-selector .goog-te-combo {
    padding: 5px 22px 5px 8px;
    font-size: 11px;
    min-width: 50px;
  }

  .modern-cart-icon {
    width: 38px;
    height: 38px;
    font-size: 15px;
  }

  .modern-cart-badge {
    min-width: 17px;
    height: 17px;
    font-size: 9px;
  }

  .modern-search-bar-section {
    top: 64px;
    padding: 8px 0;
  }

  .modern-search-input {
    height: 44px;
    font-size: 13px;
    padding: 0 40px 0 44px;
  }

  .modern-search-icon {
    left: 14px;
    font-size: 15px;
  }

  .modern-search-clear {
    width: 28px;
    height: 28px;
    font-size: 11px;
  }

  .modern-profile-user {
    padding: 16px;
  }

  .modern-profile-avatar {
    width: 56px;
    height: 56px;
    font-size: 28px;
  }

  .modern-profile-name {
    font-size: 16px;
  }

  .modern-content-wrapper {
    padding-top: 58px;
  }
}

/* ========================================
   ANIMATIONS
   ======================================== */

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

@keyframes fadeIn {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes scaleIn {
  from {
    opacity: 0;
    transform: scale(0.9);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* Smooth scroll behavior - DISABLED */
/* html {
  scroll-behavior: smooth;
} */
