/* ============================================
   TOAST NOTIFICATIONS - Style site
   ============================================ */

.toast-notification {
    position: fixed;
    padding: 16px 24px;
    border-radius: 12px;
    color: white;
    font-weight: 500;
    font-size: 15px;
    z-index: 10001;
    display: flex;
    align-items: center;
    gap: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
    animation: slideIn 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    max-width: 400px;
    pointer-events: auto;
}

/* Desktop - Haut à droite pour être visible au-dessus des modales */
@media (min-width: 769px) {
    .toast-notification {
        top: 80px;
        right: 30px;
    }
    
    /* Quand la modale auth est ouverte, centrer dans la modale */
    body.modal-open .toast-notification {
        position: fixed;
        top: auto;
        bottom: 140px;
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        z-index: 10002;
        max-width: 500px;
    }
    
    .toast-notification.toast-exit {
        animation: slideOutRight 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    body.modal-open .toast-notification.toast-exit {
        animation: slideOutBottom 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* Mobile - Haut centré */
@media (max-width: 768px) {
    .toast-notification {
        top: 20px;
        left: 50%;
        transform: translateX(-50%);
        max-width: calc(100% - 40px);
    }
    
    /* Quand la modale auth est ouverte, positionner DANS la modale */
    body.modal-open .toast-notification {
        position: absolute !important;
        top: auto !important;
        bottom: 80px !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%) !important;
        z-index: 1 !important;
        max-width: calc(100% - 60px) !important;
        animation: slideInBottom 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
    
    .toast-notification.toast-exit {
        animation: slideOutTop 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    body.modal-open .toast-notification.toast-exit {
        animation: slideOutBottomMobile 0.3s cubic-bezier(0.4, 0, 0.2, 1) !important;
    }
}

/* Types de toast */
.toast-notification.toast-success {
    background: linear-gradient(135deg, #B8461F 0%, #8B2F0F 100%);
}

.toast-notification.toast-error {
    background: linear-gradient(135deg, #ef4444 0%, #dc2626 100%);
}

.toast-notification.toast-info {
    background: linear-gradient(135deg, #B8461F 0%, #D85A2E 100%);
}

.toast-notification.toast-warning {
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
}

/* Icône */
.toast-notification__icon {
    font-size: 20px;
    flex-shrink: 0;
}

/* Message */
.toast-notification__message {
    flex: 1;
    line-height: 1.4;
}

/* Bouton fermer */
.toast-notification__close {
    background: none;
    border: none;
    color: white;
    font-size: 20px;
    cursor: pointer;
    padding: 0;
    width: 24px;
    height: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
    flex-shrink: 0;
}

.toast-notification__close:hover {
    background: rgba(255, 255, 255, 0.2);
}

/* Animations Desktop */
@keyframes slideIn {
    from {
        opacity: 0;
        transform: translateX(100px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes slideOutRight {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(100px);
    }
}

@keyframes slideOutBottom {
    from {
        opacity: 1;
        transform: translateX(-50%) translateY(0);
    }
    to {
        opacity: 0;
        transform: translateX(-50%) translateY(20px);
    }
}

/* Animations Mobile */
@media (max-width: 768px) {
    @keyframes slideIn {
        from {
            opacity: 0;
            transform: translate(-50%, -50px);
        }
        to {
            opacity: 1;
            transform: translate(-50%, 0);
        }
    }
    
    @keyframes slideInBottom {
        from {
            opacity: 0;
            transform: translate(-50%, 50px);
        }
        to {
            opacity: 1;
            transform: translate(-50%, 0);
        }
    }
    
    @keyframes slideOutTop {
        from {
            opacity: 1;
            transform: translate(-50%, 0);
        }
        to {
            opacity: 0;
            transform: translate(-50%, -50px);
        }
    }
    
    @keyframes slideOutBottomMobile {
        from {
            opacity: 1;
            transform: translate(-50%, 0);
        }
        to {
            opacity: 0;
            transform: translate(-50%, 50px);
        }
    }
}

/* Barre de progression */
.toast-notification__progress {
    position: absolute;
    bottom: 0;
    left: 0;
    height: 3px;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 0 0 12px 12px;
    animation: progress 3s linear;
}

@keyframes progress {
    from {
        width: 100%;
    }
    to {
        width: 0%;
    }
}

/* ============================================
   ANIMATIONS POUR NOTIFICATIONS MODALE PRODUIT
   ============================================ */

@keyframes slideInNotif {
    from {
        opacity: 0;
        transform: translateY(-20px) translateX(-50%);
    }
    to {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
}

@keyframes slideOutNotif {
    from {
        opacity: 1;
        transform: translateY(0) translateX(-50%);
    }
    to {
        opacity: 0;
        transform: translateY(-20px) translateX(-50%);
    }
}

/* Desktop - Animation différente */
@media (min-width: 769px) {
    @keyframes slideInNotif {
        from {
            opacity: 0;
            transform: translateX(100px);
        }
        to {
            opacity: 1;
            transform: translateX(0);
        }
    }
    
    @keyframes slideOutNotif {
        from {
            opacity: 1;
            transform: translateX(0);
        }
        to {
            opacity: 0;
            transform: translateX(100px);
        }
    }
}
