.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0,0,0,0.6);
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
  z-index: 999999;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-sizing: border-box;
  font-family: sans-serif;
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal-content {
  background: #fff;
  border-radius: 8px;
  position: relative;
  max-width: 1000px;
  width: 100%;
  display: flex;
  padding: 30px;
  box-sizing: border-box;
  max-height: 716px; /* Alto máximo en escritorio */
  overflow: hidden; /* Para que no desborde el contenido */
}

.close-modal {
  background: #f37121;
  color: #fff;
  border: none;
  font-size: 1.2em;
  position: absolute;
  top: 15px;
  right: 20px;
  cursor: pointer;
  line-height: 1;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.modal-left {
  width: 40%; /* 1.2/3 */
  box-sizing: border-box;
  padding-right: 30px;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.modal-right {
  width: 60%; /* 1.8/3 */
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.team_img {
  width: 298px;
  height: 287px;
  border-radius: 5px;
  margin-bottom: 20px;
  object-fit: cover;
}

/* Ajustamos la zona de texto con scroll */
.text-content {
  margin-top: 5% !important;
  flex: 1;
  overflow-y: auto;
  padding-right: 10px;
  /* Ajustar el max-height según el espacio disponible dentro del modal.
     Si 716px es el total, restamos padding y tamaño de la imagen.
     Dejar así y confiar en que el overflow auto resuelva el scroll. */
}

/* Estilizar el scroll */
.text-content::-webkit-scrollbar {
  width: 6px;
}
.text-content::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 3px;
}
.text-content::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 3px;
}
.text-content::-webkit-scrollbar-thumb:hover {
  background: #999;
}

.text-content p {
  margin-bottom: 15px;
}

.modal-info {
  margin-top: 10px;
}

.team__name {
  font-size: 1.4em;
  font-weight: bold;
  margin: 0 0 5px;
  color: #073763;
}

.team__company-position {
  margin: 0 0 15px;
  font-size: 1em;
  font-weight: normal;
  color: #073763;
}

.social-link {
  display: inline-block;
  margin-bottom: 15px;
  margin-right: 5px;
  color: #073763;
  text-decoration: none;
  font-size: 1em;
}

.team__phrase {
  font-style: italic;
  color: #073763;
  border-left: 3px solid #ccc;
  padding-left: 10px;
  margin: 20px 0;
  font-size: 1.5em;
  line-height: 1.4;
}

.team__phrase .highlight {
  color: #f37121;
  font-weight: bold;
}

.team__resumen {
  line-height: 1.5;
  color: #333;
  font-size: 1em;
}

button.cta-button {
  background: transparent !important;
  color: #073763 !important;
  border: 1px solid #073763 !important;
  padding: 15px 25px;
  cursor: pointer;
  border-radius: 5px;
  font-weight: bold;
  font-size: 1em;
  margin-top: 20px;
  flex-shrink: 0;
  transition: background 0.3s ease, color 0.3s ease;
}

button.cta-button:hover {
  background: #073763;
  color: #fff;
}

/* Responsivo: en mobile, las columnas se apilan */
@media (max-width: 768px) {
  .modal-content {
    flex-direction: column;
    max-height: 90vh; /* Ajustar para mobile */
    padding: 20px;
  }

  .modal-left, .modal-right {
    width: 100% !important;
    padding-right: 0;
  }

  .team_img {
    width: 100%;
    height: auto;
    max-width: 298px;
    max-height: 287px;
    align-self: center;
  }

  .text-content {
    max-height: 40vh; /* Ajustar altura para mobile */
  }
}
