/*
  وب‌اپ (PWA) — اصلاحات مخصوص حالت نصب‌شده
  =========================================
  وقتی کاربر روی آیفون «Add to Home Screen» می‌زند یا اندروید وب‌اپ را نصب
  می‌کند، اپ در حالت `standalone` اجرا می‌شود: بدون نوار آدرس سافاری و بدون
  دکمه‌های عقب/جلو.

  عمداً کم‌دست‌کاری می‌کنیم: سربرگ سایت `position: sticky; top: 0` است و
  ناوبری پایین از قبل `env(safe-area-inset-bottom)` را رعایت می‌کند. هر
  padding اضافی روی body، سربرگ چسبان را زیر نوار وضعیت می‌برد یا ارتفاع
  ناوبری ۷۲ پیکسلی را می‌شکند.
*/

@media (display-mode: standalone) {
  body {
    /* «کشسانی» بالا/پایین صفحه در آیفون شبیه باگ دیده می‌شود */
    overscroll-behavior-y: contain;
  }

  /*
    در حالت نصب‌شده نوار آدرس نیست، پس فاصله‌ی پایینِ صفحه که برای پنهان
    نشدن محتوا زیر ناوبری شناور گذاشته شده کافی است؛ فقط در صفحه‌هایی که
    ناوبری پایین ندارند کمی جمع‌وجور می‌کنیم.
  */
  body:not(:has(.mobile-bottom-nav)) {
    padding-bottom: 24px;
  }
}

/*
  راهنمای نصب وب‌اپ روی آیفون
  ===========================
  صفحهٔ پایینی و روی محتوا؛ فقط وقتی pwa.js تشخیص دهد «iOS + سافاری +
  نصب‌نشده» است، صفت hidden برداشته می‌شود.
*/
.pwa-hint {
  position: fixed;
  inset-inline: 12px;
  bottom: calc(96px + env(safe-area-inset-bottom, 0px));
  z-index: 10000;
  display: flex;
  justify-content: center;
  pointer-events: none;
}

/* در دسکتاپ/تبلت که ناوبری پایین نیست، پایین‌تر بیاید */
@media (min-width: 769px) {
  .pwa-hint {
    bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  }
}

.pwa-hint[hidden] {
  display: none !important;
}

.pwa-hint__card {
  pointer-events: auto;
  width: 100%;
  max-width: 420px;
  background: #151628;
  color: #f7f8fd;
  border: 1px solid #252746;
  border-radius: 18px;
  padding: 14px 16px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  font-size: 13px;
  line-height: 1.8;
  direction: rtl;
  text-align: right;
}

.pwa-hint__head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 8px;
}

.pwa-hint__icon {
  border-radius: 10px;
  flex: 0 0 auto;
}

.pwa-hint__titles {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.pwa-hint__titles strong {
  font-size: 14px;
}

.pwa-hint__titles span {
  color: #9ba1c2;
  font-size: 12px;
  line-height: 1.6;
}

.pwa-hint__steps {
  margin: 0 0 10px;
  padding-inline-start: 18px;
  color: #d7dbef;
}

.pwa-hint__steps li {
  margin-bottom: 4px;
}

.pwa-hint__steps em {
  color: #7c5cff;
  font-style: normal;
  font-weight: 600;
}

.pwa-hint__share {
  display: inline-flex;
  align-items: center;
  color: #7c5cff;
  vertical-align: -2px;
}

.pwa-hint__actions {
  display: flex;
  justify-content: flex-end;
}

.pwa-hint__button {
  appearance: none;
  border: 0;
  border-radius: 12px;
  background: #7c5cff;
  color: #fff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 700;
  padding: 9px 18px;
  cursor: pointer;
}

.pwa-hint__button:active {
  opacity: 0.85;
}
