/* Floating CTA — پایین راست */
.floating-cta {
  position: fixed;
  bottom: 24px;
  right: 24px;
  left: auto;
  top: auto;
  transform: none;
  z-index: 998;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-end;
}

[dir="ltr"] .floating-cta {
  right: 24px;
  left: auto;
}

.floating-cta-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 50px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 0.85rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  transition: transform 0.25s, box-shadow 0.25s;
}

.floating-cta-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 12px 40px rgba(0, 240, 255, 0.25);
}

.floating-cta-btn.telegram { background: linear-gradient(135deg, #0088cc, #00aaff); }
.floating-cta-btn.whatsapp { background: linear-gradient(135deg, #25d366, #128c7e); }

/* GitHub section */
.github-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}

.github-card {
  display: block;
  padding: 24px;
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--border);
  background: var(--bg-card);
  text-decoration: none;
  color: inherit;
  transition: transform 0.3s, border-color 0.3s;
}

.github-card:hover {
  border-color: var(--accent-cyan);
  transform: translateY(-4px);
}

.github-card-head {
  display: flex;
  justify-content: space-between;
  margin-bottom: 12px;
  font-size: 0.8rem;
}

.github-lang {
  background: var(--bg-primary);
  padding: 4px 10px;
  border-radius: 20px;
  color: var(--accent-cyan);
}

.github-stars { color: var(--text-muted); }

.github-card h4 {
  font-size: 1.05rem;
  margin-bottom: 8px;
  color: var(--accent-cyan);
}

.github-card p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin-bottom: 12px;
}

.github-link {
  font-size: 0.85rem;
  color: var(--accent-green);
}

/* Compare */
.compare-toggle {
  background: var(--bg-primary);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  cursor: pointer;
  font-size: 0.9rem;
  transition: all 0.2s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.compare-toggle.active,
.compare-toggle:hover {
  border-color: var(--accent-cyan);
  color: var(--accent-cyan);
  background: rgba(0,240,255,0.08);
  box-shadow: 0 0 12px rgba(0,240,255,0.15);
}

.compare-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 1002;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  padding: 12px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  transform: translateY(100%);
  transition: transform 0.3s;
  box-shadow: 0 -8px 32px rgba(0,0,0,0.25);
}

.compare-bar-info { display: flex; flex-direction: column; gap: 6px; min-width: 0; }
.compare-bar-actions { display: flex; gap: 10px; flex-shrink: 0; }
.compare-names { display: flex; gap: 8px; flex-wrap: wrap; }
.compare-chip {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  background: rgba(0,240,255,0.1);
  color: var(--accent-cyan);
  border: 1px solid var(--border);
}

.compare-bar.visible { transform: translateY(0); }

.compare-modal {
  position: fixed;
  inset: 0;
  z-index: 10050;
  background: rgba(0, 0, 0, 0.75);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

.compare-modal.active {
  opacity: 1;
  pointer-events: auto;
}

.compare-modal-inner {
  background: var(--bg-card);
  border-radius: var(--radius-lg, 16px);
  border: 1px solid var(--border);
  max-width: 960px;
  width: 100%;
  max-height: 85vh;
  overflow: auto;
  padding: 24px;
}

.compare-modal-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 20px;
}

.compare-table-wrap { overflow-x: auto; }
.compare-col-head {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  min-width: 140px;
  position: relative;
}
.compare-thumb {
  width: 100px;
  height: 64px;
  border-radius: 8px;
  overflow: hidden;
  position: relative;
  background: var(--bg-primary);
  border: 1px solid var(--border);
}
.compare-thumb .product-cover-img,
.compare-thumb .product-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}
.compare-remove {
  position: absolute;
  top: -4px;
  left: -4px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  cursor: pointer;
  font-size: 1rem;
  line-height: 1;
}

body.compare-modal-open { overflow: hidden; }

.compare-table-wrap { overflow-x: auto; }

.compare-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.compare-table th,
.compare-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  text-align: center;
}

.compare-table th:first-child,
.compare-table td:first-child {
  text-align: start;
  font-weight: 600;
  color: var(--text-muted);
}

/* Honor images */
.honor-card {
  display: flex;
  gap: 16px;
  align-items: flex-start;
}

.honor-thumb {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  object-fit: cover;
  flex-shrink: 0;
  border: 2px solid var(--border);
}

.honor-thumb-fallback {
  width: 64px;
  height: 64px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.8rem;
  background: var(--bg-primary);
  flex-shrink: 0;
}

/* Resume PDF btn */
.resume-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 16px;
}

/* Inline demos */
.inline-demo-chat {
  width: 100%;
  min-height: 320px;
  display: flex;
  flex-direction: column;
}

.inline-demo-msgs {
  flex: 1;
  overflow-y: auto;
  padding: 16px;
  max-height: 280px;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.inline-demo-form {
  display: flex;
  gap: 8px;
  padding: 12px;
  border-top: 1px solid var(--border);
}

.inline-demo-form input {
  flex: 1;
  padding: 10px 14px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
}

.inline-demo-iframe iframe {
  width: 100%;
  height: 420px;
  border: none;
  border-radius: 12px;
  background: var(--bg-primary);
}

/* Estimator extras */
.estimator-extras {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.estimator-extras label {
  display: block;
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}

.estimator-extras select {
  width: 100%;
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: inherit;
}

.testimonial-avatar-img {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--accent-cyan);
}

@media (max-width: 768px) {
  .floating-cta {
    bottom: 80px;
    right: 16px;
    left: auto;
  }
  .floating-cta-btn {
    padding: 10px 14px;
    font-size: 0.8rem;
  }
  .estimator-extras { grid-template-columns: 1fr; }
}

/* Video demo */
.inline-demo-video video {
  width: 100%;
  max-height: 420px;
  border-radius: 12px;
  background: #000;
}

.inline-demo-video-placeholder {
  position: relative;
  border-radius: 12px;
  overflow: hidden;
}

.inline-demo-video-placeholder .video-poster {
  width: 100%;
  display: block;
  opacity: 0.6;
}

.inline-demo-video-placeholder .video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 24px;
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
}

/* Docs */
.docs-steps { padding-right: 20px; line-height: 1.8; }
.docs-steps li { margin-bottom: 8px; }
.docs-files code { color: var(--accent-cyan); font-size: 0.85rem; }
.docs-faq details { margin-bottom: 8px; }

/* PWA banner — فقط موبایل */
.pwa-install-banner {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 999;
  background: var(--bg-card);
  border-top: 1px solid var(--accent-cyan);
  padding: 12px 20px;
  display: none;
  align-items: center;
  gap: 12px;
  transform: translateY(100%);
  transition: transform 0.3s;
}

@media (max-width: 768px) {
  .pwa-install-banner { display: flex; }
}

.pwa-install-banner.visible {
  transform: translateY(0);
}

.pwa-install-banner span { flex: 1; font-size: 0.9rem; }

.pwa-install-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
}

/* فاصله المان‌های fixed وقتی بنر/compare فعال است */
body.has-compare-bar .chat-widget { bottom: 56px; }
body.has-compare-bar .floating-cta { bottom: 72px; }

body.pwa-visible .chat-widget { bottom: 72px; }
body.pwa-visible .floating-cta { bottom: 80px; }

body.has-compare-bar.pwa-visible .chat-widget { bottom: 120px; }
body.has-compare-bar.pwa-visible .floating-cta { bottom: 128px; }

body.pwa-visible .compare-bar.visible { bottom: 52px; }
