Yes, alliances with non-Christian factions will reduce standings with the Pope:
Code:
Trigger Alliance_Declared_Catholic_to_Non_Christian
WhenToTest FactionAllianceDeclared
Condition FactionReligion catholic
and not TargetFactionReligion catholic
and not TargetFactionReligion orthodox
FactionStanding factions { papal_states } -0.1
FactionStanding target_faction normalise 1.0 100
FactionStanding target_allies normalise 1.0 200
FactionStanding target_enemies normalise -1.0 200
However, only making the alliance reduces the relations. Ongoing alliances do nothing directly.
On-going alliances makes enemies of your allies and allies of your enemies dislike you, though, so if the Pope is at war with one or more of your allies, relations will deteriorate.
"Having trade right or any other kind of diplomatic relations with Faction X that Faction Y hates will lower it slightly."
This is incorrect, only alliances affect diplomatic relations over time.
Trade agreements only affect standings with who you're trading with, and their allies, and only when the trade agreement gets signed:
Code:
Trigger 0079_F_Trade_Agreement
WhenToTest FactionTradeAgreementMade
FactionStanding target_faction 0.1
FactionStanding target_allies normalise 0.6 50