<template>
  <Carousel class="carousel" :items-to-show="2" :wrap-around="false">
    <Slide v-for="product in products" :key="product.kind">
      <div class="carousel-item">
        <ProductBox :product="product"></ProductBox>
      </div>
    </Slide>

    <template #addons>
      <Navigation />
      <Pagination />
    </template>
  </Carousel>
</template>

<script>
import 'vue3-carousel/dist/carousel.css'
import { Carousel, Slide, Pagination, Navigation } from 'vue3-carousel'
import ProductBox from './ProductBox.vue';

export default {
  props: {
    products: Array
  },
  components: {
    Carousel,
    Slide,
    Pagination,
    Navigation,
    ProductBox,
  },
}
</script>

<style lang="scss">
  
  .carousel {
    margin-top: 32px;
    &-item {
      min-height: 570px;
      width: 625px;
      font-size: 20px;
    }

    &__slide {
      padding: 10px;
    }
    &__pagination-button:hover::after, &__pagination-button--active::after {
      background: rgba(255,255,255, 0.6);
    }

    &__pagination-button {
      &::after{    
        background: rgba(255,255,255, 0.3);
      }

      &--active::after {
        background: rgba(255,255,255, 0.6);
        &:hover {
          background: rgba(255,255,255, 0.6);
        }
      }
    }

    &__prev,
    &__next {
      box-sizing: content-box;
      background : rgba(255,255,255, 0.3);
      border-radius: 50px;
      border: none;
      color: #333;

      &:hover {
        background : rgba(255,255,255, 0.8);
      }
    }
  }
</style>