/* ============================================================
   SISTEMA DE TOASTS / NOTIFICACIONES
   Inventario TX
   ============================================================
   Notificaciones flotantes en esquina superior derecha.
   Usar mostrarNotificacion() de animaciones.js
   ============================================================ */

/* ── CONTENEDOR DE TOASTS ─────────────────────────────── */
.toast-container {
    position: fixed;
    top: 80px;
    right: 20px;
    z-index: var(--z-toast);
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    pointer-events: none;
    max-width: 380px;
    width: calc(100vw - 40px);
}

/* ── TOAST INDIVIDUAL ─────────────────────────────────── */
.toast-item {
    pointer-events: auto;
    display: flex;
    align-items: flex-start;
    gap: 0.875rem;
    padding: 1rem 1.25rem;
    border-radius: var(--radius-lg);
    background: var(--color-surface);
    box-shadow: var(--shadow-toast);
    border-left: 4px solid transparent;
    animation: deslizar-notificacion 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
    font-family: var(--font-family);
}

.toast-item.saliendo {
    animation: deslizar-salida 0.3s ease forwards;
}

/* Colores por tipo */
.toast-item.toast-success {
    border-left-color: var(--color-esmeralda);
    background: linear-gradient(135deg, #f0fdf4 0%, var(--color-surface) 100%);
}

.toast-item.toast-error {
    border-left-color: var(--color-rubi);
    background: linear-gradient(135deg, #fef2f2 0%, var(--color-surface) 100%);
}

.toast-item.toast-warning {
    border-left-color: var(--color-warning);
    background: linear-gradient(135deg, #fffbeb 0%, var(--color-surface) 100%);
}

.toast-item.toast-info {
    border-left-color: var(--color-primary);
    background: linear-gradient(135deg, #eff6ff 0%, var(--color-surface) 100%);
}

/* Icono del toast */
.toast-icon {
    flex-shrink: 0;
    width: 32px;
    height: 32px;
    border-radius: var(--radius-md);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.toast-success .toast-icon {
    background: var(--color-esmeralda);
    color: white;
}

.toast-error .toast-icon {
    background: var(--color-rubi);
    color: white;
}

.toast-warning .toast-icon {
    background: var(--color-warning);
    color: white;
}

.toast-info .toast-icon {
    background: var(--color-primary);
    color: white;
}

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

.toast-title {
    font-size: var(--font-size-sm);
    font-weight: 600;
    color: var(--color-text-heading);
    margin: 0 0 0.125rem 0;
}

.toast-message {
    font-size: var(--font-size-xs);
    color: var(--color-muted);
    margin: 0;
    line-height: 1.4;
}

/* Boton cerrar */
.toast-close {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: var(--radius-full);
    border: none;
    background: transparent;
    color: var(--color-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
    font-size: 0.875rem;
}

.toast-close:hover {
    background: var(--color-bg);
    color: var(--color-text);
}

/* Progress bar (opcional para auto-dismiss) */
.toast-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: currentColor;
    opacity: 0.3;
    animation: toast-progress linear forwards;
}

/* ── TOAST SIMPLE (inline, sin contenedor) ─────────────── */
/* Alternativa minima para alertas dentro de formularios */
.toast-inline {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: var(--radius-md);
    font-size: var(--font-size-sm);
    font-weight: 500;
    animation: deslizar-entrada var(--transition-normal) both;
}

.toast-inline i {
    font-size: 1rem;
}

.toast-inline.toast-success {
    background: var(--color-esmeralda-light);
    color: var(--color-esmeralda);
}

.toast-inline.toast-error {
    background: var(--color-rubi-light);
    color: var(--color-rubi);
}

.toast-inline.toast-warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
}

.toast-inline.toast-info {
    background: var(--color-info-light);
    color: var(--color-info);
}

/* ── NOTIFICACION EMBEBIDA EN PANEL ────────────────────── */
.panel-notification {
    border-radius: var(--radius-md);
    padding: 1rem;
    margin-bottom: var(--space-md);
    display: flex;
    align-items: center;
    gap: 0.75rem;
    animation: deslizar-entrada var(--transition-normal) both;
}

.panel-notification i {
    font-size: 1.25rem;
}

.panel-notification.success {
    background: var(--color-esmeralda-light);
    color: var(--color-esmeralda);
    border: 1px solid rgba(5, 150, 105, 0.2);
}

.panel-notification.error {
    background: var(--color-rubi-light);
    color: var(--color-rubi);
    border: 1px solid rgba(225, 29, 72, 0.2);
}

.panel-notification.warning {
    background: var(--color-warning-light);
    color: var(--color-warning);
    border: 1px solid rgba(245, 158, 11, 0.2);
}

/* ── RESPONSIVE ────────────────────────────────────────── */
@media (max-width: 576px) {
    .toast-container {
        top: 60px;
        right: 12px;
        left: 12px;
        max-width: none;
        width: auto;
    }

    .toast-item {
        padding: 0.875rem 1rem;
    }
}