It works in the head, but the code duplicates the content in the body and there are two close tags for </head>
in line 14:
<script type="text/javascript" defer src="assets/js/buscador.js"></script>
and in line 43
<script type="text/javascript" defer src="assets/js/buscador.js"></script>
The same with the rest of the code in the HTML appended.
It's for a finder. You can see an example here:
https://emagazines.es/caribe/
This is the new code with the duplication. As you can see it generates a double </head>
</head>
<body>
<!--[if lt IE 10]>
<![endif]-->
<div id="loadIndicator"><img src="assets/images/loading.gif" alt="loading..."/><span> </span></div>
<div id="container-wrap">
<div id="container">
<div class="page" data-name="1" data-section="" data-section-marker="" data-layout="undefined" style="width:595px;height:842px;">
<div class="page-scale-wrap mq-none mq-default" data-layout-name="undefined" style="width:595px;height:842px;">
<img src="assets/images/AdobeStock_240374286-recortada%20(1200px,%2025fps).gif" class="pageItem" alt="Created with PlotagraphPro Learn more at https: plotaverse com" style="width:637px !important;height:893px !important;left:-21px !important;top:-8px !important;" id="item3546"/>
</div>
</div>
<script type="text/javascript" defer src="assets/js/buscador.js"></script>
<!-- BUSCADOR -->
<div class="header-content">
<div id="ctn-icon-search">
<i class="fas fa-search" id="icon-search"></i>
</div>
</div>
<div id="icon-menu">
<i class="fas fa-bars"></i>
</div>
<!-- FIN BUSCADOR -->
</head>