.overlay {
  --bg-overlay-color: rgba(16, 16, 16, 0.65);
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--bg-overlay-color);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 5000;
  overflow-y: auto;
  padding: 20px;
}

.popup {
  --font-family: 'Cera Pro', sans-serif;
  --main-color: #fff;
  --secondary-color: #221e1f;
  --bg-color: #2a4934;
  --animation: cubic-bezier(0.4, 0, 0.2, 1);
  --animamation-duration: 250ms;

  display: flex;
  max-width: 664px;
  width: 100%;
  max-height: calc(100vh - 40px);
  background-color: var(--bg-color);
  color: var(--main-color);
  font-family: var(--font-family);
  line-height: 1.2;
  margin: auto;
  flex-shrink: 0;
}

.popup__content {
  position: relative;
  padding: 48px 30px 50px;
  text-align: center;
  width: 100%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.popup__title,
.popup__subtitle {
  display: block;
  max-width: 200px;
  margin: 0 auto 22px;
  font-weight: 400;
  font-size: 18px;
  line-height: 1.2;
  font-family: var(--font-family) !important;
}

.popup__wrapper {
  overflow: hidden;
  width: 50%;
  flex: none;
  display: none;
}

@media screen and (min-width: 992px) {
  .popup__wrapper {
    display: block;
  }
}

.popup__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.popup__close {
  stroke: var(--main-color);
  fill: none;
  width: 16px;
  height: 16px;
}

.popup__button {
  display: inline-block;
  width: 100%;
  border-radius: 30px;
  padding: 20px;
  border: none;
  color: var(--secondary-color);
  background: var(--main-color);
  font-size: 17px;
  font-weight: 500;
  text-transform: uppercase;
  transition: all var(--animamation-duration) var(--animation);
  cursor: pointer;
}

.popup__button:hover,
.popup__button:focus {
  background: #dbdbd9;
}

.popup__button--close {
  position: absolute;
  top: 0;
  right: 0;
  padding: 10px;
  width: fit-content;
  background-color: transparent;
  border: none;
  display: flex;
  overflow: hidden;
}
.popup__button--close:hover,
.popup__button--close:focus {
  background-color: transparent;
}
.popup__button--close:hover svg,
.popup__button--close:focus svg {
  transform: scale(1.1);
}

.popup__text {
  margin: 0 auto;
  margin-bottom: 15px;
  font-size: 14px;
  text-align: center;
}
.popup__text--last {
  margin-bottom: 24px;
}
.popup__text--accent {
  font-weight: 500;
}
.popup__icon {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-bottom: 10px;
}

/* Responsive adjustments for better scrolling */
@media screen and (max-height: 600px) {
  .overlay {
    align-items: flex-start;
    padding: 10px;
  }
  
  .popup {
    margin: 10px auto;
  }
  
  .popup__content {
    padding: 30px 20px 40px;
  }
}

@media screen and (max-width: 576px) {
  .overlay {
    padding: 10px;
  }
  
  .popup {
    margin: 10px auto;
    flex-direction: column;
  }
  
  .popup__wrapper {
    width: 100%;
    max-height: 200px;
  }
  
  .popup__content {
    padding: 30px 20px 40px;
  }
}
