/* ---------------------------------------------------------------- Product cards
 * Breakdance "Woo Products List": white cards with 15px padding in a grid 33.886px apart (8px x 1.618 cubed),
 * four across, three from 1023px, two from 767px, one from 479px (pages can keep two: .ioa-cards--2-phone).
 * Picture with 4px corners, the name (heading 5 size, regular weight), the green price, a full-width blue button.
 */

.ioa-cards {
	--ioa-woo-space: 12.944px; /* 8px x 1.618 */
	--ioa-woo-gap: 33.886px;
	width: 100%;
}

.ioa-cards .wc-block-product-template.ioa-cards__list {
	display: grid;
	gap: var(--ioa-woo-gap);
	grid-template-columns: repeat(var(--ioa-cards-per-row, 4), minmax(0, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

@media (max-width: 1023px) {
	.ioa-cards {
		--ioa-cards-per-row: 3;
	}
}

@media (max-width: 767px) {
	.ioa-cards {
		--ioa-cards-per-row: 2;
	}
}

@media (max-width: 479px) {
	.ioa-cards {
		--ioa-cards-per-row: 1;
	}

	.ioa-cards.ioa-cards--2-phone {
		--ioa-cards-per-row: 2;
	}
}

/* WooCommerce sizes each item to a share of a flex row; here the grid does that. */
.ioa-cards .wc-block-product-template.ioa-cards__list.is-flex-container > li.wc-block-product {
	background: var(--wp--preset--color--white);
	display: flex;
	flex-direction: column;
	margin: 0;
	max-width: none;
	padding: 15px;
	position: relative;
	text-align: left;
	width: auto;
}

.ioa-cards .wc-block-product > .ioa-card__main {
	display: flex;
	flex-direction: column;
	margin: 0;
}

.ioa-card__main .wc-block-components-product-image {
	margin: 0 0 var(--ioa-woo-space);
}

.ioa-card__main .wc-block-components-product-image img {
	aspect-ratio: 1;
	border-radius: 4px;
	display: block;
	height: auto;
	object-fit: cover;
	width: 100%;
}

.ioa-card__title.ioa-card__title {
	color: var(--wp--preset--color--headings);
	font-size: var(--ioa-h5);
	font-weight: 400;
	line-height: 1.2;
	margin: 0 0 8px;
}

.ioa-card__title a {
	color: inherit;
	text-decoration: none;
}

.ioa-card__price.ioa-card__price {
	align-items: center;
	color: var(--wp--preset--color--brand);
	display: flex;
	font-size: var(--ioa-h4);
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 var(--ioa-woo-space);
	text-align: left;
}

.ioa-cards .wc-block-product .ioa-card__button.ioa-card__button {
	margin: auto 0 0;
	padding: 0;
}

.ioa-cards .wc-block-product .ioa-card__button .wp-block-button__link {
	background: var(--wp--preset--color--blue);
	border: 1px solid transparent;
	border-radius: 3px;
	color: var(--wp--preset--color--white);
	font-size: var(--ioa-base);
	font-weight: 500;
	line-height: 1;
	margin: 0;
	padding: 10px;
	text-transform: capitalize;
	width: 100%;
}

.ioa-cards .wc-block-product .ioa-card__button .wp-block-button__link * {
	line-height: 1;
}

.ioa-cards .wc-block-product a:hover {
	text-decoration: none;
}

/* Five across down to 768px (homepage: the list's own setting overrode the site's three on tablets). */
.ioa-cards.ioa-cards--5 {
	--ioa-cards-per-row: 5;
}
@media (max-width: 767px) {
	.ioa-cards.ioa-cards--5 {
		--ioa-cards-per-row: 2;
	}
}

/* Plain cards (homepage, Bird Rings): no white box, dark price, green outline button at the bottom of the card. */
.ioa-cards--plain .wc-block-product-template.ioa-cards__list.is-flex-container > li.wc-block-product {
	background: none;
	padding: 0;
}
.ioa-cards--plain .ioa-card__price.ioa-card__price {
	color: var(--wp--preset--color--headings);
}
.ioa-cards.ioa-cards--plain .wc-block-product .ioa-card__button .wp-block-button__link {
	background: transparent;
	border-color: var(--wp--preset--color--brand);
	color: var(--wp--preset--color--brand);
	padding: 14px 10px;
	transition: all 300ms ease-in-out;
}
.ioa-cards.ioa-cards--plain .wc-block-product .ioa-card__button .wp-block-button__link:hover {
	background: var(--wp--preset--color--brand);
	color: #fff;
}

/* Breakdance's price was a flex row, so the spaces around the range dash disappear: "£5.00–£14.00". */
.ioa-card__price .wc-block-components-product-price {
	align-items: center;
	display: flex;
	flex-wrap: wrap; /* a range wraps after the dash in a narrow card */
}

/* Archive: no store notice space unless there is a notice. */
.wc-block-store-notices:empty,
.woocommerce-notices-wrapper:empty {
	display: none;
}
.ioa-section > .wc-block-store-notices + .ioa-cards {
	margin-top: 0;
}
