Header declaration for unavailable product

Of the HTTP 1.1 codes, 404 Not Found and 410 Gone are really the only ones related to resources going away (besides the 3xx redirections). The difference is that 410 is "this resource is gone for good and not accessible anywhere else we know of/can redirect you to" while 404 is merely "the resource isn't here right now". In fact, they specifically say to use 404 and not 410 if you don't know that the resource was permanently removed.
Go to the full post

I am wonrdering what the best type of http header to declare for a product page the is trying to display a product that is either not active at the moment or no longer available. Basically is google was trying to reach product-details.php?product-id=50 but that $_GET didn't return any results from the DB, I typically have a message that says "That product does not exist or is unavailable at this time.", but it's just a else{} that is showing that and not declaring any http error like 404.

I don't think 404 would be appropriate though cause I don't want it to be can't find type error I think since the product might just be inactive at the moment. Maybe I am wrong and it should be a 404 error, or is there a more appropriate error to use? I am mostly concerned about the http header for search engines since the message I display is more than enough for users on the page.

Of the HTTP 1.1 codes, 404 Not Found and 410 Gone are really the only ones related to resources going away (besides the 3xx redirections). The difference is that 410 is "this resource is gone for good and not accessible anywhere else we know of/can redirect you to" while 404 is merely "the resource isn't here right now". In fact, they specifically say to use 404 and not 410 if you don't know that the resource was permanently removed.

Here's one last question on this. I have a custom 404.php page that the htaccess redirects to. Should I be declaring a 404 error on that page or is that stupid cause the 404 page does exist. I'm trying to wrap my head around what the browser / googlebot is seeing and how it's interpreting that redirect.

It's not just about files but the thing(s) represented by the URL. As Kevin said, if the page references a product that does not exist then send a 404.You should not redirect to the 404 page as that sends a 300-level response (original page -> 3xx -> error page -> 404), but you can rewrite to it (via mod_rewrite sans-[R] or ErrorDocument with a filename) and that's where the 404 should come in.

So here it is: if I go to a page, what response do I get back? If it's a 404 then that's good. If it's a 3xx redirect to a 404 page then that's bad. If it's a 200 then that's bad. (Not meaning "harmful" bad, merely "not what it should be doing" bad.)