/* ===== Dosta PWA install prompt ===== */
.dpwa {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  font-family: var(--dosta-font, 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif);
  direction: rtl;
  pointer-events: none;
}
.dpwa.is-open { pointer-events: auto; }

.dpwa__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(29, 31, 35, .45);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  opacity: 0;
  transition: opacity .3s ease;
}
.dpwa.is-open .dpwa__backdrop { opacity: 1; }

.dpwa__sheet {
  position: relative;
  width: 100%;
  max-width: 480px;
  background: #fff;
  border-radius: 28px 28px 0 0;
  box-shadow: 0 -12px 40px rgba(45, 48, 54, .18);
  padding: 10px 22px calc(22px + env(safe-area-inset-bottom));
  transform: translateY(105%);
  transition: transform .42s cubic-bezier(.22, 1, .36, 1);
  touch-action: pan-x;
  will-change: transform;
}
.dpwa.is-open .dpwa__sheet { transform: translateY(0); }
.dpwa__sheet.is-dragging { transition: none; }

.dpwa__handle {
  width: 42px;
  height: 5px;
  border-radius: 999px;
  background: #E2E3E5;
  margin: 0 auto 14px;
}

.dpwa__close {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #F7F7F8;
  color: #7A7D83;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s ease, color .2s ease;
}
.dpwa__close:hover { background: #EFEFF1; color: #2D3036; }
.dpwa__close svg { width: 16px; height: 16px; }

.dpwa__head {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}
.dpwa__icon {
  position: relative;
  flex-shrink: 0;
  width: 68px;
  height: 68px;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 22px rgba(250, 62, 31, .22), 0 0 0 1px rgba(45, 48, 54, .06);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  animation: dpwa-pop .6s .15s cubic-bezier(.34, 1.56, .64, 1) both;
}
.dpwa__icon img { width: 100%; height: 100%; object-fit: cover; }

.dpwa__title {
  margin: 0 0 4px;
  font-size: 18px;
  line-height: 28px;
  font-weight: 800;
  color: #2D3036;
}
.dpwa__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: #7A7D83;
}
.dpwa__badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #E8F7EE;
  color: #12A150;
  font-weight: 700;
  font-size: 11px;
}
.dpwa__sep { width: 3px; height: 3px; border-radius: 50%; background: #C9CBCE; }

.dpwa__desc {
  margin: 0 0 16px;
  font-size: 14px;
  line-height: 25px;
  color: #5A5D63;
}

.dpwa__features {
  list-style: none;
  margin: 0 0 20px;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.dpwa__feature {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 12px 6px;
  border-radius: 16px;
  background: #F7F7F8;
  text-align: center;
  font-size: 12px;
  line-height: 18px;
  font-weight: 600;
  color: #43464C;
  animation: dpwa-rise .5s cubic-bezier(.22, 1, .36, 1) both;
}
.dpwa__feature:nth-child(1) { animation-delay: .18s; }
.dpwa__feature:nth-child(2) { animation-delay: .26s; }
.dpwa__feature:nth-child(3) { animation-delay: .34s; }
.dpwa__feature-icon {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: #FFF1EF;
  color: #FA3E1F;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dpwa__feature-icon svg { width: 18px; height: 18px; }

.dpwa__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dpwa__btn {
  width: 100%;
  border: 0;
  border-radius: 16px;
  padding: 14px 16px;
  font: inherit;
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: transform .15s ease, box-shadow .2s ease, background .2s ease;
  -webkit-tap-highlight-color: transparent;
}
.dpwa__btn:active { transform: scale(.97); }
.dpwa__btn svg { width: 18px; height: 18px; }
.dpwa__btn--primary {
  color: #fff;
  background: linear-gradient(135deg, #FA3E1F 0%, #DC371B 100%);
  box-shadow: 0 8px 20px rgba(250, 62, 31, .32);
}
.dpwa__btn--primary:hover { box-shadow: 0 10px 26px rgba(250, 62, 31, .4); }
.dpwa__btn--ghost {
  color: #7A7D83;
  background: transparent;
  padding: 10px 16px;
  font-weight: 600;
}
.dpwa__btn--ghost:hover { color: #2D3036; }
.dpwa__btn:focus-visible,
.dpwa__close:focus-visible { outline: none; box-shadow: 0 0 0 3px rgba(250, 62, 31, .3); }

/* iOS guide */
.dpwa__steps {
  list-style: none;
  margin: 0 0 18px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.dpwa__step {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 16px;
  background: #F7F7F8;
  font-size: 13px;
  line-height: 22px;
  color: #43464C;
  animation: dpwa-rise .5s cubic-bezier(.22, 1, .36, 1) both;
}
.dpwa__step:nth-child(1) { animation-delay: .18s; }
.dpwa__step:nth-child(2) { animation-delay: .26s; }
.dpwa__step:nth-child(3) { animation-delay: .34s; }
.dpwa__step-num {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #FA3E1F;
  color: #fff;
  font-size: 13px;
  font-weight: 800;
  display: flex;
  align-items: center;
  justify-content: center;
}
.dpwa__step b { color: #2D3036; font-weight: 700; }
.dpwa__step small { display: block; margin-top: 2px; font-size: 11px; line-height: 18px; color: #7A7D83; }
.dpwa__inline-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  width: 26px;
  height: 26px;
  margin: 0 2px;
  border-radius: 8px;
  background: #fff;
  color: #2F7FE0;
  box-shadow: 0 1px 3px rgba(45, 48, 54, .12);
}
.dpwa__inline-icon svg { width: 16px; height: 16px; }

/* Toast */
.dpwa-toast {
  position: fixed;
  left: 50%;
  bottom: calc(20px + env(safe-area-inset-bottom));
  z-index: 10000;
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: calc(100% - 32px);
  padding: 12px 18px;
  border-radius: 16px;
  background: #2D3036;
  color: #fff;
  font-family: var(--dosta-font, 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif);
  font-size: 14px;
  font-weight: 600;
  direction: rtl;
  box-shadow: 0 12px 32px rgba(45, 48, 54, .3);
  transform: translate(-50%, 140%);
  opacity: 0;
  transition: transform .4s cubic-bezier(.22, 1, .36, 1), opacity .3s ease;
}
.dpwa-toast.is-visible { transform: translate(-50%, 0); opacity: 1; }
.dpwa-toast__icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: #12A150;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.dpwa-toast__icon svg { width: 14px; height: 14px; }

@keyframes dpwa-pop {
  from { transform: scale(.6); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
@keyframes dpwa-rise {
  from { transform: translateY(10px); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .dpwa__sheet, .dpwa__backdrop, .dpwa-toast { transition-duration: .01ms; }
  .dpwa__icon, .dpwa__feature, .dpwa__step { animation: none; }
}
