Как не подбирать max-height?
речь о .item:hover .inner
просто высота скрытого блока может быть разной
* {
box-sizing: border-box;
}
.wrap {
display: flex;
flex-wrap: wrap;
margin: 0 -12px;
}
.item {
position: relative;
width: 306px;
height: 415px;
margin: 0 12px;
margin-bottom: 24px;
}
.item .inner {
position: absolute;
left: 0;
top: 0;
width: 100%;
max-height: 100%;
border: 1px solid #E9E8F4;
border-radius: 15px;
padding: 15px;
padding-bottom: 5px;
background-color: #fff;
overflow: hidden;
transition: max-height .5s, box-shadow .5s;
}
.item img {
width: 100%;
height: auto;
}
.item:hover {
z-index: 2;
}
.item:hover .inner {
max-height: 120%;
box-shadow: 0 0 30px -5px rgba(0,0,0,.2);
}
<div class="wrap">
<div class="item">
<div class="inner">
<img src="https://cdn.shopify.com/s/files/1/2570/9456/products/My-Name-Label_Personalised-School-Bag-Tags.png?v=1534927228" alt="">
<h4>Рюкзак 3000</h4>
<div class="info">
<p>скрытый блок</p>
<p>скрытый блок</p>
</div>
</div>
</div>
<div class="item">
<div class="inner">
<img src="https://cdn.shopify.com/s/files/1/2570/9456/products/My-Name-Label_Personalised-School-Bag-Tags.png?v=1534927228" alt="">
<h4>Рюкзак 3000</h4>
<div class="info">
<p>скрытый блок</p>
</div>
</div>
</div>
<div class="item">
<div class="inner">
<img src="https://cdn.shopify.com/s/files/1/2570/9456/products/My-Name-Label_Personalised-School-Bag-Tags.png?v=1534927228" alt="">
<h4>Рюкзак 3000</h4>
<div class="info">
<p>скрытый блок</p>
</div>
</div>
</div>
<div class="item">
<div class="inner">
<img src="https://cdn.shopify.com/s/files/1/2570/9456/products/My-Name-Label_Personalised-School-Bag-Tags.png?v=1534927228" alt="">
<h4>Рюкзак 3000</h4>
<div class="info">
<p>скрытый блок</p>
</div>
</div>
</div>
<div class="item">
<div class="inner">
<img src="https://cdn.shopify.com/s/files/1/2570/9456/products/My-Name-Label_Personalised-School-Bag-Tags.png?v=1534927228" alt="">
<h4>Рюкзак 3000</h4>
<div class="info">
<p>скрытый блок</p>
</div>
</div>
</div>
</div>