/*
  Usage:
  <button class="button-underline">
    <span class="icon">
      <i class="fa fa-heart"></i>
    </span>
    <span class="text">Button</span>
    <span class="icon--arrow-right"></span>
  </button>


*/

.button-underline {
  cursor: pointer;
  color: var(--front);
  font-size: 1em;
  margin-bottom: .625rem;
  position:relative;
  text-decoration: none;
  outline: none;
}

.button-underline .text~.icon {
  margin-left: 0.5rem;
}

.button-underline .icon~.text {
  margin-left: 0.5rem;
}


.button-underline .text{
  min-width: 20px;
}


/* Underlined Button */

.button-underline{
  color: var(--front);
  font-weight: 500;
  position: relative;
  border: none;
  background: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 2.5;
}
.button-underline::before {
  position: absolute;
  left: 0;
  bottom: 0em;
  width: 00%;
  height: 2px;
  background: var(--front);
  content: "";
  transition: 0.15s;
}
.button-underline:focus:before, .button-underline:hover:before {
  width: 100%;
  transition: 0.6s;
}
.button-underline::after {
  position: absolute;
  left: auto;
  right: 0;
  bottom: 0em;
  width: 100%;
  height: 2px;
  background: var(--front);
  content: "";
  transition: 0.6s;
}
.button-underline:focus:after, .button-underline:hover:after {
  width: 00%;
  transition: 0.15s;
}
.button-underline .icon--arrow-right{
  margin-left: 0.5rem;
}


.icon--arrow-right{
  position: relative;
  width: 2em;
  height: 2em;
  min-width: 2em;
  min-height: 2em;
  padding: 0;
  margin: 0;
  cursor: pointer;
  transition: all .2s ease-in-out;
}

.icon--arrow-right::before{
  content: "";
  position: absolute;
  right: calc(50% - 2px);
  top: calc(50% - 1px);
  width: 1em;
  height: 1em;
  border-right: 2px solid var(--front);
  border-top: 2px solid var(--front);
  transform: rotate(45deg);
  transform-origin: right top;
  transition: all .25s ease-in-out;

}

.icon--arrow-right::after{
  content: "";
  position: absolute;
  left: calc(50% - 4px);
  top: calc(50% - 1px);
  width: 1em;
  height: 1em;
  border-right: 2px solid var(--front);
  border-top: 2px solid var(--front);
  transform: rotate(45deg);
  transform-origin: right top;
  transition: all .25s ease-in-out;
}

*:hover>.icon--arrow-right::before, .icon--arrow-right:hover::before{
  height:0;
  transform: rotate(0deg);
  right: calc(50% - 2px);
  top: calc(50% - 1px);
}

*:hover>.icon--arrow-right::after,.icon--arrow-right:hover::after{
  left: calc(50% - 2px);
  
}
