/* ==========================================================================
   Turbo Reman Center: product page (basic; the owner's own product layout comes later)
   WooCommerce's single-product markup arranged on its hooks (inc/product.php).
   ========================================================================== */

/* Trail on white ---------------------------------------------------------- */

.breadcrumbs--light {
	padding-top: clamp(16px, 2.4vw, 28px);
}

.breadcrumbs--light ol {
	color: var(--c-muted);
}

.breadcrumbs--light li + li::before {
	color: var(--c-line-strong);
}

.breadcrumbs--light a {
	color: var(--c-text);
}

.breadcrumbs--light [aria-current="page"] {
	color: var(--c-ink);
}

@media (hover: hover) and (pointer: fine) {
	.breadcrumbs--light a:hover {
		color: var(--c-ink);
		text-decoration-color: var(--c-red);
	}
}

/* On phones the name follows right under the trail, so the trail stops at the category. */
@media (max-width: 639.98px) {
	.breadcrumbs--light [aria-current="page"] {
		display: none;
	}
}

.product-page .breadcrumbs :focus-visible {
	outline-color: var(--c-red);
}

/* Layout ------------------------------------------------------------------ */

.product-page__inner {
	padding-block: clamp(20px, 3vw, 36px) var(--space-section);
}

/* Photos and summary share their own box (opened and closed on WooCommerce's hooks, inc/product.php), so the
   photos' sticky position ends where the summary ends and never slides over the sections below. */
.product-main {
	display: grid;
	gap: 32px;
	align-items: start;
}

@media (min-width: 768px) {
	.product-main {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		column-gap: clamp(36px, 5vw, 80px);
	}
}

/* Photos -------------------------------------------------------------------- */

.product-gallery {
	display: grid;
	gap: 12px;
	max-width: 600px;
}

/* Beside the summary the photos stay in view while the summary is read. */
@media (min-width: 768px) {
	.product-gallery {
		position: sticky;
		top: calc(var(--header-top) + var(--header-nav) + 16px);
	}
}

@media (min-width: 1024px) {
	.product-gallery {
		top: calc(var(--header-nav) + 24px);
	}
}

.product-gallery__main,
.product-gallery__tile {
	position: relative;
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	border-radius: var(--radius-lg);
	background: var(--c-dark-3);
	cursor: zoom-in;
	transition: box-shadow 0.3s var(--ease-out), transform 0.16s var(--ease-out);
}

.product-gallery__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.8s var(--ease-out);
}

.product-gallery__more {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

.product-gallery__main:active,
.product-gallery__tile:active {
	transform: scale(0.985);
}

@media (hover: hover) and (pointer: fine) {
	.product-gallery__main:hover,
	.product-gallery__tile:hover {
		box-shadow: var(--shadow-1);
	}

	.product-gallery__main:hover .product-gallery__img,
	.product-gallery__tile:hover .product-gallery__img {
		transform: scale(1.03);
	}
}

@media (prefers-reduced-motion: reduce) {
	.product-gallery__img,
	.product-gallery__main,
	.product-gallery__tile {
		transition: none;
	}

	.product-gallery__main:hover .product-gallery__img,
	.product-gallery__tile:hover .product-gallery__img,
	.product-gallery__main:active,
	.product-gallery__tile:active {
		transform: none;
	}
}

/* Summary --------------------------------------------------------------------- */

.product-page .summary {
	display: grid;
	align-content: start;
	min-width: 0;
}

.product-page .product_title {
	max-width: 20ch;
	font-size: clamp(2rem, 1.45rem + 1.9vw, 3rem);
	line-height: 1.02;
	overflow-wrap: anywhere;
}

.fitment {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 16px;
	list-style: none;
}

.fitment__tag {
	display: inline-flex;
	align-items: center;
	min-height: 40px;
	padding: 0 16px;
	border-radius: var(--radius-pill);
	background: var(--c-surface);
	color: var(--c-ink);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
	transition: background-color 0.15s ease, box-shadow 0.15s ease;
}

@media (hover: hover) and (pointer: fine) {
	.fitment__tag:hover {
		background: var(--c-white);
		box-shadow: inset 0 0 0 1px var(--c-line-strong);
		color: var(--c-ink);
	}
}

.product-page .summary > .price {
	margin-top: 26px;
	color: var(--c-ink);
	font-family: var(--font-display);
	font-size: clamp(2.25rem, 1.8rem + 1.4vw, 3rem);
	font-weight: 600;
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.product-page .summary > .price del {
	margin-right: 10px;
	color: var(--c-muted);
	font-size: 0.6em;
}

.product-page .summary > .price ins {
	text-decoration: none;
}

/* "Check your part number": jumps to the checker under the photos. */
.part-check-link {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	justify-self: start;
	min-height: 44px;
	margin-top: 8px;
	color: var(--c-ink);
	font-size: 0.9375rem;
	font-weight: 500;
	text-decoration: none;
}

.part-check-link .icon {
	width: 18px;
	height: 18px;
	color: var(--c-red);
}

.part-check-link__text {
	text-decoration: underline;
	text-decoration-color: rgb(229 39 39 / 0.45);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.25em;
	transition: text-decoration-color 0.15s ease;
}

.part-check-link__count {
	color: var(--c-muted);
	font-size: 0.875rem;
	font-weight: 400;
}

@media (hover: hover) and (pointer: fine) {
	.part-check-link:hover {
		color: var(--c-ink);
	}

	.part-check-link:hover .part-check-link__text {
		text-decoration-color: var(--c-red);
	}
}

/* The core deposit, with the answer from the FAQ opening in place. */
.price-note {
	margin-top: 10px;
	color: var(--c-text);
	font-size: 0.9375rem;
}

.price-note summary {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 2px 8px;
	min-height: 32px;
	cursor: pointer;
	list-style: none;
}

.price-note summary::-webkit-details-marker {
	display: none;
}

.price-note__toggle {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	color: var(--c-red-600);
	font-weight: 500;
}

.price-note__toggle .icon {
	width: 14px;
	height: 14px;
	transition: transform 0.2s var(--ease-out);
}

.price-note[open] .price-note__toggle .icon {
	transform: rotate(180deg);
}

.price-note__answer {
	max-width: 52ch;
	margin-top: 8px;
	padding: 12px 16px;
	border-radius: var(--radius-sm);
	background: var(--c-surface);
	line-height: 1.55;
}

@media (prefers-reduced-motion: no-preference) {
	@supports (interpolate-size: allow-keywords) {
		.price-note {
			interpolate-size: allow-keywords;
		}

		.price-note::details-content {
			height: 0;
			overflow: clip;
			transition: height 0.25s var(--ease-out), content-visibility 0.25s allow-discrete;
		}

		.price-note[open]::details-content {
			height: auto;
		}
	}
}

.stock-line {
	display: flex;
	align-items: center;
	gap: 8px;
	margin-top: 14px;
	color: var(--c-ink);
	font-size: 0.9375rem;
	font-weight: 500;
}

.stock-line .icon {
	width: 18px;
	height: 18px;
	color: var(--c-red);
}

.product-page .summary .stock {
	margin-top: 14px;
	font-weight: 500;
}

.product-page .summary .out-of-stock {
	color: var(--c-red-600);
}

.woocommerce-product-details__short-description {
	margin-top: 20px;
	max-width: 60ch;
}

/* Add to cart: WooCommerce's form (quantity and button), as the shop's large pill. */
.product-page form.cart {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin-top: 28px;
}

.product-page .quantity .qty {
	width: 96px;
	height: 56px;
	padding: 0 12px;
	border: 1px solid var(--c-line-strong);
	border-radius: var(--radius-pill);
	background: var(--c-white);
	color: var(--c-ink);
	font-weight: 600;
	text-align: center;
	font-variant-numeric: tabular-nums;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-page .quantity .qty:focus-visible {
	border-color: var(--c-red);
	outline: none;
	box-shadow: 0 0 0 4px rgb(229 39 39 / 0.14);
}

/* With the script: one pill holding minus, the number and plus. */
.product-page .quantity.has-steps {
	display: inline-flex;
	align-items: center;
	height: 56px;
	padding-inline: 5px;
	border: 1px solid var(--c-line-strong);
	border-radius: var(--radius-pill);
	background: var(--c-white);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product-page .quantity.has-steps:focus-within {
	border-color: var(--c-red);
	box-shadow: 0 0 0 4px rgb(229 39 39 / 0.14);
}

.product-page .quantity.has-steps .qty {
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	box-shadow: none;
	-moz-appearance: textfield;
	appearance: textfield;
}

.product-page .quantity.has-steps .qty::-webkit-inner-spin-button,
.product-page .quantity.has-steps .qty::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.qty-step {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--c-ink);
	transition: background-color 0.15s ease, transform 0.16s var(--ease-out);
}

.qty-step .icon {
	width: 18px;
	height: 18px;
}

.qty-step:active:not(:disabled) {
	transform: scale(0.92);
}

.qty-step:disabled {
	color: var(--c-line-strong);
	cursor: default;
}

@media (hover: hover) and (pointer: fine) {
	.qty-step:hover:not(:disabled) {
		background: var(--c-surface);
	}
}

.product-page .single_add_to_cart_button.is-added {
	border-color: var(--c-ink);
	background: var(--c-ink);
}

.product-page .single_add_to_cart_button.is-loading {
	cursor: progress;
}

.product-promises {
	display: grid;
	gap: 10px;
	margin-top: 22px;
	list-style: none;
}

.product-promises li {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	font-size: 0.9375rem;
	line-height: 1.45;
}

.product-promises .icon {
	width: 20px;
	height: 20px;
	margin-top: 1px;
	color: var(--c-red);
}

/* Description and specifications ----------------------------------------------- */

.product-details {
	display: grid;
	gap: 40px;
	margin-top: clamp(24px, 4vw, 56px);
	padding-top: clamp(36px, 5vw, 64px);
	border-top: 1px solid var(--c-line);
}

@media (min-width: 768px) {
	.product-details {
		grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
		column-gap: clamp(36px, 5vw, 80px);
	}

	.product-details__panel:only-child {
		grid-column: 1 / -1;
	}
}

.product-details h2 {
	margin-bottom: 16px;
	font-size: clamp(1.75rem, 1.4rem + 1vw, 2.25rem);
}

.woocommerce-Tabs-panel--description {
	max-width: 66ch;
	overflow-wrap: anywhere;
}

.woocommerce-Tabs-panel--description strong {
	color: var(--c-ink);
	font-weight: 500;
}

.shop_attributes {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.shop_attributes th,
.shop_attributes td {
	padding: 12px 0;
	border-bottom: 1px solid var(--c-line);
	text-align: left;
	vertical-align: top;
}

.shop_attributes tr:first-child th,
.shop_attributes tr:first-child td {
	border-top: 1px solid var(--c-line);
}

.shop_attributes th {
	width: 42%;
	padding-right: 16px;
	color: var(--c-muted);
	font-weight: 500;
}

.shop_attributes td {
	color: var(--c-ink);
}

.shop_attributes td p {
	margin: 0;
}

/* Related parts ------------------------------------------------------------------ */

.product-page .related,
.product-page .upsells {
	margin-top: clamp(56px, 7vw, 96px);
}

.product-page .related > h2,
.product-page .upsells > h2 {
	margin-bottom: clamp(20px, 3vw, 32px);
	font-size: clamp(2rem, 1.5rem + 1.6vw, 2.75rem);
}

/* Google rating under the promises ------------------------------------------------ */

.product-rating {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-self: start;
	gap: 6px 8px;
	min-height: 44px;
	margin-top: 10px;
	color: var(--c-text);
	font-size: 0.875rem;
	text-decoration: none;
}

.product-rating__g {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--c-white);
	box-shadow: inset 0 0 0 1px var(--c-line);
}

.product-rating strong {
	color: var(--c-ink);
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 600;
	line-height: 1;
}

@media (hover: hover) and (pointer: fine) {
	.product-rating:hover {
		color: var(--c-ink);
	}

	.product-rating:hover .product-rating__count {
		text-decoration: underline;
		text-decoration-color: var(--c-red);
		text-underline-offset: 0.2em;
	}
}

/* Part numbers with the checker ------------------------------------------------------ */

.part-numbers {
	scroll-margin-top: calc(var(--header-top) + var(--header-nav) + 16px);
}

@media (min-width: 1024px) {
	.part-numbers {
		scroll-margin-top: calc(var(--header-nav) + 24px);
	}
}

.part-numbers__head {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 14px;
	margin-bottom: 16px;
}

.product-details .part-numbers__title {
	margin-bottom: 0;
}

.part-numbers__count {
	color: var(--c-muted);
	font-size: 0.9375rem;
	font-variant-numeric: tabular-nums;
}

.part-check {
	margin-bottom: 18px;
}

.part-check__label {
	display: block;
	margin-bottom: 8px;
	color: var(--c-ink);
	font-weight: 500;
}

.part-check__field {
	position: relative;
	max-width: 420px;
}

.part-check__field .icon {
	position: absolute;
	top: 50%;
	left: 18px;
	width: 20px;
	height: 20px;
	color: var(--c-muted);
	transform: translateY(-50%);
	pointer-events: none;
}

.part-check__input {
	width: 100%;
	height: 52px;
	padding: 0 20px 0 48px;
	border: 1px solid var(--c-line-strong);
	border-radius: var(--radius-pill);
	background: var(--c-white);
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.02em;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
	-webkit-appearance: none;
	appearance: none;
}

.part-check__input::placeholder {
	color: #767676;
	letter-spacing: 0;
}

.part-check__input:focus {
	border-color: var(--c-red);
	outline: none;
	box-shadow: 0 0 0 4px rgb(229 39 39 / 0.14);
}

.part-check__result {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 4px 8px;
	margin-top: 10px;
	color: var(--c-text);
	font-size: 0.9375rem;
}

.part-check__result:empty {
	display: none;
}

.part-check__result .icon {
	width: 20px;
	height: 20px;
	padding: 3px;
	border-radius: 50%;
	background: var(--c-red);
	color: var(--c-white);
}

.part-check__result.is-ok {
	color: var(--c-ink);
	font-weight: 500;
}

.part-check__result.is-none a {
	font-weight: 500;
}

.part-numbers__list {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
	gap: 6px;
	list-style: none;
}

.part-numbers__list li {
	padding: 7px 12px;
	border-radius: var(--radius-sm);
	background: var(--c-surface);
	color: var(--c-ink);
	font-size: 0.9375rem;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.01em;
	overflow-wrap: anywhere;
	transition: background-color 0.15s ease, color 0.15s ease;
}

.part-numbers__list li.is-match {
	background: var(--c-red);
	color: var(--c-white);
	font-weight: 500;
}

.part-numbers__list li:focus {
	outline: none;
}

.part-numbers__more {
	margin-top: 14px;
	min-height: 44px;
	padding: 0.5em 1.3em;
	font-size: 0.9375rem;
}

/* Bar at the bottom of phones and tablets ------------------------------------------------ */

.buybar {
	position: fixed;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 45;
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 10px max(var(--gutter), env(safe-area-inset-right, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(var(--gutter), env(safe-area-inset-left, 0px));
	border-top: 1px solid var(--c-line);
	background: var(--c-white);
	box-shadow: 0 -14px 28px -22px rgb(20 20 20 / 0.55);
	transform: translateY(105%);
	visibility: hidden;
	transition:
		transform 0.3s var(--ease-drawer),
		visibility 0s linear 0.3s;
}

.buybar.is-visible {
	transform: none;
	visibility: visible;
	transition:
		transform 0.3s var(--ease-drawer),
		visibility 0s;
}

@media (min-width: 1024px) {
	.buybar {
		display: none;
	}
}

.buybar__info {
	flex: 1;
	min-width: 0;
}

.buybar__name {
	overflow: hidden;
	color: var(--c-muted);
	font-size: 0.8125rem;
	line-height: 1.3;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.buybar__price {
	color: var(--c-ink);
	font-family: var(--font-display);
	font-size: 1.375rem;
	font-weight: 600;
	line-height: 1.1;
	font-variant-numeric: tabular-nums;
}

.buybar__price del {
	margin-right: 6px;
	color: var(--c-muted);
	font-size: 0.75em;
}

.buybar__price ins {
	text-decoration: none;
}

.buybar__call {
	display: grid;
	flex: none;
	place-items: center;
	width: 48px;
	height: 48px;
	border: 2px solid var(--c-red);
	border-radius: 50%;
	color: var(--c-red);
	transition: transform 0.16s var(--ease-out);
}

.buybar__call .icon {
	width: 22px;
	height: 22px;
}

.buybar__call:active {
	transform: scale(0.94);
}

.buybar__add {
	flex: none;
	min-height: 48px;
	padding: 0.6em 1.3em;
}

.buybar__add.is-added {
	--btn-bg: var(--c-ink);
	--btn-border: var(--c-ink);
}

/* Things fixed to the bottom make room for the bar while it shows; the footer ends above it. */
html.has-buybar .back-to-top {
	bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

html.has-buybar .cart-toast {
	bottom: calc(84px + env(safe-area-inset-bottom, 0px));
}

@media (max-width: 1023.98px) {
	body:has(.buybar) .site-footer__bar-inner {
		padding-bottom: calc(88px + env(safe-area-inset-bottom, 0px));
	}
}

@media (prefers-reduced-motion: reduce) {
	.buybar,
	.buybar.is-visible {
		transition: visibility 0s;
	}
}
