/* Toast Container */

.toast-container {
  position: fixed;
  top: 88px;
  right: 20px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 99999;
}

/* Toast */

.toast {
  min-width: 320px;
  max-width: 400px;
  padding: 16px 18px;
  border-radius: var(--z-radius-control, 10px);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: space-between;
  box-shadow: var(--z-shadow-dropdown, 0 12px 30px rgba(0, 0, 0, 0.18));
  font-family: var(--z-font-body, sans-serif);
  animation: toastIn 0.35s ease;
}

/* Left */
.toast-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 12px;
}
.toast-content {
  display: grid;
  min-width: 0;
  gap: 4px;
}

/* Icon */
.toast-icon {
  font-size: 20px;
}

/* Message */
.toast-message {
  font-size: 14px;
  line-height: 22px;
  overflow-wrap: anywhere;
}
.toast-action {
  width: max-content;
  padding: 0;
  border: 0;
  border-bottom: 1px solid currentColor;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

/* Close */
.toast-close {
  border: none;
  background: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  margin-left: 15px;
}

.toast-close:focus-visible {
  outline: 3px solid #fff;
  outline-offset: 3px;
}

/* Types */
.toast.success {
  background: var(--z-color-success, #28734a);
}

.toast.error {
  background: var(--z-color-error, #a92e3b);
}

.toast.warning {
  background: var(--z-color-warning, #9b5b0b);
}

.toast.info {
  background: var(--z-color-info, #2853a7);
}

/* Animation */
@keyframes toastIn {
  from {
    opacity: 0;
    transform: translateX(100%);
  }

  to {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes toastOut {
  from {
    opacity: 1;
    transform: translateX(0);
  }

  to {
    opacity: 0;
    transform: translateX(120%);
  }
}

.toast.hide {
  animation: toastOut 0.3s forwards;
}

@media (max-width: 600px) {
  .toast-container {
    top: auto;
    right: 12px;
    bottom: calc(12px + env(safe-area-inset-bottom));
    left: 12px;
  }
  .toast {
    width: 100%;
    min-width: 0;
    max-width: none;
  }
}

@media (prefers-reduced-motion: reduce) {
  .toast,
  .toast.hide {
    animation-duration: 0.01ms;
  }
}
