/**
 * woocommerce-layout.scss
 * Applies layout to the default WooCommerce frontend design
 */

/**
 * Imports
 */
@import 'fragments/mixins';
@import 'fragments/variables';

/**
 * Styling begins
 */
.woocommerce, .woocommerce-page {

	.woocommerce-message,
	.woocommerce-error,
	.woocommerce-info {
		.button {
			float: right;
		}
	}

	/**
	 * General layout styles, 2 column layout on checkout page
	 */
	.col2-set {
		@include clearfix();
		width: 100%;

		.col-1 {
			float: left;
			width: 48%;
			margin-bottom: $margin;
		}
		.col-2 {
			float: right;
			width: 48%;
			margin-bottom: $margin;
		}
	}

	/**
	 * Product page
	 */
	div.product,
	#content div.product {
		div.images {
			float: left;
			width: 48%;
		}

		div.thumbnails {
			@include clearfix();

			a {
				float: left;
				width: 30.75%;
				margin-right: 3.8%;
				margin-bottom: 1em;
			}

			a.last {
				margin-right: 0;
			}

			a.first {
				clear: both;
			}

			&.columns-1 {
				a {
					width: 100%;
					margin-right: 0;
					float: none;
				}
			}

			&.columns-2 {
				a {
					width: 48%;
				}
			}

			&.columns-4 {
				a {
					width: 22.05%;
				}
			}

			&.columns-5 {
				a {
					width: 16.9%;
				}
			}
		}

		div.summary {
			float: right;
			width: 48%;
			clear: none;
		}

		.woocommerce-tabs {
			clear: both;

			ul.tabs {
				@include menu();
			}
		}

		.related {
			clear: both;
		}

		#reviews {
			.comment {
				@include mediaright();
			}
		}
	}

	/**
	 * Product loops
	 */
	ul.products {
		li.product {
			margin-bottom: $margin-medium;
		}
	}

	.woocommerce-result-count {
		float: left;
	}
	.woocommerce-ordering {
		float: right;
	}

	.woocommerce-pagination {
		ul.page-numbers {
			@include menu();
		}
	}

	/**
	 * Cart page
	 */
	table.cart,
	#content table.cart {
		td.actions {
			text-align: right;

			.input-text {
				width: 180px;
			}

			.coupon {
				float: left;

				label {
					display: none;
				}
			}
		}
	}

	.cart-collaterals {
		@include clearfix();
		width: 100%;

		.related {
			width: 30.75%;
			float: left;
		}

		.cross-sells {
			width: 48%;
			float: left;

			ul.products {
				float: none;

				li {
					width: 48%;
				}
			}
		}

		.shipping_calculator {
			width: 48%;
			@include clearfix();
			clear: right;
			float: right;

			.col2-set {
				.col-1,
				.col-2 {
					width: 47%;
				}
			}
		}

		.cart_totals {
			float: right;
			width: 48%;
		}
	}

	/**
	 * Cart sidebar
	 */
	ul.cart_list,
	ul.product_list_widget {
		li {
			@include mediaright();
		}
	}

	/**
	 * Forms
	 */
	form {
		.form-row {
			@include clearfix();

			label {
				display: block;

				&.checkbox {
					display: inline;
				}
			}

			select {
				width: 100%;
			}

			.input-text {
				box-sizing: border-box;
				width: 100%;
			}
		}

		.form-row-first,
		.form-row-last {
			width: 47%;
			overflow: visible;
		}

		.form-row-first {
			float: left;

			/*rtl:raw:
			float: right;
			*/
		}

		.form-row-last {
			float: right;
		}

		.form-row-wide {
			clear: both;
		}
	}

	#payment {
		.form-row {
			select {
				width: auto;
			}
		}

		.wc-terms-and-conditions, .terms {
			text-align: left;
			padding: 0 1em 0 0;
			float:left;
		}

		#place_order {
			float: right;
		}
	}

	.woocommerce-billing-fields,
	.woocommerce-shipping-fields {
		@include clearfix();
	}

	.woocommerce-terms-and-conditions {
		margin-bottom: $margin;
		padding: $padding;
	}

	/**
	 * oEmbeds
	 */
	.woocommerce-oembed {
		position: relative;
	}
}

.woocommerce-account {
	.woocommerce-MyAccount-navigation {
		float: left;
		width: 30%;
	}

	.woocommerce-MyAccount-content {
		float: right;
		width: 68%;
	}
}

/**
 * RTL styles.
 */
.rtl {
	.woocommerce, .woocommerce-page {
		.col2-set {
			.col-1 {
				float: right;
			}
			.col-2 {
				float: left;
			}
		}
	}
}
