Make the crust: In a large bowl, mix flour, sugar, and salt. Cut in the cold butter with a pastry blender or your fingers until the mixture resembles coarse crumbs with some pea-sized butter pieces. Stir in ice water until the dough just comes together. Divide in half, form into two disks, wrap in plastic, and chill for at least 1 hour.
Make the caramel: In a saucepan, combine sugar and water over medium-high heat. Swirl the pan occasionally, but do not stir, until the sugar dissolves and the mixture turns a medium amber color. Remove from heat and carefully whisk in the warm heavy cream (it will bubble vigorously). Whisk in the butter, salt, and vanilla until smooth. Set aside to cool.
Prepare the filling: Preheat oven to 400°F (200°C). In a large bowl, toss the sliced apples with lemon juice. In a small bowl, whisk together the sugar, flour, cinnamon, and nutmeg. Add the sugar mixture to the apples and toss to coat.
Assemble the pie: On a floured surface, roll one dough disk into a 12-inch circle. Ease it into a 9-inch pie dish. Pile the apple filling into the crust. Drizzle about half of the cooled caramel sauce over the apples.
Add the top crust: Roll out the second dough disk. Place it over the filling. Trim the overhang to 1 inch, fold the top crust under the bottom, and crimp the edges to seal. Cut several slits in the top for steam to escape.
Finish and chill: Brush the top crust with the egg wash and sprinkle with coarse sugar, if using. Place the pie on a baking sheet and freeze for 15-20 minutes to firm up the pastry.
Bake the pie: Bake for 15 minutes at 400°F (200°C). Reduce the oven temperature to 375°F (190°C) and continue to bake for 40-50 minutes, or until the crust is deep golden brown and the filling is bubbling. If the edges brown too quickly, cover them with foil.
Cool and serve: Let the pie cool on a wire rack for at least 3 hours before slicing. This allows the filling to set. Serve slices warm, with the remaining salted caramel sauce drizzled on top.