/**
 * Shop by Brand homepage grid
 *
 * Restores the 4-column layout for brand thumbnails on the Homepage template.
 * WooCommerce's brands.css is not enqueued on this page, so items stack vertically.
 */
.storefront-woocommerce-brands ul.brand-thumbnails {
	margin-left: 0;
	margin-bottom: 0;
	clear: both;
	list-style: none;
}

.storefront-woocommerce-brands ul.brand-thumbnails::before,
.storefront-woocommerce-brands ul.brand-thumbnails::after {
	content: "";
	display: table;
	clear: both;
}

.storefront-woocommerce-brands ul.brand-thumbnails li {
	float: left;
	margin: 0 3.8% 1em 0;
	padding: 0;
	position: relative;
	width: 22.05%;
	list-style: none;
}

.storefront-woocommerce-brands ul.brand-thumbnails li.first {
	clear: both;
}

.storefront-woocommerce-brands ul.brand-thumbnails li.last {
	margin-right: 0;
}

.storefront-woocommerce-brands .brand-thumbnails li img {
	box-sizing: border-box;
	width: 100%;
	max-width: none;
	height: auto;
	margin: 0;
	display: block;
}

@media screen and (max-width: 768px) {
	.storefront-woocommerce-brands ul.brand-thumbnails li {
		width: 48% !important;
	}

	.storefront-woocommerce-brands ul.brand-thumbnails li.first {
		clear: none;
	}

	.storefront-woocommerce-brands ul.brand-thumbnails li.last {
		margin-right: 3.8%;
	}

	.storefront-woocommerce-brands ul.brand-thumbnails li:nth-of-type(odd) {
		clear: both;
	}

	.storefront-woocommerce-brands ul.brand-thumbnails li:nth-of-type(even) {
		margin-right: 0;
	}
}
