﻿/* Systeme de toast â€” L'Atelier CBD */

/* Container */
.toast-container {
  position: fixed;
  z-index: 10000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
  max-height: 100vh;
  overflow: visible;
}

.toast-container--bottom-right {
  bottom: 24px;
  right: 24px;
}

/* Toast */
.toast {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 20px;
  border-radius: 10px;
  color: #fff;
  font-family: var(--font-body, sans-serif);
  font-size: 0.875rem;
  line-height: 1.4;
  max-width: 380px;
  min-width: 280px;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.25);
  position: relative;
  overflow: hidden;
  pointer-events: auto;
  cursor: default;
  animation: toastBounceIn 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
  touch-action: pan-y;
}

.toast.toast--exit {
  animation: toastBounceOut 0.3s ease-in forwards;
}

/* Variantes */
.toast--success { background: #16a34a; }
.toast--error   { background: #dc2626; }
.toast--warning { background: #f59e0b; }
.toast--info    { background: #3b82f6; }

/* Icone */
.toast__icon {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

/* Message */
.toast__message {
  flex: 1;
  word-break: break-word;
}

/* Bouton fermer */
.toast__close {
  flex-shrink: 0;
  background: none;
  border: none;
  color: #fff;
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0 0 0 4px;
  opacity: 0.7;
  transition: opacity 0.15s;
  line-height: 1;
}

.toast__close:hover {
  opacity: 1;
}

/* Barre de progression (pilotee par JS via transform + transition) */
.toast__progress {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: rgba(255, 255, 255, 0.35);
  border-radius: 0 0 8px 8px;
  transform-origin: left;
}

/* Animations */
@keyframes toastBounceIn {
  0%   { transform: translateX(120%); opacity: 0; }
  60%  { transform: translateX(-6px); opacity: 1; }
  80%  { transform: translateX(3px); }
  100% { transform: translateX(0); }
}

@keyframes toastBounceOut {
  0%   { transform: translateX(0); opacity: 1; }
  100% { transform: translateX(120%); opacity: 0; }
}

/* Responsive mobile */
@media (max-width: 480px) {
  .toast-container--bottom-right {
    left: 12px;
    right: 12px;
    bottom: 12px;
  }

  .toast {
    max-width: 100%;
    min-width: 0;
  }
}
