.flip-container {
  perspective: 1000px;
  display: inline-block;
  width: 300px;
  height: 300px;
}

.flipper {
  position: relative;
  width: 100%;
  height: 100%;
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
}

.flip-container.flipped .flipper {
  transform: rotateY(180deg);
}

.front,
.back {
  position: absolute;
  width: 100%;
  height: 100%;
  backface-visibility: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  /* border: 1px solid #ccc; */
  font-size: 18px;
  transition: background 0.3s ease-in-out;
  box-sizing: border-box;
}

.front img,
.back {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.front {
  background: #fff;
}

.back {
  background: #f8f8f8;
  transform: rotateY(180deg);
  padding: 10px;
  text-align: center;
}

@media (max-width: 768px) {
  .flip-container {
    width: 300px;
    height: 300px;
  }
}