/* ═══════════════════════════════════════════════
   TOASTS — Coco Galaxy
   ═══════════════════════════════════════════════ */

.toast-container {
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  pointer-events: none;
  width: 100%;
  max-width: 420px;
  padding: 0 16px;
  box-sizing: border-box;
}

/* ── Toast base ────────────────────────────────── */
.toast {
  width: 100%;
  background: var(--card-bg, #fff);
  border-radius: 16px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.18);
  border: 1px solid var(--nav-border);
  overflow: hidden;
  pointer-events: all;
  display: flex;
  flex-direction: column;

  /* Animación entrada */
  animation: toast-in 0.38s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

.toast.toast-out {
  animation: toast-out 0.28s ease-in forwards;
}

@keyframes toast-in {
  from { opacity: 0; transform: translateY(-20px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0)     scale(1); }
}

@keyframes toast-out {
  from { opacity: 1; transform: translateY(0)    scale(1);    max-height: 200px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateY(-12px) scale(0.96); max-height: 0;    margin-bottom: -10px; }
}

/* ── Cuerpo del toast ──────────────────────────── */
.toast-body {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 16px 18px 14px;
}

/* ── Ícono ─────────────────────────────────────── */
.toast-icon {
  flex-shrink: 0;
  width: 38px;
  height: 38px;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ── Contenido ─────────────────────────────────── */
.toast-content {
  flex: 1;
  min-width: 0;
}

.toast-title {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.3px;
  text-transform: uppercase;
  margin-bottom: 3px;
}

.toast-msg {
  font-size: 0.92rem;
  line-height: 1.45;
  color: var(--text-secondary);
}

/* ── Botón cerrar ──────────────────────────────── */
.toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-secondary);
  padding: 2px;
  line-height: 0;
  opacity: 0.6;
  transition: opacity 0.2s;
  align-self: flex-start;
}

.toast-close:hover { opacity: 1; }

/* ── Barra de progreso ─────────────────────────── */
.toast-progress {
  height: 3px;
  border-radius: 0 0 16px 16px;
  transform-origin: left;
  animation: toast-progress linear forwards;
}

@keyframes toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ── Tipos ─────────────────────────────────────── */

/* Error */
.toast--error .toast-icon  { background: rgba(255, 61, 107, 0.12); color: #ff3d6b; }
.toast--error .toast-title { color: #ff3d6b; }
.toast--error .toast-progress { background: #ff3d6b; }

/* Éxito */
.toast--success .toast-icon  { background: rgba(16, 185, 129, 0.12); color: #10b981; }
.toast--success .toast-title { color: #10b981; }
.toast--success .toast-progress { background: #10b981; }

/* Info / aviso */
.toast--info .toast-icon  { background: rgba(124, 58, 237, 0.12); color: #7c3aed; }
.toast--info .toast-title { color: #7c3aed; }
.toast--info .toast-progress { background: #7c3aed; }

/* Advertencia */
.toast--warning .toast-icon  { background: rgba(245, 158, 11, 0.12); color: #f59e0b; }
.toast--warning .toast-title { color: #f59e0b; }
.toast--warning .toast-progress { background: #f59e0b; }

/* ── Responsive ────────────────────────────────── */
@media (max-width: 480px) {
  .toast-container {
    top: 70px;
    padding: 0 12px;
  }
}
