/* toast.css - Sistema unificado de notificaciones Toast */
:root {
  /* Colores base para los toast */
  --toast-bg: #ffffff;
  --toast-text: #333333;
  --toast-border-radius: 8px;
  --toast-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  --toast-success: #00a650;
  --toast-error: #f44336;
  --toast-warning: #ff9800;
  --toast-info: #2196f3;
  --toast-icon-size: 1.2rem;
}

/* Contenedor principal del toast */
.toast-notification {
  position: fixed;
  bottom: 20px;
  right: 20px;
  background: var(--toast-bg);
  border-left: 4px solid var(--toast-info); /* Color por defecto */
  box-shadow: var(--toast-shadow);
  padding: 16px 20px;
  border-radius: var(--toast-border-radius);
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 350px;
  z-index: 10000;
  opacity: 0;
  transform: translateX(100%);
  transition: all 0.3s ease;
  cursor: pointer;
}

/* Estado visible del toast */
.toast-notification.show {
  opacity: 1;
  transform: translateX(0);
}

/* Contenido interno */
.toast-contenido {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-grow: 1;
}

.toast-icono {
  font-size: var(--toast-icon-size);
  min-width: 24px;
  text-align: center;
}

.toast-mensaje {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--toast-text);
  margin: 0;
  line-height: 1.4;
  flex-grow: 1;
}

.toast-cerrar {
  background: none;
  border: none;
  font-size: 1.1rem;
  margin-left: 15px;
  cursor: pointer;
  color: #999;
  padding: 4px;
  border-radius: 4px;
  transition: all 0.2s;
  flex-shrink: 0;
}

.toast-cerrar:hover {
  color: var(--toast-text);
  background: rgba(0, 0, 0, 0.05);
}

/* ===== VARIANTES POR TIPO ===== */

/* Success (para: producto agregado/eliminado) */
.toast-notification.toast-success {
  border-left-color: var(--toast-success);
}

/* Error */
.toast-notification.toast-error {
  border-left-color: var(--toast-error);
}

/* Warning */
.toast-notification.toast-warning {
  border-left-color: var(--toast-warning);
}

/* Info (para: carrito vaciado, cambios de cantidad) */
.toast-notification.toast-info {
  border-left-color: var(--toast-info);
}

/* ===== ANIMACIONES ===== */
@keyframes toastSlideIn {
  from {
    transform: translateX(100%);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@keyframes toastSlideOut {
  from {
    transform: translateX(0);
    opacity: 1;
  }
  to {
    transform: translateX(100%);
    opacity: 0;
  }
}

.toast-notification {
  animation: toastSlideIn 0.3s ease forwards;
}

.toast-notification.hiding {
  animation: toastSlideOut 0.3s ease forwards;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
  .toast-notification {
    right: 10px;
    left: 10px;
    max-width: none;
    bottom: 10px;
  }
}

/* Para múltiples toasts - se apilan verticalmente */
.toast-notification:not(:first-child) {
  margin-bottom: 10px;
}