session_start();
<?php
include 'config/koneksi.php';
$id_jasa = $_GET['id_jasa'];
$data = mysqli_query($conn, "SELECT * FROM jasa WHERE id='$id_jasa'");
$d = mysqli_fetch_array($data);
$qty = $_GET['qty'] ?? 1;
$total = $d['harga'] * $qty;
?>

<!DOCTYPE html>
<html>
<head>
<title>Checkout</title>

<link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.5.0/css/all.min.css">

<style>
:root {
    --primary:#3F5D50;
    --accent:#F9BF29;
}

body {
    background:#f5f5f5;
}

.navbar {
            position: sticky;
            top: 0;
            z-index: 999;
            background: rgba(63,93,80,0.95) !important;
            backdrop-filter: blur(6px);
        }
        .navbar .navbar-brand {
            font-size: 28px;   /* BESARKAN */
            font-weight: 700;  /* BOLD */
            letter-spacing: 1px; /* biar keren */
        }
        .navbar .navbar-brand span {
            color: #F9BF29;
        }
        .nav-link {
            color: white !important;
             position: relative;
        }
        .navbar .nav-link {
            font-size: 25px;   /* BESARIN FONT */
            font-weight: 500;  /* AGAK TEBAL */
            margin: 0 10px;

        }

        .navbar .nav-link::after {
            content: "";
            position: absolute;
            width: 0%;
            height: 2px;
            background: #F9BF29;
            left: 0;
            bottom: -5px;
            transition: 0.3s;
        }

        .navbar .nav-link:hover::after {
            width: 100%;
        }

        .nav-icons a {
            color: white;
            font-size: 25px;
            margin-left: 25px;
            transition: 0.3s;
        }

        .nav-icons a:hover {
            color: #F9BF29;
            transform: scale(1.2);
        }

/* CARD */
.card-custom {
    border:none;
    border-radius:20px;
    box-shadow:0 10px 25px rgba(0,0,0,0.1);
}

/* BUTTON */
.btn-custom {
    background:var(--primary);
    color:white;
    border-radius:30px;
}

.btn-custom:hover {
    background:#2f4a40;
}

/* SUMMARY */
.summary {
    background:#fff;
    padding:20px;
    border-radius:15px;
}
</style>
</head>

<body>

<nav class="navbar navbar-expand-lg navbar-dark px-5">
    <div class="container-fluid">

        <a class="navbar-brand fw-bold text-white" href="index.php">F3F3.</a>
        <div class="d-flex align-items-center nav-icons">

            <!-- WhatsApp -->
            <a href="https://wa.me/6281234567890" target="_blank">
                <i class="fab fa-whatsapp"></i>
            </a>

            <!-- Cart -->
            <a href="jasa.php">
                <i class="fas fa-shopping-cart"></i>
            </a>

            <!-- User -->
            <a href="#">
                <i class="fas fa-user"></i>
            </a>

        </div>

    </div>
</nav>

<div class="container mt-5">

<div class="row">

<!-- FORM -->
<div class="col-md-7">
<div class="card card-custom p-4">

<h4 class="mb-3">🧾 Checkout</h4>

<form action="payment.php" method="GET">

<input type="hidden" name="id_jasa" value="<?= $d['id']; ?>">
<input type="hidden" name="total" value="<?= $d['harga']; ?>">
<input type="hidden" name="qty" value="<?= $qty ?>">
<input type="hidden" name="total" value="<?= $total ?>">

<div class="mb-3">
<label>Nama</label>
<input type="text" name="nama" class="form-control" required>
</div>

<div class="mb-3">
<label>No HP</label>
<input type="text" name="no_hp" class="form-control" required>
</div>

<div class="mb-3">
<label>Alamat</label>
<textarea name="alamat" class="form-control" required></textarea>
</div>

<div class="mb-3">
<label>Metode Pembayaran</label>
<select name="metode" class="form-control" required>    
<option value="">-- Pilih --</option>
<option value="QRIS">QRIS</option>
<option value="Transfer">Transfer Bank</option>
</select>
</div>

<button class="btn btn-custom w-100">Bayar Sekarang</button>

</form>
</div>
</div>

<!-- SUMMARY -->
<div class="col-md-5">
<div class="summary">

<h5>Detail Pesanan</h5>
<hr>

<p><b><?= $d['nama_jasa']; ?></b></p>

<p class="text-muted">
<?= substr($d['deskripsi'],0,80); ?>...
</p>

<h4 style="color:#3F5D50;">
Rp <?= number_format($d['harga']); ?>
</h4>

<p>Jumlah: <?= $qty ?></p>
<p>Total: Rp <?= number_format($total) ?></p>

</div>
</div>

</div>
</div>

</body>
</html>