@charaset 'utf-8';

.img-modal {
  position: fixed;
  inset: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  z-index: 9999;
}

.img-modal.active {
  opacity: 1;
  visibility: visible;
}

.img-modal_overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.85);
}

.img-modal_container {
  position: relative;
  max-width: 90%;
  max-height: 90%;
  transform: scale(0.9);
  transition: 0.3s;
}

.img-modal.active .img-modal_container {
  transform: scale(1);
}

.img-modal img {
  max-width: 100%;
  max-height: 90vh;
  display: block;
}

.modal_img img {
  cursor: pointer;
  transition: 0.3s;
}
.modal_img img:hover {
  opacity: 0.7;
}
/* close */

.img-modal_close {
  position: absolute;
  top: -40px;
  right: -10px;
  width: 30px;
  height: 30px;
  background: none;
  border: none;
  cursor: pointer;
}

.img-modal_close::before,
.img-modal_close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 28px;
  height: 2px;
  background: #fff;
}

.img-modal_close::before {
  transform: translate(-50%, -50%) rotate(45deg);
}

.img-modal_close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}

/* arrows */

.img-modal_prev,
.img-modal_next {
  position: absolute;
  top: 50%;
  width: 40px;
  height: 40px;
  border: none;
  background: none;
  cursor: pointer;
}

.img-modal_prev {
  left: -60px;
}

.img-modal_next {
  right: -60px;
}

.img-modal_prev::before,
.img-modal_next::before {
  content: "";
  display: block;
  width: 18px;
  height: 18px;
  border-top: 3px solid #fff;
  border-right: 3px solid #fff;
}

.img-modal_prev::before {
  transform: rotate(-135deg);
}

.img-modal_next::before {
  transform: rotate(45deg);
}

body.modal-open {
  overflow: hidden;
}
