/* ——— Toast اعلان سراسری — همیشه بالاتر از مودال و ویجت‌ها ——— */
.deliche-notify-stack {
  position: fixed;
  left: 50%;
  right: auto;
  bottom: calc(var(--bottom-nav-h, 64px) + var(--safe-bottom, 0px) + 16px);
  z-index: var(--z-toast, 10200);
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 10px;
  width: min(400px, calc(100vw - 24px));
  transform: translateX(-50%);
  pointer-events: none;
  isolation: isolate;
}

/* وقتی مودال ورود باز است — اعلان بالای صفحه دیده شود */
body.auth-modal-open .deliche-notify-stack {
  bottom: auto;
  top: max(1rem, env(safe-area-inset-top, 0px));
  flex-direction: column;
}

.deliche-notify-item {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 16px;
  background: rgba(255, 255, 255, 0.98);
  color: var(--text, #1a1f1c);
  border: 1px solid rgba(129, 176, 97, 0.14);
  border-radius: 16px;
  box-shadow:
    0 2px 8px rgba(26, 31, 28, 0.06),
    0 12px 32px rgba(26, 31, 28, 0.12),
    0 0 0 1px rgba(255, 255, 255, 0.6);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  font-family: var(--font-body);
  font-size: 0.88rem;
  font-weight: 600;
  line-height: 1.5;
  text-align: start;
  opacity: 0;
  transform: translateY(14px) scale(0.96);
  max-height: 88px;
  overflow: hidden;
  pointer-events: auto;
  transition:
    opacity 0.38s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    max-height 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    margin 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    padding 0.42s cubic-bezier(0.22, 1, 0.36, 1),
    border-width 0.3s ease,
    box-shadow 0.38s ease;
}

.deliche-notify-item.is-visible {
  opacity: 1;
  transform: translateY(0) scale(1);
}

body.auth-modal-open .deliche-notify-item {
  transform: translateY(-10px) scale(0.96);
}

body.auth-modal-open .deliche-notify-item.is-visible {
  transform: translateY(0) scale(1);
}

.deliche-notify-item.is-leaving {
  opacity: 0;
  transform: translateY(8px) scale(0.97);
  max-height: 0;
  margin-block: -5px;
  padding-block: 0;
  border-width: 0;
  box-shadow: none;
}

body.auth-modal-open .deliche-notify-item.is-leaving {
  transform: translateY(-6px) scale(0.97);
}

.deliche-notify-icon {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  color: #fff;
}

.deliche-notify-icon .deliche-notify-icon-svg {
  width: 18px;
  height: 18px;
}

.deliche-notify-item--success .deliche-notify-icon {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 10px rgba(129, 176, 97, 0.22);
}

.deliche-notify-item--success {
  border-color: rgba(129, 176, 97, 0.14);
}

.deliche-notify-item--error .deliche-notify-icon {
  background: linear-gradient(145deg, #e85d4c, #c0392b);
  color: #fff;
  box-shadow: 0 3px 10px rgba(192, 57, 43, 0.22);
}

.deliche-notify-item--error {
  border-color: rgba(192, 57, 43, 0.22);
  box-shadow:
    0 2px 8px rgba(192, 57, 43, 0.08),
    0 12px 32px rgba(26, 31, 28, 0.12);
}

.deliche-notify-item--info .deliche-notify-icon {
  background: linear-gradient(145deg, #5b9bd5, #3a7ab8);
  color: #fff;
  box-shadow: 0 3px 10px rgba(58, 122, 184, 0.22);
}

.deliche-notify-item--info {
  border-color: rgba(58, 122, 184, 0.18);
}

.deliche-notify-text {
  flex: 1;
  min-width: 0;
}

@media (min-width: 769px) {
  .deliche-notify-stack {
    bottom: 24px;
  }

  body.auth-modal-open .deliche-notify-stack {
    top: 1.25rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .deliche-notify-item {
    transition: opacity 0.15s ease;
  }
}
