<?php $__env->startSection('title', 'Detalle de Producto'); ?>

<?php $__env->startSection('header', 'Gestión de Productos'); ?>

<?php $__env->startSection('content'); ?>
<div class="page-container">
    <div class="page-header">
        <div>
            <h2 class="page-title"><?php echo e($producto->fragancia); ?></h2>
            <p style="color: #64748b; margin: 0.25rem 0 0 0;"><?php echo e($producto->nombre); ?></p>
        </div>
        <div class="page-actions">
            <a href="<?php echo e(route('productos.edit', $producto)); ?>" class="btn btn-warning">
                <i class="fa-solid fa-pen-to-square"></i>
                Editar
            </a>
            <a href="<?php echo e(route('productos.index')); ?>" class="btn btn-secondary">
                <i class="fa-solid fa-arrow-left"></i>
                Volver
            </a>
        </div>
    </div>

    <div class="show-grid">
        <!-- Columna Principal -->
        <div class="show-main">
            <!-- Información General -->
            <div class="card">
                <div class="card-header">
                    <h3><i class="fa-solid fa-info-circle"></i> Información General</h3>
                </div>
                <div class="card-body">
                    <div class="info-row">
                        <div class="info-item">
                            <span class="info-label">Código</span>
                            <span class="info-value code"><?php echo e($producto->codigo); ?></span>
                        </div>
                        <div class="info-item">
                            <span class="info-label">Estado</span>
                            <span class="badge <?php echo e($producto->estado ? 'badge-success' : 'badge-danger'); ?>">
                                <?php echo e($producto->estado ? 'Activo' : 'Inactivo'); ?>

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

                    <div class="info-row">
                        <div class="info-item">
                            <span class="info-label">Fragancia (Nombre Comercial)</span>
                            <span class="info-value"><?php echo e($producto->fragancia); ?></span>
                        </div>
                        <div class="info-item">
                            <span class="info-label">Producto (Nombre del Proveedor)</span>
                            <span class="info-value"><?php echo e($producto->nombre); ?></span>
                        </div>
                    </div>

                    <div class="info-row">
                        <div class="info-item">
                            <span class="info-label">Categoría</span>
                            <span class="badge badge-info"><?php echo e($producto->categoria->nombre); ?></span>
                        </div>
                        <div class="info-item">
                            <span class="info-label">Presentación</span>
                            <span class="info-value"><?php echo e($producto->presentacion ?? 'No especificada'); ?></span>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Costos -->
            <div class="card">
                <div class="card-header">
                    <h3><i class="fa-solid fa-calculator"></i> Costos del Producto</h3>
                </div>
                <div class="card-body">
                    <div class="pricing-grid">
                        <div class="price-card">
                            <div class="price-label">COSTO 1K</div>
                            <div class="price-amount">$<?php echo e(number_format($producto->costo_1k, 0, '', '.')); ?></div>
                            <small class="text-muted">Por kilogramo</small>
                        </div>
                        <div class="price-card">
                            <div class="price-label">IVA 19%</div>
                            <div class="price-amount">$<?php echo e(number_format($producto->iva_19, 0, '', '.')); ?></div>
                        </div>
                        <div class="price-card">
                            <div class="price-label">COSTO 1K + IVA</div>
                            <div class="price-amount">$<?php echo e(number_format($producto->costo_1k_con_iva, 0, '', '.')); ?></div>
                        </div>
                        <div class="price-card">
                            <div class="price-label">COSTO GR</div>
                            <div class="price-amount">$<?php echo e(number_format($producto->costo_gr, 0, '', '.')); ?></div>
                            <small class="text-muted">Por gramo</small>
                        </div>
                        <div class="price-card primary">
                            <div class="price-label">COSTO FRAG + CF + CV</div>
                            <div class="price-amount">$<?php echo e(number_format($producto->costo_frag_cf_cv, 0, '', '.')); ?></div>
                            <small class="text-muted">Costo total del producto</small>
                        </div>
                    </div>
                </div>
            </div>

            <!-- Precios de Venta -->
            <div class="card">
                <div class="card-header">
                    <h3><i class="fa-solid fa-tags"></i> Precios de Venta con Márgenes</h3>
                </div>
                <div class="card-body">
                    <div class="pricing-grid">
                        <div class="price-card">
                            <div class="price-label">Precio 30% Ganancia</div>
                            <div class="price-amount">$<?php echo e(number_format($producto->precio_30, 0, ',', '.')); ?></div>
                            <div class="price-percentage text-primary">
                                <?php
                                    $ganancia30 = $producto->precio_30 - $producto->costo_frag_cf_cv;
                                ?>
                                +$<?php echo e(number_format($ganancia30, 0, ',', '.')); ?>

                            </div>
                        </div>
                        <div class="price-card success">
                            <div class="price-label">Precio 50% Ganancia</div>
                            <div class="price-amount">$<?php echo e(number_format($producto->precio_50, 0, ',', '.')); ?></div>
                            <div class="price-percentage text-success">
                                <?php
                                    $ganancia50 = $producto->precio_50 - $producto->costo_frag_cf_cv;
                                ?>
                                +$<?php echo e(number_format($ganancia50, 0, ',', '.')); ?>

                            </div>
                        </div>
                        <div class="price-card success">
                            <div class="price-label">Precio 75% Ganancia</div>
                            <div class="price-amount">$<?php echo e(number_format($producto->precio_75, 0, ',', '.')); ?></div>
                            <div class="price-percentage text-success">
                                <?php
                                    $ganancia75 = $producto->precio_75 - $producto->costo_frag_cf_cv;
                                ?>
                                +$<?php echo e(number_format($ganancia75, 0, ',', '.')); ?>

                            </div>
                        </div>
                        <div class="price-card success">
                            <div class="price-label">Precio 100% Ganancia</div>
                            <div class="price-amount">$<?php echo e(number_format($producto->precio_100, 0, ',', '.')); ?></div>
                            <div class="price-percentage text-success">
                                <?php
                                    $ganancia100 = $producto->precio_100 - $producto->costo_frag_cf_cv;
                                ?>
                                +$<?php echo e(number_format($ganancia100, 0, ',', '.')); ?>

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

        <!-- Columna Lateral -->
        <div class="show-sidebar">
            <!-- Stock -->
            <div class="card">
                <div class="card-header">
                    <h3><i class="fa-solid fa-boxes-stacked"></i> Inventario</h3>
                </div>
                <div class="card-body">
                    <div class="stock-info">
                        <div class="stock-current">
                            <span class="stock-label">Stock Actual</span>
                            <?php if($producto->stock_actual <= $producto->stock_minimo): ?>
                                <span class="stock-value warning">
                                    <i class="fa-solid fa-triangle-exclamation"></i>
                                    <?php echo e($producto->stock_actual); ?>

                                </span>
                                <span class="stock-alert">Bajo stock</span>
                            <?php else: ?>
                                <span class="stock-value"><?php echo e($producto->stock_actual); ?></span>
                            <?php endif; ?>
                        </div>
                        <div class="stock-divider"></div>
                        <div class="stock-item">
                            <span class="stock-label">Stock Mínimo</span>
                            <span class="stock-value-small"><?php echo e($producto->stock_minimo); ?> unidades</span>
                        </div>
                        <div class="stock-item">
                            <span class="stock-label">Valor Inventario</span>
                            <span class="stock-value-small fw-bold">
                                $<?php echo e(number_format($producto->stock_actual * $producto->costo_frag_cf_cv, 0, ',', '.')); ?>

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

        </div>
    </div>
</div>
<?php $__env->stopSection(); ?>

<?php echo $__env->make('layouts.app', \Illuminate\Support\Arr::except(get_defined_vars(), ['__data', '__path']))->render(); ?><?php /**PATH C:\xampp\htdocs\perfumeChimi\resources\views/productos/show.blade.php ENDPATH**/ ?>