/*
 *  https://codepen.io/onion2k/pen/xxZYBVj
 */

.pixdev-card-swiper-elementor-wrapper {
  height: 700px;
  margin: 0;
  display: grid;
  grid-template-rows: 600px 100px;
  grid-template-columns: 1fr 30px 30px 30px 30px 30px 1fr;
  align-items: center;
  justify-items: center;
}

#radios {
  grid-column: 3 / 4;
  display: flex;
  gap: 10px;
  width: 100%;
  text-align: center;
}

#carousel {
  grid-row: 1 / 2;
  grid-column: 1 / 8;
  width: 100%;
  height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  transform-style: preserve-3d;
  perspective: 600px;
  --items: 5;
  --middle: 3;
  --position: 2;
  /* pointer-events: none; */
}

div.item {
  position: absolute;
  width: 300px;
  /* height: 560px; */
  /* background-color: coral; */
  background-color: #fff;
  --r: calc(var(--position) - var(--offset));
  --abs: max(calc(var(--r) * -1), var(--r));
  transition: all 0.25s linear;
  transform: rotateY(calc(-10deg * var(--r)))
    translateX(calc(-300px * var(--r)));
  z-index: calc((var(--position) - var(--abs)));
  /* box-shadow: 0 -1px 0 #e5e5e5, 0 0 2px rgba(0, 0, 0, .12), 0 2px 4px rgba(0, 0, 0, .24); */
  box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
  cursor: pointer;
  padding: 40px;
  text-align: center;
}

div.item h3 {
  color: #c03e53;
}

@media (max-width: 575px) {
  div.item {
    width: calc(100vw - 100px);
  }
}

div.item:nth-of-type(1) {
  --offset: 1;
  /* background-color: #90f1ef; */
}

div.item:nth-of-type(2) {
  --offset: 2;
  /* background-color: #ff70a6; */
}

div.item:nth-of-type(3) {
  --offset: 3;
  /* background-color: #ff9770; */
}

div.item:nth-of-type(4) {
  --offset: 4;
  /* background-color: #ffd670; */
}

div.item:nth-of-type(5) {
  --offset: 5;
  /* background-color: #e9ff70; */
}

input:nth-of-type(1) {
  grid-column: 2 / 3;
  grid-row: 2 / 3;
}

input:nth-of-type(1):checked ~ #carousel {
  --position: 1;
}

input:nth-of-type(2) {
  grid-column: 3 / 4;
  grid-row: 2 / 3;
}

input:nth-of-type(2):checked ~ #carousel {
  --position: 2;
}

input:nth-of-type(3) {
  grid-column: 4 /5;
  grid-row: 2 / 3;
}

input:nth-of-type(3):checked ~ #carousel {
  --position: 3;
}

input:nth-of-type(4) {
  grid-column: 5 / 6;
  grid-row: 2 / 3;
}

input:nth-of-type(4):checked ~ #carousel {
  --position: 4;
}

input:nth-of-type(5) {
  grid-column: 6 / 7;
  grid-row: 2 / 3;
}

input:nth-of-type(5):checked ~ #carousel {
  --position: 5;
}

/* Adaptation verticale pour mobiles */
@media (max-width: 921px) {
  .pixdev-card-swiper-elementor-wrapper {
    height: 800px;
    margin: 0;
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: 1fr 30px 30px 30px 30px 30px 1fr;
    align-items: center;
    justify-items: center;
  }

  #radios {
    display: none;
    grid-column: 3 / 4;
    display: flex;
    gap: 10px;
    width: 100%;
    text-align: center;
  }

  #carousel {
    grid-column: 1 / 1;
    grid-row: 1 / 8;
    width: 100%;
    height: 800px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    /* overflow: hidden; */
    transform-style: preserve-3d;
    /* perspective: 600px; */
    --items: 5;
    --middle: 3;
    --position: 2;
    /* pointer-events: none; */
  }

  div.item {
    position: absolute;
    width: 300px;
    /* height: 560px; */
    /* background-color: coral; */
    background-color: #fff;
    --r: calc(var(--position) - var(--offset));
    --abs: max(calc(var(--r) * -1), var(--r));
    transition: all 0.25s linear;
    transform: rotateX(calc(5deg * var(--r)))
      translateY(calc(-240px * var(--r)));
    z-index: calc((var(--position) - var(--abs)));
    /* box-shadow: 0 -1px 0 #e5e5e5, 0 0 2px rgba(0, 0, 0, .12), 0 2px 4px rgba(0, 0, 0, .24); */
    box-shadow: rgba(0, 0, 0, 0.35) 0px 5px 15px;
    cursor: pointer;
    padding: 40px;
    text-align: center;
  }
}
