/**
 * Notifications - System-wide toast notifications
 * Theme: Noir et blanc, simple et moderne (Optimisé E-commerce)
 * =============================================
 */

.notification-container {
    position: fixed;
    top: 24px;
    right: 24px;
    z-index: 10000;
    display: flex;
    flex-direction: column;
    gap: 12px;
    pointer-events: none;
    max-width: 400px;
}

.notification {
    pointer-events: auto;
    background: var(--color-bg-card);
    color: var(--color-text-primary);
    border: 1px solid var(--color-border-light);
    padding: 12px;
    border-radius: var(--radius-sm);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.4);
    transform: translateX(120%);
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.4s ease;
    opacity: 0;
    position: relative;
    overflow: hidden;
}

.notification.show {
    transform: translateX(0);
    opacity: 1;
}

/* Inline variant */
.notification--inline {
    position: relative;
    top: auto;
    right: auto;
    transform: none;
    width: 100%;
    flex-basis: 100%;
    min-width: 0;
    margin-bottom: 12px;
    box-shadow: none;
    opacity: 0;
    transform: translateY(-10px);
}

.notification--inline.show {
    transform: translateY(0);
    opacity: 1;
}

/* Success style */
.notification--success { border-left: 3px solid var(--color-white); }
.notification--error { border-left: 3px solid #ef4444; }
.notification--info { border-left: 3px solid var(--color-text-muted); }

.notification__inner {
    display: flex;
    gap: 12px;
    align-items: flex-start;
    transition: all 0.3s ease;
}

/* Thumbnail for products */
.notification__image {
    width: 48px;
    height: 48px;
    border-radius: 4px;
    object-fit: cover;
    background: var(--color-bg-secondary);
    flex-shrink: 0;
}

.notification__body {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-top: 2px;
}

.notification__content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.notification__title {
    font-size: var(--text-sm);
    font-weight: var(--weight-medium);
    color: var(--color-text-primary);
}

.notification__message {
    font-size: var(--text-xs);
    color: var(--color-text-secondary);
    line-height: 1.4;
}

/* Actions (e.g., "View Cart") */
.notification__actions {
    display: flex;
    gap: 8px;
    margin-top: 4px;
}

.notification__action {
    font-size: var(--text-xs);
    font-weight: var(--weight-medium);
    color: var(--color-white);
    text-decoration: underline;
    text-underline-offset: 4px;
    transition: opacity var(--transition-fast);
}

.notification__action:hover {
    opacity: 0.8;
}

.notification__close {
    cursor: pointer;
    background: none;
    border: none;
    color: var(--color-text-muted);
    font-size: 18px;
    line-height: 1;
    padding: 4px;
    flex-shrink: 0;
    transition: color var(--transition-fast);
}

.notification__close:hover {
    color: var(--color-text-primary);
}

/* Progress bar timer */
.notification__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 2px;
    background: rgba(255, 255, 255, 0.3);
    width: 100%;
    transform-origin: left;
    animation: notification-progress linear forwards;
}

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

@media (max-width: 480px) {
    .notification-container {
        top: auto;
        bottom: calc(12px + env(safe-area-inset-bottom, 0));
        right: 12px;
        left: 12px;
        max-width: none;
    }

    .notification {
        transform: translateY(120%);
        touch-action: pan-x;
    }

    .notification.show {
        transform: translateY(0);
    }

    /* Swipe-to-dismiss animation */
    .notification.swiping {
        transition: none;
    }

    .notification.dismissed {
        transform: translateX(100%);
        opacity: 0;
    }
}
