.flip-card {
  perspective: 1000px;
  position: relative;
}

/* HIDE CHECKBOX */
.flip-toggle {
  position: absolute;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
  z-index: 5;
}

.flip-inner {
  position: relative;
  height: 350px;
  transform-style: preserve-3d;
  transition: transform 0.7s;
}

/* BOTH SIDES */
.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  backface-visibility: hidden;
}

/* FRONT */
.flip-front {
  background-size: cover;
  background-position: center;
}

.flip-front .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.flip-front h3 {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: #fff;
}

/* BACK */
.flip-back {
  transform: rotateY(180deg);
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
}

/* DESKTOP HOVER */
.flip-card:hover .flip-inner {
  transform: rotateY(180deg);
}

/* MOBILE TOGGLE */
.flip-toggle:checked + .flip-inner {
  transform: rotateY(180deg);
}



.flip-card {
  perspective: 1000px;
}

.flip-inner {
  position: relative;
  height: 350px;
  transform-style: preserve-3d;
  transition: transform 0.6s ease-in-out;
}

.flip-front,
.flip-back {
  position: absolute;
  width: 100%;
  height: 100%;
  border-radius: 20px;
  overflow: hidden;
  backface-visibility: hidden;
}

/* FRONT */
.flip-front {
  background-size: cover;
  background-position: center;
}

.flip-front .overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.6), transparent);
}

.flip-front h3 {
  position: absolute;
  bottom: 20px;
  left: 20px;
  color: #fff;
}

/* BACK */
.flip-back {
  transform: rotateY(180deg);
  padding: 25px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: #fff;
}

/* DESKTOP */
.flip-card:hover .flip-inner {
  transform: rotateY(180deg);
}

/* MOBILE */
.flip-card.active .flip-inner {
  transform: rotateY(180deg);
}

.flip-front,
.flip-front *,
.flip-back,
.flip-back * {
  pointer-events: none;
}