jQuery(document).ready(function($) {
    $('.cof-wrapper').each(function() {
        var $form = $(this).closest('form.cart');
        if ($form.length) {
            $(this).insertAfter($form);
        }
    });
});
/* COD Order Form Pro – Public */
.cof-wrapper { clear:both; float:none; display:block; width:100%; margin-top:30px; }
.cof-form-wrap { font-family:inherit; width:100%; box-sizing:border-box; }
.cof-title { text-align:center; font-weight:700; margin-bottom:16px; }
.cof-grid { display:grid; grid-template-columns:1fr 1fr; gap:8px; margin-bottom:12px; }
.cof-field { border:1px solid #ddd; border-radius:8px; padding:10px 12px; font-size:13px; width:100%; outline:none; color:#333; background:#fff; box-sizing:border-box; }
.cof-field:focus { border-color:#7c3aed; }
.cof-qty-section { display:flex; align-items:center; gap:12px; margin-bottom:12px; }
.cof-qty-label { font-size:13px; font-weight:600; color:#555; white-space:nowrap; }
.cof-qty-controls { display:flex; align-items:center; border:1px solid #ddd; border-radius:8px; overflow:hidden; }
.cof-qty-btn { width:36px; height:36px; background:#f5f5f5; border:none; font-size:18px; cursor:pointer; color:#333; flex-shrink:0; }
.cof-qty-btn:hover { background:#eee; }
.cof-qty { width:50px; text-align:center; border:none; border-right:1px solid #ddd; border-left:1px solid #ddd; padding:8px 4px; font-size:14px; height:36px; outline:none; -moz-appearance:textfield; }
.cof-qty::-webkit-outer-spin-button,.cof-qty::-webkit-inner-spin-button { -webkit-appearance:none; }
.cof-btn-buy,.cof-btn-wa { display:block; width:100%; border:none; padding:13px; font-weight:700; cursor:pointer; margin-bottom:10px; box-sizing:border-box; text-align:center; }
.cof-trust { display:flex; justify-content:space-around; font-size:11px; color:#888; text-align:center; margin-bottom:14px; }
.cof-summary { border-radius:10px; padding:14px; }
.cof-summary-title { font-size:15px; font-weight:700; text-align:center; margin-bottom:10px; color:#1a1a1a; }
.cof-row { display:flex; justify-content:space-between; padding:5px 0; }
.cof-val { font-weight:600; }
.cof-msg { margin-top:10px; padding:10px; border-radius:8px; font-size:13px; text-align:center; }
.cof-msg-success { background:#d1fae5; color:#065f46; }
.cof-msg-error   { background:#fee2e2; color:#991b1b; }

/* VARIANTS */
.cof-variants-wrap { margin-bottom:12px; }
.cof-variants-label { font-size:13px; font-weight:700; color:#333; margin-bottom:6px; }
.cof-variant-row { margin-bottom:10px; }
.cof-variant-label { font-size:12px; color:#666; display:block; margin-bottom:4px; }
.cof-radio-group,.cof-swatch-group,.cof-text-swatches { display:flex; flex-wrap:wrap; gap:6px; }
.cof-radio-lbl { font-size:12px; display:flex; align-items:center; gap:4px; }
.cof-swatch { width:28px; height:28px; border-radius:50%; cursor:pointer; display:block; border:2px solid transparent; }
.cof-swatch input { display:none; }
.cof-swatch:has(input:checked) { border-color:#333; box-shadow:0 0 0 2px #fff inset; }
.cof-swatch-img,.cof-text-swatch { padding:4px 10px; border:1px solid #ddd; border-radius:6px; font-size:12px; cursor:pointer; }
.cof-swatch-img:has(input:checked),.cof-text-swatch:has(input:checked) { border-color:#7c3aed; background:#f5f0ff; }
