<div style="display: flex; flex-direction: column; gap: 10px;">
    <?php
    $checkedAdded = false;
    // Kredi Kartı
    if (isset($paymentMethods['credit_card']['enabled']) && $paymentMethods['credit_card']['enabled'] == '1') {
        $checked = !$checkedAdded ? 'checked' : '';
        $checkedAdded = true;
        echo '
        <label style="display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; background: var(--surface-2);">
            <input type="radio" name="payment_method" value="credit_card" ' . $checked . ' class="payment-radio" style="accent-color: var(--orange);">
            <i class="fa fa-credit-card" style="color: var(--text-3);"></i>
            <span style="font-size: 14px; font-weight: 500;">Kredi Kartı ile Öde</span>
        </label>
        <div id="credit-card-form" class="payment-form" style="padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-card); display: flex; flex-direction: column; gap: 10px;">
            <input type="text" name="cc_name" id="cc-name" placeholder="Kart Üzerindeki İsim" class="cc-input" autocomplete="cc-name" minlength="3" style="padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); width: 100%; font-family: var(--font); background: var(--surface-2); color: var(--text-1); box-sizing: border-box; outline: none;">
            <input type="text" name="cc_number" id="cc-number" placeholder="0000 0000 0000 0000" class="cc-input" inputmode="numeric" maxlength="19" autocomplete="cc-number" style="padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); width: 100%; font-family: var(--font); background: var(--surface-2); color: var(--text-1); box-sizing: border-box; outline: none; letter-spacing: 1px;">
            <div style="display: flex; gap: 10px;">
                <input type="text" name="cc_expiry" id="cc-expiry" placeholder="AA/YY" class="cc-input" inputmode="numeric" maxlength="5" autocomplete="cc-exp" style="padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); flex: 1; font-family: var(--font); background: var(--surface-2); color: var(--text-1); outline: none;">
                <input type="text" name="cc_cvv" id="cc-cvv" placeholder="CVV" class="cc-input" inputmode="numeric" maxlength="4" autocomplete="cc-csc" style="padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-sm); flex: 1; font-family: var(--font); background: var(--surface-2); color: var(--text-1); outline: none;">
            </div>
            <p id="cc-error" style="display: none; color: #ef4444; font-size: 12px; margin: 4px 0 0 0;"></p>
        </div>
        ';
    }

    // Havale / EFT
    if (isset($paymentMethods['bank_transfer']['enabled']) && $paymentMethods['bank_transfer']['enabled'] == '1') {
        $checked = !$checkedAdded ? 'checked' : '';
        $checkedAdded = true;
        $desc = htmlspecialchars($paymentMethods['bank_transfer']['description'] ?? '');
        echo '
        <label style="display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; background: var(--surface-2);">
            <input type="radio" name="payment_method" value="bank_transfer" ' . $checked . ' class="payment-radio" style="accent-color: var(--orange);">
            <i class="fa fa-university" style="color: var(--text-3);"></i>
            <span style="font-size: 14px; font-weight: 500;">Havale / EFT</span>
        </label>
        <div id="bank-transfer-info" class="payment-form" style="display: none; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-card); font-size: 13px; color: var(--text-3); line-height: 1.6;">
            <strong style="color: var(--text-1);">Banka Bilgilerimiz:</strong><br>
            ' . nl2br($desc) . '<br><br>
            Lütfen ödeme açıklamasına adınızı ve soyadınızı yazmayı unutmayın.<br>
            <span style="color:var(--orange); font-weight:600;">Siparişi tamamladıktan sonra Profil > Siparişlerim sekmesinden siparişinize girerek ödeme dekontunuzu yüklemelisiniz.</span>
        </div>
        ';
    }

    // Kapıda Ödeme
    if (isset($paymentMethods['cash_on_delivery']['enabled']) && $paymentMethods['cash_on_delivery']['enabled'] == '1') {
        $checked = !$checkedAdded ? 'checked' : '';
        $checkedAdded = true;
        $fee = (float)($paymentMethods['cash_on_delivery']['extra_fee'] ?? 0);
        $feeFormatted = \App\Services\CurrencyService::format($fee);
        echo '
        <label style="display: flex; align-items: center; gap: 10px; padding: 12px 16px; border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; background: var(--surface-2);">
            <input type="radio" name="payment_method" value="cash_on_delivery" ' . $checked . ' data-fee="' . $fee . '" class="payment-radio" style="accent-color: var(--orange);">
            <i class="fa fa-truck" style="color: var(--text-3);"></i>
            <span style="font-size: 14px; font-weight: 500;">Kapıda Ödeme</span>
        </label>
        <div id="cash-on-delivery-info" class="payment-form" style="display: none; padding: 14px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface-card); font-size: 13px; color: var(--text-3); line-height: 1.6;">
            Kapıda ödeme seçeneğinde <strong>' . $feeFormatted . '</strong> ek işlem ücreti alınmaktadır. Siparişi onayladığınızda bu ücret toplama yansıyacaktır.
        </div>
        ';
    }
    ?>
</div>
