/* Modern QR Menu Theme - Mobile First */
:root {
  --primary: #17B477;
  --primary-dark: #129963;
  --gradient-1: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
  --gradient-2: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
  --gradient-3: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
  --shadow-sm: 0 2px 8px rgba(74,74,74,0.15);
  --shadow-md: 0 4px 16px rgba(74,74,74,0.2);
  --shadow-lg: 0 8px 32px rgb(74,74,74);
  --radius: 20px;
  --radius-sm: 12px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: var(--menu-font-family, 'Inter'), -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: #f8f9fa;
  color: #1a1a1a;
  line-height: 1.5;
  overflow-x: hidden;
  padding-top: 60px;
}

/* ============ HEADER ============ */
.menu-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  padding: 10px 16px;
  box-shadow: var(--shadow-sm);
  z-index: 1000;
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
}

.header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.menu-logo {
  height: 40px;
  margin-left:-20px;

}

.menu-logo-text {
  font-size: 18px;
  font-weight: 800;
  color: white;
}

.header-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.social-icon {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-radius: 50%;
  color: white;
  font-size: 16px;
  transition: transform 0.3s ease;
}

.social-icon:hover {
  transform: scale(1.1) rotate(5deg);
}

.lang-btn {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  overflow: hidden;
  border: 2px solid transparent;
  transition: all 0.3s ease;
}

.lang-btn.active {
  display: none;
}

.lang-selector {
  display: flex;
  gap: 8px;
}

.lang-btn img {
  width: 28px;
  height: 28px;
  object-fit: cover;
  display: block;
}

/* ============ CATEGORY STORIES ============ */
.category-bubbles {
  position: fixed;
  left: 0;
  right: 0;
  background: white;
  box-shadow: var(--shadow-sm);
  z-index: 99;
  border-bottom: 1px solid rgba(0,0,0,0.05);
}

.category-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-top: 16px;
  padding-left:10px;
  padding-bottom: 10px;
  scroll-behavior: smooth;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
}

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

.category-bubble {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-decoration: none;
  min-width: 70px;
  transition: transform 0.3s ease;
}

.category-bubble:active {
  transform: scale(0.95);
}

.bubble-icon {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 6px;
  box-shadow: var(--shadow-md);
  position: relative;
  transition: all 0.3s ease;
  border: 3px solid white;
}

.category-bubble.active .bubble-icon {
  background: var(--gradient-2);
  transform: scale(1.08);
  box-shadow: 0 6px 20px rgb(56 56 56 / 40%);
  border: 3px solid var(--primary);
}

.bubble-icon img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
}

.bubble-icon i {
  font-size: 28px;
  color: white;
}

.bubble-label {
  font-size: 12px;
  font-weight: 600;
  color: #666;
  text-align: center;
  max-width: 70px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-bubble.active .bubble-label {
  color: var(--primary);
  font-weight: 700;
}

/* ============ MENU CONTAINER ============ */
.menu-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 130px 16px 20px;
}

/* ============ SEARCH ============ */
.search-wrap {
  position: relative;
  margin-bottom: 20px;
}

.search-wrap input {
  width: 100%;
  padding: 14px 48px 14px 48px;
  border: 2px solid #e9ecef;
  border-radius: var(--radius-sm);
  font-size: 15px;
  transition: all 0.3s ease;
  background: white;
}

.search-wrap input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(23,180,119,0.1);
}

.search-wrap i {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #adb5bd;
  font-size: 18px;
}

#menuSearchClear {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 24px;
  color: #adb5bd;
  cursor: pointer;
  display: none;
}

/* ============ VIEW TOGGLE ============ */
.view-toggle {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 20px;
  gap: 12px;
}

.table-info {
  flex: 1;
  font-size: 13px;
  font-weight: 600;
  color: var(--primary);
  display: flex;
  align-items: center;
  gap: 6px;
}

.view-btn {
  width: 40px;
  height: 40px;
  border: 2px solid #e9ecef;
  background: white;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s ease;
  color: #6c757d;
}

.view-btn.active {
  background: var(--primary);
  border-color: var(--primary);
  color: white;
}

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

.category-section.is-empty {
  display: none;
}

.category-title {
  font-size: 24px;
  font-weight: 800;
  margin-bottom: 16px;
  color: #1a1a1a;
  display: flex;
  align-items: center;
  gap: 10px;
}

.category-title::before {
  content: '';
  width: 4px;
  height: 28px;
  background: var(--primary);
  border-radius: 4px;
}

/* ============ PRODUCT GRID ============ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

body.view-list .product-grid {
  grid-template-columns: 1fr;
}

body.view-card .product-grid {
  grid-template-columns: 1fr;
  gap: 16px;
}

body.view-grid .product-grid {
  grid-template-columns: repeat(2, 1fr);
  gap: 12px;
}

body.view-grid .product-image {
  height: 140px;
}

body.view-grid .product-name {
  font-size: 14px;
  min-height: auto;
  -webkit-line-clamp: 1;
}

body.view-grid .product-desc {
  display: none;
}

body.view-grid .product-info {
  padding: 10px;
  gap: 4px;
}

body.view-grid .price-current {
  font-size: 16px;
}

body.view-grid .btn-add-cart {
  width: 36px;
  height: 36px;
  bottom: 8px;
  right: 8px;
  font-size: 16px;
}

@media (min-width: 640px) {
  body.view-grid .product-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1024px) {
  body.view-grid .product-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}

/* ============ PRODUCT CARD - INSTAGRAM STYLE ============ */
.product-card {
  background: white;
  border-radius: 20px 0 20px 0;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  display: flex;
  flex-direction: column;
}

.product-card:active {
  transform: scale(0.97);
}

.product-card.is-hidden {
  display: none;
}

/* Product Image - Large & Prominent */
.product-image {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  cursor: pointer;
  transition: transform 0.3s ease;
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-no-image {
  background: var(--primary);
  display: flex;
  align-items: center;
  justify-content: center;
}

.product-no-image i {
  font-size: 56px;
  color: rgba(255,255,255,0.6);
}

/* Product Badges - Top Left */
.product-badges {
  position: absolute;
  top: 10px;
  left: 5px;
  display: flex;
  gap: 6px;
  z-index: 10;
}

.badge {
  background: rgba(255,255,255,0.95);
  backdrop-filter: blur(10px);
  padding: 6px 10px;
  border-radius: 20px;
  font-size: 14px;
  box-shadow: var(--shadow-sm);
  font-weight: 600;
}

/* Product Info */
.product-info {
  padding: 14px;
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
  cursor: pointer;
}

.product-name {
  font-size: 15px;
  font-weight: 800;
  color: #1a1a1a;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 20px;
}

.product-desc {
  font-size: 12px;
  color: #6c757d;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.product-price-row {
  margin-top: auto;
  display: flex;
  align-items: center;
  gap: 6px;
  padding-right: 50px;
}

.price-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: nowrap;
  flex-direction: row-reverse;
}

.price-old {
  font-size: 11px;
  color: #9ca3af;
  text-decoration: line-through;
  font-weight: 600;
  white-space: nowrap;
}

.price-current {
  font-size: 16px;
  font-weight: 900;
  color: var(--primary);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

/* Add to Cart Button - Bottom Right Floating */
.btn-add-cart {
  position: absolute;
  bottom: 12px;
  right: 12px;
  width: 44px;
  height: 44px;
  background: var(--primary);
  color: white;
  border: none;
  border-radius: 50%;
  font-size: 18px;
  cursor: pointer;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(74,74,74,0.2);
  z-index: 10;
}

.btn-add-cart:hover {
  transform: scale(1.1) rotate(90deg);
  box-shadow: 0 6px 20px rgba(74,74,74,0.3);
}

.btn-add-cart:active {
  transform: scale(0.95) rotate(90deg);
}

/* ============ LIST VIEW ============ */
body.view-list .product-card {
  display: flex;
  flex-direction: row;
  height: 120px;
}

body.view-list .product-image {
  width: 120px;
  height: 120px;
  flex-shrink: 0;
}

body.view-list .product-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
}

/* ============ CART BAR - FLOATING ============ */
.cart-bar {
  position: fixed;
  bottom: 20px;
  left: 48%;
  transform: translateX(-50%) translateY(100px);
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 16px 24px;
  border-radius: 50px;
  box-shadow: 0 8px 32px rgb(74 74 74);
  display: flex;
  align-items: center;
  gap: 20px;
  z-index: 1001;
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  max-width: 90%;
}

.cart-bar.show {
  transform: translateX(-50%) translateY(0);
}

.cart-info {
  display: flex;
  align-items: center;
  gap: 12px;
  white-space: nowrap;
}

.cart-count {
  background: rgba(255,255,255,0.2);
  padding: 8px 16px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 14px;
  display: flex;
  align-items: center;
  gap: 6px;
}

#cartCount {
  background: white;
  color: var(--primary);
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 800;
}

.cart-amount {
  font-size: 16px;
  font-weight: 800;
  white-space: nowrap;
}

.cart-actions {
  display: flex;
  gap: 12px;
}

.btn-clear-cart {
  width: 40px;
  height: 40px;
  background: rgba(255,255,255,0.2);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-clear-cart:active {
  transform: scale(0.9);
}

.btn-view-cart {
  background: white;
  color: var(--primary);
  border: none;
  padding: 10px 20px;
  border-radius: 25px;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.btn-view-cart:active {
  transform: scale(0.95);
}

/* ============ MODAL - BOTTOM DRAWER ============ */
.modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0,0,0,0);
  z-index: 2000;
  display: none;
  pointer-events: none;
  transition: background 0.3s ease;
}

.modal.active {
  display: block;
  pointer-events: all;
  background: rgba(0,0,0,0.5);
}

.modal-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: white;
  border-radius: 24px 24px 0 0;
  max-height: 85vh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 0.4s cubic-bezier(0.68, -0.55, 0.265, 1.55);
  box-shadow: 0 -8px 32px rgba(74,74,74,0.3);
}

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

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(0,0,0,0.05);
  border: none;
  border-radius: 50%;
  font-size: 24px;
  color: #6c757d;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
}

.modal-close:active {
  transform: scale(0.9);
}

.modal-header {
  padding: 20px;
  border-bottom: 1px solid #e9ecef;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  z-index: 10;
}

.modal-header h3 {
  font-size: 20px;
  font-weight: 800;
  display: flex;
  align-items: center;
  gap: 10px;
  color: white;
}

.modal-header .modal-close {
  background: rgba(255,255,255,0.2);
  color: white;
}

.modal-body {
  padding: 20px;
}

.modal-footer {
  padding: 20px;
  border-top: 1px solid #e9ecef;
  display: flex;
  gap: 12px;
  position: sticky;
  bottom: 0;
  background: white;
}

.btn {
  flex: 1;
  padding: 14px;
  border-radius: var(--radius-sm);
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.3s ease;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.btn:active {
  transform: scale(0.98);
}

.btn-outline {
  background: white;
  border: 2px solid #e9ecef;
  color: #6c757d;
}

.btn-primary {
  background: var(--primary);
  color: white;
  box-shadow: var(--shadow-md);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .product-grid {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
  }
  
  .cart-bar {
    padding: 12px 0px;
    gap: 12px;
  }
  
  .cart-amount {
    font-size: 16px;
  }
}

@media (min-width: 768px) {
  body {
    padding-top: 70px;
  }
  
  .menu-header {
    padding: 14px 20px;
  }
  
  .category-bubbles {
    top: 65px;
  }
  
  .menu-container {
    padding-top: 140px;
  }
}

/* ============ ANIMATIONS ============ */
@keyframes slideUp {
  from {
    transform: translateY(100%);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

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

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

/* ============ UTILITIES ============ */
.miktar {
  margin-bottom: 0px;
}

body.menu-only .btn-add-cart,
body.menu-only .miktar,
body.menu-only .cart-bar {
  display: none !important;
}

/* ============ AI ASSISTANT & WAITER BUTTON ============ */
.ai-assistant-root {
  position: fixed;
  bottom: 100px;
  right: 20px;
  z-index: 100;
}

.ai-assistant-toggle {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  border: none;
  color: white;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(74,74,74,0.7);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.3s ease;
}

.ai-assistant-toggle:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(74,74,74,0.4);
}

.ai-assistant-toggle:active {
  transform: scale(0.95);
}

.ai-assistant-icon i {
  font-size: 24px;
  animation: robot-pulse 2s ease-in-out infinite;
}

@keyframes robot-pulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.1); }
}

.ai-assistant-label {
  font-size: 10px;
  font-weight: 600;
  padding-left:5px;
  padding-right:5px;
}

.waiterFab {
  position: fixed;
  bottom: 170px;
  right: 20px;
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: #fff;
  border: none;
  border-radius: 50%;
  width: 60px;
  height: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 12px rgba(74,74,74,0.7);
  cursor: grab;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  z-index: 100;
  user-select: none;
  touch-action: none;
}

.waiterFab:hover {
  transform: scale(1.05);
  box-shadow: 0 6px 16px rgba(74,74,74,0.4);
}

.waiterFab:active {
  cursor: grabbing;
  transform: scale(0.95);
}

.waiterFab i {
  font-size: 24px;
  animation: bell-shake 1.5s infinite;
}

.waiterFab span {
  font-size: 10px;
  margin-top: 4px;
  font-weight: 600;
}

@keyframes bell-shake {
  0%, 100% { transform: rotate(0); }
  20% { transform: rotate(-15deg); }
  40% { transform: rotate(10deg); }
  60% { transform: rotate(-10deg); }
  80% { transform: rotate(5deg); }
}

/* AI Panel */
.ai-assistant-panel {
  position: fixed;
  bottom: 170px;
  right: 20px;
  width: 340px;
  max-width: calc(100vw - 40px);
  height: 500px;
  max-height: calc(100vh - 200px);
  background: white;
  border-radius: 20px;
  box-shadow: 0 8px 32px rgba(74,74,74,0.3);
  display: none;
  flex-direction: column;
  overflow: hidden;
  z-index: 1003;
}

.ai-assistant-panel:not([hidden]) {
  display: flex;
}

.ai-assistant-header {
  background: linear-gradient(135deg, var(--primary) 0%, var(--primary-dark) 100%);
  color: white;
  padding: 16px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}

.ai-assistant-header strong {
  font-size: 16px;
  display: block;
  margin-bottom: 4px;
}

.ai-assistant-header small {
  font-size: 12px;
  opacity: 0.9;
}

.ai-assistant-close {
  background: rgba(255,255,255,0.2);
  border: none;
  color: white;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  font-size: 20px;
  cursor: pointer;
  transition: all 0.2s;
}

.ai-assistant-close:hover {
  background: rgba(255,255,255,0.3);
}

.ai-assistant-messages {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ai-chat-message {
  padding: 10px 14px;
  border-radius: 12px;
  max-width: 80%;
  font-size: 14px;
  line-height: 1.4;
}

.ai-chat-message.user {
  background: var(--primary);
  color: white;
  align-self: flex-end;
  border-bottom-right-radius: 4px;
}

.ai-chat-message.assistant {
  background: #f1f3f5;
  color: #1a1a1a;
  align-self: flex-start;
  border-bottom-left-radius: 4px;
}

.ai-assistant-footer {
  padding: 16px;
  border-top: 1px solid #e9ecef;
}

.ai-assistant-footer form {
  display: flex;
  gap: 8px;
}

.ai-assistant-footer textarea {
  flex: 1;
  border: 2px solid #e9ecef;
  border-radius: 12px;
  padding: 10px;
  font-size: 14px;
  resize: none;
  font-family: inherit;
}

.ai-assistant-footer textarea:focus {
  outline: none;
  border-color: var(--primary);
}

.ai-assistant-send {
  width: 40px;
  height: 40px;
  background: var(--primary);
  border: none;
  border-radius: 50%;
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
}

.ai-assistant-send:hover {
  transform: scale(1.05);
}

.ai-assistant-send:active {
  transform: scale(0.95);
}
