/**
 * Product page (ADR-037): breadcrumbs, gallery, buy panel, detail sections,
 * the editorial story and related products.
 *
 * Gallery and buy panel sit side by side from 1024px (64rem), where the
 * panel sticks under the compact header; they stack below that.
 */

/* Hero layout -------------------------------------------------------------- */

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

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

.pc-product__breadcrumbs {
	font-size: var(--wp--preset--font-size--small);
}

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

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

.pc-product__layout {
	display: grid;
	row-gap: var(--wp--preset--spacing--70);
	align-items: start;
}

.pc-product__layout > * {
	min-width: 0;
	margin-block: 0;
}

@media (min-width: 64rem) {

	.pc-product__layout {
		grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
		column-gap: var(--wp--preset--spacing--80);
	}

	.pc-product__panel {
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--custom--header--compact-height-wide, 80px) + var(--wp--preset--spacing--40));
	}
}

/* Gallery: main image with thumbnails underneath --------------------------- */

/* Block settings do the layout: vertical (thumbnails in a row underneath),
   4:5 frames like the design's product shots, and WooCommerce fits the whole
   photo inside. */
.pc-product__gallery.wc-block-product-gallery {
	gap: var(--wp--preset--spacing--30);
}

.pc-product__gallery .wc-block-product-gallery-large-image {
	width: 100%;
	background: color-mix(in srgb, var(--wp--preset--color--border) 35%, var(--wp--preset--color--base));
}

.pc-product__gallery .wc-block-product-gallery-thumbnails__scrollable {
	gap: var(--wp--preset--spacing--20);
}

/* Buy panel ---------------------------------------------------------------- */

.pc-product__panel {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--40);
}

.pc-product .pc-product__panel > * {
	margin: 0;
}

/* Long names: a word of about 12 Cinzel capitals stays whole at 1024. */
.pc-product__title {
	letter-spacing: 0.02em;
}

/* The category line above the title, styled as an eyebrow (ADR-050). */
.pc-product__eyebrow {
	font-family: var(--wp--preset--font-family--accent);
	font-size: 1.75rem;
	line-height: 1.2;
}

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

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

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

.pc-product__summary p {
	margin: 0;
}

/* Add-to-cart area: size choices, note, stock, quantity and button. */

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

.pc-product__buy > *,
.pc-product__buy form > * {
	margin-block: 0;
}

/* Stretches the label row and the chips (core's vertical stack aligns left). */
.wp-block-group.pc-buy__attribute {
	align-items: stretch;
}

.pc-buy__attribute-head {
	align-items: baseline;
}

.pc-buy__attribute-name {
	font-size: var(--wp--preset--font-size--x-small);
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

.pc-buy__chips .wc-block-product-filter-chips__items {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--wp--preset--spacing--20);
}

.pc-buy__chips .wc-block-product-filter-chips__item {
	box-sizing: border-box;
	justify-content: center;
	min-height: 3rem;
	padding: 0.5rem;
	border: 1px solid var(--wp--custom--color--control-border);
	border-radius: 0;
	background: transparent;
	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;
	cursor: pointer;
}

.pc-buy__chips .wc-block-product-filter-chips__item:hover {
	border-color: var(--wp--preset--color--contrast);
}

.pc-buy__chips .wc-block-product-filter-chips__item[aria-checked="true"] {
	border-color: var(--wp--preset--color--contrast);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--contrast);
	background: color-mix(in srgb, var(--wp--preset--color--contrast) 6%, transparent);
}

.pc-buy__chips .wc-block-product-filter-chips__item:focus-visible {
	outline: 2px solid var(--wp--custom--color--focus, currentcolor);
	outline-offset: 2px;
}

/* Sizes that can't be bought: struck through as well as dimmer, so the state
   doesn't rely on colour (handoff review). */
.pc-buy__chips .wc-block-product-filter-chips__item:disabled {
	border-style: dashed;
	color: var(--wp--preset--color--contrast-alt);
	text-decoration: line-through;
	cursor: not-allowed;
	opacity: 1;
}

.pc-buy__note {
	color: var(--wp--preset--color--contrast-alt);
}

.pc-buy__actions {
	gap: var(--wp--preset--spacing--30);
}

/* "Save to wishlist" under the actions (ADR-045). */
.pc-buy__wishlist {
	margin-top: var(--wp--preset--spacing--30);
}

.pc-buy__actions .wc-block-components-quantity-selector {
	box-sizing: border-box;
	flex: none;
	width: 7rem;
	min-height: 3.25rem;
	margin: 0;
	border: 1px solid var(--wp--custom--color--control-border);
	border-radius: 0;
}

.pc-buy__actions .wc-block-components-quantity-selector::after {
	border: 0;
}

/* Outranks WooCommerce's inline button rules, which shrink it to its text. */
.pc-buy__actions .wp-block-button.pc-buy__button {
	flex: 1 1 auto;
	align-items: stretch;
	margin: 0;
}

.pc-buy__actions .wp-block-button.pc-buy__button .wp-block-button__link {
	box-sizing: border-box;
	display: flex;
	gap: 0.75rem;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 3.25rem;
	padding: 0.75rem 1rem;
	border: 1px solid var(--wp--preset--color--contrast);
	border-radius: 0;
	background: var(--wp--preset--color--accent);
	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;
}

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

.pc-buy__actions .wp-block-button.pc-buy__button .wp-block-button__link:hover {
	background: var(--wp--custom--color--pattern, var(--wp--preset--color--accent));
}

/* Detail sections (accordions) ------------------------------------------- */

.pc-accordion .wp-block-accordion-item {
	border-bottom: 1px solid var(--wp--preset--color--border);
}

.pc-accordion .wp-block-accordion-heading {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 400;
	line-height: 1.4;
}

.pc-accordion .wp-block-accordion-heading__toggle {
	padding-block: var(--wp--preset--spacing--40);
}

.pc-accordion .wp-block-accordion-heading__toggle-icon {
	font-size: 1.5rem;
	font-weight: 300;
	line-height: 1;
}

.pc-accordion .wp-block-accordion-panel {
	padding-bottom: var(--wp--preset--spacing--40);
}

.pc-accordion .wp-block-accordion-panel p {
	margin-block: 0 var(--wp--preset--spacing--30);
}

/* Editorial story -------------------------------------------------------- */

/* Until a photo is added, the image half shows a soft butter tint. */
.pc-product-story .wp-block-media-text__media:empty {
	min-height: 20rem;
	background: color-mix(in srgb, var(--wp--preset--color--accent) 55%, var(--wp--preset--color--base));
}

.pc-product-story .wp-block-media-text__content {
	box-sizing: border-box;
	max-width: 38rem;
	padding: var(--wp--preset--spacing--80) var(--wp--style--root--padding-right);
}

@media (min-width: 64rem) {

	.pc-product-story .wp-block-media-text__content {
		padding: var(--wp--preset--spacing--90) var(--wp--preset--spacing--80);
	}
}

.pc-product-story .wp-block-media-text__content > * {
	margin-block: 0 var(--wp--preset--spacing--50);
}

/* Related products ("Lovely together"), using the shop card ------------- */

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

.pc-related .pc-shop__grid {
	margin-top: var(--wp--preset--spacing--40);
}

/* WooCommerce marks the button "disabled" until a size is chosen, but a click
   still explains what is missing, so it keeps its full colour. */
.pc-buy__actions .wp-block-button.pc-buy__button .wp-block-button__link.disabled {
	opacity: 1;
	cursor: pointer;
}
