.gallery {
  padding: 20px 20px 60px;
}

.gallery .container h2 {
  text-align: center;
  color: var(--mainColor);
}

.gallery .container .gallery-box {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 400px));
  justify-content: center;
  align-items: center;
  gap: 20px;
}

.gallery .container .gallery-box img {
  height: 240;
  width: 360;
  cursor: pointer;
  padding: 10px;
  background-color: #e1e1e1;
  border-radius: 7px;
  transition: outline 0.2s ease;
}

.gallery .container .gallery-box img:hover {
  outline: 4px var(--mainColor) solid;
}

.overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgb(0 0 0 / 62%);
  z-index: 5;
}

.popup {
  width: 80%;
  height: 70%;
  background-color: #e1e1e1;
  position: fixed;
  top: -70%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 20px;
  z-index: 10;
  border-radius: 7px;
  display: flex;
  justify-content: center;
  align-items: center;
  flex-direction: column;
  transition: top 0.5s ease;
}

@media (max-width: 700px) {
  .popup {
    height: 50%;
  }
}

@media (max-width: 550px) {
  .popup {
    height: 40%;
  }
}

@media (max-width: 400px) {
  .popup {
    height: 30%;
  }
}

.popup img {
  width: 100%;
  height: 90%;
  border-radius: 7px;
}

.popup div {
  display: flex;
  justify-content: center;
  align-items: center;
  position: absolute;
  top: -15px;
  right: -15px;
  font-size: 20px;
  font-weight: bold;
  background-color: var(--mainColor);
  color: white;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  cursor: pointer;
}

.popup .close-btn {
  transition: background-color 0.3s ease;
}

.popup .close-btn:hover {
  background-color: red;
}

.popup .next {
  position: absolute;
  top: 50%;
  right: -9%;
  transform: translateY(-50%);
}

.popup .previous {
  position: absolute;
  top: 50%;
  left: -9%;
  transform: translateY(-50%);
}

@media (max-width: 850px) {
  .popup .next {
    right: -11%;
  }

  .popup .previous {
    left: -11%;
  }
}

@media (max-width: 630px) {
  .popup .next {
    right: -12%;
  }

  .popup .previous {
    left: -12%;
  }
}

@media (max-width: 565px) {
  .popup .next,
  .popup .previous {
    width: 40px;
    height: 40px;
  }
}
