/**
 * Shop listing (ADR-035): intro, category tabs, toolbar, sidebar layout,
 * product card, promo, pagination and the no-results message.
 *
 * Breakpoints from the handoff: filters become a sidebar at 1280px (80rem);
 * the intro sits in two columns from 1024px (64rem).
 */

/* Intro ------------------------------------------------------------------ */

.pc-shop__intro {
	display: grid;
	row-gap: var(--wp--preset--spacing--30);
}

.pc-shop .pc-shop__intro > * {
	margin: 0;
}

.pc-shop__breadcrumbs {
	margin-bottom: var(--wp--preset--spacing--30);
	font-size: var(--wp--preset--font-size--small);
}

.pc-shop__breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.pc-shop__lede {
	max-width: 30rem;
	font-size: 1.125rem;
}

.pc-shop__lede p {
	margin: 0;
}

@media (min-width: 64rem) {

	.pc-shop__intro {
		grid-template-columns: minmax(0, 1fr) minmax(0, 22rem);
		column-gap: var(--wp--preset--spacing--70);
	}

	.pc-shop__intro > * {
		grid-column: 1;
	}

	.pc-shop .pc-shop__intro > .pc-shop__lede {
		grid-row: 3;
		grid-column: 2;
		align-self: center;
	}
}

/* Category tabs ----------------------------------------------------------- */

.pc-shop .pc-shop__tabs.is-style-tabs {
	gap: 0.75rem;
}

.pc-shop__tabs .wp-block-navigation-item__content {
	box-sizing: border-box;
	display: inline-flex;
	align-items: center;
	min-width: 6.5rem;
	min-height: 2.75rem;
	padding-inline: 0.25rem;
	border-bottom: 2px solid transparent;
	text-decoration: none;
}

.pc-shop__tabs .current-menu-item > .wp-block-navigation-item__content {
	border-bottom-color: currentcolor;
}

/* Toolbar ----------------------------------------------------------------- */

.pc-shop__toolbar {
	gap: 0.75rem;
	padding-bottom: var(--wp--preset--spacing--40);
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.pc-shop .pc-shop__toolbar > * {
	margin: 0;
}

@media (max-width: 79.99rem) {

	.pc-shop__toolbar .pc-shop__count {
		flex: 1;
		text-align: center;
		white-space: nowrap;
	}
}

/* Sidebar layout ---------------------------------------------------------- */

.pc-shop__layout {
	display: grid;
	gap: var(--wp--preset--spacing--60);
}

.pc-shop .pc-shop__layout > * {
	margin: 0;
}

/* Below 1280px the filters live in a fixed drawer and take no space. */
@media (max-width: 79.99rem) {

	.pc-shop__filters {
		display: contents;
	}
}

@media (min-width: 80rem) {

	.pc-shop__layout {
		grid-template-columns: 14rem minmax(0, 1fr);
		column-gap: 2.5rem;
		align-items: start;
	}
}

.pc-fit-help__title {
	font-size: 1.125rem;
}

.pc-fit-help a {
	color: inherit;
	text-decoration: none;
}

.pc-shop__results {
	display: grid;
	gap: var(--wp--preset--spacing--50);
}

.pc-shop .pc-shop__results > *,
.pc-shop .pc-shop__grid > * {
	margin-block: 0;
}

/* Product grid and card ---------------------------------------------------- */

.pc-shop__grid {
	display: grid;
	gap: var(--wp--preset--spacing--70);
}

/* Row gap only: WooCommerce sizes its responsive columns
   around its own 1.25em column gap. */
.pc-shop__grid .wc-block-product-template {
	row-gap: var(--wp--preset--spacing--70);
}

/* Card photos: portrait on phones, nearly square on wide screens
   (handoff frames).
   Setting an aspect ratio on the Product Image block overrides this. */
.pc-shop__grid .wc-block-components-product-image img:not([style*="aspect-ratio"]) {
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

@media (min-width: 80rem) {

	.pc-shop__grid .wc-block-components-product-image img:not([style*="aspect-ratio"]) {
		aspect-ratio: 13 / 12;
	}
}

.pc-shop__grid .wc-block-product {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--20);
}

.pc-shop__grid .wc-block-product > * {
	margin: 0;
}

/* Wishlist heart (ADR-045): over the photo's top-right corner, below a sale
   badge when there is one. */
.pc-shop__grid .wc-block-product {
	position: relative;
}

.pc-shop__grid .wc-block-product > .pc-card__wishlist {
	position: absolute;
	top: var(--wp--preset--spacing--30);
	right: var(--wp--preset--spacing--30);
	z-index: 1;
}

.pc-shop__grid .wc-block-product:has(.wc-block-components-product-sale-badge) > .pc-card__wishlist {
	top: calc(var(--wp--preset--spacing--30) + 3rem);
}

/* Add to bag on a card (the wishlist page), drawn like "Choose size". */
.pc-shop__grid .wc-block-product > .pc-card__add {
	align-self: stretch;
	margin-top: auto;
}

/* One class more than WooCommerce's own button rules, which load later. */
.pc-shop__grid .pc-card__add .wp-block-button__link {
	box-sizing: border-box;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 3rem;
	padding: 0.75rem 1rem;
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	background: none;
	border: 1px solid var(--wp--preset--color--contrast);
	border-radius: 0;
}

.pc-shop__grid .pc-card__add .wp-block-button__link:hover {
	color: var(--wp--preset--color--base);
	background: var(--wp--preset--color--contrast);
}

/* The bag drawer opens after adding (ADR-038), so WooCommerce's extra
   link isn't needed. */
.pc-shop__grid .pc-card__add .added_to_cart {
	display: none;
}

.pc-shop__grid .wc-block-components-product-image {
	margin-bottom: var(--wp--preset--spacing--30);
	background: color-mix(in srgb, var(--wp--preset--color--border) 35%, var(--wp--preset--color--base));
}

.pc-card__title {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	letter-spacing: 0.02em;
	line-height: 1.4;
	text-transform: uppercase;
}

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

.pc-card__title a:hover {
	text-decoration: underline;
}

.pc-card__price {
	font-size: var(--wp--preset--font-size--medium);
}

.wp-block-read-more.pc-card__cta {
	box-sizing: border-box;
	display: flex;
	align-self: stretch;
	width: auto;
	gap: 0.75rem;
	align-items: center;
	justify-content: center;
	min-height: 3rem;
	margin-top: auto;
	padding: 0.75rem 1rem;
	border: 1px solid var(--wp--preset--color--contrast);
	color: inherit;
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-decoration: none;
	text-transform: uppercase;
}

/* Buttons line up along a row whether or not a card has the meta line. */
.pc-shop__grid .wc-block-product > .pc-card__cta {
	margin-top: auto;
}

.pc-shop__grid .wc-block-product > :nth-last-child(2) {
	margin-bottom: var(--wp--preset--spacing--30);
}

.wp-block-read-more.pc-card__cta::after {
	content: "";
	flex: none;
	width: 1.5rem;
	height: 1.5rem;
	background: currentcolor;
	mask: url(../icons/arrow.svg) center / contain no-repeat;
}

.wp-block-read-more.pc-card__cta:hover {
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 6%, transparent);
}

/* Promo, range and pagination --------------------------------------------- */

.pc-shop-promo .wp-block-heading {
	max-width: 12em;
}

.pc-shop__range {
	text-align: center;
}

.pc-pagination {
	gap: 0.5rem;
}

.pc-pagination .page-numbers,
.pc-pagination .wp-block-query-pagination-previous,
.pc-pagination .wp-block-query-pagination-next {
	display: inline-grid;
	place-items: center;
	min-width: 2.75rem;
	height: 2.75rem;
	margin: 0;
	padding: 0 0.5rem;
	border: 1px solid var(--wp--preset--color--border);
	color: inherit;
	text-decoration: none;
}

.pc-pagination .page-numbers.current {
	border-color: var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--contrast);
	color: var(--wp--preset--color--base);
}

.pc-pagination .page-numbers.dots {
	border-color: transparent;
}

.pc-pagination a:hover {
	border-color: var(--wp--preset--color--contrast);
}

/* No results ------------------------------------------------------- */

.pc-no-results .wp-block-heading {
	max-width: 10em;
}
