<!DOCTYPE html>
<html>
<head>
    <title>Barcode - <?php echo e($product->name); ?></title>
    <style>
        * {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
        }
        
        body {
            font-family: Arial, Helvetica, sans-serif;
            background: white;
            padding: 0;
            margin: 0;
        }
        
        /* Hide buttons when printing */
        .no-print {
            text-align: center;
            padding: 10px;
            background: #f0f0f0;
        }
        
        .print-btn {
            background: #2563eb;
            color: white;
            padding: 8px 25px;
            border: none;
            border-radius: 5px;
            cursor: pointer;
            font-size: 14px;
            margin: 0 5px;
        }
        
        .close-btn {
            background: #6b7280;
        }
        
        /* Barcode container */
        .barcode-container {
            display: flex;
            justify-content: center;
            align-items: center;
            min-height: calc(100vh - 45px);
            padding: 0;
            margin: 0;
        }
        
        /* Barcode card - slightly larger */
        .barcode-card {
            width: 2.5in;
            padding: 0;
            margin: 0;
            background: white;
            text-align: center;
        }
        
        /* Product name */
        .product-name {
            font-size: 11pt;
            font-weight: bold;
            margin: 0 0 5px 0;
            padding: 0;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
        }
        
        /* Barcode image */
        .barcode-image {
            margin: 0;
            padding: 0;
            line-height: 0;
        }
        
        .barcode-image img {
            display: block;
            margin: 0 auto;
            width: 100%;
            max-width: 2.2in;
            height: auto;
        }
        
        /* Barcode number */
        .barcode-number {
            font-family: 'Courier New', monospace;
            font-size: 10pt;
            letter-spacing: 0.8px;
            margin: 5px 0;
            padding: 0;
            font-weight: 600;
        }
        
        /* Price */
        .product-price {
            font-size: 13pt;
            font-weight: bold;
            margin: 5px 0;
            padding: 0;
            color: #000;
        }
        
        /* SKU */
        .sku-info {
            font-size: 8pt;
            color: #555;
            margin: 5px 0 0 0;
            padding: 0;
        }
        
        @media print {
            body {
                background: white;
                margin: 0;
                padding: 0;
            }
            
            .no-print {
                display: none;
            }
            
            .barcode-container {
                min-height: auto;
                padding: 0;
                margin: 0;
            }
            
            .barcode-card {
                padding: 0;
                margin: 0;
                width: 2.5in;
            }
            
            .barcode-image img {
                print-color-adjust: exact;
                -webkit-print-color-adjust: exact;
            }
        }
        
        @media screen {
            .barcode-card {
                border: 1px dashed #ccc;
                padding: 10px;
                margin: 10px auto;
                background: white;
                box-shadow: 0 2px 8px rgba(0,0,0,0.1);
            }
        }
    </style>
</head>
<body>
    <div class="no-print">
        <button class="print-btn" onclick="window.print()">🖨️ Print Barcode</button>
        <button class="print-btn close-btn" onclick="window.close()">✖ Close</button>
    </div>
    
    <div class="barcode-container">
        <div class="barcode-card">
            <div class="product-name"><?php echo e(Str::limit($product->name, 25)); ?></div>
            <div class="barcode-image">
                <img src="data:image/png;base64,<?php echo e($barcodePNG); ?>" alt="Barcode">
            </div>
            <div class="barcode-number"><?php echo e($product->barcode); ?></div>
            <div class="product-price">$<?php echo e(number_format($product->selling_price, 2)); ?></div>
            <div class="sku-info">SKU: <?php echo e($product->sku); ?></div>
        </div>
    </div>
</body>
</html><?php /**PATH D:\filament\pos-system\resources\views/products/print-barcode.blade.php ENDPATH**/ ?>