A spec panel is metafields in rows, all under one namespace: product.metafields.origin.region, product.metafields.origin.process, and so on.
Wrap each row in {% if %} so a blank field hides its row. Then wrap the whole panel in one more {% if %} that uses or to check if any field is set.
{% if product.metafields.specs.material or product.metafields.specs.weight %}
<section class="specs">
{% if product.metafields.specs.material %}
<p>{{ product.metafields.specs.material }}</p>
{% endif %}
</section>
{% endif %}
AI tell: it gates the rows but not the wrapper, so an empty product shows a `Details` heading above nothing.