body.is-modal-open, body.is-modal-overflow {
  overflow: hidden;
}

[data-modal] {
  cursor: pointer;
}

template {
  display: none;
}

.m-modal {
  visibility: hidden;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  opacity: 0;
  position: fixed;
  top: 0;
  left: 0;
  z-index: 3000;
  width: 100vw;
  height: 100%;
  overflow: auto;
  -webkit-transition: all .3s cubic-bezier(.215, .61, .355, 1) 0s;
  transition: all .3s cubic-bezier(.215, .61, .355, 1) 0s;

  pointer-events: none;
  -ms-touch-action: none;
      touch-action: none;
}

.m-modal.is-open {
  visibility: visible;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
  opacity: 1;
  -webkit-transition: all .3s cubic-bezier(.215, .61, .355, 1) 0s;
  transition: all .3s cubic-bezier(.215, .61, .355, 1) 0s;

  pointer-events: auto;
  -ms-touch-action: auto;
      touch-action: auto;
}

.m-modal.is-load-start {
  visibility: visible;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)";
  opacity: 1;
  -webkit-transition: all 0s cubic-bezier(.215, .61, .355, 1) 0s;
  transition: all 0s cubic-bezier(.215, .61, .355, 1) 0s;

  pointer-events: auto;
  -ms-touch-action: auto;
      touch-action: auto;
}

.m-modal.is-close {
  visibility: hidden;
  -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=0)";
  opacity: 0;
  -webkit-transition: all .3s cubic-bezier(.215, .61, .355, 1) 0s;
  transition: all .3s cubic-bezier(.215, .61, .355, 1) 0s;

  pointer-events: none;
  -ms-touch-action: none;
      touch-action: none;
}

.m-modal__bg {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, .7);
  background-size: cover;
  cursor: pointer;
}

.is-modal-overflow .m-modal__bg {
  position: absolute;
}

.m-modal__content {
  position: fixed;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  width: 80%;
  max-width: 1500px;
  min-width: 500px;
  height: auto;
  font-size: 0;
  text-align: center;
}

.is-modal-overflow-prep .m-modal__content {
  position: relative;
  top: auto;
  left: auto;
  -webkit-transform: translate(0, 0);
          transform: translate(0, 0);
  margin: 8% auto;
}

.m-modal__content > * {
  width: 100%;
  height: auto;
}

.m-modal__content > * img {
  margin: 0 auto;
  -webkit-backface-visibility: hidden;
          backface-visibility: hidden;
}

.m-modal__content-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  cursor: pointer;
}

.m-modal__close-btn {
  position: fixed;
  top: 10px;
  right: 10px;
  z-index: 3000;
  width: 50px;
  height: 50px;
  cursor: pointer;
  -webkit-transition: all .5s cubic-bezier(.39, .575, .565, 1) 1s;
  transition: all .5s cubic-bezier(.39, .575, .565, 1) 1s;
}

.is-open .m-modal__close-btn {
  -webkit-transform: rotate(45deg);
          transform: rotate(45deg);
}

.m-modal__close-btn span {
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
          transform: translate(-50%, -50%);
  background: #393d40;
}

.m-modal__close-btn span:first-child {
  width: 0;
  height: 1px;
  -webkit-transition: width .4s cubic-bezier(.39, .575, .565, 1) .4s;
  transition: width .4s cubic-bezier(.39, .575, .565, 1) .4s;
}

.is-open .m-modal__close-btn span:first-child {
  width: 18px;
}

.m-modal__close-btn span:last-child {
  width: 1px;
  height: 0;
  -webkit-transition: height .4s cubic-bezier(.39, .575, .565, 1) .4s;
  transition: height .4s cubic-bezier(.39, .575, .565, 1) .4s;
}

.is-open .m-modal__close-btn span:last-child {
  height: 18px;
}

@media screen and (max-width: 959px) {
  .is-modal-overflow-prep .m-modal__content {
    margin-top: 20%;
  }
  .m-modal__content {
    width: 90%;
    min-width: 0;
  }
  .m-modal__content-btn {
    position: relative;
    top: auto;
    right: auto;
    width: 84%;
    height: auto;
    margin: 20px auto 0;
  }
}

@media screen and (max-height: 1100px) {
  .m-modal__content {
    max-width: 1300px;
  }
}

@media screen and (max-height: 1000px) {
  .m-modal__content {
    max-width: 1200px;
  }
}

@media screen and (max-height: 900px) {
  .m-modal__content {
    max-width: 1100px;
  }
}

@media screen and (max-height: 800px) {
  .m-modal__content {
    max-width: 1000px;
  }
}

@media screen and (max-height: 700px) {
  .m-modal__content {
    max-width: 900px;
  }
}

@media screen and (max-height: 600px) {
  .m-modal__content {
    max-width: 800px;
  }
}
