.main-container-envelope {
  height: 300px;
  width: 350px;
  position: relative;
  transition: transform 1s;
  left: calc(65% - 400px);
  display: flex;
  z-index: 0;
}
.envelope-container {
  overflow: hidden;
}
.envelope:not(:first-child) {
  margin-left: -100px;
  transition: all 0.5s;
}
.envelope {
  height: 150px;
  width: 270px;
  position: relative;
  left: 40px;
  top: 100px;
  padding: 0;
  margin: 0;
  z-index: 1;
}
.envelope.red {
  background-color: #d74443;
}
.envelope.blue {
  background-color: #2d4bb7;
}
.envelope.green {
  background-color: #1e8a1e;
}

/* button {
  overflow-y: clip !important;
}

.envelope:hover button{
  overflow-y: none !important;
  overflow: visible;
} */

.paper {
  background-color: white;
  height: 150px;
  width: 250px;
  left: 10px;
  position: relative;
  transition: all 0.5s linear;
  /* overflow: hidden;  */
}

.inner1 {
  width: 0;
  height: 0;
  border-right: 270px solid transparent;
  position: relative;
  bottom: 150px;
  z-index: 2;
}
.inner1.red {
  border-bottom: 150px solid #ea4e42;
}
.inner1.blue {
  border-bottom: 150px solid #2d4bb7;
}
.inner1.green {
  border-bottom: 150px solid #1e8a1e;
}

.inner2 {
  width: 0;
  height: 0;
  border-left: 270px solid transparent;
  position: relative;
  z-index: 2;
}
.inner2.red {
  border-bottom: 150px solid #cb3f35;
}
.inner2.blue {
  border-bottom: 150px solid #1f3993;
}
.inner2.green {
  border-bottom: 150px solid #187518;
}

.cover {
  width: 0;
  height: 0;
  border-right: 135px solid transparent;
  border-left: 135px solid transparent;
  position: relative;
  bottom: 300px;
  z-index: 2;
  transition: all 0.05s linear 1s;
  overflow-y: hidden;
}

.cover.red {
  border-top: 95px solid #bd3737;
}
.cover.blue {
  border-top: 95px solid #1d3aa3;
}
.cover.green {
  border-top: 95px solid #135f13;
}

.envelope:hover ~ .envelope {
  position: relative;
  left: 150px;
  transition: 0.4s ease-out;
}
.envelope:hover .cover {
  transform-origin: top;
  transition: all 0.05s linear;
  transform: rotateX(180deg);
  z-index: -1;
}
.envelope:hover .paper {
  /* transform-origin: top; */
  transition-delay: 0.3s;
  transform: translateY(-40%);
  z-index: 0;
}
.envelope:hover {
  transform: translateY(10%);
}
.envelope:hover .inner1,
.envelope:hover .inner2 {
  /* transform-origin: top; */
  z-index: 1;
}

@media only screen and (max-width: 767px) {
  .main-container-envelope {
    height: 500px;
    flex-direction: column;
    left: 0;
  }
  .envelope:not(:first-child) {
    margin-left: 0px;
    margin-top: -50px;
    transition: all 0.5s;
  }
  .envelope:hover ~ .envelope {
    position: relative;
    left: 40px;
    top: 180px;
    transition: 0.4s ease-out;
  }

  .container-fluid .card-title {
    font-size: 30px !important;
  }
}
