/* Modal overlay */
.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.65);
  display: flex;
  justify-content: center;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity 0.4s ease,
    visibility 0.4s ease;
  z-index: 1000;
}

.modal.active {
  opacity: 1;
  visibility: visible;
}

/* Modal content */
.modal-content {
  background: #ffffff;
  width: 90%;
  max-width: 1100px;
  border-radius: 14px;
  overflow: hidden;
  transform: translateY(40px);
  transition: transform 0.4s ease;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.25);
  position: relative;
}

.modal.active .modal-content {
  transform: translateY(0);
}

/* Close button */
.close-btn {
  position: absolute;
  top: 20px;
  right: 25px;
  font-size: 28px;
  cursor: pointer;
  color: #333;
}

/* Modal body: image left, text right */
.modal-body {
  display: flex;
  gap: 40px;
  padding: 40px;
  flex-wrap: wrap; /* allows stacking on smaller screens */
}

/* Left side: image */
.modal-left img {
  width: 350px;
  max-width: 100%;
  height: auto;
  border-radius: 12px;
  object-fit: cover;
}

/* Right side: text */
.modal-right {
  flex: 1;
  max-height: 70vh;
  overflow-y: auto;
}

/* Text styles */
.modal-right h2 {
  font-size: 28px;
  margin-bottom: 5px;
  color: #0254a5;
}

.modal-right h4 {
  color: #00c853;
  margin-bottom: 20px;
}

.modal-right p {
  line-height: 1.7;
  margin-bottom: 18px;
  /* color: #444; */
}

.modal-contact {
  color: #0254a5;
  margin-top: 25px;
  font-weight: 500;
}

/* Scrollbar styling for modal-right */
.modal-right::-webkit-scrollbar {
  width: 6px;
}
.modal-right::-webkit-scrollbar-thumb {
  background-color: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

/* ================= MOBILE ================= */
@media (max-width: 768px) {
  /* Overlay: add side padding so modal doesn't touch edges */
  .modal {
    align-items: flex-end; /* sheet slides up from bottom */
    padding: 0;
  }

  /* Content: full-width bottom sheet with rounded top corners */
  .modal-content {
    width: 100%;
    max-width: 100%;
    max-height: 92vh; /* never taller than viewport */
    overflow-y: auto;
    border-radius: 20px 20px 0 0;
    transform: translateY(100%); /* slide in from bottom */
  }

  .modal.active .modal-content {
    transform: translateY(0);
  }

  /* Drag handle hint */
  .modal-content::before {
    content: "";
    display: block;
    width: 40px;
    height: 4px;
    background: #ddd;
    border-radius: 2px;
    margin: 12px auto 0;
  }

  /* Close button: larger tap target */
  .close-btn {
    top: 14px;
    right: 18px;
    font-size: 24px;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f1f5f9;
    border-radius: 50%;
    color: #555;
  }

  /* Body: stack vertically, tighter padding */
  .modal-body {
    flex-direction: column;
    padding: 16px 20px 28px;
    gap: 16px;
  }

  /* Image: fixed height portrait style, not full width × natural height */
  .modal-left img {
    width: 100%;
    height: 220px;
    object-fit: cover;
    object-position: top;
    border-radius: 10px;
    margin-bottom: 0;
  }

  /* Right: no internal scroll on mobile — modal itself scrolls */
  .modal-right {
    max-height: none;
    overflow-y: visible;
  }

  .modal-right h2 {
    font-size: 20px;
    margin-bottom: 4px;
  }

  .modal-right h4 {
    font-size: 14px;
    margin-bottom: 12px;
  }

  .modal-right p {
    font-size: 14px;
    line-height: 1.65;
    margin-bottom: 12px;
  }

  .modal-contact {
    font-size: 13px;
    margin-top: 14px;
  }
}
