.modal {
  position: fixed;
  z-index: 9999;
  left: 0;
  top: 0;
  width: 100vw;
  height: 100vh;
  background-color: rgba(0,0,0,0.5);

  display: flex;
  justify-content: center;
  align-items: flex-start;

  padding: 20px 15px;

  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s ease, visibility 0.4s ease;
  overflow-y: auto;
}

.modal.show {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background-color: #fefefe;
  border: 2px solid #fbbb24;
  border-radius: 20px;

  /* fluid width with min and max */
  width: 80vw;
  max-width: 900px;
  min-width: 320px;

  padding: 20px 25px;
  box-sizing: border-box;

  max-height: calc(100vh - 60px);
  overflow-y: auto;

  transform: translateY(-20px);
  transition: transform 0.4s ease;
}

.modal.show .modal-content {
  transform: translateY(0);
}

.modal-header {
  display: flex;
  justify-content: flex-end;
  border-bottom: none !important;
  box-shadow: none !important;
  background: transparent !important;
  padding: 0;
  margin-bottom: 10px;
}

/* Flex row for desktop and tablets */
.row.align-items-center {
  display: flex !important;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 20px;
}

.col-lg-6 {
  flex: 1 1 50% !important;
  max-width: 50% !important;
  display: flex;
  flex-direction: column;
}

.contact-image-one {
  flex: 1 1 auto;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px; /* ensure minimum height */
}

.contact-image-one img {
  max-height: 100%;
  max-width: 100%;
  width: auto;
  height: auto;
  border-radius: 15px;
  object-fit: cover;
}

/* Close button */
.close {
  color: #aaa;
  font-size: 28px;
  font-weight: bold;
  cursor: pointer;
  user-select: none;
  border: none;
  background: none;
  text-decoration: none;
  outline: none;
}

.close:hover,
.close:focus {
  color: black;
  outline: none;
  text-decoration: none;
}

/* Tablets: Medium screens */
@media (max-width: 991px) {
  .modal-content {
    width: 90vw;
    max-width: 700px;
    min-width: 300px;
  }

  .row.align-items-center {
    flex-wrap: wrap;  /* allow wrapping on tablets */
  }

  .col-lg-6 {
    max-width: 100% !important;
    flex-basis: 100% !important;
  }

  .contact-image-one {
    min-height: 250px;
    margin-bottom: 20px;
  }
}

/* Mobile Phones: Small screens */
@media (max-width: 767px) {
  .modal-content {
    width: 95vw;
    max-width: 400px;
    padding: 15px 15px;
  }

  .row.align-items-center {
    flex-direction: column !important;
  }

  .col-lg-6 {
    width: 100% !important;
    max-width: 100% !important;
  }

  .contact-image-one {
    min-height: 200px;
    margin-bottom: 15px;
  }

  .contact-image-one img {
    width: 100%;
    height: auto;
  }
}

/* Desktop: vertically center modal */
@media (min-width: 992px) {
  .modal {
    align-items: center;
  }
}

/* Very small phones */
@media (max-width: 400px) {
  .modal-content {
    width: 98vw;
    padding: 10px 10px;
  }

  .contact-image-one {
    min-height: 150px;
  }
}
