/* ==========================================================================
   Product page. Loaded on product pages only (inc/assets.php).
   ========================================================================== */

.product-page { padding-bottom: var(--bd-space-7); }
.product-hero {
	display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
	gap: clamp(1.5rem, 4vw, 4rem); align-items: start;
	margin-top: var(--bd-space-4);
}

/* Gallery: one swipeable track; thumbnails jump to a photo. Works without JavaScript. */
.product-gallery { position: sticky; top: 96px; min-width: 0; }
.product-gallery__track {
	position: relative;
	display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scroll-behavior: smooth;
	border-radius: var(--bd-radius-l); background: var(--bd-paper);
	scrollbar-width: none;
}
.product-gallery__track::-webkit-scrollbar { display: none; }
.product-gallery__slide { flex: 0 0 100%; scroll-snap-align: center; aspect-ratio: 1 / 1; display: grid; place-items: center; padding: var(--bd-space-6); }
.product-gallery__slide img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.product-gallery__count {
	position: absolute; top: var(--bd-space-4); right: var(--bd-space-4);
	padding: 0.15em 0.7em; border-radius: 999px; background: rgb(23 24 28 / 72%); color: var(--bd-white);
	font-size: var(--bd-step--1); font-weight: 600;
}
.product-gallery__thumbs { position: relative; /* anchors the thumbnails' hidden labels inside the scroller */ display: flex; gap: var(--bd-space-2); margin-top: var(--bd-space-3); overflow-x: auto; padding-bottom: var(--bd-space-1); }
.product-gallery__thumb {
	flex: 0 0 68px; height: 68px; padding: 4px;
	border: 2px solid transparent; border-radius: var(--bd-radius-s); background: var(--bd-paper);
}
.product-gallery__thumb img { width: 100%; height: 100%; object-fit: contain; mix-blend-mode: multiply; }
.product-gallery__thumb.is-current { border-color: var(--bd-ink); }

/* Summary and buy box */
.product-summary { display: flex; flex-direction: column; gap: var(--bd-space-3); }
.product-summary__kicker { color: var(--bd-muted); font-weight: 600; font-size: var(--bd-step--1); letter-spacing: 0.02em; }
.product-summary__title { font-size: var(--bd-step-3); line-height: 1.08; }
.product-summary__set {
	display: inline-block; margin-left: 0.15em; padding: 0.05em 0.35em; vertical-align: 0.15em;
	border-radius: var(--bd-radius-s); background: var(--bd-yellow);
	font-size: 0.55em; font-weight: 800; letter-spacing: 0.02em;
}
.product-summary__buy { padding: var(--bd-space-5); border: 1px solid var(--bd-line); border-radius: var(--bd-radius); background: var(--bd-paper); }
.product-summary__buy .price { display: block; font-size: var(--bd-step-2); }
.product-summary__buy .you-save { margin-top: var(--bd-space-1); color: var(--bd-red); font-weight: 600; }
.product-summary__buy .you-save .amount { font-weight: 800; }
.product-summary__buy .bd-price-on-request { font-family: var(--bd-font-display); font-size: var(--bd-step-2); color: var(--bd-ink); }
.product-summary__buy .bd-on-request-ask, .product-summary__buy .bd-oos-ask { margin: var(--bd-space-3) 0 0 !important; font-family: var(--bd-font-body); font-weight: 400; font-size: var(--bd-step-0); color: var(--bd-text-soft); }
.product-summary__buy .bd-on-request-ask .button,
.product-summary__buy .bd-oos-ask .button { width: 100%; background: var(--bd-yellow); border-color: var(--bd-yellow); color: var(--bd-ink); }
.product-summary__buy form.cart { display: flex; gap: var(--bd-space-2); margin-top: var(--bd-space-4); }
.product-summary__buy form.cart .quantity input { width: 72px; height: 48px; border: 1px solid var(--bd-line); border-radius: 999px; text-align: center; }
.product-summary__buy form.cart .button { flex: 1; }
.product-summary__buy .stock { margin-top: var(--bd-space-2); font-size: var(--bd-step--1); font-weight: 600; color: var(--bd-green); }
.product-summary__buy .stock.out-of-stock { color: var(--bd-red); }

/* Facts: always visible, never inside a tab */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0; overflow: hidden; border: 1px solid var(--bd-line); border-radius: var(--bd-radius); background: var(--bd-line); }
.facts__row { padding: var(--bd-space-3) var(--bd-space-4); background: var(--bd-white); }
.facts dt { font-size: var(--bd-step--1); color: var(--bd-muted); }
.facts dd { margin: 0; font-weight: 700; }
.product-summary__trust { display: grid; gap: var(--bd-space-1); margin: 0; padding: 0; list-style: none; font-size: var(--bd-step--1); color: var(--bd-text-soft); }
.product-summary__trust li::before { content: "✓"; margin-right: 0.5em; color: var(--bd-green); font-weight: 800; }

/* Below the fold */
.product-about { max-width: 760px; margin-top: var(--bd-space-8); }
.product-about h2 { margin-bottom: var(--bd-space-3); }
.product-about__text p + p { margin-top: var(--bd-space-3); }

.product-guides { max-width: 760px; margin-top: var(--bd-space-7); }
.product-guides h2 { margin-bottom: var(--bd-space-3); }
.product-guides ul { display: grid; gap: var(--bd-space-2); margin: 0; padding: 0; list-style: none; }
.product-guides li { padding: var(--bd-space-3) var(--bd-space-4); border: 1px solid var(--bd-line); border-radius: var(--bd-radius); }
.product-guides a { font-weight: 700; }
.product-guides p { margin-top: var(--bd-space-1); color: var(--bd-muted); font-size: var(--bd-step--1); }
.product-row { padding-bottom: 0; }
.product-reviews { margin-top: var(--bd-space-7); max-width: 760px; }

/* Phone buy bar: appears once the buy box has scrolled away (site.js) */
.buy-bar { display: none; }
@media (max-width: 900px) {
	.product-hero { grid-template-columns: 1fr; }
	.product-gallery { position: relative; top: 0; margin-inline: calc(-1 * var(--bd-gutter)); }
	.product-gallery__track { border-radius: 0; }
	.product-gallery__slide { padding: var(--bd-space-4); }
	.product-gallery__thumbs { padding-inline: var(--bd-gutter); }
	.buy-bar {
		position: fixed; left: 0; right: 0; bottom: 0; z-index: 40;
		display: flex; align-items: center; gap: var(--bd-space-3);
		padding: var(--bd-space-3) var(--bd-gutter) calc(var(--bd-space-3) + env(safe-area-inset-bottom));
		background: var(--bd-white); border-top: 1px solid var(--bd-line); box-shadow: 0 -8px 24px rgb(23 24 28 / 8%);
		transform: translateY(110%); transition: transform 0.2s ease;
	}
	.buy-bar.is-visible { transform: none; }
	.buy-bar__name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 700; }
	.buy-bar__price { font-weight: 700; white-space: nowrap; }
}

/* Reviews (WooCommerce's own form; its stylesheet is not loaded) */
.product-reviews h2 { margin-bottom: var(--bd-space-3); }
.product-reviews .commentlist { margin: 0 0 var(--bd-space-5); padding: 0; list-style: none; }
.product-reviews .comment-reply-title { display: block; margin: var(--bd-space-4) 0 var(--bd-space-2); font-family: var(--bd-font-display); font-weight: 700; font-size: var(--bd-step-1); }
.product-reviews .comment-form { display: grid; gap: var(--bd-space-3); }
.product-reviews .comment-form label { display: block; margin-bottom: var(--bd-space-1); font-weight: 600; }
.product-reviews .comment-form input[type="text"],
.product-reviews .comment-form input[type="email"],
.product-reviews .comment-form textarea { width: 100%; padding: var(--bd-space-3); border: 1px solid var(--bd-line); border-radius: var(--bd-radius-s); }
.product-reviews .comment-form-cookies-consent { display: flex; gap: var(--bd-space-2); align-items: center; }
.product-reviews .comment-form-cookies-consent label { margin: 0; font-weight: 400; }
.product-reviews p.stars a { display: inline-block; width: 1.4em; overflow: hidden; white-space: nowrap; color: transparent; text-decoration: none; }
.product-reviews p.stars a::before { content: "★"; color: var(--bd-line); font-size: 1.5rem; }
.product-reviews p.stars:hover a::before,
.product-reviews p.stars.selected a::before { color: var(--bd-yellow); }
.product-reviews p.stars a:hover ~ a::before,
.product-reviews p.stars.selected a.active ~ a::before { color: var(--bd-line); }
.product-reviews .form-submit input { min-height: 48px; padding: 0 var(--bd-space-5); border: 0; border-radius: 999px; background: var(--bd-ink); color: var(--bd-white); font-weight: 700; cursor: pointer; }
.facts__row:last-child:nth-child(odd) { grid-column: 1 / -1; }

/* Zoom: hover magnifier on the page photo, and the full-screen viewer --------------- */
.product-gallery__slide { overflow: hidden; cursor: zoom-in; }
.product-gallery__slide img { transition: transform 0.12s ease-out; }
.product-gallery__slide img.is-zoomed { transform: scale(2); }
.product-gallery__enlarge {
	position: absolute; top: var(--bd-space-4); left: var(--bd-space-4); z-index: 2;
	display: inline-grid; place-items: center; width: 40px; height: 40px;
	border: 0; border-radius: 999px; background: rgb(255 255 255 / 92%); color: var(--bd-ink);
	box-shadow: var(--bd-shadow); cursor: pointer;
}
.product-gallery__enlarge svg { width: 18px; height: 18px; }
.product-gallery__enlarge:hover { background: var(--bd-yellow); }

.lightbox { width: 100vw; height: 100dvh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: var(--bd-ink); color: var(--bd-white); }
.lightbox::backdrop { background: transparent; }
.has-lightbox { overflow: hidden; }
.lightbox__stage { position: absolute; inset: 56px 64px 48px; display: grid; place-items: center; overflow: hidden; touch-action: pinch-zoom; }
.lightbox__stage img { max-width: 100%; max-height: 100%; object-fit: contain; border-radius: var(--bd-radius); background: var(--bd-white); cursor: zoom-in; transition: transform 0.15s ease-out; }
.lightbox__stage img.is-zoomed { transform: scale(2.2); cursor: zoom-out; }
.lightbox__close, .lightbox__prev, .lightbox__next {
	position: absolute; display: grid; place-items: center; width: 48px; height: 48px;
	border: 0; border-radius: 999px; background: rgb(255 255 255 / 14%); color: var(--bd-white);
	font-size: 1.6rem; line-height: 1; cursor: pointer;
}
.lightbox__close:hover, .lightbox__prev:hover, .lightbox__next:hover { background: var(--bd-yellow); color: var(--bd-ink); }
.lightbox__close { top: var(--bd-space-3); right: var(--bd-space-3); font-size: 1.2rem; }
.lightbox__prev { left: var(--bd-space-3); top: 50%; transform: translateY(-50%); }
.lightbox__next { right: var(--bd-space-3); top: 50%; transform: translateY(-50%); }
.lightbox__count { position: absolute; bottom: var(--bd-space-3); left: 0; right: 0; text-align: center; font-weight: 600; }
@media (max-width: 700px) {
	.lightbox__stage { inset: 56px 8px 56px; }
	.lightbox__prev, .lightbox__next { top: auto; bottom: var(--bd-space-2); transform: none; }
}
.lightbox__stage.is-loading::after { content: ""; position: absolute; width: 36px; height: 36px; border: 3px solid rgb(255 255 255 / 25%); border-top-color: var(--bd-yellow); border-radius: 50%; animation: bd-spin 0.8s linear infinite; }
@keyframes bd-spin { to { transform: rotate(360deg); } }
