<?php
require_once __DIR__.'/../inc/config.php'; require_once __DIR__.'/../inc/db.php'; header('Content-Type: application/json');
$utm=$_SESSION['utm'] ?? [];
$persona = (strpos(($utm['utm_source']??'').' '.($utm['utm_campaign']??''),'niaga')!==false) ? 'peniaga' : 'umum';
if($persona==='peniaga'){
  $offer=['name'=>'Bundle Niaga','items'=>['Vanilla Blue 3x','Rahsia Mak Tok 1x'],'reason'=>'Kos secawan rendah + rasa konsisten untuk gerai'];
}else{
  $offer=['name'=>'Bundle Keluarga','items'=>['Vanilla Blue 1x','Strawberry Milk 1x'],'reason'=>'Pilihan rasa untuk anak-anak dan keluarga'];
}
echo json_encode(['ok'=>true,'bundle'=>$offer]);