"If you had seen a snake in the garden, you would have fainted."
is a valid example of the third conditional, which describes a hypothetical situation in the past and its possible result. The structure is:
- If + past perfect, would have + past participle.
In your sentence, the past perfect ("had seen") is used to describe the hypothetical action, and "would have fainted" shows the potential result of that action. It suggests that seeing a snake would have caused you to faint, though this didn't actually happen.