/* Listing gallery: content-width band, summary below; 50% hero square + 50% 2×2 thumbs. */

body.single-product.wl-listing-product .product-entry-wrapper {
	display: block !important;
}

body.single-product.wl-listing-product .product-entry-wrapper > .woocommerce-product-gallery {
	width: 100% !important;
	max-width: 100%;
	margin-inline: 0 !important;
	margin-bottom: 1.5rem;
	float: none;
}

body.single-product.wl-listing-product .product-entry-wrapper > .entry-summary {
	width: 100% !important;
	max-width: 100%;
	margin-inline-start: 0 !important;
	clear: both;
}

/* Below gallery: title/details ~70% left; from-price + benefits ~30% right. */
@media (min-width: 690px) {
	body.single-product.wl-listing-product .product-entry-wrapper > .summary.entry-summary.entry-summary-items {
		display: block !important;
	}

	body.single-product.wl-listing-product .wl-listing-summary-columns {
		display: grid;
		grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
		column-gap: 32px;
		align-items: start;
		width: 100%;
	}

	body.single-product.wl-listing-product .wl-listing-summary__main,
	body.single-product.wl-listing-product .wl-listing-summary__sidebar {
		min-width: 0;
	}

	body.single-product.wl-listing-product .wl-listing-summary__main > *,
	body.single-product.wl-listing-product .wl-listing-summary__sidebar > * {
		margin-bottom: var(--product-element-spacing, 10px);
	}

	body.single-product.wl-listing-product .wl-listing-summary__main > *:last-child,
	body.single-product.wl-listing-product .wl-listing-summary__sidebar > *:last-child {
		margin-bottom: 0;
	}

	body.single-product.wl-listing-product .wl-listing-summary__sidebar > .ct-product-divider[data-id="divider_2"] {
		display: none;
	}
}

body.single-product .wl-listing-gallery {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	align-items: stretch;
	gap: 8px;
	width: 100%;
	min-width: 0;
}

@media (min-width: 690px) {
	body.single-product .wl-listing-gallery {
		/* Two equal columns: left square hero + right 2×2 square thumbs share the same height. */
		aspect-ratio: 2 / 1;
	}
}

body.single-product .wl-listing-gallery__hero,
body.single-product .wl-listing-gallery__cell {
	position: relative;
	display: block;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	background: #f0f0f0;
	cursor: pointer;
	overflow: hidden;
	border-radius: var(--border-radius, 4px);
	text-align: left;
	color: inherit;
	font: inherit;
}

body.single-product .wl-listing-gallery__hero {
	-webkit-user-select: none;
	user-select: none;
}

body.single-product .wl-listing-gallery__hero {
	grid-column: 1;
	grid-row: 1 / span 2;
	min-height: 0;
	height: 100%;
	min-width: 0;
}

body.single-product .wl-listing-gallery__hero .wl-listing-gallery__media,
body.single-product .wl-listing-gallery__hero > .ct-media-container {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block !important;
}

body.single-product .wl-listing-gallery__hero .ct-media-container,
body.single-product .wl-listing-gallery__cell .ct-media-container,
body.single-product .wl-listing-gallery__hero .wl-listing-gallery__img,
body.single-product .wl-listing-gallery__cell .wl-listing-gallery__img {
	width: 100%;
	height: 100%;
	display: block !important;
	min-width: 0;
}

body.single-product .wl-listing-gallery__hero .ct-media-container img,
body.single-product .wl-listing-gallery__cell .ct-media-container img,
body.single-product .wl-listing-gallery__hero .wl-listing-gallery__img,
body.single-product .wl-listing-gallery__cell .wl-listing-gallery__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

body.single-product .wl-listing-gallery__grid {
	grid-column: 2;
	grid-row: 1 / span 2;
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
	grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
	gap: 8px;
	min-height: 0;
	min-width: 0;
	width: 100%;
}

body.single-product .wl-listing-gallery__cell {
	aspect-ratio: 1 / 1;
}

body.single-product .wl-listing-gallery__cell--empty {
	display: none;
	pointer-events: none;
}

body.single-product .wl-listing-gallery__hero:focus-visible,
body.single-product .wl-listing-gallery__cell:focus-visible {
	outline: 2px solid #222;
	outline-offset: 2px;
}

body.single-product .wl-listing-gallery__hero .wl-show-all-photos-overlay {
	display: none;
}

body.single-product .ct-product-gallery-container:has(.wl-listing-gallery) .woocommerce-product-gallery__trigger {
	display: none !important;
}

body.single-product .ct-product-gallery-container:has(.wl-listing-gallery) {
	display: block;
	width: 100%;
}

body.single-product .woocommerce-product-gallery:has(.wl-listing-gallery) {
	overflow: visible;
}

body.single-product.wl-listing-product .pswp__caption,
body.single-product.wl-listing-product .pswp__caption__center {
	text-align: center;
}

body.single-product.wl-listing-product .pswp__scroll-wrap {
	touch-action: pan-x pan-y pinch-zoom;
}

@media (min-width: 690px) {
	body.single-product .wl-listing-gallery__hero .wl-show-all-photos-overlay {
		display: none !important;
	}
}

@media (max-width: 768px) {
	/* wp-custom-css sets .ct-container-full { margin-top: 25px } — tighten on listings. */
	body.single-product.wl-listing-product #main > .ct-container-full {
		margin-top: 15px;
	}
}

@media (max-width: 689.98px) {
	body.single-product .wl-listing-gallery {
		display: block !important;
	}

	body.single-product .wl-listing-gallery__hero {
		aspect-ratio: 4 / 3;
		touch-action: pan-y;
		-webkit-user-select: none;
		user-select: none;
	}

	body.single-product .wl-listing-gallery__grid {
		display: none;
	}

	body.single-product .wl-listing-gallery__hero .wl-show-all-photos-overlay {
		display: flex !important;
		position: absolute !important;
		inset: 0 !important;
		z-index: 2 !important;
		align-items: flex-end;
		justify-content: flex-end;
		padding: 12px;
		box-sizing: border-box;
		pointer-events: none;
	}

	body.single-product .wl-listing-gallery__hero .wl-show-all-photos-overlay .wl-show-all-photos {
		pointer-events: auto;
		display: inline-flex;
		align-items: center;
		gap: 8px;
		padding: 8px 14px;
		border: none;
		border-radius: 8px;
		background: rgba(0, 0, 0, 0.62);
		color: #f5f5f5;
		font-size: 13px;
		font-weight: 500;
		line-height: 1.2;
		cursor: pointer;
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	}
}
