/*
 * Product page (product-page change): breadcrumbs, gallery, summary, options, add to cart, tabs, size guide, related
 * products. Mobile first; the gallery and the summary sit side by side from 1024px (frames product-detail 3:1961 and
 * product-detail-mobile 3:5935).
 */

/* Breadcrumbs: one line; below 768px the category is hidden and the product name is cut. */

.breadcrumbs {
	padding-block: var(--space-16) var(--space-8);
	color: var(--color-text-muted);
	font-size: 11px;
	line-height: 1.2;
}

.breadcrumbs__list {
	display: flex;
	align-items: center;
	gap: 6px;
	min-width: 0;
	list-style: none;
	white-space: nowrap;
}

.breadcrumbs__item {
	display: flex;
	flex: none;
	align-items: center;
	gap: 6px;
}

.breadcrumbs__item + .breadcrumbs__item::before {
	content: "/";
}

.breadcrumbs__item:last-child {
	flex: 0 1 auto;
	min-width: 0;
}

.breadcrumbs__item:last-child span {
	overflow: hidden;
	text-overflow: ellipsis;
}

.breadcrumbs a:hover {
	color: var(--color-text);
}

@media (max-width: 767px) {
	.breadcrumbs__item--category {
		display: none;
	}
}

@media (min-width: 768px) {
	.breadcrumbs {
		padding-block: var(--space-16);
		font-size: 12px;
	}

	.breadcrumbs__list,
	.breadcrumbs__item {
		gap: var(--space-12);
	}

	.breadcrumbs__item:last-child span {
		color: var(--color-text);
		font-weight: 600;
	}
}

/* WooCommerce notices (added to cart, errors) above the product. */

.product-page__notices:empty,
.product-page__notices .woocommerce-notices-wrapper:empty {
	display: none;
}

/* Stage: gallery and summary. */

.product-stage {
	display: flex;
	flex-direction: column;
	padding-bottom: var(--space-40);
}

@media (min-width: 1024px) {
	.product-stage {
		display: grid;
		grid-template-columns: minmax(0, 1fr) minmax(320px, 660px);
		align-items: start;
		gap: clamp(32px, 4vw - 9px, 60px);
		padding-top: var(--space-16);
		padding-bottom: 55px;
	}
}

/* Gallery: a swiped row below 1024px, the current slide with a thumbnail column from 1024px. */

.product-gallery {
	margin-inline: calc(-1 * var(--page-padding));
}

.product-gallery__slides {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	overscroll-behavior-x: contain;
}

.product-gallery__slides::-webkit-scrollbar {
	display: none;
}

.product-gallery__slide {
	flex: 0 0 100%;
	aspect-ratio: 402 / 360;
	background: var(--color-surface);
	scroll-snap-align: start;
}

.product-gallery__slide img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.product-gallery__thumbs {
	display: none;
}

.product-gallery__open {
	display: block;
	width: 100%;
	height: 100%;
	cursor: zoom-in;
}

/*
 * Full-screen image viewer (motion-and-counters, D6): white, the counter and close button on top, the image as large
 * as the window allows, arrows at the sides and thumbnails below (from 768px). A click on the image zooms it.
 */
.lightbox {
	position: fixed;
	inset: 0;
	width: 100%;
	max-width: none;
	height: 100%;
	max-height: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: var(--color-white);
	color: var(--color-ink);
}

.lightbox[open] {
	display: grid;
	grid-template-rows: auto minmax(0, 1fr) auto;
}

.lightbox::backdrop {
	background: var(--color-white);
}

.lightbox__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: var(--space-8) var(--space-8) var(--space-8) var(--space-24);
}

.lightbox__counter {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1.5px;
}

.lightbox__close,
.lightbox__arrow {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	cursor: pointer;
}

.lightbox__close .icon {
	width: 24px;
	height: 24px;
}

.lightbox__stage {
	position: relative;
	overflow: hidden;
	touch-action: pan-y pinch-zoom;
}

.lightbox__zoom {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	padding: 0 var(--space-16);
	border: 0;
	background: none;
	cursor: zoom-in;
}

.lightbox__image {
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	transition: transform var(--transition);
}

.lightbox__zoom.is-zoomed {
	cursor: zoom-out;
	touch-action: none;
}

.lightbox__zoom.is-zoomed .lightbox__image {
	transform: scale(2);
}

.lightbox__arrow {
	position: absolute;
	top: 50%;
	border: 1px solid var(--color-border);
	border-radius: 50%;
	background: var(--color-white);
	transform: translateY(-50%);
	transition: border-color var(--transition);
}

.lightbox__arrow:hover {
	border-color: var(--color-ink);
}

.lightbox__arrow .icon {
	width: 16px;
	height: 16px;
	stroke-width: 1.5;
}

.lightbox__arrow--prev {
	left: var(--space-16);
}

.lightbox__arrow--prev .icon {
	transform: rotate(180deg);
}

.lightbox__arrow--next {
	right: var(--space-16);
}

.lightbox__zoom.is-zoomed ~ .lightbox__arrow {
	display: none;
}

.lightbox__thumbs {
	display: none;
}

@media (min-width: 768px) {
	.lightbox__bar {
		padding: var(--space-16) var(--space-24) var(--space-16) 40px;
	}

	.lightbox__arrow--prev {
		left: 40px;
	}

	.lightbox__arrow--next {
		right: 40px;
	}

	.lightbox__thumbs {
		display: flex;
		justify-content: center;
		gap: var(--space-12);
		padding: var(--space-16) var(--space-24) var(--space-24);
	}

	.lightbox__thumb {
		display: block;
		width: 64px;
		height: 64px;
		padding: 0;
		border: 1px solid var(--color-border);
		background: var(--color-surface);
		cursor: pointer;
		opacity: 0.6;
		transition: opacity var(--transition), border-color var(--transition);
	}

	.lightbox__thumb:hover,
	.lightbox__thumb[aria-current="true"] {
		border-color: var(--color-ink);
		opacity: 1;
	}

	.lightbox__thumb img {
		width: 100%;
		height: 100%;
		object-fit: cover;
	}
}

@media (min-width: 1024px) {
	.product-gallery {
		display: grid;
		grid-template-columns: minmax(0, 1fr);
		margin-inline: 0;
	}

	.product-gallery--multiple {
		grid-template-columns: 96px minmax(0, 1fr);
		gap: var(--space-24);
	}

	.product-gallery__slides {
		grid-column: -2;
		overflow: visible;
	}

	.product-gallery__slide {
		display: none;
		aspect-ratio: 1;
	}

	.product-gallery__slide.is-current {
		display: block;
	}

	.product-gallery__dots {
		display: none;
	}

	.product-gallery__thumbs {
		display: flex;
		flex-direction: column;
		grid-row: 1;
		grid-column: 1;
		gap: var(--space-16);
		/* As tall as the main image, scrolled when there are more thumbnails than fit. */
		height: 0;
		min-height: 100%;
		overflow-y: auto;
		list-style: none;
		scrollbar-width: thin;
	}

	.product-gallery__thumb {
		display: block;
		overflow: hidden;
		aspect-ratio: 1;
		border: 1px solid var(--color-border);
		border-radius: 2px;
		background: var(--color-surface);
	}

	.product-gallery__thumb[aria-current="true"] {
		border: 2px solid var(--color-accent);
	}

	.product-gallery__thumb img {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.product-gallery__thumb:hover img {
		opacity: 0.85;
	}
}

@media (min-width: 1440px) {
	.product-gallery--multiple {
		grid-template-columns: 160px minmax(0, 1fr);
		gap: 60px;
	}

	.product-gallery__thumbs {
		gap: 53px;
	}
}

/* Summary. */

.product-summary {
	display: flex;
	flex-direction: column;
	gap: var(--space-24);
	padding-top: var(--space-24);
}

.product-summary__head {
	display: flex;
	flex-direction: column;
	gap: var(--space-8);
	padding-bottom: var(--space-24);
	border-bottom: 1px solid var(--color-border);
}

.product-summary__eyebrow {
	color: var(--color-accent);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.product-summary__title {
	font-family: var(--font-serif);
	font-size: 30px;
	font-weight: 700;
	line-height: 1.21;
}

.product-summary__price {
	font-size: 22px;
	font-weight: 500;
	line-height: 1.2;
}

.product-summary__price del {
	color: var(--color-text-muted);
	font-size: 0.75em;
}

.product-summary__price ins {
	text-decoration: none;
}

.product-summary__stock:empty {
	display: none;
}

.product-summary__stock .stock {
	color: var(--color-text-body);
	font-size: 13px;
}

.product-summary__stock .out-of-stock {
	color: var(--color-error);
	font-weight: 600;
}

.product-summary__description,
.product-summary__request p {
	color: var(--color-text-body);
	font-size: 13px;
	line-height: 1.5;
}

.product-summary__request {
	display: flex;
	flex-direction: column;
	gap: var(--space-16);
}

@media (min-width: 1024px) {
	.product-summary {
		gap: var(--space-32);
		padding-top: 0;
	}

	.product-summary__head {
		gap: var(--space-12);
		padding-bottom: var(--space-32);
	}

	.product-summary__eyebrow {
		font-size: 12px;
	}

	.product-summary__title {
		font-size: 40px;
	}

	.product-summary__description,
	.product-summary__request p {
		font-size: 14px;
		line-height: 1.6;
	}
}

/* Options: swatches and size buttons. */

.product-form {
	display: flex;
	flex-direction: column;
	gap: var(--space-24);
}

.product-option {
	position: relative;
}

.product-option__group {
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
}

.product-option__label {
	display: block;
	float: left;
	width: 100%;
	margin-bottom: var(--space-12);
	padding: 0 6em 0 0;
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 1px;
	text-transform: uppercase;
}

.product-option--swatches .product-option__label {
	padding-right: 0;
}

.product-option__chosen {
	color: var(--color-text-body);
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
}

.product-option__values {
	clear: both;
}

.product-option__guide {
	position: absolute;
	top: 0;
	right: 0;
	color: var(--color-accent);
	font-size: 11px;
	line-height: 1.2;
	text-decoration: underline;
	text-underline-offset: 2px;
}

.product-option__guide:hover {
	color: var(--color-text);
}

.product-option__input {
	position: absolute;
	width: 1px;
	height: 1px;
	opacity: 0;
}

.product-option--swatches .product-option__values {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-8);
}

.product-option__swatch {
	position: relative;
	display: flex;
	padding: 3px;
	border-radius: 50%;
	cursor: pointer;
}

.product-option__dot {
	display: block;
	width: 14px;
	height: 14px;
	border-radius: 50%;
	background: var(--swatch, var(--color-border));
	box-shadow: inset 0 0 0 1px rgb(0 0 0 / 8%);
}

.product-option__swatch:has(:checked) {
	box-shadow: 0 0 0 1px var(--color-text);
}

.product-option__swatch:has(:focus-visible) {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

.product-option__swatch.is-unavailable .product-option__dot {
	opacity: 0.35;
	background-image: linear-gradient(135deg, transparent 46%, var(--color-text) 46%, var(--color-text) 54%, transparent 54%);
}

.product-option__button .product-option__text {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 35px;
	padding: 10px 14px;
	border: 1.5px solid var(--color-border);
	color: var(--color-text-body);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	cursor: pointer;
	transition: border-color var(--transition), color var(--transition);
}

.product-option:not(.product-option--swatches) .product-option__values {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
	gap: var(--space-8);
}

.product-option__button:hover .product-option__text,
.product-option__button :checked + .product-option__text {
	border-color: var(--color-text);
	color: var(--color-ink);
}

.product-option__button :focus-visible + .product-option__text {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

.product-option__button.is-unavailable .product-option__text {
	color: var(--color-text-muted);
	text-decoration: line-through;
}

.product-option__error {
	margin-top: var(--space-8);
	color: var(--color-error);
	font-size: 12px;
}

.product-option__error:empty {
	display: none;
}

@media (min-width: 1024px) {
	.product-option__label,
	.product-option__guide {
		font-size: 12px;
	}

	.product-option__guide {
		text-decoration: none;
	}

	.product-option__dot {
		width: 20px;
		height: 20px;
	}

	.product-option__button .product-option__text {
		min-height: 40px;
		padding: 12px 24px;
		color: var(--color-text);
		font-size: 13px;
		font-weight: 400;
	}

	.product-option__button :checked + .product-option__text {
		font-weight: 600;
	}

	.product-option:not(.product-option--swatches) .product-option__values {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		gap: var(--space-12);
	}
}

/* Quantity, add to cart, compare and favorite. */

.product-form__row {
	display: flex;
	gap: var(--space-12);
}

.product-form__row .quantity {
	flex: none;
}

.product-form__submit {
	flex: 1;
	min-width: 0;
	padding-inline: var(--space-16);
	color: var(--color-ink);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 1px;
	border-width: 1px;
}

.product-form__submit:disabled,
.product-form__submit[aria-disabled="true"] {
	border-color: var(--color-border);
	background: transparent;
	color: var(--color-text-muted);
	cursor: not-allowed;
}

.product-form__submit[aria-busy="true"] {
	cursor: progress;
	opacity: 0.6;
}

.product-form__action {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 42px;
	border: 1px solid var(--color-border);
	color: var(--color-text);
	transition: border-color var(--transition), color var(--transition);
}

.product-form__action .icon {
	width: 18px;
	height: 18px;
	stroke-width: 1.5;
}

.product-form__action:hover {
	border-color: var(--color-text);
}

.product-form__action.is-active {
	color: var(--color-accent);
}

.product-form__action--favorite.is-active {
	color: var(--color-favorite);
}

.product-form__message {
	margin-top: calc(-1 * var(--space-12));
	font-size: 13px;
	line-height: 1.4;
}

.product-form__message:empty {
	display: none;
}

.product-form__message.is-error {
	color: var(--color-error);
}

@media (min-width: 1024px) {
	.product-form {
		gap: var(--space-32);
	}

	.product-form__row {
		gap: var(--space-16);
	}

	.product-form__submit {
		font-size: 13px;
		letter-spacing: 2px;
	}

	.product-form__action {
		width: 46px;
	}
}

/* Accordion: FAQ-style items (.faq-item, components.css). */

.product-tabs {
	display: flex;
	flex-direction: column;
	gap: var(--space-16);
}

.product-tabs ul {
	padding: 0;
	list-style: none;
}

.product-tabs li::before {
	content: "• ";
}

/* Tables in the size guide. */

.size-guide__content table {
	width: 100%;
	border-collapse: collapse;
}

.size-guide__content th,
.size-guide__content td {
	padding: var(--space-8) var(--space-12) var(--space-8) 0;
	border-bottom: 1px solid var(--color-border);
	font-weight: 400;
	text-align: left;
	vertical-align: top;
}

.size-guide__content th {
	color: var(--color-text);
	font-weight: 600;
}

/* Size guide: a section at the end of the summary without JavaScript, a dialog with it. */

.size-guide {
	padding-top: var(--space-24);
	border-top: 1px solid var(--color-border);
}

.size-guide__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space-16);
	margin-bottom: var(--space-16);
}

.size-guide__title {
	font-family: var(--font-serif);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.2;
}

.size-guide__close {
	display: flex;
	padding: var(--space-8);
	border: 0;
	background: none;
	color: var(--color-text);
	cursor: pointer;
}

.size-guide__close .icon {
	width: 24px;
	height: 24px;
	stroke-width: 1.5;
}

.size-guide__content {
	color: var(--color-text-body);
	font-size: 13px;
	line-height: 1.6;
}

.size-guide__content > * + * {
	margin-top: var(--space-12);
}

.js .product-summary > .size-guide {
	display: none;
}

.dialog {
	width: min(560px, calc(100% - 2 * var(--space-16)));
	max-height: calc(100% - 2 * var(--space-16));
	margin: auto;
	padding: var(--space-24);
	border: 0;
	background: var(--color-white);
	color: var(--color-text);
}

.dialog::backdrop {
	background: rgb(0 0 0 / 40%);
}

.dialog .size-guide {
	padding-top: 0;
	border-top: 0;
}

@media (min-width: 768px) {
	.dialog {
		padding: var(--space-32);
	}
}

/* Related products: compact cards, 4 in a row from 1200px, 2 from 768px, a swiped row below. */

.related-products {
	padding-block: var(--space-40);
	background: var(--color-surface);
}

.related-products__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-24);
}

.related-products__heading {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: var(--space-4);
	text-align: center;
}

.related-products__eyebrow {
	color: var(--color-accent);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.related-products__title {
	font-family: var(--font-serif);
	font-size: 24px;
	font-weight: 400;
	line-height: 1.21;
}

.related-products__track {
	display: flex;
	align-self: stretch;
	gap: var(--space-16);
	margin-inline: calc(-1 * var(--page-padding));
	padding-inline: var(--page-padding);
	overflow-x: auto;
	scroll-padding-inline: var(--page-padding);
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.related-products__track::-webkit-scrollbar {
	display: none;
}

.related-products__track .product-card {
	flex: 0 0 220px;
	scroll-snap-align: start;
}

.related-products__dots {
	margin-top: calc(-1 * var(--space-16));
}

@media (min-width: 768px) {
	.related-products__track {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		margin-inline: 0;
		padding-inline: 0;
		overflow: visible;
	}

	.related-products__dots {
		display: none;
	}
}

@media (min-width: 1200px) {
	.related-products {
		padding-block: var(--space-80) var(--space-100);
	}

	.related-products__inner {
		gap: 60px;
	}

	.related-products__heading {
		gap: var(--space-12);
	}

	.related-products__eyebrow {
		font-size: 12px;
		letter-spacing: 2.5px;
	}

	.related-products__title {
		font-size: 40px;
	}

	.related-products__track {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		gap: var(--space-40);
	}
}

/* Gallery: the photos of a variant other than the chosen one (main.js swaps the set) stay out of the slides,
   the thumbnails, the dots and the viewer. */
.product-gallery [hidden],
.lightbox__thumbs [hidden] {
	display: none !important;
}
