Using two layouts simultaneously in Nuxt 3

I have a /profile page that includes common elements like sidebar, which I handle with a profile layout. The /profile page also has a sub-page at /profile/favorite. I want to use both the default layout (which includes a header and a footer) and the profile layout (which includes the sidebar and other common parts) at the same time for both /profile and /profile/favorite.

However, when I set the /profile page to use the profile layout, the default layout elements (header and footer) disappear, and my transitions break.

Question:

How can I make the /profile and /profile/favorite pages share the same sidebar while maintaining the default layout (header and footer) without duplicating the code? Is there any other recommended approach to solve this problem?

I appreciate any advice or solution.