/* v6.6.0 — استایل PWA سه‌سوتی */

/* نوار پایین موبایل (Bottom Navigation) */
.pwa-bottom-nav {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 64px;
  background: white;
  border-top: 1px solid #e2e8f0;
  display: flex;
  justify-content: space-around;
  align-items: center;
  z-index: 9990;
  box-shadow: 0 -4px 20px rgba(0,0,0,0.08);
}

.dark .pwa-bottom-nav {
  background: #1e293b;
  border-color: #334155;
}

.pwa-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 8px 12px;
  border-radius: 12px;
  color: #64748b;
  font-size: 10px;
  font-weight: 600;
  text-decoration: none;
  transition: all 0.2s;
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
  flex: 1;
}

.dark .pwa-nav-item { color: #94a3b8; }

.pwa-nav-item.active {
  color: #6366f1;
}

.dark .pwa-nav-item.active { color: #818cf8; }

.pwa-nav-item:active {
  transform: scale(0.95);
}

/* دکمه دستیار هوشمند (وسط) */
.pwa-nav-ai {
  position: relative;
}

.pwa-nav-ai-icon {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4);
  margin-top: -20px;
  animation: aiNavPulse 2s infinite;
}

@keyframes aiNavPulse {
  0% { box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); }
  50% { box-shadow: 0 4px 25px rgba(99, 102, 241, 0.7); }
  100% { box-shadow: 0 4px 15px rgba(99, 102, 241, 0.4); }
}

.pwa-nav-ai span {
  margin-top: 2px;
}

/* فاصله پایین صفحه وقتی نوار پایین هست */
body.has-bottom-nav {
  padding-bottom: 70px !important;
}

/* v6.6.2: مخفی کردن دکمه‌های شناور تو موبایل */
@media (max-width: 768px) {
  /* مخفی کردن دکمه شناور پشتیبانی (چت ویجت) */
  body.has-bottom-nav #chat-widget,
  body.has-bottom-nav #chat-toggle,
  body.has-bottom-nav #chat-toggle-mobile {
    display: none !important;
  }
  
  /* مخفی کردن دکمه شناور AI (چت‌بات) */
  body.has-bottom-nav .ai-chat-toggle {
    display: none !important;
  }
  
  /* پنجره چت‌بات بالای نوار پایین */
  body.has-bottom-nav .ai-chat-window {
    bottom: 70px !important;
    left: 10px !important;
    right: 10px !important;
    width: auto !important;
    height: 70vh !important;
    z-index: 9991 !important;
  }
  
  /* نوار «ادامه سفارش» (sticky cart bar) بالای نوار پایین */
  body.has-bottom-nav #home-cart-bar,
  body.has-bottom-nav .sticky-cart-bar,
  body.has-bottom-nav .cart-bar,
  body.has-bottom-nav [class*="cart-bar"],
  body.has-bottom-nav [class*="sticky-bar"] {
    bottom: 70px !important;
    z-index: 9989 !important;
  }
}

/* بنر نصب PWA */
.pwa-install-banner {
  display: none;
  position: fixed;
  bottom: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: 90%;
  max-width: 400px;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  color: white;
  padding: 16px;
  border-radius: 16px;
  z-index: 9995;
  box-shadow: 0 10px 30px rgba(99, 102, 241, 0.3);
  align-items: center;
  gap: 12px;
}

.pwa-install-banner .install-icon {
  font-size: 32px;
}

.pwa-install-banner .install-text {
  flex: 1;
}

.pwa-install-banner .install-text h4 {
  font-size: 14px;
  font-weight: bold;
  margin: 0;
}

.pwa-install-banner .install-text p {
  font-size: 11px;
  opacity: 0.9;
  margin: 2px 0 0;
}

.pwa-install-banner .install-btn {
  background: white;
  color: #6366f1;
  border: none;
  padding: 8px 16px;
  border-radius: 10px;
  font-weight: bold;
  cursor: pointer;
  font-size: 13px;
}

.pwa-install-banner .close-banner {
  background: none;
  border: none;
  color: white;
  opacity: 0.7;
  cursor: pointer;
  font-size: 18px;
}

/* دکمه‌های هدر موبایل */
.mobile-header-buttons {
  display: flex;
  align-items: center;
  gap: 4px;
}

.mobile-header-btn {
  padding: 8px;
  border-radius: 10px;
  background: transparent;
  border: none;
  cursor: pointer;
  color: #475569;
  transition: background 0.2s;
}

.dark .mobile-header-btn { color: #cbd5e1; }

.mobile-header-btn:hover {
  background: #f1f5f9;
}

.dark .mobile-header-btn:hover { background: #334155; }

@media (min-width: 1024px) {
  .mobile-header-btn { display: none; }
}
