/* ==========================================================================
   PDP above the fold (reference layout)
   Gallery grid + popup, breadcrumb, title/tagline, price + colour line,
   size row, alert, Add to bag card, Find in store card.
   ========================================================================== */

.yb.single-product {
	--yb-pdp-red: #D22030;
	--yb-pdp-red-dark: #A91A27;
	--yb-pdp-line: #E5E5E5;
	--yb-pdp-grey: #EDEDED;
	--yb-pdp-muted: #555;
}

/* ---------- Columns: gallery ~58%, buy box ~42% (max 460px) ---------- */
@media (min-width: 1025px) {
	.yb.single-product .product-image-summary-inner > .product-images {
		flex: 0 0 58%;
		max-width: 58%;
	}
	.yb.single-product .product-image-summary-inner > .summary {
		flex: 0 0 42%;
		max-width: 42%;
		padding-left: 40px;
	}
	.yb.single-product .product-image-summary-inner > .summary .summary-inner {
		max-width: 460px;
	}
}

/* ---------- Gallery: two-column grid on light grey ---------- */
/* WoodMart's slider stays in the DOM (variation scripts) but is hidden once the grid exists. */
.yb.single-product .product-images-inner.yb-pdp-ready > .woocommerce-product-gallery { display: none !important; }
/* Avoid a flash of the slider before the grid is built; shows anyway after 2.5s if JS fails. */
.yb.single-product .product-images-inner:not(.yb-pdp-ready) > .woocommerce-product-gallery {
	opacity: 0;
	animation: yb-pdp-show 0s linear 2.5s forwards;
}
@keyframes yb-pdp-show { to { opacity: 1; } }

.yb .yb-pdp-grid {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
}
.yb .yb-pdp-grid__item {
	position: relative;
	display: block;
	width: 100%;
	min-height: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: var(--yb-pdp-grey, #EDEDED);
	aspect-ratio: 390 / 470;
	overflow: hidden;
	cursor: zoom-in;
	box-shadow: none;
}
.yb .yb-pdp-grid__item:hover,
.yb .yb-pdp-grid__item:focus { background: var(--yb-pdp-grey, #EDEDED); }
.yb .yb-pdp-grid__item:focus-visible { outline: 2px solid #111; outline-offset: -2px; }
.yb .yb-pdp-grid__item > img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: contain;
	border-radius: 0 !important;
	mix-blend-mode: multiply; /* white studio backgrounds read as the grey tile */
}
.yb .yb-pdp-grid--single { grid-template-columns: 1fr; }
.yb .yb-pdp-grid--single .yb-pdp-grid__item {
	aspect-ratio: auto;
	height: clamp(420px, 82vh, 860px);
}

/* Badge: black pill top-left of image 1 */
.yb .yb-pdp-badge {
	position: absolute;
	top: 16px;
	left: 16px;
	z-index: 3;
	padding: 5px 10px;
	border-radius: 4px;
	background: #111;
	color: #fff;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.2;
	letter-spacing: 0;
	text-transform: none;
	pointer-events: none;
}

/* Heart: small white circle top-right of image 2 (moved in by pdp-top.js) */
.yb .yb-pdp-grid__item .yb-gallery-heart {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 4;
	margin: 0;
	cursor: pointer;
}
.yb .yb-pdp-grid__item .yb-gallery-heart > a {
	width: 34px;
	height: 34px;
	padding: 0;
	border-radius: 50%;
	background: #fff;
	color: #111;
	box-shadow: 0 1px 3px rgba(0, 0, 0, .08);
}
.yb .yb-pdp-grid__item .yb-gallery-heart > a::before { font-size: 16px; }

/* Wishlist lives on the image only — hide the text link in the buy box */
.yb.single-product .summary .wd-wishlist-btn:not(.yb-gallery-heart) { display: none !important; }
/* Old "click to enlarge" button + WoodMart labels inside the slider */
.yb.single-product .product-images .wd-show-product-gallery-wrap { display: none !important; }

/* ---------- Image popup: large white modal, images stacked ---------- */
html.yb-pdp-popup-open,
html.yb-pdp-popup-open body { overflow: hidden; }
.yb-pdp-popup {
	position: fixed;
	inset: 0;
	/* Overlay tier 100040 (INTEGRATION-3 S7): above the mobile drawer (100000), below the
	   added-to-bag modal (100050) that can be opened from inside this popup. */
	z-index: 100040;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vh 16px;
	background: rgba(0, 0, 0, .55);
}
.yb-pdp-popup[hidden] { display: none !important; }
.yb-pdp-popup__panel {
	position: relative;
	width: min(80vw, 1100px);
	height: 92vh;
	background: #fff;
	border-radius: 4px;
	overflow: hidden;
}
.yb-pdp-popup__close {
	position: absolute;
	top: 12px;
	right: 12px;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	min-height: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #fff;
	color: #111;
	cursor: pointer;
}
.yb-pdp-popup__close:hover { background: #f2f2f2; }
.yb-pdp-popup__scroll {
	height: 100%;
	overflow-y: auto;
	overscroll-behavior: contain;
	padding: 56px 24px 24px;
}
.yb-pdp-popup__item {
	max-width: 760px;
	margin: 0 auto 16px;
	background: #EDEDED;
}
.yb-pdp-popup__item img {
	display: block;
	width: 100%;
	height: auto;
	mix-blend-mode: multiply;
}

/* ---------- Breadcrumb: category link only, no prev/next ---------- */
.yb.single-product .single-breadcrumbs-wrapper { margin-bottom: 8px; }
.yb.single-product .single-breadcrumbs .wd-products-nav { display: none !important; }
.yb.single-product .single-breadcrumbs .woocommerce-breadcrumb > *:not(.breadcrumb-link-last) { display: none !important; }
.yb.single-product .single-breadcrumbs .woocommerce-breadcrumb .breadcrumb-link-last {
	margin: 0;
	padding: 0;
	color: #111;
	font-size: 13px;
	font-weight: 400;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.yb.single-product .single-breadcrumbs .woocommerce-breadcrumb .breadcrumb-link-last::before,
.yb.single-product .single-breadcrumbs .woocommerce-breadcrumb .breadcrumb-link-last::after { display: none !important; content: none !important; }

/* ---------- Title + tagline ---------- */
.yb.single-product .summary .product_title {
	margin: 0 0 8px;
	font-size: 36px;
	font-weight: 700;
	line-height: 1.12;
	letter-spacing: -.01em;
}
.yb .yb-pdp-tagline {
	margin: 0 0 12px;
	color: #111;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: .08em;
	line-height: 1.3;
	text-transform: uppercase;
}

/* ---------- "Select Colour", price + colour line, swatch ---------- */
.yb .yb-pdp-colour { margin: 20px 0 8px; }
.yb .yb-pdp-colour__heading { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: #111; }
.yb .yb-pdp-colour__line {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 4px 12px;
	margin: 0 0 12px;
}
.yb.single-product .summary .yb-pdp-colour .price {
	margin: 0;
	color: #111;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.3;
}
.yb.single-product .summary .yb-pdp-colour .price del { color: var(--yb-pdp-muted, #555); font-weight: 400; font-size: 16px; }
.yb.single-product .summary .yb-pdp-colour .price ins { text-decoration: none; }
.yb .yb-pdp-colour__name { margin: 0; color: #111; font-size: 16px; font-weight: 400; }
.yb .yb-pdp-colour__swatch {
	display: inline-flex;
	width: 44px;
	height: 44px;
	padding: 2px;
	border-radius: 50%;
	border: 1px solid #111;
	background: #fff;
}
.yb .yb-pdp-colour__swatch > span {
	display: block;
	width: 100%;
	height: 100%;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}

/* ---------- Size row ---------- */
.yb.single-product .summary form.variations_form table.variations { margin-bottom: 8px; }
.yb.single-product .summary .variations tr.yb-pdp-size-row th.yb-pdp-size-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 12px;
	margin: 20px 0 10px;
}
.yb.single-product .summary .yb-pdp-size-label {
	margin: 0;
	color: #111;
	font-size: 16px;
	font-weight: 700;
	text-transform: none;
	letter-spacing: 0;
}
.yb.single-product .summary .yb-pdp-size-label::after { content: none !important; display: none !important; }
.yb.single-product .summary .yb-pdp-sizeguide {
	margin: 0;
	text-align: right;
	font-size: 14px;
	font-weight: 400;
	white-space: nowrap;
}
.yb.single-product .summary .yb-pdp-sizeguide a {
	color: #111;
	text-decoration: underline;
	text-underline-offset: 4px;
}
/* Before JS moves it into the size label row */
.yb.single-product .summary form.variations_form > .yb-sizeguide { margin: 0 0 -8px; }

.yb.single-product .summary .wd-swatches-product .wd-swatch.wd-text {
	min-width: 48px;
	height: 44px;
	margin: 0 8px 8px 0;
	padding: 0 12px;
	/* A9-ROUND2 §4.3: 1px #C8C8C8 is 1.62:1 against white; #949494 is 3.03:1 (1.4.11). */
	border: 1px solid #949494;
	border-radius: 2px;
	background: #fff;
	color: #111;
	font-size: 16px;
	font-weight: 600;
	box-shadow: none;
}
.yb.single-product .summary .wd-swatches-product .wd-swatch.wd-text:hover { border-color: #111; background: #fff; color: #111; }
.yb.single-product .summary .wd-swatches-product .wd-swatch.wd-text.wd-active,
.yb.single-product .summary .wd-swatches-product .wd-swatch.wd-text.wd-active:hover {
	border: 1px solid #111;
	background: #111;
	color: #fff;
}
.yb.single-product .summary .wd-swatches-product .wd-swatch.wd-text.wd-disabled {
	color: #BBB;
	border-color: #DDD;
	background: #fff linear-gradient(to top right, transparent calc(50% - .5px), #BBB, transparent calc(50% + .5px));
}
.yb.single-product .summary .wd-swatches-product .wd-swatch.wd-text .wd-swatch-text { font-weight: inherit; }

/* No "Clear" link, no quantity box */
.yb.single-product .summary .reset_variations,
.yb.single-product .summary .wd-reset-var,
.yb.single-product .summary form.cart .quantity { display: none !important; }

/* ---------- Inline "Please select a size" alert ---------- */
.yb .yb-pdp-alert {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 16px 0 4px;
	padding: 12px 14px;
	border: 1px solid var(--yb-pdp-red, #D22030);
	border-radius: 4px;
	background: #FBEAEA;
	color: #111;
	font-size: 15px;
	line-height: 1.35;
}
.yb .yb-pdp-alert[hidden] { display: none; }
.yb .yb-pdp-alert svg { flex: 0 0 auto; color: var(--yb-pdp-red, #D22030); }

/* ---------- Buy card: Add to bag + delivery / returns rows ---------- */
.yb.single-product .summary .variations_button,
.yb.single-product .summary form.cart:not(.variations_form) {
	display: flex;
	flex-wrap: wrap;
	margin: 16px 0 0;
	padding: 16px;
	border: 1px solid var(--yb-pdp-line, #E5E5E5);
	border-radius: 4px;
	background: #fff;
}
.yb.single-product .summary .single_add_to_cart_button {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 0 100%;
	width: 100%;
	min-height: 54px;
	margin: 0 !important;
	padding: 14px 20px;
	border: 0;
	border-radius: 4px;
	background: var(--yb-pdp-red, #D22030);
	color: #fff;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: .08em;
	text-transform: uppercase;
	box-shadow: none;
	opacity: 1 !important;
	cursor: pointer;
	transition: background-color .15s ease;
}
.yb.single-product .summary .single_add_to_cart_button:hover,
.yb.single-product .summary .single_add_to_cart_button:focus-visible {
	background: var(--yb-pdp-red-dark, #A91A27);
	color: #fff;
}
.yb.single-product .summary .single_add_to_cart_button.disabled,
.yb.single-product .summary .single_add_to_cart_button:disabled {
	background: var(--yb-pdp-red, #D22030);
	color: #fff;
	opacity: 1 !important;
	cursor: pointer;
}
.yb.single-product .summary .single_add_to_cart_button.loading { opacity: .85 !important; }
.yb.single-product .summary .single_add_to_cart_button.yb-pdp-atb--added,
.yb.single-product .summary .single_add_to_cart_button.yb-pdp-atb--added:hover { background: #111; }

.yb .yb-pdp-card__rows { flex: 1 0 100%; width: 100%; margin-top: 8px; }
.yb .yb-pdp-card__row {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	padding: 16px 0 0;
}
.yb .yb-pdp-icon { flex: 0 0 24px; color: #111; margin-top: 2px; }
.yb .yb-pdp-card__title {
	display: block;
	margin: 0 0 2px;
	color: #111;
	font-size: 18px;
	font-weight: 700;
	line-height: 1.3;
}
.yb .yb-pdp-card__text {
	margin: 0;
	color: #333;
	font-size: 15px;
	line-height: 1.45;
}
.yb .yb-pdp-card__text a {
	color: #111;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Rows belong to the main buy card only (not WoodMart's sticky bar / other forms) */
.yb .wd-sticky-btn .yb-pdp-card__rows { display: none !important; }

/* Old service list (store-content.php) if it ever prints again */
.yb.single-product .summary .yb-service { display: none; }

/* ---------- Find in store card ---------- */
.yb .yb-pdp-store {
	display: flex;
	align-items: flex-start;
	gap: 14px;
	margin: 12px 0 24px;
	padding: 16px;
	border: 1px solid var(--yb-pdp-line, #E5E5E5);
	border-radius: 4px;
	background: #fff;
	color: #111;
	text-decoration: none;
}
.yb .yb-pdp-store:hover .yb-pdp-card__title { text-decoration: underline; text-underline-offset: 3px; }
.yb .yb-pdp-store > span { display: block; }
.yb .yb-pdp-store__text {
	display: flex;
	align-items: center;
	gap: 8px;
	color: var(--yb-pdp-muted, #555);
	font-size: 15px;
}
.yb .yb-pdp-store__text i {
	display: inline-block;
	width: 8px;
	height: 8px;
	border-radius: 50%;
	background: #9A9A9A;
}

/* ---------- Tablet / phone ---------- */
@media (max-width: 1024px) {
	.yb.single-product .summary .product_title { font-size: 30px; }
}
@media (max-width: 767px) {
	.yb .yb-pdp-grid { gap: 2px; }
	.yb .yb-pdp-grid--single .yb-pdp-grid__item { height: auto; aspect-ratio: 390 / 470; }
	.yb.single-product .summary .product_title { font-size: 26px; }
	.yb .yb-pdp-badge { top: 10px; left: 10px; font-size: 12px; }
	.yb-pdp-popup { padding: 0; }
	.yb-pdp-popup__panel { width: 100vw; height: 100vh; border-radius: 0; }
	.yb-pdp-popup__scroll { padding: 56px 0 0; }
	.yb .yb-pdp-card__title { font-size: 16px; }
	.yb .yb-pdp-card__text { font-size: 14px; }
}
