Characterization of Prepared Superhydrophobic Surfaces on AZ31 and AZ91 Alloys Etched with ZnCl 2 and SnCl 2

: Superhydrophobic surfaces were prepared using a two-step method that involved the etching of AZ31 and AZ91 magnesium alloys and then modifying the etched alloys with stearic acid. Magnesium alloys etched with ZnCl 2 and SnCl 2 exhibited surfaces roughened with micro-and nanoscale hierarchical structures consisting of two chemically distinct regions (Zn/Zn(OH) 2 or Sn/SnO 2 and Mg(OH) 2 ). An optimum etching time of ten minutes was chosen for both etchants. Superhydrophobic surfaces with the highest contact angle were prepared when stearic acid reacted with the etched alloys at 50 ◦ C for 4 h. Stearic acid was bound as zinc stearate and magnesium stearate on Mg alloys etched with ZnCl 2 and SnCl 2 solutions, respectively. The superhydrophobic process on AZ31 alloys etched with ZnCl 2 and SnCl 2 improved the corrosion resistance in phosphate buffered saline (PBS) solution compared to bare AZ31 alloy, with the use of ZnCl 2 etchant leading to better results. An improvement in the corrosion resistance of AZ91 alloy was observed when the stearic-acid-modiﬁed AZ91 alloy was etched with SnCl 2 . In contrast, the use of ZnCl 2 etchant to pretreat AZ91 alloy resulted in a signiﬁcant deterioration in corrosion properties compared to bare AZ91 alloy. The microstructure of the Mg alloy had an impact on the etching and modiﬁcation process. On the basis of the ﬁndings, a characterization of the chemistry of etching magnesium alloys and the formation of superhydrophobic surfaces was proposed. Magnesium alloys were prepared with superhydrophobic surfaces, incorporating antibacterial metals, features which may increase their potential for use in medical applications.


Introduction
Magnesium and its alloys have considerable application potential and could become some of the most important engineering materials of the 21st century. Currently, magnesium materials are finding applications in the automotive, aerospace, and electronics industries, as well as in biomedicine [1]. The attractiveness of magnesium and its alloys is due to their favorable properties, such as low density, high specific strength, favorable thermal and electrical conductivity, favorable electromagnetic shielding ability, excellent castability, biocompatibility, and biodegradability [2]. Unfortunately, their main drawback is their poor corrosion resistance, which limits the wider use of magnesium materials in practice. In order to overcome this problem, various coatings, including fluoride coatings, Ni-P coatings, plasma electrolytic oxidation coatings, calcium phosphate coatings, and layered double hydroxide coatings, are diligently being developed [3][4][5][6][7][8][9], as well as examined and studied from different points of view.
In the past decade, the preparation of superhydrophobic surfaces has become a very attractive area of research. Superhydrophobic surfaces are defined by a contact angle greater than 150 • and a sliding angle of less than 10 • . They perfectly repel water from the surface and this allows a significant improvement in the corrosion resistance of the between the etched magnesium alloys and stearic acid. In this work, optimal conditions for the preparation of superhydrophobic surfaces were determined and attention was paid to the effect of the etchant used (ZnCl 2 , SnCl 2 ) and the etching time on the surface roughening of the alloys. Two different microstructures were examined to determine the influence of material bases on the process: cast AZ91 magnesium alloy, with a heterogeneous microstructure, and wrought AZ31 alloy, which can be considered to be homogeneous. Prior to this work, no study involving the preparation of a superhydrophobic surface via the chemical etching of AZ91 alloy has been published. The corrosion resistance of superhydrophobic surfaces on different alloys was tested by potentiodynamic measurements and electrochemical impedance spectroscopy in phosphate buffered saline (PBS) solution, which is used as one type of simulated solution for in vitro experiments. The chemical characterization of superhydrophobic surfaces using spectrometric methods was also carried out and, subsequently, the chemistry of etching magnesium alloys and the formation of superhydrophobic surface was characterized. On the basis of their observations, the authors also formulated a description of the chemical reactions taking place during the etching and modification process. The work demonstrates a possible strategy for the protection of magnesium materials with different microstructures for biomedical applications because pretreatment with ZnCl 2 or SnCl 2 followed by modification with stearic acid allows for increased corrosion protection as well as the production of nanoscale crystals of metals and their salts with antibacterial properties.

Preparation of the Superhydrophobic Surface
The superhydrophobization process was performed using a two-step method involving chemical etching followed by surface modification with stearic acid in ethanol ( Figure 1). It was partly adopted from the work of Xie et al. [17], who prepared a superhydrophobic coating on AZ31 alloy etched with ZnCl 2 .
Etching was performed with two different etchants by immersing the samples of magnesium alloys in 0.25 M ZnCl 2 or 0.25 M SnCl 2 for 2 and 10 min each. The samples were then rinsed with deionized water, sonicated in deionized water for 10 min, and dried in an oven for 20 min at 50 • C to remove residual water. The superhydrophobic surface was prepared in an ethanol solution of 0.05 M stearic acid. The etched samples were immersed in the solution at 50 or 60 • C for 1, 2, 3, 4, and 5 h to determine the optimum conditions for the preparation of the superhydrophobic surface.

Characterization
A scanning electron microscope (SEM, JEOL JSM-7600, Tokyo, Japan) with an energy dispersive X-ray spectroscope (EDS, Oxford Instruments plc, Abingdon, UK) was used to

Characterization
A scanning electron microscope (SEM, JEOL JSM-7600, Tokyo, Japan) with an energy dispersive X-ray spectroscope (EDS, Oxford Instruments plc, Abingdon, UK) was used to characterize the surface morphology and elemental composition of the etched samples and the superhydrophobic surfaces.
The wetting properties of the surface were measured with a contact angle meter (DataPhysics Instruments, OCA 20, Filderstadt, Germany) using the sessile drop method. The volume of deionized water drops was about 5 µL. A total of ten contact angle values were measured at different spots on the sample surface at room temperature. The resulting contact angle value was calculated as the arithmetic mean. The contact angle was analyzed by SCA 20 software. The sliding angle was determined using in-house instruments. The superhydrophobic sample was placed on a tilting stage and a drop of water was applied to the surface. Then, the stage was slowly tilted at a rate of 1.5°/s. Once the droplet began to slide, the sliding angle was recorded.
Potentiodynamic measurements and electrochemical impedance spectroscopy (EIS) on superhydrophobic samples and ground magnesium alloys were performed using a Bio-Logic VSP-300 potentiostat (BioLogic, Seyssinet-Pariset, France). Measured samples with an exposed area of 1 cm 2 served as the working electrode. The saturated calomel electrode (SCE) was used as the reference electrode and Pt mesh as the counter-electrode. Phosphate buffered saline (PBS) solution with pH 7.4 was used as a corrosion medium in the corrosion cell with a volume of 200 mL. The composition of this solution was 8.00 g/L NaCl, 0.2 g/L KCl, 1.44 g/L Na2HPO4, and 0.24 g/L KH2PO4. Open circuit potential (OCP) variations with time were recorded during 30 min of exposure. Afterwards, potentiodynamic measurements were performed in the potential range from −200 mV to 200 mV vs. OCP at a scan rate of 1 mV/s. Only cathodic branches of the polarization curves were used to evaluate the corrosion current density. EIS measurements were performed at the OCP with a perturbation amplitude of 10 mV and a scan frequency range from 100 kHz to 10 mHz. The measurement time was 24 h.
The phase composition of the superhydrophobic samples, etched samples, and bare alloys was analyzed by X-ray diffraction (XRD; Panalytical, Malvern, UK). The X-ray source was Cu Kα1 radiation (λ = 1.540598 Å), which was operated at a voltage of 40 kV The wetting properties of the surface were measured with a contact angle meter (DataPhysics Instruments, OCA 20, Filderstadt, Germany) using the sessile drop method. The volume of deionized water drops was about 5 µL. A total of ten contact angle values were measured at different spots on the sample surface at room temperature. The resulting contact angle value was calculated as the arithmetic mean. The contact angle was analyzed by SCA 20 software. The sliding angle was determined using in-house instruments. The superhydrophobic sample was placed on a tilting stage and a drop of water was applied to the surface. Then, the stage was slowly tilted at a rate of 1.5 • /s. Once the droplet began to slide, the sliding angle was recorded.
Potentiodynamic measurements and electrochemical impedance spectroscopy (EIS) on superhydrophobic samples and ground magnesium alloys were performed using a Bio-Logic VSP-300 potentiostat (BioLogic, Seyssinet-Pariset, France). Measured samples with an exposed area of 1 cm 2 served as the working electrode. The saturated calomel electrode (SCE) was used as the reference electrode and Pt mesh as the counter-electrode. Phosphate buffered saline (PBS) solution with pH 7.4 was used as a corrosion medium in the corrosion cell with a volume of 200 mL. The composition of this solution was 8.00 g/L NaCl, 0.2 g/L KCl, 1.44 g/L Na 2 HPO 4 , and 0.24 g/L KH 2 PO 4 . Open circuit potential (OCP) variations with time were recorded during 30 min of exposure. Afterwards, potentiodynamic measurements were performed in the potential range from −200 mV to 200 mV vs. OCP at a scan rate of 1 mV/s. Only cathodic branches of the polarization curves were used to evaluate the corrosion current density. EIS measurements were performed at the OCP with a perturbation amplitude of 10 mV and a scan frequency range from 100 kHz to 10 mHz. The measurement time was 24 h.
The phase composition of the superhydrophobic samples, etched samples, and bare alloys was analyzed by X-ray diffraction (XRD; Panalytical, Malvern, UK). The X-ray source was Cu Kα 1 radiation (λ = 1.540598 Å), which was operated at a voltage of 40 kV and a current of 30 mA within the range of 5 • and 90 • 2θ at a scanning rate of 0.01313 • 2θ time per step of 46 s. Fourier transform infrared spectroscopy (FTIR; Nicolet iS50, Thermo Fisher Scientific, Madison, WI, USA) was used to analyze the superhydrophobic samples, etched samples, bare alloys, and stearic acid. Measurements were performed in absorbance mode with the attenuated total reflection technique (ATR) across a spectral range of 4000-400 cm −1 and with a resolution of 4 cm −1 . A total of 256 scans were performed on each sample. X-ray photoelectron spectroscopy (XPS; Axis Supra, Kratos Analytical Ltd., Manchester, UK) was used to analyze the superhydrophobic samples. A monochromatic Al Kα source operated at 225 W. High-resolution spectra were obtained using an analysis area of 300 µm × 700 µm and 20 eV pass energy. The Kratos charge neutralizer system was used for all analyses. XPS spectra were analyzed using CasaXPS software (version 2.3.15) and have been charge-corrected to the main line of carbon C 1s (C-C; C-H) set to 284.8 eV. A standard Shirley background was used for all sample spectra.

Morphology
SEM-EDS analysis was employed to obtain detailed information on surface roughening due to etching in terms of morphology and the resulting elemental composition. Knowledge of the surface can be useful for the successful preparation of a superhydrophobic surface and understanding its properties.
Surface analysis of AZ31 alloy etched for 10 min with the ZnCl 2 solution revealed a rough surface with pits and cracks ( Figure 2A). Much of the surface was covered with clusters of fine nanoscale crystals, some of which had a well-developed hexagonal shape ( Figure 2B). Elemental analysis by EDS indicated that the crystals were composed of Zn(OH) 2 ( Table 2). The detection of a relatively high chlorine content can be related to Mg 2 Cl(OH) 2 , MgCl 2 , and/or the etchant residue of ZnCl 2 . The presence of Mg 2 Cl(OH) 2 was indicated by XRD analysis; see below. MgCl 2 could be formed by the interaction between Cl − etchant and Mg 2+ ions released during the etching of the alloy. The detection of chlorine may also indicate the presence of zinc chloride hydroxide [25]. The surface of the etched AZ31 alloy also included regions of zinc dendrites (detail not shown) formed by the interaction of magnesium alloys with the ZnCl 2 etchant solution, as described below. The occurrence of elemental zinc was also detected by XRD analysis. In addition to the regions containing zinc compounds, the surface of the etched alloy was also composed of regions of Mg(OH) 2 ( Table 2) with typical plate-like crystals of about 15 nm in thickness ( Figure 2C). Comparison of the EDS analyses of etched and bare magnesium alloys demonstrated that the surface was heavily oxidized during the etching process ( Table 2). The observed micro-and nanoscale hierarchical structures consisting of two chemically distinct regions (Zn/Zn(OH) 2 and Mg(OH) 2 ) satisfy the crucial condition for the preparation of a superhydrophobic surface [14]. Compared to the alloy surface etched for 10 min, the surface of the alloy etched for 2 min ( Figure 2D-F) appeared to be less roughened, exhibiting therefore shallower pits, and less covered with clusters of zinc compound crystals. The surface also contained cracks. The region formed by Zn/Zn(OH) 2 crystals, as determined from EDS analysis ( Table 2), is shown in Figure 2E. The Mg(OH) 2 structure (Table 2) appeared to be less porous ( Figure 2F) than that observed for the longer etching time ( Figure 2C). In both cases, coarser structures were created compared to those created after the longer etching time. The etching time of 2 min resulted in a rather underdeveloped hierarchical structure compared to the longer etching time of 10 min.
The surface of AZ31 alloy etched with the SnCl 2 solution for 10 min was rough, containing shallow pits and cracks ( Figure 3A). The etching effect of the SnCl 2 solution was lower than that of the ZnCl 2 solution, as the surface etched with SnCl 2 for 10 min was much less degraded than the surface etched with ZnCl 2 for 2 min. Similar to the surfaces etched with the ZnCl 2 solution, two chemically different regions occurred on the SnCl 2 etched surface. One of the regions consisted of a cluster of crystals ( Figure 3B), which were attributed to elemental Sn and SnO 2 on the basis of EDS analysis ( Table 2). The crystals were coarser than those observed on surfaces of alloys etched with the zinc solution. With respect to the detection of chlorine in the displayed region ( Figure 3B), the presence of Mg 2 Cl(OH) 2 /MgCl 2 and SnCl 2 is assumed. The occurrence of Sn(OH)Cl cannot be completely excluded either [26]. The second characteristic region of etched AZ31 alloy was formed by Mg(OH) 2 crystals ( Figure 3C, Table 2). The surface etched for 2 min was smoother than the surface etched for 10 min ( Figure 3D). It contained fewer regions formed by clusters of crystals ( Figure 2E) composed of Sn and SnO 2 , as determined by EDS analysis ( Table 2). Most of the surface of AZ31 alloy appeared to be composed of Mg(OH) 2 with poorly grown crystals ( Figure 3F, Table 2). The results obtained suggest that the SnCl 2 solution provides an underdeveloped micro-and nanoscale hierarchical structure for both etching times of 2 and 10 min. attributed to elemental Sn and SnO2 on the basis of EDS analysis ( Table 2). The crystals were coarser than those observed on surfaces of alloys etched with the zinc solution. With respect to the detection of chlorine in the displayed region ( Figure 3B), the presence of Mg2Cl(OH)2/MgCl2 and SnCl2 is assumed. The occurrence of Sn(OH)Cl cannot be completely excluded either [26]. The second characteristic region of etched AZ31 alloy was formed by Mg(OH)2 crystals ( Figure 3C, Table 2). The surface etched for 2 min was smoother than the surface etched for 10 min ( Figure 3D). It contained fewer regions formed by clusters of crystals ( Figure 2E) composed of Sn and SnO2, as determined by EDS analysis ( Table 2). Most of the surface of AZ31 alloy appeared to be composed of Mg(OH)2 with poorly grown crystals ( Figure 3F, Table 2). The results obtained suggest that the SnCl2 solution provides an underdeveloped micro-and nanoscale hierarchical structure for both etching times of 2 and 10 min.  The surface of AZ91 alloy etched with the ZnCl2 solution for 10 min was rough, containing cracks, with the original microstructure of the alloy no longer visible ( Figure 4A).     The surface of AZ91 alloy etched with the ZnCl2 solution for 10 min was rough, containing cracks, with the original microstructure of the alloy no longer visible ( Figure 4A).  Figure 4B shows the area of nanoscale crystals attributed to Zn(OH)2 on the basis of elemental analysis (Table 2). At the same time, areas of Mg(OH)2 comprising platelet crystals with a thickness of about 13 nm were also present on the sample surface ( Figure 4C). Another region (not shown) also contained elemental zinc. The surface of AZ91 alloy etched with the ZnCl2 solution for 2 min ( Figure 4D) revealed the original, recognizable AZ91 alloy microstructure, from which the α phase was preferentially dissolved. Observable residues of the β phase were retained due to its higher electrode potential compared to the electrode potential of the α phase (solid solution of elements in Mg) [4,23]. Figure 4E shows the zinc dendrites ( Table 2) that were generally observed on the β phase residues. Figure 4F shows the structure of Mg(OH)2 in the α phase region ( Table 2). The AZ91 alloy surface etched with the SnCl2 solution for 10 min was characterized by a more pronounced degradation of the original microstructure compared to the surfaces etched for shorter times ( Figure 5A,D). However, residues of the β phase and the corroded α phase were still distinguishable on the surface. Tin compounds created on the surface due to the reaction of the alloy with the etchant formed isolated islands of nanoscale crystals that preferentially occurred on the preserved β phase. Elemental analysis indicated that these regions ( Figure 5B) were most probably composed of Sn and SnO2; see Table 2. Once the Sn/SnO2 crystals occupied the surface of the residues of the original β phase, they also began to grow on the surfaces of the degraded α phase. Similar behavior was also observed in a study of NiP deposition on AZ91 alloy [27]. The growth of the NiP coating was initiated on the β phase and subsequently extended to the α phase. The region of Mg(OH)2 is shown in Figure 5C.
The AZ91 alloy surface etched with the SnCl2 solution for 2 min was characterized by a more preserved original microstructure with few cracks. Tiny clusters of nanoscale elemental Sn and SnO2 crystals were randomly located on the β phase of the original microstructure of the AZ91 alloy ( Figure 5D,E, Table 2). The Sn/SnO2 crystals appeared to be coarser compared to those observed on the surface etched for a longer time. This observation indicates that the microstructure of the magnesium alloy has an impact on the etching process and, as a consequence, can affect the wetting of the stearic-acid-modified surface. Figure 5F shows the region with a chemical composition of Mg(OH)2, which was without observable crystal growth. Additionally, the effect of a longer etching time (15 min) on surface morphology was investigated (see Figures S1 and S2). The results show that crystals containing zinc or tin were larger in size and that regions of Mg(OH)2 were mostly poor in observable fine crys-  The surface of AZ91 alloy etched with the ZnCl 2 solution for 10 min was rough, containing cracks, with the original microstructure of the alloy no longer visible ( Figure 4A). Figure 4B shows the area of nanoscale crystals attributed to Zn(OH) 2 on the basis of elemental analysis (Table 2). At the same time, areas of Mg(OH) 2 comprising platelet crystals with a thickness of about 13 nm were also present on the sample surface ( Figure 4C). Another region (not shown) also contained elemental zinc. The surface of AZ91 alloy etched with the ZnCl 2 solution for 2 min ( Figure 4D) revealed the original, recognizable AZ91 alloy microstructure, from which the α phase was preferentially dissolved. Observable residues of the β phase were retained due to its higher electrode potential compared to the electrode potential of the α phase (solid solution of elements in Mg) [4,23]. Figure 4E shows the zinc dendrites ( Table 2) that were generally observed on the β phase residues. Figure 4F shows the structure of Mg(OH) 2 in the α phase region ( Table 2).
The AZ91 alloy surface etched with the SnCl 2 solution for 10 min was characterized by a more pronounced degradation of the original microstructure compared to the surfaces etched for shorter times ( Figure 5A,D). However, residues of the β phase and the corroded α phase were still distinguishable on the surface. Tin compounds created on the surface due to the reaction of the alloy with the etchant formed isolated islands of nanoscale crystals that preferentially occurred on the preserved β phase. Elemental analysis indicated that these regions ( Figure 5B) were most probably composed of Sn and SnO 2 ; see Table 2. Once the Sn/SnO 2 crystals occupied the surface of the residues of the original β phase, they also began to grow on the surfaces of the degraded α phase. Similar behavior was also observed in a study of NiP deposition on AZ91 alloy [27]. The growth of the NiP coating was initiated on the β phase and subsequently extended to the α phase. The region of Mg(OH) 2 is shown in Figure 5C.
The AZ91 alloy surface etched with the SnCl 2 solution for 2 min was characterized by a more preserved original microstructure with few cracks. Tiny clusters of nanoscale elemental Sn and SnO 2 crystals were randomly located on the β phase of the original microstructure of the AZ91 alloy ( Figure 5D,E, Table 2). The Sn/SnO 2 crystals appeared to be coarser compared to those observed on the surface etched for a longer time. This observation indicates that the microstructure of the magnesium alloy has an impact on the etching process and, as a consequence, can affect the wetting of the stearic-acid-modified surface. Figure 5F shows the region with a chemical composition of Mg(OH) 2 , which was without observable crystal growth.
Additionally, the effect of a longer etching time (15 min) on surface morphology was investigated (see Figures S1 and S2). The results show that crystals containing zinc or tin were larger in size and that regions of Mg(OH) 2 were mostly poor in observable fine crystals. Moreover, magnesium alloys etched with SnCl 2 were more covered with Sn and SnO 2 crystals than those etched for shorter times, see EDS analysis in Table S1. Thus, surface analysis suggests that a longer etching time for both magnesium alloys does not provide roughening with micro-and nanoscale hierarchical structures.
The etched samples were immersed in a stearic acid solution to prepare superhydrophobic surfaces but SEM analysis showed that the resulting morphology resembled the etched samples. Since the effect of stearic acid on the surface morphology of the etched alloys was negligible, SEM images of the stearic-acid-modified samples are not presented here. This negligible effect is attributed to the formation of a very thin film on the surface of the etched alloys. Similar observations have also been reported by other authors [17,24]. The grafting of stearic acid onto the surfaces of etched samples was shown by FTIR spectrometry (see below).

Effect of Etchant and Etching Time on the Creation of Superhydrophobic Surface
The etched samples were modified by immersion in stearic acid solution at 50 • C for 4 h to obtain a superhydrophobic surface. As shown in Table 3, the pretreatment of the sample by etching had an effect on the degree of wetness on the modified surface. The measured contact angles were either close to 150 • (highly hydrophobic properties) or above 150 • (superhydrophobic properties). It should be noted that the bare AZ31 and AZ91 alloys had contact angles of 38.0 • ± 3.8 • and 40.8 • ± 3.8 • , respectively. These measured values agree with those published and demonstrate the hydrophilic nature of the alloy surface [28,29]. Images of water droplets on stearic-acid-modified magnesium alloys etched with ZnCl 2 and SnCl 2 are shown in Figure S4. Table 3. Contact angles measured on stearic-acid-modified magnesium alloys etched under different etching conditions.

Alloys
ZnCl 2 SnCl 2 2 min 10 min 2 min 10 min The ZnCl 2 etchant proved to be very effective in the case of AZ31 alloy because a superhydrophobic surface with a contact angle of about 150.1 • was obtained on the sample etched for 2 min. Prolonging the etching time had a positive effect on increasing the contact angle (Table 3). This indicates that the ZnCl 2 solution can provide a rough surface with a hierarchical structure very quickly. This observation is consistent with the observed morphology, which showed a micro-and nanoscale hierarchical structure (Figures 2-5). Undoubtedly, the creation of the Mg(OH) 2 morphology with a large content of pores, which could be filled with air and prevent contact with a corrosive medium, could have played a supporting role in increasing the water repellency. AZ31 alloy etched with the SnCl 2 solution for 2 min probably acquired insufficient roughness, because the contact angle of the stearic-acid-modified surface was below 150 • . The lower contact angle may be related to the lower degree of roughening than that formed by ZnCl 2 etching, as recognized by surface morphology analysis. The longer etching time (10 min) resulted in a reduction in surface wettability, because a slight increase in contact angle was observed. Nevertheless, when considering statistical deviations, the measured values of the contact angle were close to those indicating superhydrophobic properties. Unfortunately, increasing the etching time (15 min) resulted in a worsening of the contact angle value (see Table S2).
The contact angles measured for modified surfaces of AZ91 alloy etched with the ZnCl 2 solution for 2 and 10 min were lower than 150 • . A longer time (15 min) did not result in a higher contact angle value, as shown in Table S2. In addition, ZnCl 2 appears to be an unsuitable etchant for AZ91 alloy. The contact angle for the stearic-acid-modified surface of AZ91 alloy etched with SnCl 2 for 2 min was about 147.5 • ; however, a superhydrophobic surface with a contact angle of about 152.0 • was successfully prepared when AZ91 alloy was etched for 10 min using the SnCl 2 solution. This confirms that the SnCl 2 solution is able to provide the necessary micro-and nanoscale hierarchical structure for the preparation of a superhydrophobic surface, unlike the ZnCl 2 etchant. The longer etching time led to a decrease in the contact angle; see Table S2. Thus, the results suggest that an etching time of 10 min is sufficient for the pretreatment of AZ31 and AZ91 alloys using ZnCl 2 or SnCl 2 solutions in the context of producing surfaces with superhydrophobic properties.

Effect of Temperature and Time on the Preparation of a Superhydrophobic Surface
Etching conditions, including the choice of etchant and etching time, are important for the successful preparation of a superhydrophobic surface on magnesium alloys, as shown by the experiments above. In addition, the preparation of a superhydrophobic surface can also be dependent on the reaction conditions (temperature and time) when the etched magnesium alloy reacts with a low surface energy substance, such as stearic acid [11,12]. Hence, for an optimum etching time of 10 min, the effect of temperature and time on the reaction of stearic acid with etched samples was investigated. Figure 6 shows the dependence of the contact angle on time (1-5 h) at 50 and 60 • C for a stearic-acid-modified surface on magnesium alloys etched with ZnCl 2 and SnCl 2 for 10 min.
It should be noted that the standard deviation of the contact angles was approximately 1.5 • and the sliding angle of samples was below 10 • .
shown by the experiments above. In addition, the preparation of a superhydrophobic surface can also be dependent on the reaction conditions (temperature and time) when the etched magnesium alloy reacts with a low surface energy substance, such as stearic acid [11,12]. Hence, for an optimum etching time of 10 min, the effect of temperature and time on the reaction of stearic acid with etched samples was investigated. Figure 6 shows the dependence of the contact angle on time (1-5 h) at 50 and 60 °C for a stearic-acid-modified surface on magnesium alloys etched with ZnCl2 and SnCl2 for 10 min. It should be noted that the standard deviation of the contact angles was approximately 1.5° and the sliding angle of samples was below 10°.   (Figure 6b). However, it appears that the contact angles decreased with increasing time. Furthermore, the contact angle values were slightly lower than those found at 50 °C. This indicates higher surface wettability with water and consequently poorer corrosion resistance. The observation of lower contact angle values at 60 °C for different reaction times could be explained by the predominance of the hydrolysis reaction of stearate and/or the higher solubility of metal stearate. The highest water repellency was observed for the surfaces prepared at 50 °C for 4 h; therefore, these conditions were chosen as optimal for the reaction with stearic acid.

Potentiodynamic Tests
The measured contact angles confirmed that superhydrophobic surfaces were prepared on etched magnesium alloys. In light of the obtained results, samples etched for 10   (Figure 6b). However, it appears that the contact angles decreased with increasing time. Furthermore, the contact angle values were slightly lower than those found at 50 • C. This indicates higher surface wettability with water and consequently poorer corrosion resistance. The observation of lower contact angle values at 60 • C for different reaction times could be explained by the predominance of the hydrolysis reaction of stearate and/or the higher solubility of metal stearate. The highest water repellency was observed for the surfaces prepared at 50 • C for 4 h; therefore, these conditions were chosen as optimal for the reaction with stearic acid.

Potentiodynamic Tests
The measured contact angles confirmed that superhydrophobic surfaces were prepared on etched magnesium alloys. In light of the obtained results, samples etched for 10 min and modified with stearic acid for 4 h at 50 • C were used for electrochemical measurements. Consequently, these investigated samples with superhydrophobic surfaces should have had a higher corrosion resistance than bare AZ31 and AZ91 alloys, because superhydrophobic surfaces prevent wetting by a corrosive solution. To verify the improved corrosion resistance of the prepared superhydrophobic surfaces, potentiodynamic polarization measurements were performed in PBS solution (Figure 7). The evaluated parameters, including corrosion current density (i cor ) and corrosion potential (E cor ), are summarized in Table 4.
The positions of the curves and the obtained i cor and E cor values indicate that the corrosion resistance of AZ31 alloy was improved by the preparation of a superhydrophobic surface (Figure 7a). The values of E cor for both superhydrophobic samples were the same and were more positive than the E cor of bare AZ31 alloy. This indicates a lower tendency to corrode after treatment, from a thermodynamic point of view. From the kinetic point of view, slightly better corrosion results were obtained for the samples prepared on AZ31 alloy etched with ZnCl 2 compared to AZ31 alloy etched with SnCl 2 because the corrosion current density was slightly lower (Table 4). This observation is consistent with the measured value of the contact angle for superhydrophobic surfaces. The superhydrophobic surface of AZ31 alloy etched with ZnCl 2 had a higher the contact angle (about 151.3 • ) than the one etched with SnCl 2 (about 150.2 • ) and therefore it more effectively prevented contact with the corrosive environment. The improvement in corrosion resistance by the superhydrophobization process is also illustrated by the fact that the superhydrophobic surface on AZ31 etched with ZnCl 2 reduced the corrosion current density approximately nine times compared to bare AZ31 alloy.
Coatings 2022, 12, x FOR PEER REVIEW 11 of 21 min and modified with stearic acid for 4 h at 50 °C were used for electrochemical measurements. Consequently, these investigated samples with superhydrophobic surfaces should have had a higher corrosion resistance than bare AZ31 and AZ91 alloys, because superhydrophobic surfaces prevent wetting by a corrosive solution. To verify the improved corrosion resistance of the prepared superhydrophobic surfaces, potentiodynamic polarization measurements were performed in PBS solution (Figure 7). The evaluated parameters, including corrosion current density (icor) and corrosion potential (Ecor), are summarized in Table 4. The positions of the curves and the obtained icor and Ecor values indicate that the corrosion resistance of AZ31 alloy was improved by the preparation of a superhydrophobic surface (Figure 7a). The values of Ecor for both superhydrophobic samples were the same and were more positive than the Ecor of bare AZ31 alloy. This indicates a lower tendency to corrode after treatment, from a thermodynamic point of view. From the kinetic point of view, slightly better corrosion results were obtained for the samples prepared on AZ31 alloy etched with ZnCl2 compared to AZ31 alloy etched with SnCl2 because the corrosion current density was slightly lower (Table 4). This observation is consistent with the measured value of the contact angle for superhydrophobic surfaces. The superhydrophobic surface of AZ31 alloy etched with ZnCl2 had a higher the contact angle (about 151.3°) than the one etched with SnCl2 (about 150.2°) and therefore it more effectively prevented contact with the corrosive environment. The improvement in corrosion resistance by the superhydrophobization process is also illustrated by the fact that the superhydrophobic surface on AZ31 etched with ZnCl2 reduced the corrosion current density approximately nine times compared to bare AZ31 alloy.   A different situation was observed in the case of AZ91 alloy (Figure 7b). Additionally, in this case, both the superhydrophobic surfaces on AZ91 alloy etched with ZnCl 2 and SnCl 2 had the same E cor value and it was more positive than the E cor of bare AZ91 alloy. However, a significant difference in the corrosion kinetics was observed. The prepared superhydrophobic surface on AZ91 alloy etched with ZnCl 2 exhibited significantly deteriorated corrosion resistance compared to bare AZ91 alloy, from the kinetic point of view, even though the resistance from the thermodynamic point of view was improved, as can be seen in Figure 7b and Table 4. In contrast, the superhydrophobic surface prepared on AZ91 alloy etched with SnCl 2 provided good corrosion protection against the corrosive environment, as the corrosion current density decreased approximately five times compared to the value for bare AZ91 alloy.
The corrosion deterioration observed in stearic-acid-modified AZ91 alloy etched with ZnCl 2 could be related to the nature of the surface, which exhibits the contact angle equal to 149.8 • ± 2.1 • . As a result, the corrosive environment could more easily come into contact with the surface. The corrosion reaction may have been facilitated by the formation of a galvanic cell between magnesium and zinc (or Zn(OH) 2 ) crystals, which had a higher electrode potential. Moreover, it can be assumed that the corrosive environment had easier access to the magnesium-rich α phase, since stearic acid reacted exclusively with Zn/Zn(OH) 2 during the superhydrophobization process (see FTIR analysis), which was mainly accumulated on β phase residues of AZ91 alloy ( Figure 4A,D). Thus, a significant reduction in surface energy probably occurred in the areas where zinc was present. This observation suggests that the microstructure of magnesium alloys may affect the surface properties.

EIS Measurements
EIS data obtained after one day of exposure in PBS solution are shown in Figure 8. Nyquist plots were fitted using two different equivalent electrical circuits, which are shown in Figure 9. The model in Figure 9a was used for all samples except for the superhydrophobic surface of AZ91 alloy etched with SnCl 2 . The equivalent electrical circuit shown in Figure 9a consisted of components representing the solution resistance (R 1 ), the resistance (R 2 ) and the constant phase element (Q 1 ) of the corrosion products and/or the superhydrophobic film, and the resistance (R 3 ) and the constant phase element (Q 3 ) of the electric double layer at the electrolyte and substrate interface. The second equivalent electrical circuit (Figure 9b) consisted of components representing the solution resistance (R 1 ), the constant phase element (Q 1 ) of the present corrosion layer, the resistance of the capacitance part (R 2 ), the inductance (L 3 ; the time-independent part of the circuit characterizing the inductive loop of the plot), and the resistance (R 3 ) of the inductive loop. The parameters evaluated by fitting the EIS data and the calculated polarization resistance values are summarized in Table 5. The polarization resistances were calculated according to the relations presented in Figure 9. The higher the polarization resistance values, the higher the corrosion resistance. The shapes of the Nyquist plots (Figure 8a) and the R p values show that the superhydrophobic process resulted in improved corrosion resistance in PBS solution compared to bare AZ31 alloy. The corrosion resistance was of a comparable order of magnitude for both superhydrophobic samples. Figure 9b and the R p values clearly show that only the superhydrophobic surface of AZ91 alloy etched with SnCl 2 resulted in better corrosion resistance. Even the superhydrophobic surface of AZ91 alloy etched with ZnCl 2 had a polarization resistance two orders of magnitude lower than bare AZ91 alloy. Moreover, the application of the other equivalent electrical circuit (Figure 9b) indicates that the corrosion of the sample was proceeded by a different corrosion mechanism. The EIS results are consistent with those of the potentiodynamic polarization measurements.

XRD Analysis
The superhydrophobic samples, etched samples, and both bare magnesium alloys were characterized using the XRD method. The analysis revealed the presence of elemental zinc on surface of AZ31 and AZ91 alloys etched with the ZnCl2 solution ( Figure  10). No other chemical form of zinc was identified. Similarly, XRD analysis of magnesium alloys etched with SnCl2 showed only the presence of elemental tin ( Figure 10). These results are contrary to expectation arising from the EDS analysis. The absence of other forms

XRD Analysis
The superhydrophobic samples, etched samples, and both bare magnesium alloys were characterized using the XRD method. The analysis revealed the presence of elemental zinc on surface of AZ31 and AZ91 alloys etched with the ZnCl 2 solution (Figure 10). No other chemical form of zinc was identified. Similarly, XRD analysis of magnesium alloys etched with SnCl 2 showed only the presence of elemental tin ( Figure 10). These results are contrary to expectation arising from the EDS analysis. The absence of other forms of zinc and tin in the XRD spectra could be explained by the nanoscale size of crystals and/or their low abundance. The presented XRD spectra of superhydrophobic and etched samples did not differ from each other. The observed broad peak around 11 • is undoubtedly related to the etching process, as the peak did not appear in the XRD spectra of bare alloys. On the basis of these results and the literature, the peak can probably be attributed to Mg 2 Cl(OH) 3 ·4H 2 O [17,30]. The absence of metal stearates in the XRD spectra can be explained by their amorphous nature or their low abundance on the surface. Their occurrence was revealed by FTIR analysis, as discussed below. This fact is not surprising since metal stearates are not commonly identified in XRD spectra, as indicated in the published literature [12,17,24]. The presence of zinc and tin on the surface of magnesium alloys can enhance the alloys' antibacterial properties, as these metals inhibit bacterial infection [23]. However, biological experiments would be needed to confirm this hypothesis. Xie et al. recently reported that the superhydrophobic AZ31 alloy surface with deposited zinc significantly enhanced biocompatibility and had lower cytotoxicity than AZ31 alloy [17].

FTIR Analysis
FTIR spectra recorded for stearic acid and superhydrophobic and etched samples are shown in Figure 11. FTIR spectra for bare AZ31 and AZ91 alloys are shown in Figure S5. Identification of the bands was made on the basis of the literature [31][32][33]. In all displayed FTIR spectra (with the exception of etched samples), very pronounced bands at 2914 and 2847 cm −1 were related to asymmetric and symmetric stretching in methylene groups.
Moreover, a shoulder of the asymmetric stretching at 2954 cm −1 in methyl groups was observed. Deformation vibrations of methylene groups were present at about 1460 cm −1 . The identification of predominantly methylene groups is consistent with the structure of the stearic acid/stearate molecule. The presence of long carbon chains derived from stearic acid was revealed by the band at 728 cm −1 and by the shoulder at the same wavenumber. Thus, FTIR analysis confirmed the presence of hydrophobic long-chain alkyl, which was present on the surfaces of all superhydrophobic samples.
of zinc and tin in the XRD spectra could be explained by the nanoscale size of crystals and/or their low abundance. The presented XRD spectra of superhydrophobic and etched samples did not differ from each other. The observed broad peak around 11° is undoubtedly related to the etching process, as the peak did not appear in the XRD spectra of bare alloys. On the basis of these results and the literature, the peak can probably be attributed to Mg2Cl(OH)3·4H2O [17,30]. The absence of metal stearates in the XRD spectra can be explained by their amorphous nature or their low abundance on the surface. Their occurrence was revealed by FTIR analysis, as discussed below. This fact is not surprising since metal stearates are not commonly identified in XRD spectra, as indicated in the published literature [12,17,24]. The presence of zinc and tin on the surface of magnesium alloys can enhance the alloys' antibacterial properties, as these metals inhibit bacterial infection [23]. However, biological experiments would be needed to confirm this hypothesis. Xie et al. recently reported that the superhydrophobic AZ31 alloy surface with deposited zinc significantly enhanced biocompatibility and had lower cytotoxicity than AZ31 alloy [17]. The peaks corresponding to tin, zinc, magnesium, and Al12Mg17 are shown by circles, triangles, stars, and diamonds, respectively.

FTIR Analysis
FTIR spectra recorded for stearic acid and superhydrophobic and etched samples are shown in Figure 11. FTIR spectra for bare AZ31 and AZ91 alloys are shown in Figure S5. Identification of the bands was made on the basis of the literature [31][32][33]. In all displayed FTIR spectra (with the exception of etched samples), very pronounced bands at 2914 and 2847 cm −1 were related to asymmetric and symmetric stretching in methylene groups. Moreover, a shoulder of the asymmetric stretching at 2954 cm −1 in methyl groups was observed. Deformation vibrations of methylene groups were present at about 1460 cm −1 . The identification of predominantly methylene groups is consistent with the structure of the stearic acid/stearate molecule. The presence of long carbon chains derived from stearic acid was revealed by the band at 728 cm −1 and by the shoulder at the same wavenumber. In the FTIR spectrum of stearic acid, a strong band at 1698 cm −1 was present and corresponded to the asymmetric stretching of carboxyl groups. This characteristic band disappeared in the spectra of superhydrophobic samples and two new distinguishable bands appeared instead. These two bands situated in the range of 1530-1560 and 1390-1460 cm −1 were ascribed to asymmetric and symmetric stretching in metal carboxylate. The FTIR spectra of superhydrophobic magnesium alloys etched with the ZnCl 2 solution exhibited bands at 1538 and 1397 cm −1 , perfectly corresponding to the positions of the zinc stearate bands [32]. These bands were not present in the FTIR spectra of the etched magnesium alloys. It is noteworthy that Xie et al. [17] obtained magnesium stearate, as indicated by the bands of the published FTIR spectrum, although they applied the same method to AZ31 alloy. On the other hand, Zhang et al. [12] observed the formation of zinc stearate when they prepared a superhydrophobic surface on AZ31 alloy in a one-step method using ZnCl 2 and stearic acid. Their results suggest that the form of the stearate did not affect the value of the contact angle, as both works presented a contact angle of about 162 • . The occurrence of zinc stearate in our investigated samples is also supported by XPS analysis; see below.
In the case of superhydrophobic magnesium alloys etched with SnCl 2 , FTIR spectra revealed relatively broad bands centered at 1560 and 1465 cm −1 , predominantly indicating the presence of magnesium stearate instead of the expected stannous stearate [33]. A minority formation of stannate stearate cannot be completely ruled out because the band corresponding to the asymmetric vibration was slightly shifted to lower wavenumbers compared to the band corresponding to magnesium stearate [32,33]. It should be noted that the bands identified as carboxylates were not observed in the FTIR spectra of the etched magnesium alloys.
occurrence of zinc stearate in our investigated samples is also supported by XPS analysis; see below.
In the case of superhydrophobic magnesium alloys etched with SnCl2, FTIR spectra revealed relatively broad bands centered at 1560 and 1465 cm −1 , predominantly indicating the presence of magnesium stearate instead of the expected stannous stearate [33]. A minority formation of stannate stearate cannot be completely ruled out because the band corresponding to the asymmetric vibration was slightly shifted to lower wavenumbers compared to the band corresponding to magnesium stearate [32,33]. It should be noted that the bands identified as carboxylates were not observed in the FTIR spectra of the etched magnesium alloys.

XPS Analysis
XPS analysis was used to identify the chemical state of Mg, Zn, and Sn for the superhydrophobic samples. The Mg 1s spectra of stearic-acid-modified AZ31 and AZ91 alloys Figure 11. (a) FTIR spectra of the following: stearic acid (purple), AZ31 alloy etched with ZnCl 2 (brown) and etched with SnCl 2 (grey), and superhydrophobic surfaces of AZ31 alloy etched with ZnCl 2 (red) and etched with SnCl 2 (dark blue). (b) FTIR spectra of the following: stearic acid (purple), AZ91 alloy etched with ZnCl 2 (pink) and etched with SnCl 2 (light blue), and superhydrophobic surfaces of AZ91 alloy etched with ZnCl 2 (green) and etched with SnCl 2 (orange).

XPS Analysis
XPS analysis was used to identify the chemical state of Mg, Zn, and Sn for the superhydrophobic samples. The Mg 1s spectra of stearic-acid-modified AZ31 and AZ91 alloys etched with ZnCl 2 (Figure 12) contained one strong peak at 1304.1 eV corresponding to the presence of Mg(OH) 2 [34]. The high-resolution XPS spectra of Zn 2p was characterized by two peaks assigned to Zn 2p 1/2 and Zn 2p 3/2 . These two peaks, which appear due to the spin-orbit splitting, are well-separated and therefore only Zn 2p 3/2 peaks can be considered for the assignment of zinc chemical state. Deconvolution of the Zn 2p 3/2 peak for both superhydrophobic samples revealed the occurrence of one chemical state with a binding energy of 1022.4 eV, which was higher than the binding energy of Zn, ZnO, and Zn(OH) 2 [35]. Consequently, the binding value received was attributed to zinc stearate. These results are in agreement with the findings of FTIR analysis, which confirmed the presence of zinc stearate.
The Mg 1s spectrum of stearic-acid-modified AZ31 alloy etched with SnCl 2 (Figure 12a) contained a single peak with a binding energy of 1304.1 eV corresponding to Mg(OH) 2 . The shift in binding energy to 1304.4 eV in the Mg 1s spectrum for stearic-acid-modified AZ91 alloy etched with SnCl 2 (Figure 12b) may be an indicator of the presence of magnesium stearate, which has a binding energy of about 1304.8 eV [36]. The high-resolution XPS spectra of Sn 3d comprised two peaks assigned to Sn 3d 3/2 and Sn 3d 5/2 . For the same reasons as in the case of the Zn 2p XPS spectra, only the Sn 3d 5/2 peaks were fitted. For stearic-acid-modified AZ31 alloy etched with SnCl 2 (Figure 12a), one peak with a binding energy of 486.7 eV was found to be attributed to SnO 2 [37]. By deconvolution of Sn 3d 5/2 for the stearic-acid-modified AZ91 alloy etched with SnCl 2 (Figure 12b), two peaks with binding energies of 486.8 and 484.5 eV were found, which were attributed to SnO 2 and elemental tin, respectively [37]. The occurrence of tin and its oxide and Mg(OH) 2 is in agreement with previous spectrometric analyses. Unfortunately, the XPS analysis did not unambiguously identify magnesium stearate, which is assumed to be present in the samples based on FTIR analysis. On the other hand, stannous stearate was not observed at all in the XPS spectra. The inconclusive evidence of stearate in the XPS spectra can be explained by the fact that the signal was collected from an area very poor in stearate and/or by the interfering contribution of Mg(OH) 2 to the Mg 1s spectrum.
fitted. For stearic-acid-modified AZ31 alloy etched with SnCl2 (Figure 12a), one peak with a binding energy of 486.7 eV was found to be attributed to SnO2 [37]. By deconvolution of Sn 3d5/2 for the stearic-acid-modified AZ91 alloy etched with SnCl2 (Figure 12b), two peaks with binding energies of 486.8 and 484.5 eV were found, which were attributed to SnO2 and elemental tin, respectively [37]. The occurrence of tin and its oxide and Mg(OH)2 is in agreement with previous spectrometric analyses. Unfortunately, the XPS analysis did not unambiguously identify magnesium stearate, which is assumed to be present in the samples based on FTIR analysis. On the other hand, stannous stearate was not observed at all in the XPS spectra. The inconclusive evidence of stearate in the XPS spectra can be explained by the fact that the signal was collected from an area very poor in stearate and/or by the interfering contribution of Mg(OH)2 to the Mg 1s spectrum.

Chemism of the Etching and Preparation of Superhydrophobic Surface
On the basis of the results presented in this paper and published in the literature [12,17,24,26,27,38], reaction steps were proposed to describe the etching process and the reaction of the formed products with stearic acid.
The etchant ZnCl 2 underwent hydrolysis to form Zn(OH) 2 or ZnO and H + ions, which gave the solution an acidic pH. The process can be described by the following Equations (1) and (2). ZnCl 2 + 2H 2 O ↔ Zn(OH) 2 + 2HCl (1) The generated H + ions reacted with the magnesium (Equation (3)) contained in the α phase of the magnesium alloys (AZ31 and AZ91), while the other phases with higher electrode potentials remained more intact by corrosion. This led to the formation of a rough surface, as described above (Figures 2 and 4).
The reaction rate was undoubtedly facilitated by the higher temperature, as a relatively large heat was released during the hydrolysis.
The released H + ions could react with the formed ZnO to form Zn 2+ , as described by Equation (4): The consumption of H + ions shifted the chemical equilibrium of both hydrolysis reactions to the right in favor of Zn(OH) 2 or ZnO.
The elemental zinc frequently observed in the form of dendrites was produced by the reaction of the etchant with the magnesium alloy (5).
In addition to the above reactions, corrosion reactions of the magnesium alloy with water and chloride ions could simultaneously take place according to the sequence of reactions (6) and (7): The XRD analysis indicated the presence of Mg 2 Cl(OH) 3 , which could have been formed during the etching process according to reaction (8) [30]: The OHanions generated by the reaction (7), including those from the hydrolysis of Mg(OH) 2 , could participate in the following interaction (9): Zn(OH)Cl could theoretically be formed as a minor by-product of hydrolysis [25].
During the superhydrophobic process, stearic acid interacted with Zn 2+ ions to form zinc stearate (11), as shown by FTIR and XPS analysis.
Zn 2+ + 2CH 3 (CH 2 ) 16 COOH → Zn[CH 3 (CH 2 ) 16 COO] 2 + 2H + (11) Unfortunately, stearates are generally highly sensitive to pH and therefore can easily undergo hydrolysis in acidic or alkaline environments. This is a limitation of superhydrophobic surfaces prepared with stearic acid. On the other hand, since blood has a pH of about 7.4 due to its natural buffering system, the relatively long-term stability of stearates can be expected.
The reaction steps during etching with the SnCl 2 solution can be understood in a similar way. The hydrolysis of SnCl 2 could provide two stable compounds involving Sn(OH)Cl and SnO 2 , as described by reactions (12) and (13) The formation of Sn(OH) 2 (including Sn(OH) 4 ) is unlikely because its preparation from an aqueous solution has not yet been described in the literature [39]. The released H + ions reacted with magnesium, as described above by chemical Equation (3). Reducing the amount of H + ions shifted the chemical equilibrium of reactions (12) and (13) to the right, towards the products. This shift in equilibrium was visually observed by the precipitation of a white precipitate from the solution during etching. Similar to the previously described etchant, SnCl 2 reacted with the magnesium and was reduced to elemental tin (14), which was demonstrated by the XRD, the XPS, and the EDS analysis. SnCl 2 + Mg → Sn + MgCl 2 (14) Surface analysis in the case of cast AZ91 alloy showed that Sn/SnO 2 were mainly accumulated on the residues of the β phase ( Figure 5A,D) because these sites had a higher electrode potential than the corroded magnesium-rich α phase. This was not observed in the case of wrought AZ31 alloy, since its microstructure is de facto homogeneous and composed of magnesium-rich grains. We believe that the observed phenomenon is associated with the different electrode potentials of the α and β phases. The dissolution of magnesium from the α phase produced electrons (15) that were consumed by Sn 2+ ions on the β phase (16).
The occurrence of Sn 4+ ions was demonstrated by XPS and EDS analysis; thus, elemental tin occurring on the surface of magnesium alloys did not reduce Sn 4+ ions to Sn 2+ according to chemical Equation (17), as would be inferred from standard electrode potentials.
Sn + Sn 4+ → Sn 2+ + 2e − During the superhydrophobic process, stearic acid interacted with Mg 2+ ions to form stearate, as indicated by FTIR analysis; this interaction can be described by Equation (18).
Mg 2+ + 2CH 3 (CH 2 ) 16 COOH → Mg[CH 3 (CH 2 ) 16 COO] 2 + 2H + (18) Theoretically, stearic acid could also react to a minor extent with Sn 2+ ions to form stannous stearate, as described by (19). However, it should be emphasized that stannous stearate in the superhydrophobic samples was not detected by any of the spectrometric methods used. Sn 2+ + 2CH 3 (CH 2 ) 16 COOH → Sn[CH 3 (CH 2 ) 16 COO] 2 + 2H + (19) Superhydrophobic surfaces of magnesium alloys etched with ZnCl 2 or SnCl 2 appear to be a possible strategy for the protection of magnesium materials in medicine applications. The prepared samples not only had enhanced corrosion resistance but also contained Zn/Zn(OH) 2 or Sn/SnO 2 , which could improve the biological properties. The corrosion behavior was monitored in PBS solution in this work, but for a deeper evaluation it is desirable to perform long-term experiments in simulated physiological solutions with respect to the location of the magnesium implant in the body. The positive effect of Zn/Zn(OH) 2 or Sn/SnO 2 in superhydrophobic samples on biological properties also needs to be demonstrated and monitored as a function of time. Future work will therefore focus on these areas of research. Mechanical stability is a hot issue of superhydrophobic materials, which limits their long-term applications in practice [10]. However, the development of advanced magnesium implants may be a solution, as a superhydrophobic surface can provide biological protection, which is crucial at the beginning of implant placement in the body, and corrosion protection can continue through appropriate coatings on the surface of the magnesium material [23].

Conclusions
The chemical etching of magnesium alloys led to surface roughening with a microand nano-scale hierarchical structure. The surface morphology of magnesium alloys etched with ZnCl 2 or SnCl 2 contained regions of nanoscale Zn/Zn(OH) 2 or Sn/SnO 2 crystals and platelet-like Mg(OH) 2 crystals. AZ91 alloy etched with SnCl 2 also contained observable residues of the β phase of the original alloy microstructure, which preferentially contained Sn/SnO 2 crystals. Stearic acid bound to the surface of ZnCl 2 -and SnCl 2 -etched magnesium alloys in the form of zinc stearate and magnesium stearate, respectively. The superhydrophobic surfaces on AZ31 alloy etched with ZnCl 2 and SnCl 2 improved the corrosion resistance compared to bare AZ31 alloy. The improvement of the corrosion resistance of AZ91 alloy was observed only in the case of the superhydrophobic surface of the alloy etched with SnCl 2 . The results show that the microstructure of magnesium alloys can have an impact on the surface roughening and consequently some physicochemical properties (wettability and corrosion resistance) of the surface modified with stearic acid. A sequence of reactions is proposed to describe the chemical processes during the etching of AZ31 and AZ91 alloys and their subsequent modification with stearic acid. Future research will focus on long-term corrosion tests and the investigation of biological properties, with an emphasis on the antibacterial effects of the presented superhydrophobic magnesium alloys.
Supplementary Materials: The following are available online at https://www.mdpi.com/article/ 10.3390/coatings12101414/s1, Figure S1: SEM images of AZ31 alloy etched with ZnCl 2 (A-C) and SnCl 2 for 15 min (D-F). Details B and E show the regions of zinc and tin, respectively, and details C and F show the Mg(OH) 2 regions.; Figure S2: SEM images of AZ91 alloy etched with ZnCl 2 (A-C) and SnCl 2 for 15 min (D-F). Details B and E show the regions of zinc and tin, respectively, and details C and F show the Mg(OH) 2 regions; Figure S3: EDS energy spectra of the magnesium alloys etched with ZnCl 2 and SnCl 2 for 2 and 10 min; Figure S4: Images of water droplets on (a) stearic acid-modified AZ31 alloy etched with ZnCl 2 , (b) stearic acid-modified AZ31 alloy etched with SnCl 2 , (c) stearic acid-modified AZ91 alloy etched with ZnCl 2 , (d) stearic acid-modified AZ91 alloy etched with SnCl 2 ; Figure S5: FTIR spectra of bare AZ31 alloy (black) and bare AZ91 alloy (purple); Table S1: Elemental composition determined by the EDS method for different regions subject to SEM analysis. The regions of elemental composition correspond to the SEM images; see Figures S1 and S2; Table S2: Contact angles measured on stearic acid-modified magnesium alloys etched with ZnCl 2 and SnCl 2 for 15 min.