@import 'bourbon';

// Susy
// Susy grid system. See: http://susydocs.oddbird.net/en/latest/
@import '../../../node_modules/susy/sass/susy';

// Utilities
// Sass tools and helpers used across the project.
@import '../utils/variables';
@import '../utils/mixins';
@import '../vendors/font-awesome/font-awesome';
@import '../vendors/modular-scale';

.site-search {
	.widget_product_search {
		form {
			input[type=search],
			input[type=text] {
				padding-left: ms(5);
			}
		}
	}
}

#comments {
	.commentlist {
		.bypostauthor {
			> .comment-body cite {
				&:after {
					@include fa-icon();
					margin-left: ms(-3);
					content: "\f0f6";
				}
			}
		}

		.reply {
			a {
				&:after {
					@include fa-icon();
					content: "\f112";
					margin-left: ms(-3);
				}

				&.comment-edit-link {
					&:after {
						content: "\f040";
					}
				}
			}
		}
	}
}

#respond {
	#cancel-comment-reply-link {
		&:before {
			@include fa-icon();
			content: "\f057";
			display: block;
		}
	}
}

.sticky {
	.entry-title {
		&:before {
			@include fa-icon();
			margin-right: ms(-3);
			content: "\f08d";
		}
	}
}

button,
input[type="button"],
input[type="reset"],
input[type="submit"],
.button,
.added_to_cart {
	&.loading {
		position: relative;

		&:after {
			@include fa-icon();
			content: "\f110";
			animation: fa-spin .75s linear infinite;
			height: 20px;
			width: 20px;
			line-height: 20px;
			font-size: 20px;
			position: absolute;
			top: 50%;
			left: 50%;
			margin-left: -10px;
			margin-top: -10px;
		}
	}
}

.main-navigtion {
	ul {
		li {
			a {
				&:before {
					@include fa-icon();
					content: "\f0f6";
					margin-right: ms(-3);
				}
			}
		}
	}
}

.site-main {
	nav.navigation {
		.nav-previous {
			a {
				&:before {
					@include fa-icon();
					content: "\f177";
					margin-right: ms(-3);
				}
			}
		}

		.nav-next {
			a {
				&:after {
					@include fa-icon();
					content: "\f178";
					margin-left: ms(-3);
				}
			}
		}
	}
}

.widget_search,
.widget_product_search {
	form {
		&:before {
			@include fa-icon();
			content: "\f002";
			position: absolute;
			top: 1em;
			left: 1em;
		}

		input[type=text],
		input[type=search] {
			padding-left: ms(5);
		}
	}
}

.storefront-handheld-footer-bar {
	ul {
		li {
			> a {
				&:before {
					@include fa-icon();
					position: absolute;
					top: 0;
					left: 0;
					right: 0;
					bottom: 0;
					text-align: center;
					line-height: 2.618046972; // 4.236/1.618
					font-weight: 400;
					font-size: ms(3);
					text-indent: 0;
					display: block;
					cursor: pointer;
				}
			}

			&.search {
				> a:before {
					content: "\f002";
				}
			}

			&.my-account {
				> a:before {
					content: "\f007";
				}
			}

			&.cart {
				> a:before {
					content: "\f291";
				}
			}
		}
	}
}

.single-product {
	.pswp__button {
		background-color: transparent;
	}

	div.product {
		.woocommerce-product-gallery {
			.woocommerce-product-gallery__trigger {
				text-indent: -999px;
				overflow: hidden;

				&:before {
					@include fa-icon();
					display: block;
					content: "\f00e";
					line-height: 2;
					text-indent: 0;
				}

				img {
					display: none !important;
				}
			}
		}
	}
}

.stock {
	&:before {
		@include fa-icon();
		margin-right: ms(-3);
	}

	&.in-stock {
		&:before {
			content: "\f118";
		}
	}

	&.out-of-stock {
		&:before {
			content: "\f119";
		}
	}
}

a.reset_variations {
	&:before {
		@include fa-icon();
		content: "\f021";
		margin-right: ms(-3);
	}
}

.woocommerce-breadcrumb {
	a {
		&:first-of-type {
			&:before {
				@include fa-icon();
				content: "\f015";
				margin-right: ms(-3);
			}
		}
	}
}

.widget_recent_entries,
.widget_pages,
.widget_categories,
.widget_archive,
.widget_recent_comments,
.widget_nav_menu,
.widget_links,
.widget_product_categories,
.widget_layered_nav,
.widget_layered_nav_filters {
	ul {
		margin: 0;

		li {
			padding-left: ms(3);

			&:before {
				font-family: "FontAwesome";
				margin-right: ms(-3);
				display: block;
				float: left;
				opacity: 0.35;
				margin-left: - ms(3);
				width: 1em;
			}
		}
	}
}

.widget_product_categories {
	ul {
		li {
			&:before {
				content: "\f114";
			}

			&.current-cat {
				&:before {
					content: "\f115";
				}
			}
		}
	}
}

.widget_layered_nav {
	li {
		&:before {
			content: "\f0c8";
		}
	}

	.chosen {
		&:before {
			content: "\f14a";
		}
	}
}

.widget_layered_nav_filters {
	ul {
		li {
			&.chosen {
				&:before {
					content: "\f00d";
					color: $error;
					opacity: 1;
				}
			}
		}
	}
}

.widget_recent_entries,
.widget_pages {
	ul {
		li {
			&:before {
				content: "\f0f6";
			}
		}
	}
}

.widget_categories {
	ul {
		li {
			&:before {
				content: "\f114";
			}

			&.current-cat {
				&:before {
					content: "\f115";
				}
			}
		}
	}
}

.widget_archive {
	ul {
		li {
			&:before {
				content: "\f115";
			}
		}
	}
}

.widget_recent_comments {
	ul {
		li {
			&:before {
				content: "\f0e5";
			}
		}
	}
}

.widget_nav_menu {
	ul {
		li {
			&:before {
				content: "\f0f6";
			}
		}
	}
}

.widget_links {
	ul {
		li {
			&:before {
				content: "\f08e";
			}
		}
	}
}

a.remove {
	display: block;
	width: ms(3);
	height: ms(3);
	line-height: 1.618;
	font-weight: 400;
	text-indent: -9999px;
	position: relative;

	&:before {
		content: "\f057";
		@include fa-icon();
		position: absolute;
		top: 0;
		left: 0;
		right: 0;
		bottom: 0;
		color: $error;
		line-height: 1.618;
		text-indent: 0;
		text-align: center;
	}
}

.woocommerce-shipping-calculator {
	> p:first-child {
		a {
			&:before {
				@include fa-icon();
				content: "\f0d1";
				margin-right: ms(-5);
			}
		}
	}
}

.blockUI {
	&:before {
		@include fa-icon();
		content: "\f110";
		animation: fa-spin .75s linear infinite;
		height: 30px;
		width: 30px;
		line-height: 30px;
		font-size: 30px;
		position: absolute;
		top: 50%;
		left: 50%;
		margin-left: -15px;
		margin-top: -15px;
	}
}

.woocommerce-pagination {
	.next,
	.prev {
		text-indent: -9999px;
		display: inline-block;
		position: relative;

		&:after {
			@include fa-icon;
			content: "\f0d9";
			text-indent: 0;
			position: absolute;
			top: 50%;
			left: 50%;
			width: 1em;
			height: 1em;
			transform: translateX(-50%) translateY(-50%);
			line-height: 1;
		}
	}

	.next {
		&:after {
			content: "\f0da";
		}
	}
}

.woocommerce-breadcrumb {
	.breadcrumb-separator {
		text-indent: -9999px;
		position: relative;
		display: inline-block;
		padding: 0 ms(9);

		&:after {
			display: block;
			@include fa-icon;
			content: "\f105";
			font-size: ms(-1);
			text-indent: 0;
			position: absolute;
			top: 50%;
			left: 50%;
			width: 1em;
			height: 1em;
			transform: translateX(-50%) translateY(-50%);
			text-align: center;
			opacity: .25;
		}
	}
}

#payment {
	.payment_methods {
		> .wc_payment_method {
			> label {
				&:before {
					@include fa-icon();
					content: "\f10c";
					margin-right: ms(-3);
					transition: color, ease, .2s;
				}
			}
		}

		li {
			&.wc_payment_method > input[type=radio]:first-child {
				@include screen-reader-text();

				&:checked + label:before {
					content: "\f192";
				}
			}
		}
	}
}

.woocommerce-password-strength {
	&:after {
		@include fa-icon();
		content: "\f119";
		margin-left: ms(-3);
	}

	&.strong {
		&:after {
			content: "\f118";
		}
	}

	&.good {
		&:after {
			content: "\f11a";
		}
	}
}

.woocommerce-MyAccount-navigation {
	ul {
		li {
			&.is-active {
				a:before {
					opacity: 1;
				}
			}

			a {
				&:before {
					@include fa-icon();
					content: "\f0f6";
					line-height: 1.618;
					margin-left: ms(-3);
					width: ms(2);
					text-align: right;
					float: right;
					opacity: .25;
				}

				&:hover {
					&:before {
						opacity: 1;
					}
				}
			}

			&.woocommerce-MyAccount-navigation-link--dashboard a:before {
				content: "\f0e4";
			}

			&.woocommerce-MyAccount-navigation-link--orders a:before {
				content: "\f291";
			}

			&.woocommerce-MyAccount-navigation-link--downloads a:before {
				content: "\f1c6";
			}

			&.woocommerce-MyAccount-navigation-link--edit-address a:before {
				content: "\f015";
			}

			&.woocommerce-MyAccount-navigation-link--payment-methods a:before {
				content: "\f09d";
			}

			&.woocommerce-MyAccount-navigation-link--edit-account a:before {
				content: "\f007";
			}

			&.woocommerce-MyAccount-navigation-link--customer-logout a:before {
				content: "\f08b";
			}

			&.woocommerce-MyAccount-navigation-link--subscriptions a:before {
				content: "\f021";
			}
		}
	}
}

.my_account_orders {
	.button.view {
		&:after {
			@include fa-icon();
			content: "\f06e";
			margin-left: ms(-3);
		}
	}
}

p.order-again {
	.button {
		&:after {
			@include fa-icon();
			content: "\f021";
			margin-left: ms(-3);
		}
	}
}

.woocommerce-MyAccount-downloads {
	.button {
		&:after {
			@include fa-icon();
			content: "\f0ed";
			margin-left: ms(-3);
		}
	}
}

.demo_store {
	&:before {
		@include fa-icon();
		margin-right: ms(-3);
		content: "\f05a";
	}
}

.woocommerce-tabs {
	ul.tabs {
		li {
			&:after {
				@include fa-icon();
				content: "\f107";
				display: block;
				position: absolute;
				top: 50%;
				right: -1em;
				transform: translateY(-50%);
				opacity: 0;
				transition: all,ease,.3s;
			}

			&.active {
				&:after {
					opacity: 1;
					right: 0;
				}
			}
		}
	}
}

.wc-forward,
.woocommerce-Button--next {
	&:after {
		@include fa-icon();
		content: "\f178";
		margin-left: ms(-3);
	}
}

.woocommerce-Button--previous {
	&:before {
		@include fa-icon();
		content: "\f177";
		margin-right: ms(-3);
	}
}

#reviews {
	.commentlist {
		li {
			p.meta {
				.verified {
					display: inline-block;
					height: ms(2);
					width: ms(2);
					position: relative;
					text-indent: -9999px;

					&:before {
						@include fa-icon();
						content: "\f058";
						color: $success;
						position: absolute;
						top: 0;
						left: 0;
						width: ms(2);
						height: ms(2);
						text-indent: 0;
						text-align: center;
						line-height: ms(3);
					}
				}
			}
		}
	}
}

/**
 * Composite Products
 */
 .single-product div.product {
 	.component_selections {
 		.clear_component_options:before {
 			@include fa-icon();
 			content: "\f021";
 			margin-right: ms(-3);
 		}
	}
}

/**
 * Mix and Match
 */
.cart,
.shop_table {
	.mnm_table_item {
		.mnm_table_item_indent {
			&:before {
				@include fa-icon();
				@include fa-icon-rotate(90deg,1);
				content: "\f148";
				margin-right: ms(-4);
				opacity: .25;
			}
		}
	}
}

/**
 * Quick view
 */
.quick-view-button {
	&:before {
		@include fa-icon();
		content: "\f06e";
		margin-right: ms(-2);
	}
}

/**
 * Ship multiple addresses
 */
.woocommerce-page {
	.ship_address,
	.no_shipping_address {
		.gift-form {
			label {
				&:after {
					@include fa-icon();
					content: "\f06b";
					margin-left: ms(-3);
				}
			}
		}

		.modify-address-button {
			&:before {
				@include fa-icon();
				content: "\f044";
				margin-right: ms(-3);
			}
		}
	}

	.addresses {
		+ .addresses {
			header.title {
				a:before {
					content: "\f067";
				}
			}
		}
	}
}

/**
 * Product reviews pro
 */
.woocommerce,
.woocommerce-page {
	.woocommerce-MyAccount-navigation {
		li.woocommerce-MyAccount-navigation-link--contributions {
			a:before {
				content: "\f005";
			}
		}
	}
}

/**
 * Variation Swatches
 */
a#variations_clear {
	&:before {
		@include fa-icon();
		content: "\f021";
		margin-right: ms(-3);
	}
}

/**
 * Wishlists
 */
.wl-add-link {
	&:before {
		@include fa-icon();
		content: "\f004";
		margin-right: ms(-3);
	}
}

.button.wl-create-new {
	&:before {
		@include fa-icon();
		content: "\f067";
		margin-right: ms(-3);
	}
}

@include susy-media($desktop) {
	.main-navigation {
		ul.menu,
		ul.nav-menu {
			> li {
				&.menu-item-has-children,
				&.page_item_has_children {
					> a {
						&:after {
							// The dropdown indicator
							@include fa-icon();
							content: "\f107";
							margin-left: 1em;
						}
					}
				}
			}
		}
	}

	.main-navigation {
		ul.menu,
		ul.nav-menu {
			ul {
				li {
					&.menu-item-has-children,
					&.page_item_has_children {
						> a {
							&:after {
								// The dropdown indicator
								@include fa-icon();
								content: "\f105";
								float: right;
								line-height: 1.618;
							}
						}
					}
				}
			}
		}
	}

	.demo_store {
		a {
			&:before {
				@include fa-icon();
				content: "\f057";
				margin-right: ms(-5);
			}
		}
	}

	.site-header-cart {
		.cart-contents {
			&:after {
				@include fa-icon();
				height: 1em;
				float: right;
				content: "\f291";
				line-height: 1.618;
			}
		}
	}

	.addresses {
		header.title {
			a {
				display: block;
				width: 1em;
				height: 1em;
				text-indent: -9999px;
				position: relative;
				padding: ms(-1);
				margin-top: ms(-2);

				&:before {
					@include fa-icon();
					content: "\f044";
					line-height: 1.618;
					position: absolute;
					top :0;
					left: 0;
					height: 100%;
					width: 100%;
					text-align: center;
					text-indent: 0;
				}
			}
		}
	}

	.woocommerce-tabs {
		ul.tabs {
			li {
				&:after {
					content: "\f105";
				}
			}
		}
	}

	/**
	 * Wishlists
	 */
	 #wl-wrapper {
		.wl-tabs {
			> li {
				&.active {
					&:after {
						@include fa-icon();
						content: "\f105";
						display: block !important;
						position: absolute;
						top: 50%;
						height: 1em;
						width: 1em;
						margin-top: -.5em;
					}
				}
			}
		}
	}
}
