/* NovaMarket PWA — ظاهر پنجره نصب، نوار پایین و تنظیم‌های حالت اپ */

/* حاشیه امن برای گوشی‌های نوچ‌دار در حالت اپ */
html.pw-app body { padding-bottom: env(safe-area-inset-bottom); }
html.pw-app .sf-util { display: none; }

/* پنجره پایین‌آمدنی */
.pw-sheet {
  position: fixed; inset: 0; z-index: 9999; display: flex; align-items: flex-end; justify-content: center;
  background: rgba(10, 12, 18, 0); transition: background .25s ease; padding: 0;
}
.pw-sheet.on { background: rgba(10, 12, 18, .45); backdrop-filter: blur(2px); }
.pw-sheet-card {
  width: 100%; max-width: 460px; background: var(--card, #fff); color: var(--ink, #111);
  border-radius: 22px 22px 0 0; padding: 22px 20px calc(20px + env(safe-area-inset-bottom));
  box-shadow: 0 -12px 40px rgba(0, 0, 0, .22); transform: translateY(102%); transition: transform .28s cubic-bezier(.2,.8,.2,1);
  display: grid; gap: 14px; justify-items: center; text-align: center;
}
.pw-sheet.on .pw-sheet-card { transform: translateY(0); }
.pw-sheet-ico { width: 62px; height: 62px; border-radius: 18px; object-fit: contain; box-shadow: 0 6px 18px rgba(0,0,0,.14); }
.pw-sheet-txt b { display: block; font-size: 16px; margin-bottom: 6px; }
.pw-sheet-txt span { display: block; font-size: 13px; line-height: 2; color: var(--muted, #666); }
.pw-sheet-row { display: flex; gap: 10px; width: 100%; }
.pw-btn {
  flex: 1; border: 0; cursor: pointer; font: inherit; font-weight: 700; padding: 13px 18px; border-radius: 14px;
  background: var(--accent, #1d6ff2); color: #fff;
}
.pw-btn.ghost { flex: 0 0 auto; background: transparent; color: var(--muted, #777); font-weight: 500; }

/* نوار پایین حالت اپ */
.pw-nav {
  position: fixed; inset-inline: 0; bottom: 0; z-index: 900; display: none;
  grid-template-columns: repeat(5, 1fr); gap: 2px; padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
  background: var(--card, #fff); border-top: 1px solid var(--line, #eceef2);
  box-shadow: 0 -6px 24px rgba(0, 0, 0, .06);
}
html.pw-app .pw-nav { display: grid; }
html.pw-app body.pw-has-nav { padding-bottom: 78px; }
.pw-nav-i {
  position: relative; display: grid; justify-items: center; gap: 3px; padding: 6px 2px; text-decoration: none;
  color: var(--muted, #8b8f98); font-size: 11px; border-radius: 12px;
}
.pw-nav-i i, .pw-nav-i svg { width: 21px; height: 21px; }
.pw-nav-i.on { color: var(--accent, #1d6ff2); background: color-mix(in srgb, var(--accent, #1d6ff2) 10%, transparent); }
.pw-nav-i em {
  position: absolute; top: 2px; inset-inline-end: 12px; min-width: 16px; height: 16px; padding: 0 4px;
  border-radius: 9px; background: #e5484d; color: #fff; font-size: 10px; font-style: normal;
  display: grid; place-items: center;
}

/* نان‌نما */
.pw-toast {
  position: fixed; inset-inline: 12px; bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 9998;
  margin-inline: auto; max-width: 420px; display: flex; align-items: center; gap: 12px; justify-content: space-between;
  background: #15181f; color: #fff; padding: 12px 16px; border-radius: 14px; font-size: 13px;
  opacity: 0; transform: translateY(14px); transition: .28s ease;
}
html.pw-app body.pw-has-nav .pw-toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
.pw-toast.on { opacity: 1; transform: translateY(0); }
.pw-toast button { border: 0; background: #ffffff22; color: #fff; font: inherit; padding: 6px 12px; border-radius: 10px; cursor: pointer; }

/* دکمه «نصب اپ» اختیاری در قالب: <button data-pw-install> */
html:not(.pw-installable) [data-pw-install] { display: none; }
html.pw-app [data-pw-install] { display: none !important; }
