{#
 # @author    SWM
 # @copyright 2025 SWM
 # @license   https://www.gnu.org/licenses/gpl-2.0.html GNU General Public License v2.0 or later
 #}
<div id="tdbinpacking-dimensions-form" class="tdbinpacking-dimensions-form">
    <h4>
        <span class="dashicons dashicons-warning"></span>
        {{ trans('m3d.dimension_form.title') }}
    </h4>
    
    <table class="tdbinpacking-dimensions-table">
        <thead>
            <tr>
                <th class="col-product">{{ trans('m3d.dimension_form.product') }}</th>
                <th class="col-qty">{{ trans('m3d.dimension_form.quantity') }}</th>
                <th class="col-dimension">{{ trans('m3d.dimension_form.length') }}</th>
                <th class="col-dimension">{{ trans('m3d.dimension_form.width') }}</th>
                <th class="col-dimension">{{ trans('m3d.dimension_form.height') }}</th>
                <th class="col-dimension">{{ trans('m3d.dimension_form.weight') }}</th>
                <th class="col-vr">{{ trans('m3d.dimension_form.vr_rotation') }}</th>
            </tr>
        </thead>
        <tbody>
            {% for product in products_without_dimensions %}
            <tr data-product-id="{{ product.product_id }}">
                <td class="col-product">{{ product.product_name }}</td>
                <td class="col-qty">{{ product.quantity }}</td>
                <td class="col-dimension">
                    <input type="number" step="0.01" min="0" 
                           class="dimension-input"
                           name="length_{{ product.product_id }}"
                           value="{{ product.length > 0 ? product.length : '' }}"
                           placeholder="0.00" />
                </td>
                <td class="col-dimension">
                    <input type="number" step="0.01" min="0" 
                           class="dimension-input"
                           name="width_{{ product.product_id }}"
                           value="{{ product.width > 0 ? product.width : '' }}"
                           placeholder="0.00" />
                </td>
                <td class="col-dimension">
                    <input type="number" step="0.01" min="0" 
                           class="dimension-input"
                           name="height_{{ product.product_id }}"
                           value="{{ product.height > 0 ? product.height : '' }}"
                           placeholder="0.00" />
                </td>
                <td class="col-dimension">
                    <input type="number" step="0.01" min="0" 
                           class="dimension-input"
                           name="weight_{{ product.product_id }}"
                           value="{{ product.weight > 0 ? product.weight : '' }}"
                           placeholder="0.00" />
                </td>
                <td class="col-vr">
                    <div class="tdbinpack-toggle-wrapper">
                        <label class="tdbinpack-toggle-switch">
                            <input type="checkbox" 
                                   id="vr_{{ product.product_id }}"
                                   name="vr_{{ product.product_id }}" 
                                   value="1"
                                   {{ product.vr ? 'checked' : '' }}
                                   data-product-id="{{ product.product_id }}">
                            <span class="tdbinpack-toggle-slider"></span>
                        </label>
                        <span class="tdbinpack-toggle-status-text">
                            {{ product.vr_label }}
                        </span>
                    </div>
                </td>
            </tr>
            {% endfor %}
        </tbody>
    </table>
</div>
