<!doctype html>
<html lang="ar" dir="rtl">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>طباعة QR القطعة</title>
<style>
body{font-family:Tahoma,Arial,sans-serif;background:#f7f3ef;margin:0;padding:20px;color:#1f2937}
.label-wrap{max-width:420px;margin:0 auto}
.label{background:#fff;border-radius:24px;padding:24px;border:1px solid #eadfd5;box-shadow:0 10px 24px rgba(17,24,39,.06);text-align:center}
.shop{display:inline-block;background:#f3ece5;color:#7a5d47;border-radius:999px;padding:6px 12px;font-size:12px;font-weight:700;margin-bottom:12px}
.item-code{font-size:30px;font-weight:800;margin:0 0 6px}
.item-name{font-size:16px;color:#6b7280;margin:0 0 18px}
.qr img{width:260px;height:260px;max-width:100%}
.urlhint{font-size:12px;color:#9ca3af;word-break:break-word;margin-top:10px}
@media print{
  body{padding:0;background:#fff}
  .label{box-shadow:none;border:0;border-radius:0;padding:12mm 8mm}
}
</style>
</head>
<body onload="window.print()">
<div class="label-wrap">
  <div class="label">
    <div class="shop"><?= e(setting('shop_name_ar', 'فخر الأصالة العمانية')) ?></div>
    <div class="item-code"><?= e($item['item_code']) ?></div>
    <div class="item-name"><?= !empty($item['item_name']) ? e($item['item_name']) : e($item['category_name']) ?></div>
    <div class="qr">
      <img alt="qr" src="https://api.qrserver.com/v1/create-qr-code/?size=260x260&data=<?= urlencode($publicUrl) ?>">
    </div>
    <div class="urlhint"><?= e($publicUrl) ?></div>
  </div>
</div>
</body>
</html>
