How to write a SQL query to produce a result which has more than 2 levels of depth

tell me, is it possible to get all the data from 4 tables with one SQL query?

Here is the DB diagram with connections:
enter image description here

Thus, a product can have 1 category, many configurations in which many options.

I would like to get something like this result after the request:

{
  "product_1": {
    "name": "product1",
    "category": "cat1",
    "equipments": {
      "0": {
        "name": "equip1",
        "options": {
          "options1": "options 1",
          "options2": "options 2",
          "options3": "options 3"
        }
      },
      "1": {
        "name": "equip2",
        "options": {
          "options1": "options 3",
          "options2": "options 2"
        }
      }
    }
  },
  "product_2": {
    "name": "product2",
    "category": "cat2",
    "equipments": {
      "0": {
        "name": "equip1",
        "options": {
          "options1": "options 1",
          "options2": "options 3"
        }
      },
      "1": {
        "name": "equip2",
        "options": {
          "options1": "options 3"
        }
      }
    }
  }
}

Is it possible to get this with one query? I’m already tired of these Join and JSON_ARRAYAGG functions, it doesn’t work, I tried to combine them, nothing… Maybe I’m wasting my time and should I use several queries? Or is it possible to get all the data for all the connections in one query? I’m writing in PHP using PDO. Please help me with my problem.

UPD:

Here is an example of what I tried, this is one of the options. Here I was able to get a value only from two tables “Equipments” and “Options”, then I tried to combine another JOIN and it doesn’t work at all.

$stmt = $link->prepare("select equipment.*, JSON_ARRAYAGG(JSON_OBJECT(
            'name', options.name,
            'descript', options.descript
            )) AS Options FROM equipment
            LEFT JOIN options ON equipment.id=options.equipment_id GROUP BY equipment.id
          ");