.category-card {
    position: relative;
    height: 240px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: center;
    padding: 20px 15px 15px;
    border-radius: 20px;
    color: white;
    font-weight: bold;
    text-align: center;
    overflow: hidden;
    background-size: cover;
    background-position: center;
}

/* Ensure heading is always visible and clean */
.category-card h4 {
    font-weight: 600;
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    width: 100%;
}

/* Wrapper to control height and overflow */
.image-wrapper {
    height: 150px;
    width: 100%;
    overflow: hidden;
    display: flex;
    justify-content: center;
    align-items: flex-start;
}

/* Ensures image fills height, and excess is cropped from bottom */
.category-img {
    height: 160px; /* taller than wrapper */
    width: auto;
    object-fit: cover;
    object-position: top;
    display: block;
}
