<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8"> 
  <meta http-equiv="X-UA-Compatible" content="IE=edge"> 
  <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover"> 
  <title><?php echo e(config('app.name')); ?> | Product</title> 
  <link rel="stylesheet" href="/static/home/css/reset.css"> 
  <link rel="stylesheet" href="/static/home/css/style.css"> 
  <link rel="stylesheet" href="/static/home/layui/css/layui.css"> 

  <style>
    body {
      background-color: #f7f8fa;
      font-family: 'Poppins', sans-serif;
      margin: 0;
      color: #333;
    }

    /* Top bar */
    .top {
      display: flex;
      align-items: center;
      justify-content: space-between;
      padding: 12px 15px;
      background: #ff7a00;
      color: #fff;
      position: sticky;
      top: 0;
      z-index: 1000;
    }

    .topLeft i {
      font-size: 22px;
      color: #fff;
    }

    .topTit {
      flex: 1;
      text-align: center;
      font-weight: 600;
      font-size: 18px;
    }

    /* Product Section */
    .detail-main {
      padding: 20px 15px;
    }

    .detail-container {
      background: #fff;
      border-radius: 12px;
      box-shadow: 0 3px 10px rgba(0,0,0,0.05);
      padding: 20px;
    }

    .detail-product-info-top {
      display: flex;
      align-items: center;
      gap: 15px;
      border-bottom: 1px solid #eee;
      padding-bottom: 15px;
    }

    .product-img img {
      width: 100px; /* Smaller image size */
      height: 100px;
      object-fit: cover;
      border-radius: 10px;
      border: 1px solid #eee;
    }

    .detail-product-info-top dl dt {
      font-size: 18px;
      font-weight: bold;
      margin-bottom: 6px;
    }

    .detail-product-info-top dl dd {
      margin: 2px 0;
      color: #666;
    }

    /* Product Stats */
    .detail-product-info-nav ul {
      display: grid;
      grid-template-columns: repeat(2, 1fr);
      gap: 12px;
      margin-top: 20px;
      padding: 0;
      list-style: none;
    }

    .detail-product-info-nav li {
      text-align: center;
      background: transparent;
      border-radius: 10px;
      padding: 12px;
    }

    .detail-product-info-nav h3 {
      color: #00A478;
      margin-bottom: 4px;
      font-size: 16px;
      font-weight: 600;
    }

    /* Buy button */
    .flex-btn {
      text-align: center;
      margin-top: 25px;
    }

    .buy-btn {
      background: #00A478;
      color: white;
      padding: 12px 24px;
      font-size: 16px;
      border-radius: 8px;
      border: none;
      cursor: pointer;
      transition: 0.3s ease;
    }

    .buy-btn:hover {
      background: #008a63;
    }

    /* Description */
    .detail-desc {
      margin-top: 25px;
      background: #f9fafb;
      border-radius: 10px;
      padding: 15px;
      line-height: 1.6;
      color: #444;
    }

    .detail-desc p {
      margin: 8px 0;
    }

    /* Coupon Modal */
    .z-coupon {
      display: none;
      position: fixed;
      bottom: 0;
      left: 0;
      width: 100%;
      background: #fff;
      z-index: 9999;
      border-top-left-radius: 16px;
      border-top-right-radius: 16px;
      box-shadow: 0 -5px 15px rgba(0,0,0,0.2);
      animation: slideUp 0.3s ease;
    }

    @keyframes slideUp {
      from { transform: translateY(100%); }
      to { transform: translateY(0); }
    }

    .couponCon { padding: 20px; position: relative; }
    .couponTit { font-size: 18px; font-weight: bold; margin-bottom: 15px; }
    .couponList { max-height: 220px; overflow-y: auto; }

    .couponItem {
      display: flex;
      justify-content: space-between;
      align-items: center;
      background: #f3f7f5;
      border-radius: 10px;
      padding: 12px;
      margin-bottom: 10px;
    }

    .couponItemLeft {
      font-size: 22px;
      font-weight: bold;
      color: #00A478;
    }

    .couponItemRight h3 {
      font-size: 15px;
      margin: 0;
      color: #333;
    }

    .couponItemRight span {
      font-size: 13px;
      color: #666;
    }

    .couponBtn {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-top: 20px;
    }

    .couponBtn button {
      background: #00A478;
      color: white;
      padding: 10px 20px;
      border-radius: 6px;
      border: none;
      font-size: 15px;
      cursor: pointer;
    }

    .couponClose {
      position: absolute;
      top: 10px;
      right: 15px;
      font-size: 22px;
      color: #999;
      cursor: pointer;
    }
  </style>
</head>

<body>
  <!-- Top Bar -->
  <div class="top"> 
    <a href="<?php echo e(url('dashboard')); ?>" class="topLeft"><i class="layui-icon layui-icon-left"></i></a> 
    <div class="topTit">Product</div> 
  </div> 

  <form method="POST" action="<?php echo e(route('purchase.confirmation', $package->id)); ?>">
    <?php echo csrf_field(); ?>
    <div class="detail-main"> 
      <div class="detail-container"> 
        <div class="detail-product-info"> 
          <div class="detail-product-info-top"> 
            <div class="product-img"> 
              <img src="<?php echo e(asset($package->photo)); ?>" alt="<?php echo e($package->name); ?>"> 
            </div> 
            <dl> 
              <dt><?php echo e($package->name); ?></dt> 
              <dd>Cycle: <span><?php echo e($package->validity); ?> Days</span></dd> 
              <dd>Limit: <span><?php echo e($package->limit ?? 0); ?> / <?php echo e($package->max_limit ?? 1); ?></span></dd> 
            </dl> 
          </div> 

          <div class="detail-product-info-nav"> 
            <ul> 
              <li><h3><?php echo e(price($package->price)); ?></h3><p>Buy price</p></li> 
              <li><h3><?php echo e(price($package->daily_income)); ?></h3><p>Daily income</p></li> 
              <li><h3><?php echo e(price($package->total_income)); ?></h3><p>Total income</p></li> 
              <li><h3><?php echo e($package->stock_percentage); ?>%</h3><p>Number of stocks</p></li> 
            </ul> 
          </div> 

          <div class="flex-btn"> 
            <button type="button" class="buy-btn" onclick="openCoupon()">Buy</button> 
          </div> 


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

    <!-- Coupon Popup -->
    <div class="z-coupon" id="couponBox"> 
      <div class="couponCon"> 
        <div class="couponTit">Confirm to purchase this product</div> 
        <span class="couponClose" onclick="closeCoupon()">×</span>
        <div class="couponList"> 
          <?php $__empty_1 = true; $__currentLoopData = $coupons; $__env->addLoop($__currentLoopData); foreach($__currentLoopData as $coupon): $__env->incrementLoopIndices(); $loop = $__env->getLastLoop(); $__empty_1 = false; ?>
            <div class="couponItem">
              <div class="couponItemLeft"><?php echo e($coupon->scale); ?>%</div>
              <div class="couponItemRight">
                <h3><?php echo e($coupon->scale); ?>% Coupon</h3>
                <span>Expired: <?php echo e($coupon->expire_at->format('Y-m-d')); ?></span>
              </div>
            </div>
          <?php endforeach; $__env->popLoop(); $loop = $__env->getLastLoop(); if ($__empty_1): ?>
            <p>Daily income</p>
          <?php endif; ?>
        </div> 
        <div class="couponBtn"> 
          <div class="couponPrice"><?php echo e(price($package->price)); ?></div> 
          <button type="submit">Confirm</button> 
        </div> 
      </div> 
    </div> 
  </form>

  <?php echo $__env->make('alert-message', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?>

  <script>
    function openCoupon() {
      document.getElementById("couponBox").style.display = "block";
    }
    function closeCoupon() {
      document.getElementById("couponBox").style.display = "none";
    }
  </script>
</body>
</html><?php /**PATH /home/goldenyi/public_html/resources/views/app/main/vip_details.blade.php ENDPATH**/ ?>