It's the rule:
I f the verb of the main clause is in the past simple, the verb of the IF-clause is in the conditional
If the verb of the main clause is in the present simple, the verb of the If-clause is in the future
If the verb of the main clause is in the past perfect, the If-clause is in the perfect conditional

English Teacher