/* PWA install prompt — کِی میرِه؟! */
.pwa-install {
  position: fixed;
  inset-inline: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom, 0px));
  z-index: 80;
  pointer-events: none;
}
.pwa-install[hidden] { display: none !important; }

.pwa-install-card {
  pointer-events: auto;
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: .85rem 1rem;
  align-items: center;
  max-width: 28rem;
  margin-inline: auto;
  padding: 1rem 1.1rem 1.05rem;
  border-radius: 22px;
  background:
    radial-gradient(ellipse 70% 80% at 0% 0%, rgba(62, 224, 184, 0.16), transparent 55%),
    radial-gradient(ellipse 50% 60% at 100% 100%, rgba(240, 193, 75, 0.14), transparent 50%),
    #0d2430;
  color: #edf6f3;
  border: 1px solid rgba(62, 224, 184, 0.28);
  box-shadow:
    0 18px 40px rgba(5, 14, 20, 0.45),
    0 0 0 1px rgba(255, 255, 255, 0.04) inset;
  animation: pwaIn .55s cubic-bezier(.2, .9, .2, 1) both;
}

.pwa-install-mascot {
  flex: 0 0 auto;
  width: 96px;
  height: 96px;
  display: grid;
  place-items: center;
  animation: pwaBob 2.8s ease-in-out infinite;
}
.pwa-install-mascot img,
.pwa-install-mascot svg {
  width: 96px;
  height: 96px;
  display: block;
  filter: drop-shadow(0 8px 12px rgba(0, 0, 0, 0.35));
}

.pwa-install-copy {
  min-width: 0;
}
.pwa-install-kicker {
  margin: 0 0 .2rem;
  font-size: .78rem;
  font-weight: 700;
  color: #3ee0b8;
}
.pwa-install-card h3 {
  margin: 0 0 .35rem;
  font-size: 1.08rem;
  font-weight: 800;
  line-height: 1.35;
  color: #fff;
}
.pwa-install-text {
  margin: 0 0 .85rem;
  font-size: .88rem;
  line-height: 1.65;
  color: rgba(237, 246, 243, 0.78);
}
.pwa-install-actions {
  display: flex;
  flex-wrap: wrap;
  gap: .45rem .55rem;
  align-items: center;
}
.pwa-install-btn {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 800;
  font-size: .9rem;
  padding: .55rem 1rem;
  border-radius: 999px;
  color: #0a1620;
  background: linear-gradient(135deg, #f0c14b, #3ee0b8);
}
.pwa-install-btn:hover { filter: brightness(1.06); }
.pwa-install-later {
  appearance: none;
  border: 0;
  cursor: pointer;
  font: inherit;
  font-weight: 700;
  font-size: .86rem;
  padding: .5rem .75rem;
  border-radius: 999px;
  color: rgba(237, 246, 243, 0.75);
  background: rgba(255, 255, 255, 0.08);
}
.pwa-install-later:hover { background: rgba(255, 255, 255, 0.12); }
.pwa-install-close {
  position: absolute;
  top: .45rem;
  inset-inline-start: .45rem;
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  font-size: 1.25rem;
  line-height: 1;
  color: rgba(237, 246, 243, 0.7);
  background: rgba(255, 255, 255, 0.08);
}
.pwa-install-ios {
  margin: .7rem 0 0;
  font-size: .8rem;
  line-height: 1.6;
  color: rgba(237, 246, 243, 0.72);
}
.pwa-install-ios strong { color: #f0c14b; }

@keyframes pwaIn {
  from { opacity: 0; transform: translateY(18px) scale(.96); }
  to { opacity: 1; transform: none; }
}
@keyframes pwaBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}

@media (max-width: 520px) {
  .pwa-install-card {
    grid-template-columns: 1fr;
    text-align: center;
    justify-items: center;
    padding-top: 1.35rem;
  }
  .pwa-install-actions { justify-content: center; }
  .pwa-install-mascot,
  .pwa-install-mascot svg {
    width: 88px;
    height: 88px;
  }
}

/* دسکتاپ: گوشه پایین چپ صفحه (در RTL = inline-end) */
@media (min-width: 901px) {
  .pwa-install.pwa-install--desktop {
    inset-inline: auto;
    inset-inline-end: 1.35rem;
    bottom: 1.35rem;
    width: min(22.5rem, calc(100vw - 2.5rem));
  }
  .pwa-install--desktop .pwa-install-card {
    margin-inline: 0;
    max-width: none;
    width: 100%;
    animation-name: pwaInCorner;
  }
}

@keyframes pwaInCorner {
  from { opacity: 0; transform: translateY(14px) translateX(-10px) scale(.97); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .pwa-install-card,
  .pwa-install-mascot { animation: none; }
}
