<?php echo wp_kses( $args['before_widget'], wp_kses_allowed_html( 'post' ) ); ?>

	<div class="contact-box">
		<div class="row">
			<div class="col-sm-6">
				<?php if ( ! empty( $instance['title'] ) ) : ?>
					<?php echo wp_kses( $args['before_title'], wp_kses_allowed_html( 'post' ) ); ?>
					<?php echo esc_attr( $instance['title'] ); ?>
					<?php echo wp_kses( $args['after_title'], wp_kses_allowed_html( 'post' ) ); ?>
				<?php endif; ?>

				<?php if ( ! empty( $instance['text'] ) ) : ?>
					<p>
						<?php echo esc_attr( $instance['text'] ); ?>
					</p>
				<?php endif; ?>


				<?php if ( ! empty( $instance['facebook'] ) || ! empty( $instance['twitter'] ) || ! empty( $instance['google_plus'] ) || ! empty( $instance['linkedin'] ) || ! empty( $instance['youtube'] ) ) : ?>
					<ul class="social-links">
						<?php if ( ! empty( $instance['facebook'] ) ) : ?>
							<li>
								<a href="<?php echo esc_attr( $instance['facebook'] ); ?>" target="_blank" class="btn btn-social btn-facebook">
									<i class="fa fa-facebook"></i> Facebook
								</a>
							</li>
						<?php endif; ?>

						<?php if ( ! empty( $instance['twitter'] ) ) : ?>
							<li>
								<a href="<?php echo esc_attr( $instance['twitter'] ); ?>" target="_blank" class="btn btn-social btn-twitter">
									<i class="fa fa-twitter"></i> Twitter
								</a>
							</li>
						<?php endif; ?>

						<?php if ( ! empty( $instance['google_plus'] ) ) : ?>
							<li>
								<a href="<?php echo esc_attr( $instance['google_plus'] ); ?>" target="_blank" class="btn btn-social btn-google-plus">
									<i class="fa fa-google-plus"></i> Google+
								</a>
							</li>
						<?php endif; ?>

						<?php if ( ! empty( $instance['linkedin'] ) ) : ?>
							<li>
								<a href="<?php echo esc_attr( $instance['linkedin'] ); ?>" target="_blank" class="btn btn-social btn-linkedin">
									<i class="fa fa-linkedin"></i> LinkedIn
								</a>
							</li>
						<?php endif; ?>

						<?php if ( ! empty( $instance['youtube'] ) ) : ?>
							<li>
								<a href="<?php echo esc_attr( $instance['youtube'] ); ?>" target="_blank" class="btn btn-social btn-youtube">
									<i class="fa fa-youtube"></i> YouTube
								</a>
							</li>
						<?php endif; ?>
					</ul>
				<?php endif; ?>

				<table class="contact">
					<tbody>
					<?php if ( ! empty( $instance['address'] ) ) : ?>
						<tr>
							<th class="address"><i class="fa fa-map-marker"></i><span class="contact-label"> <?php echo __( 'Address', 'realia' ); ?>:</span></th>
							<td><?php echo esc_attr( $instance['address'] ); ?></td>
						</tr>
					<?php endif; ?>

					<?php if ( ! empty( $instance['phone'] ) ) : ?>
						<tr>
							<th class="phone"><i class="fa fa-phone"></i><span class="contact-label"> <?php echo __( 'Phone', 'realia' ); ?>:</span></th>
							<td><?php echo esc_attr( $instance['phone'] ); ?></td>
						</tr>
					<?php endif; ?>

					<?php if ( ! empty( $instance['email'] ) ) : ?>
						<tr>
							<th class="email"><i class="fa fa-at"></i><span class="contact-label"> <?php echo __( 'Email', 'realia' ); ?>:</span></th>
							<td><a href="mailto:<?php echo esc_attr( $instance['email'] ); ?>"><?php echo esc_attr( $instance['email'] ); ?></a></td>
						</tr>
					<?php endif; ?>

					<?php if ( ! empty( $instance['skype'] ) ) : ?>
						<tr>
							<th class="skype"><i class="fa fa-skype"></i><span class="contact-label"> <?php echo __( 'Skype', 'realia' ); ?>:</span></th>
							<td><?php echo esc_attr( $instance['skype'] ); ?></td>
						</tr>
					<?php endif; ?>
					</tbody>
				</table>
			</div>

			<div class="col-sm-6">
				<?php echo do_shortcode( $instance['contact_form'] ); ?>
			</div>
		</div>
	</div>

<?php echo wp_kses( $args['after_widget'], wp_kses_allowed_html( 'post' ) ); ?>