<?php snippet('header') ?>
<main>
  <section class="product-panel">
    <header>
      <h1><?= $page->title() ?></h1>
      <p><?= $page->price() ?></p>
    </header>

    <div class="product-description">
      <?= $page->description() ?>
    </div>

    <?php if ($page->options()->isNotEmpty()): ?>
      <div class="product-options">
        <?php foreach($page->options()->toEntries() as $option): ?>
            <label for="<?= $option ?>">
              <input type="checkbox" id="<?= $option ?>" name="<?= $option ?>"> <?= $option ?>
            </label>
        <?php endforeach ?>
      </div>
    <?php endif ?>

    <button 
      class="snipcart-add-item"
      data-item-id="<?= $page->uri() ?>"
      data-item-price="<?= $page->price() ?>"
      data-item-description="<?= $page->infos() ?>"
      data-item-image="<?= $page->file()->url() ?>"
      data-item-name="<?= $page->title() ?>"
    >Ajouter au panier</button>
  </section>
  <section class="product-gallery">
    <?php foreach($page->files() as $image): ?>
      <figure>
        <?php snippet('picture', ['file' => $image, 
          'size' => 40
        ]) ?>
      </figure>
    <?php endforeach ?>
  </section>
</main>
<?php snippet('footer') ?>