a:not(:has(img), .button) {
    display: inline-block;
    position: relative;
}

a:not(:has(img), .button)::after {
    content: '';
    position: absolute;
    width: 100%;
    transform: scaleX(0);
    height: 2px;
    bottom: 0;
    left: 0;
    text-decoration: none;
    background-color: #37b2f0;
    transform-origin: bottom right;
    transition: transform 0.4s ease-out;
}

a:not(:has(img), .button):hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;
}