I'll be honest: I used to think a lingering cat pee smell just meant somebody wasn't cleaning hard enough. Then it was my house, my cat, and my smell that wouldn't leave, no matter how many times I scrubbed. Turns out I'd been solving the wrong half of the problem the entire time.
I steam-cleaned the carpet twice. I threw out the old rug completely. I went through enzyme spray like it was water. Each time, the smell backed off for a day or two, just long enough to make me think I'd finally won, and then it came right back, usually on a warm afternoon when I had people over.
For months I assumed I just hadn't found the right spot yet. So I bought a blacklight, crawled around every inch of the floor, and found four more stains I never knew were there. I cleaned all of them exactly the way I'd cleaned the rest. And it came back anyway.