/* ============================================================================
   ВСПЛЫВАЮЩИЕ УВЕДОМЛЕНИЯ
   ==========================================================================*/

.site-notifications {
  position: fixed;
  z-index: 110;
  left: 50%;
  display: grid;
  width: min(calc(100% - 32px), 430px);
  gap: 8px;
  justify-items: center;
  pointer-events: none;
  transform: translateX(-50%);
  transition: top 260ms cubic-bezier(0.22, 1, 0.36, 1), bottom 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-notifications[data-position="bottom"] {
  bottom: max(24px, env(safe-area-inset-bottom));
}

.site-notifications[data-position="sheet-above"] {
  bottom: var(--site-notifications-offset);
}

.site-notifications[data-position="sheet-below"] {
  top: var(--site-notifications-offset);
}

.site-notification {
  display: flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  max-width: 100%;
  min-height: 52px;
  min-width: 0;
  padding: 12px 20px;
  box-sizing: border-box;
  border-radius: 999px;
  color: var(--text);
  background: var(--surface-overlay);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.10),
    inset 0 -1px 0 rgba(0, 0, 0, 0.5),
    0 0 0 1px rgba(255, 255, 255, 0.06),
    0 18px 40px rgba(0, 0, 0, 0.65);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.35;
  opacity: 0;
  transform: scale(0.9);
  transform-origin: center;
  transition: opacity 180ms ease, transform 220ms cubic-bezier(0.22, 1, 0.36, 1);
}

.site-notification.is-visible {
  opacity: 1;
  transform: scale(1);
}

.site-notification.is-shaking {
  animation: site-notification-shake 360ms ease;
}

.site-notification__text {
  min-width: 0;
  text-align: center;
}

.site-notification__icon {
  width: 20px;
  height: 20px;
  flex: 0 0 auto;
  background: currentColor;
  -webkit-mask: var(--icon-info) center / contain no-repeat;
  mask: var(--icon-info) center / contain no-repeat;
}

/* Тон уведомления: ошибка — красный, успех — светлый, инфо — серый */
.site-notification[data-tone="error"] {
  color: #ffd9d6;
}

.site-notification[data-tone="error"] .site-notification__icon {
  background: var(--accent-bright);
}

.site-notification[data-tone="success"] {
  color: #eaffe9;
}

.site-notification[data-tone="success"] .site-notification__icon {
  background: #7ee787;
}

.site-notification[data-tone="info"] .site-notification__icon {
  background: var(--text-secondary);
}

@keyframes site-notification-shake {
  0%, 100% { transform: scale(1) translateX(0); }
  25% { transform: scale(1) translateX(-5px); }
  50% { transform: scale(1) translateX(5px); }
  75% { transform: scale(1) translateX(-3px); }
}

@media (max-width: 640px) {
  .site-notifications {
    width: min(calc(100% - 40px), 430px);
  }
}
