/* "Get the app" promotion (app_promo.php) */

/* ---------- phone: compact install button, next to the scroll-to-top button ---------- */
.s2-install {
  position: fixed;
  right: 14px;
  bottom: 18px;
  z-index: 1050;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 5px 5px 6px;
  background: #fff;
  border-radius: 40px;
  border: 2px solid #F47421;
  box-shadow: 0 8px 22px rgba(26, 31, 60, 0.28);
}
.s2-install-icon {
  width: 34px;
  height: 34px;
  flex: 0 0 34px;
  padding: 3px;
  border-radius: 50%;
  background: #fff1e7;
  object-fit: contain;
}
/* the text is kept for screen readers only */
.s2-install-text {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}
.s2-install-btn {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(135deg, #F47421, #ff9a4d);
  color: #fff !important;
  font-weight: 700;
  font-size: 0.9rem;
  padding: 8px 14px;
  border-radius: 30px;
  animation: app-pulse 2.2s ease-in-out infinite;
}
/* phones: the scroll-to-top button sits just above the Install App button (media query below) */

/* ---------- desktop: launcher + chat-style card ---------- */
.app-launch {
  position: fixed;
  right: 30px;
  bottom: 30px;
  z-index: 1050;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
}
.app-launch-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 9px;
  border: 0;
  border-radius: 40px;
  padding: 14px 24px 14px 20px;
  background: linear-gradient(135deg, #F47421, #ff9a4d);
  color: #fff;
  font-weight: 700;
  font-size: 1rem;
  box-shadow: 0 10px 26px rgba(244, 116, 33, 0.45);
  cursor: pointer;
  transition: transform 0.2s ease;
}
.app-launch-btn:hover { transform: translateY(-2px); }
.app-launch-btn i { font-size: 1.15rem; }
.app-launch-dot {
  position: absolute;
  top: 6px;
  right: 10px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7);
  animation: app-dot 1.8s infinite;
}
.app-launch.open .app-launch-dot { display: none; }

.app-card {
  width: 330px;
  background: #fff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(26, 31, 60, 0.3);
  transform-origin: bottom right;
  animation: app-pop 0.3s cubic-bezier(.2, .8, .2, 1);
}
.app-card[hidden] { display: none; }
.app-card-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, #1a1f3c, #2c3470);
  color: #fff;
}
.app-card-head img {
  width: 42px;
  height: 42px;
  padding: 4px;
  border-radius: 10px;
  background: #fff;
  object-fit: contain;
}
.app-card-head div { flex: 1; display: flex; flex-direction: column; line-height: 1.3; }
.app-card-head strong { font-size: 1rem; }
.app-card-head span { font-size: 0.75rem; opacity: 0.8; }
.app-card-close {
  border: 0;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  font-size: 20px;
  line-height: 28px;
  padding: 0;
}
.app-card-body { padding: 16px 18px 18px; text-align: center; }
.app-card-lead { margin: 0 0 10px; font-weight: 700; color: #F47421; font-size: 0.92rem; }
.app-card-qr {
  width: 100%;
  border-radius: 12px;
  border: 1px solid #f1e3d8;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}
.app-card-points {
  list-style: none;
  padding: 0;
  margin: 14px 0;
  text-align: left;
}
.app-card-points li { font-size: 0.86rem; color: #333; padding: 3px 0; }
.app-card-points i { color: #22a35a; margin-right: 6px; }
.app-card-stores { display: flex; gap: 8px; }
.app-card-stores a {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 9px 8px;
  border-radius: 10px;
  background: #1a1f3c;
  color: #fff !important;
  font-size: 0.85rem;
  font-weight: 600;
}
.app-card-stores a:hover { background: #F47421; }

/* the scroll-to-top button sits above the launcher on desktop */
@media (min-width: 769px) {
  .scroll-to-top { bottom: 100px !important; }
  .s2-install { display: none !important; }
}
@media (max-width: 768px) {
  .app-launch { display: none !important; }
  .scroll-to-top {
    bottom: 82px !important;
    inset-inline-end: 14px !important;
  }
}
@media (max-height: 640px) and (min-width: 769px) {
  .app-card-points { display: none; }
}

@keyframes app-pulse {
  0%, 100% { box-shadow: 0 4px 12px rgba(244, 116, 33, 0.4); }
  50% { box-shadow: 0 4px 22px rgba(244, 116, 33, 0.75); }
}
@keyframes app-dot {
  0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.7); }
  70% { box-shadow: 0 0 0 10px rgba(34, 197, 94, 0); }
  100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}
@keyframes app-pop {
  from { opacity: 0; transform: scale(0.85) translateY(10px); }
  to { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .s2-install, .app-card, .app-launch-btn { transition: none; animation: none; }
  .s2-install-btn, .app-launch-dot { animation: none; }
}
/* while a report popup (Bootstrap modal) is open, keep the app buttons out of the way */
body.modal-open .app-launch,
body.modal-open .s2-install { display: none !important; }
