.btn,
.link-banner,
.link-button {
  text-decoration: none;
  transition: color 0.2s,
  background-color 0.2s,
  border 0.2s ease-in;
  display: inline-block;
  text-align: center;
  border-radius: 5px;
  outline: none;

  line-height: 1.2;
  padding: 8px 10px;
  font-size: 14px;

  &.hide-icon {
    .loading-icon {
      display: none;
    }
  }

  &:hover {
    cursor: pointer;
  }

  &:hover,
  &:focus,
  &:visited {
    text-decoration: none;
  }
}

.link-banner {
  padding: 13px 28px;
  color: #ffffff;
  border-radius: 0;
  background: esprit-sentiers(orange);

  &:hover {
    background-color: #ffffff;
    color: esprit-sentiers(green);
  }
}

.btn,
a.btn {
  &:disabled,
  &:disabled:hover,
  &:disabled:active {
    border: 1px solid #b1b1b1;
    background: #ececec;
    color: #b1b1b1;
    cursor: not-allowed;
  }

  &:hover:not(:disabled),
  &:focus:not(:disabled) {
    box-shadow: 0 0 0 2px rgba(esprit-sentiers(green), .5);
  }

  &:active:not(:disabled) {
    box-shadow: 0 0 0 1px rgba(esprit-sentiers(green), .5);
  }

  &.btn-sm {
    margin: 5px 0;
    line-height: 1;
    padding: 4px;
    font-size: 11px;
  }

  &.btn-md {
    margin: 5px 0;
    line-height: 1.2;
    padding: 3px 8px;
    font-size: 14px;
  }

  &.btn-xl {
    margin: 5px 0;
    line-height: 1.2;
    padding: 15px 20px;
    font-size: 18px;
  }

}

.btn {
  .loading-icon {
    margin-right: 5px;

    &.icon-right {
      margin-right: 0;
      margin-left: 5px;
    }

    height: 15px;
    width: 15px;
  }
}

.btn-sm {
  .loading-icon {
    height: 11px;
    width: 11px;
  }
}

.btn-xl {
  .loading-icon {
    height: 16px;
    width: 16px;
  }
  font-size: 2rem;
  font-weight: 600;
}

.btn-lg,
.link-button {
  padding: 10px 22px;
  font-size: 16px;
  font-weight: 600;
}

a.link-button,
.link-button,
a.btn-secondary,
.btn-secondary {
  background-color: #ffffff;
  border: 1px esprit-sentiers(green) solid;
  color: esprit-sentiers(green);

  &:hover {
    background-color: esprit-sentiers(green);
    color: #ffffff;
  }
}

a.btn-primary,
.btn-primary {
  background-color: esprit-sentiers(green);
  border: 1px esprit-sentiers(green) solid;
  color: #ffffff;

  &:focus:not(:hover) {
    color: #ffffff;
  }

  &:hover {
    background-color: #ffffff;
    color: esprit-sentiers(green);
  }

  &.white-border {
    border: 1px #ffffff solid;

    &:hover:not(:disabled),
    &:focus:not(:disabled) {
      border: 1px esprit-sentiers(green) solid;
    }
  }
}

a.btn-action-call,
.btn-action-call {
  background-color: esprit-sentiers(orange);
  border: 1px esprit-sentiers(orange) solid;
  color: #ffffff;

  &:focus:not(:hover) {
    color: #ffffff;
  }

  &:hover {
    background-color: #ffffff;
    color: esprit-sentiers(orange);
  }

  &.white-border {
    border: 1px #ffffff solid;

    &:hover:not(:disabled),
    &:focus:not(:disabled) {
      border: 1px esprit-sentiers(orange) solid;
    }
  }

  &:hover:not(:disabled),
  &:focus:not(:disabled) {
    box-shadow: 0 0 0 2px rgba(esprit-sentiers(orange), .5);
  }

  &:active:not(:disabled) {
    box-shadow: 0 0 0 1px rgba(esprit-sentiers(orange), .5);
  }
}

a.btn-action-call-secondary,
.btn-action-call-secondary {
  background-color: #ffffff;
  border: 1px esprit-sentiers(orange) solid;
  color: esprit-sentiers(orange);

  &:focus:not(:hover) {
    color: esprit-sentiers(orange);
  }

  &:hover {
    background-color: esprit-sentiers(orange);
    color: #ffffff;
  }

  &.white-border {
    border: 1px #ffffff solid;

    &:hover:not(:disabled),
    &:focus:not(:disabled) {
      border: 1px esprit-sentiers(orange) solid;
    }
  }

  &:hover:not(:disabled),
  &:focus:not(:disabled) {
    box-shadow: 0 0 0 2px rgba(esprit-sentiers(orange), .5);
  }

  &:active:not(:disabled) {
    box-shadow: 0 0 0 1px rgba(esprit-sentiers(orange), .5);
  }
}

.link-button.inverse {
  background-color: esprit-sentiers(orange);
  color: #ffffff;

  &:hover {
    background-color: #ffffff;
    color: esprit-sentiers(green);
  }
}

.btn-vertical-group {
  display: grid;

  &.justify-left {
    justify-content: flex-start;
  }

  &.justify-center {
    justify-content: center;
  }

  &.justify-right {
    display: table;
    margin-left: auto;
  }

  &.align-top {
    align-items: flex-start;
  }

  &.align-center {
    align-items: center;
  }

  &.align-bottom {
    align-items: flex-end;
  }

  > .btn {
    width: 100%;
    margin: 5px auto;
    display: block;
    float: none;
    max-width: 100%;

    &:first-child {
      margin-top: 10px;
    }

    &:last-child {
      margin-bottom: 10px;
    }
  }
}

.btn-group-spaced {
  margin: 10px auto;
}

.round-btn {
  border-radius: 50%;
}

.loading-btn,
.btn-vertical-group .loading-btn,
.btn-inline-group .loading-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;

  :not(.hide-icon) .initial-text {
    display: none;
  }
}

.btn.hide-icon {
  .btn-icon,
  .loading-text {
    display: none;
  }
}

.btn-inline-group {
  display: flex;
  gap: 10px 5px;
  margin-bottom: 10px;

  &.border-collapse {
    > .btn {
      &:first-child {
        margin-left: 0;
      }

      &:last-child {
        margin-right: 0;
      }
    }
  }

  &.justify-right {
    justify-content: flex-end;
  }

  &.justify-center {
    justify-content: center;
  }

  &.justify-left {
    justify-content: flex-start;
  }

  &.align-top {
    align-items: flex-start;
  }

  &.align-center {
    align-items: center;
  }

  &.align-bottom {
    align-items: flex-end;
  }
}

.btn-link {
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  cursor: pointer;
}
