What's wrong with this shader code?

Here’s the code:

Shader "Custom/SeismicWave" {
    Properties {
        _MainTex ("Texture", 2D) = "white" {}
        _Speed ("Wave Speed", Range(0.1, 10.0)) = 1.0
    }

    SubShader {
        Tags {"Queue"="Transparent" "RenderType"="Opaque"}

        CGPROGRAM
        #pragma surface surf Standard

        float4 _MainTex_ST;
        float _Speed;

        struct Input {
            float2 uv_MainTex;
            float3 worldPos;
        };

        void surf (Input IN, inout SurfaceOutputStandard o) {
            // Calculate the displacement based on time and position
            float displacement = sin((IN.worldPos.x + IN.worldPos.z) * _Speed + _Time.y);

            // Add the displacement to the vertex position
            IN.worldPos.y += displacement;

            o.Albedo = tex2D (_MainTex, IN.uv_MainTex).rgb;
            o.Alpha = 1.0;
        }
        ENDCG
    }
    FallBack "Diffuse"
}

It says:

Shader error in 'Custom/SeismicWave': undeclared identifier '_MainTex' at line 28 (on d3d11)

But I clearly identify it in like 3. What’s going on?

I believe you need to define it as well within the SubShader block - I am somewhat rusty on shader-writting, but I remember something about connecting the variables therein to the ones exposed in the Properties block.

Edit:
Here’s an example from the CG Programming Wikibooks with a comment mentioning precisely what I mentioned - declaring a variable refering to the texture property: