/**
 * Single product template (redesign/single-product.php).
 * Depends on tokens.css, global.css (.dh-btn, .dh-prose, .dh-heading-48,
 * .dh-section--bg-cream, .dh-list-reset) and product-card.css.
 */

.dh-single-product__back {
	margin-bottom: var(--dh-space-48);
}

/* Image left, summary right (708 / 584 in Figma). */
.dh-single-product__row {
	display: grid;
	grid-template-columns: minmax(0, var(--dh-single-media)) minmax(0, var(--dh-single-summary));
	justify-content: space-between;
	align-items: start;
	gap: var(--dh-space-64);
}

.dh-single-product__media {
	min-width: 0;
}

/* Gallery: 4:3 main image, thumbnails below. */

/* Astra's WooCommerce CSS gives .images a fixed width on single products. */
body.single-product .dh-single-product__row .dh-gallery.images {
	width: 100%;
}

.dh-gallery {
	display: flex;
	flex-direction: column;
	gap: var(--dh-space-16);
}

.dh-gallery__main {
	position: relative;
	overflow: hidden;
	aspect-ratio: 4 / 3;
}

/* Hover zoom (product-gallery.js): full-size image over the main one,
 * moved with the cursor. Mouse devices only. */
.dh-gallery__zoom {
	position: absolute;
	inset: 0;
	background-repeat: no-repeat;
	opacity: 0;
	pointer-events: none;
	transition: opacity var(--dh-transition-fast);
}

.dh-gallery__main.is-zooming {
	cursor: zoom-in;
}

.dh-gallery__main.is-zooming .dh-gallery__zoom {
	opacity: 1;
}

/* Images with transparency (PNG) would show the main image through the
 * zoom layer, so the main image is hidden while zooming. */
.dh-gallery__main.is-zooming .dh-gallery__img {
	opacity: 0;
}

.dh-gallery__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dh-gallery__thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: var(--dh-space-12);
}

.dh-gallery__thumb {
	display: block;
	width: var(--dh-thumb-md);
	height: var(--dh-thumb-md);
	padding: 0;
	overflow: hidden;
	background: none;
	border: var(--dh-border-width-button) solid transparent;
	border-radius: var(--dh-radius-field);
	cursor: pointer;
}

.dh-gallery__thumb[aria-pressed="true"] {
	border-color: var(--dh-color-heading);
}

.dh-gallery__thumb-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.dh-single-product__summary {
	display: flex;
	flex-direction: column;
	gap: var(--dh-space-32);
	padding-top: var(--dh-space-64);
}

.dh-single-product__title {
	font-size: var(--dh-fs-heading-40);
	line-height: var(--dh-lh-heading);
	color: var(--dh-color-heading);
	text-transform: uppercase;
}

.dh-single-product__title + .dh-single-product__excerpt {
	margin-top: calc(var(--dh-space-8) * -1);
}

.dh-single-product__excerpt {
	font-size: var(--dh-fs-body-20);
	line-height: var(--dh-lh-tight);
	color: var(--dh-color-text);
}

.dh-single-product__excerpt > * + * {
	margin-top: var(--dh-space-12);
}

.dh-single-product__form {
	display: flex;
	flex-direction: column;
	gap: var(--dh-space-24);
}

/* Labels share one column, so all selects start at the same x. */
.dh-single-product__options {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	align-items: center;
	gap: var(--dh-space-16) var(--dh-space-12);
}

.dh-single-product__option {
	display: contents;
}

.dh-single-product__label {
	font-size: var(--dh-fs-body-18);
	font-weight: var(--dh-fw-medium);
	line-height: var(--dh-lh-tight);
	color: var(--dh-color-heading);
}

.dh-single-product__select {
	width: 100%;
	min-width: 0;
	padding: var(--dh-field-padding);
	font-size: var(--dh-field-font-size);
	line-height: var(--dh-lh-tight);
	color: var(--dh-field-color);
	background-color: var(--dh-field-bg);
	border: var(--dh-border-width) solid var(--dh-color-border-field);
	border-radius: var(--dh-radius-field);
}

/* "Choose an option" still selected. */
.dh-single-product__select:has(option[value=""]:checked) {
	color: var(--dh-field-placeholder);
}

.dh-single-product__select option {
	color: var(--dh-field-color);
}

.dh-single-product__price {
	font-size: var(--dh-fs-body-32);
	font-weight: var(--dh-fw-bold);
	line-height: var(--dh-lh-tight);
	color: var(--dh-color-accent-text);
	text-align: right;
}

.dh-single-product__price del {
	margin-right: var(--dh-space-8);
	font-size: var(--dh-fs-body-20);
	font-weight: var(--dh-fw-regular);
	color: var(--dh-color-text-muted);
}

.dh-single-product__price ins {
	text-decoration: none;
}

/* Woo writes variation price / stock messages here after a selection. */
.dh-single-product__variation,
.dh-single-product__stock {
	font-size: var(--dh-fs-body-16);
	color: var(--dh-color-text);
}

.dh-single-product .single_variation_wrap {
	display: flex;
	flex-direction: column;
	gap: var(--dh-space-12);
}

/* Large add to cart button (Bebas 24 in Figma). */
.dh-single-product__btn {
	--dh-btn-font-size: var(--dh-fs-heading-24);
	padding-block: var(--dh-space-24);
}

/* Long description: full content width of the Figma text column. */
.dh-single-product__description {
	max-width: var(--dh-container-shop);
	margin-top: var(--dh-space-48);
}

/* You might also like */
.dh-single-product__related-title {
	margin-bottom: var(--dh-space-48);
	color: var(--dh-color-heading);
	text-transform: uppercase;
}

.dh-single-product__related .dh-single-product__related-list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, var(--dh-card-product)));
	gap: var(--dh-space-32);
}

.dh-single-product__related-item {
	display: flex;
	min-width: 0;
}

.dh-single-product__related-item > .dh-product-card {
	width: 100%;
}

@media screen and (max-width: 1200px) {
	.dh-single-product__row {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		gap: var(--dh-space-48);
	}

	.dh-single-product__summary {
		padding-top: 0;
	}

	.dh-single-product__related .dh-single-product__related-list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: var(--dh-space-24);
	}
}

@media only screen and (max-width: 768px) {
	.dh-single-product__back {
		margin-bottom: var(--dh-space-32);
	}

	.dh-single-product__row {
		grid-template-columns: minmax(0, 1fr);
		gap: var(--dh-space-32);
	}

	.dh-single-product__related-title {
		margin-bottom: var(--dh-space-32);
	}

	.dh-single-product__related .dh-single-product__related-list {
		grid-template-columns: minmax(0, 1fr);
	}
}