/* =========================================================
   TOAST — Sistema de notificaciones global
   Estilo: Odoo / Defontana
   ========================================================= */

.ircc-toast-container {
  position: fixed;
  top: 22px;
  right: 22px;
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
  width: min(380px, calc(100vw - 32px));
}

/* ── Card base ── */
.ircc-toast {
  background: #ffffff;
  border-radius: 12px;
  box-shadow:
    0 6px 28px rgba(15,23,42,0.13),
    0 1px 5px  rgba(15,23,42,0.07);
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 14px 16px 16px;
  pointer-events: auto;
  cursor: default;
  position: relative;
  overflow: hidden;
  border-left: 4px solid transparent;
  animation: ircc-toast-in 0.32s cubic-bezier(0.34,1.3,0.64,1) both;
}

/* ── Tipos ── */
.ircc-toast--success { border-left-color: #16a34a; }
.ircc-toast--error   { border-left-color: #dc2626; }
.ircc-toast--warning { border-left-color: #d97706; }
.ircc-toast--info    { border-left-color: #2563eb; }

/* ── Salida ── */
.ircc-toast--out {
  animation: ircc-toast-out 0.24s ease-in forwards;
  pointer-events: none;
}

/* ── Ícono circular ── */
.ircc-toast-icon {
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ircc-toast--success .ircc-toast-icon { background: #dcfce7; color: #16a34a; }
.ircc-toast--error   .ircc-toast-icon { background: #fee2e2; color: #dc2626; }
.ircc-toast--warning .ircc-toast-icon { background: #fef3c7; color: #d97706; }
.ircc-toast--info    .ircc-toast-icon { background: #dbeafe; color: #2563eb; }

/* ── Texto ── */
.ircc-toast-msg {
  flex: 1;
  font-size: 13.5px;
  font-weight: 600;
  color: #1e293b;
  line-height: 1.45;
  font-family: inherit;
}

/* ── Cerrar ── */
.ircc-toast-close {
  flex-shrink: 0;
  background: none;
  border: none;
  cursor: pointer;
  color: #94a3b8;
  font-size: 13px;
  width: 22px;
  height: 22px;
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  transition: background 0.12s, color 0.12s;
  align-self: flex-start;
}
.ircc-toast-close:hover { background: #f1f5f9; color: #475569; }

/* ── Barra de progreso ── */
.ircc-toast-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 3px;
  width: 100%;
  transform-origin: left;
  border-radius: 0 0 0 12px;
  animation: ircc-toast-progress var(--td, 4200ms) linear both;
}
.ircc-toast--success .ircc-toast-bar { background: linear-gradient(90deg, #16a34a, #4ade80); }
.ircc-toast--error   .ircc-toast-bar { background: linear-gradient(90deg, #dc2626, #f87171); }
.ircc-toast--warning .ircc-toast-bar { background: linear-gradient(90deg, #d97706, #fbbf24); }
.ircc-toast--info    .ircc-toast-bar { background: linear-gradient(90deg, #2563eb, #60a5fa); }

/* ── Animaciones ── */
@keyframes ircc-toast-in {
  from { opacity: 0; transform: translateX(32px) scale(0.94); }
  to   { opacity: 1; transform: translateX(0)    scale(1);    }
}

@keyframes ircc-toast-out {
  from { opacity: 1; transform: translateX(0);    max-height: 100px; margin-bottom: 0; }
  to   { opacity: 0; transform: translateX(32px); max-height: 0;     margin-bottom: -10px;
         padding-top: 0; padding-bottom: 0; }
}

@keyframes ircc-toast-progress {
  from { transform: scaleX(1); }
  to   { transform: scaleX(0); }
}

/* ── Mobile: aparece abajo ── */
@media (max-width: 520px) {
  .ircc-toast-container {
    top: auto;
    bottom: 20px;
    right: 12px;
    left: 12px;
    width: auto;
  }
}
