First of all, I want to say I've read all the similar questions before opening this one. None of the solutions suggested worked for me.
I have a modal div, with size relative to viewport. Inside it, I have two divs. First div, contains 2 icons (only showing on hover) and an img, all of them wrapped individually in divs.
My purpose is to resize the img responsive, so I can't set a specific height.
On Chrome, everything works as expected.

On Firefox, the image wrapper (yellow outline) is taking the original width of the img.

Here is the code
.modal {
position: fixed;
top: 0;
left: 0;
width: 100vw;
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
background-color: rgba(0, 0, 0, .5);
color: white;
transition: transform .3s;
z-index: 9;
}
.modal-content {
background-color: #662824;
color: #f3e5c0;
border-radius: 8px;
padding: 1rem;
height: 60%;
width: 60%;
display: flex;
flex-direction: row;
justify-content: space-between;
}
.modal-carrousel {
display: flex;
flex-grow: 1;
flex-direction: row;
}
.modal-details {
display: flex;
flex-direction: column;
justify-content: space-between;
gap: 15px;
padding: 0 1rem;
}
.modal-img {
height: 100%;
width: auto;
}
@-moz-document url-prefix() {
.modal-carrousel {
outline: yellow 3px solid;
}
.modal-img {
outline: green 5px solid;
}
}
<div class="modal">
<div class="modal-content">
<div class="modal-carrousel">
<div class="modal-icon-change-container">
<img class="modal-icon-change" src='/assets/arrow_prev.svg' />
</div>
<div class='modal-img-container'>
<img class='modal-img' src="/assets/img1.jpg" />
</div>
<div class="modal-icon-change-container">
<img class="modal-icon-change" src='/assets/arrow_next.svg' />
</div>
</div>
<div class="modal-details">
sample text
</div>
</div>
</div>