/**
 * Product page, in the spirit of Sézane: a large fixed-size photo with dots,
 * the product details beside it, open size buttons, and a "You may also
 * like" row that shows half of the next card.
 */

/* No breadcrumbs. */
.single-product .wc-block-breadcrumbs,
.single-product .woocommerce-breadcrumb { display: none; }

/* ---- Layout ---- */
.single-product .yuna-single-product { align-items: flex-start; gap: 64px; }
.single-product .yuna-pdp__summary { position: sticky; top: 24px; }

/* ---- Gallery: one big photo, always the same size ---- */
.yuna-gallery { position: relative; display: block; }

/* Desktop: the photo with a strip of thumbnails on its right. On phones the
   thumbnails stay in the page (the dots drive them) but are not shown. */
.yuna-gallery .wc-block-product-gallery-thumbnails { display: none !important; }
.yuna-gallery__dots { display: none; }

.yuna-gallery .wc-block-product-gallery-large-image,
.yuna-gallery .wc-block-product-gallery-large-image__container { width: 100%; }

.yuna-gallery .wc-block-product-gallery-large-image__container,
.yuna-gallery .wc-block-product-gallery-large-image__wrapper {
	aspect-ratio: 2 / 3;
}

.yuna-gallery .wc-block-product-gallery-large-image__image,
.yuna-gallery .wc-block-product-gallery-large-image img {
	width: 100%;
	height: 100%;
	aspect-ratio: 2 / 3;
	object-fit: cover;
	cursor: zoom-in;
}

/* Dots on the photo. */
.yuna-gallery .wc-block-product-gallery-large-image { position: relative; }
.yuna-gallery__dots {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 18px;
	z-index: 3;
	display: flex;
	justify-content: center;
	gap: 8px;
	pointer-events: none;
}
.yuna-gallery__dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 1px solid #fff;
	border-radius: 50%;
	background: rgba(255, 255, 255, .55);
	cursor: pointer;
	pointer-events: auto;
	transition: background-color .25s ease, transform .25s ease;
}
.yuna-gallery__dot.is-active { background: #fff; transform: scale(1.25); }
.yuna-gallery__dot:hover { background: #fff; }

/* ---- Title row: name, like and share ---- */
.yuna-pdp__title-row { align-items: flex-start; gap: 16px; margin-bottom: 8px; }
.yuna-pdp__title { margin: 0; font-size: clamp(1.6rem, 2.4vw, 2.25rem); line-height: 1.1; font-weight: 400; }
.yuna-pdp__actions { gap: 8px; flex-shrink: 0; }
.yuna-pdp__actions .ype-share-button {
	width: 40px;
	height: 40px;
	border: 0;
	background: transparent;
}
.yuna-pdp__actions .ype-share-button:hover { background: rgba(0, 0, 0, .06); }
.yuna-pdp__actions .wp-block-yuna-blocks-wishlist-button { position: static; margin: 0; }
.yuna-pdp__price { margin: 0 0 28px; font-size: 1.25rem; }

/* ---- Description as links: Description – Details – Reviews ---- */
.yuna-pdp__description .wc-tabs,
.yuna-pdp__description .wp-block-woocommerce-product-details ul.tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 6px 14px;
	margin: 0 0 18px;
	padding: 0;
	list-style: none;
	border: 0;
}
.yuna-pdp__description .wc-tabs::before,
.yuna-pdp__description .wc-tabs::after { display: none; }
.yuna-pdp__description .wc-tabs li {
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
}
.yuna-pdp__description .wc-tabs li a {
	padding: 0 0 3px;
	border-bottom: 1px solid transparent;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	text-decoration: none;
	color: inherit;
}
.yuna-pdp__description .wc-tabs li.active a { border-bottom-color: currentColor; }
.yuna-pdp__description .woocommerce-Tabs-panel { padding: 0; font-size: 15px; line-height: 1.7; }
.yuna-pdp__description .woocommerce-Tabs-panel > h2:first-child { display: none; }

/* ---- Badges row ---- */
.yuna-pdp__badges { margin: 26px 0 30px; }

/* ---- Sizes as open choices ---- */
.yuna-pdp__cart table.variations { width: 100%; margin: 0 0 16px; border: 0; }
.yuna-pdp__cart table.variations th,
.yuna-pdp__cart table.variations td { display: block; padding: 0; border: 0; text-align: left; }
.yuna-pdp__cart table.variations th.label { margin-bottom: 8px; font-size: 12px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; }
/* Size buttons: assets/css/sizes.css */
.yuna-pdp__cart .single_add_to_cart_button { width: 100%; min-height: 56px; margin-top: 8px; }
.yuna-pdp__cart .quantity { display: none; }
.yuna-pdp__meta { margin-top: 24px; font-size: 12px; color: #8a8a8a; }

/* ---- You may also like: half of the next card shows ---- */
.yuna-peek__title { margin: 0 0 24px; font-size: clamp(1.4rem, 2vw, 2rem); font-weight: 400; text-transform: uppercase; letter-spacing: .02em; }
.yuna-peek .wc-block-product-template {
	display: flex !important;
	flex-wrap: nowrap;
	gap: 20px;
	margin: 0;
	padding: 0;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}
.yuna-peek .wc-block-product-template::-webkit-scrollbar { display: none; }
.yuna-peek .wc-block-product-template > li {
	flex: 0 0 calc((100% - 3 * 20px) / 3.5);
	width: auto !important;
	margin: 0 !important;
	scroll-snap-align: start;
}

/* ---- Phones ---- */
@media (max-width: 781px) {
	.single-product .yuna-single-product { gap: 24px; }
	.single-product .yuna-pdp__summary { position: static; display: flex; flex-direction: column; }
	/* Title, price, sizes and button first, the delivery / Klarna / fit / rating
	   boxes under the button, then the description. */
	.yuna-pdp__title-row { order: 1; }
	.yuna-pdp__price { order: 2; margin-bottom: 18px; }
	.yuna-pdp__cart { order: 3; }
	.yuna-pdp__badges { order: 4; margin-bottom: 0; }
	.yuna-pdp__description { order: 5; margin-top: 28px; }
	.yuna-pdp__meta { order: 6; }

	/* The photo runs under the menu, edge to edge (the menu itself: header.css). */
	.single-product .yuna-pdp__media { margin-inline: calc(var(--wp--style--root--padding-left, 16px) * -1); }

	.yuna-gallery__dots { bottom: 14px; justify-content: flex-start; padding-left: 14px; }
	.yuna-gallery .wc-block-next-previous-buttons { display: none; }

	/* One card and a half. */
	.yuna-peek .wc-block-product-template > li { flex-basis: 64%; }
}

/* WooCommerce's own tab styling is specific; these win. */
.yuna-pdp__description .woocommerce-tabs ul.tabs.wc-tabs {
	display: flex !important;
	flex-wrap: wrap;
	gap: 4px 6px;
	margin: 0 0 18px !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
}
.yuna-pdp__description .woocommerce-tabs ul.tabs.wc-tabs::before,
.yuna-pdp__description .woocommerce-tabs ul.tabs.wc-tabs::after { display: none !important; }
.yuna-pdp__description .woocommerce-tabs ul.tabs.wc-tabs li {
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	box-shadow: none !important;
}
.yuna-pdp__description .woocommerce-tabs ul.tabs.wc-tabs li::before,
.yuna-pdp__description .woocommerce-tabs ul.tabs.wc-tabs li::after { display: none !important; }
.yuna-pdp__description .woocommerce-tabs ul.tabs.wc-tabs li + li::before {
	content: "–" !important;
	display: inline !important;
	margin-right: 6px;
	border: 0 !important;
	box-shadow: none !important;
	position: static !important;
}
.yuna-pdp__description .woocommerce-tabs ul.tabs.wc-tabs li a {
	padding: 0 0 3px !important;
	border-bottom: 1px solid transparent;
	background: none !important;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #000 !important;
}
.yuna-pdp__description .woocommerce-tabs ul.tabs.wc-tabs li.active a { border-bottom-color: #000; }
.yuna-pdp__description .woocommerce-tabs .panel { border: 0; padding: 0; margin: 0; }

/* Quantity is hidden (one piece, like the original); the button is full width. */
.yuna-pdp__cart .quantity,
.yuna-pdp__cart div.quantity { display: none !important; }
.yuna-pdp__cart .woocommerce-variation-add-to-cart,
.yuna-pdp__cart form.cart:not(.variations_form) { display: block !important; }
.yuna-pdp__cart .single_add_to_cart_button { display: block; width: 100% !important; }
.yuna-pdp__cart .woocommerce-variation-add-to-cart-disabled { opacity: .55; }

@media (max-width: 781px) {
	/* No gap above the photo: it sits right under the see-through menu. */
	.single-product .wp-site-blocks > .wp-block-group,
	.single-product .yuna-single-product { margin-top: 0 !important; }
	.yuna-pdp__title { font-size: 1.5rem; }
	.yuna-pdp__summary { padding-inline: 4px; }
}

/* ---- Desktop refinements ---- */
@media (min-width: 782px) {
	.single-product .yuna-single-product { gap: 48px; }
	.single-product .yuna-pdp__media { flex-basis: 54% !important; }
	.single-product .yuna-pdp__summary { flex-basis: 46% !important; }

	/* Photo on the left, thumbnails on its right. */
	.yuna-gallery { display: flex !important; flex-direction: row !important; align-items: flex-start; gap: 14px; }
	.yuna-gallery .wc-block-product-gallery-thumbnails {
		display: block !important;
		order: 2;
		position: static;
		flex: 0 0 86px;
		width: 86px;
		height: auto;
		aspect-ratio: auto;
	}
	.yuna-gallery .wc-block-product-gallery-thumbnails__scrollable {
		position: static !important;
		display: flex;
		flex-direction: column;
		gap: 10px;
		max-height: min(86vh, 820px);
		overflow-y: auto;
		scrollbar-width: none;
	}
	.yuna-gallery .wc-block-product-gallery-thumbnails__thumbnail { width: 100% !important; cursor: pointer; }
	.yuna-gallery .wc-block-product-gallery-thumbnails__thumbnail__image { width: 100%; aspect-ratio: 2 / 3; object-fit: cover; }
	.yuna-gallery .wc-block-product-gallery-large-image { order: 1; flex: 1 1 0; min-width: 0; }

	/* A calmer photo: 3:4, never taller than the screen. */
	.yuna-gallery .wc-block-product-gallery-large-image__container,
	.yuna-gallery .wc-block-product-gallery-large-image__wrapper,
	.yuna-gallery .wc-block-product-gallery-large-image__image,
	.yuna-gallery .wc-block-product-gallery-large-image img {
		aspect-ratio: 3 / 4;
		max-height: min(86vh, 820px);
	}
}

/* ---- Badges: small, in one line ---- */
.yuna-pdp__badges { margin: 22px 0 26px; }
.yuna-pdp__badges .yuna-extras,
.yuna-pdp__badges .yuna-extras.yuna-extras--grid {
	display: flex;
	flex-wrap: nowrap;
	gap: 8px;
	margin: 0;
	font-size: 12px;
}
.yuna-pdp__badges .yuna-extras__card,
.yuna-pdp__badges .yuna-extras--grid .yuna-extras__card {
	flex: 1 1 0;
	min-width: 0;
	gap: 2px;
	padding: 12px 10px;
}
.yuna-pdp__badges .yuna-extras__icon { width: 20px; height: 20px; margin-bottom: 4px; }
.yuna-pdp__badges .yuna-extras__icon--g { width: 20px; height: 20px; }
.yuna-pdp__badges .yuna-extras__label { font-size: 11px; line-height: 1.3; }
.yuna-pdp__badges .yuna-extras__value { font-size: 12px; line-height: 1.3; }
.yuna-pdp__badges .yuna-extras__amount { font-size: 12px; }
.yuna-pdp__badges .yuna-extras__klarna-badge { margin-top: 2px; }
.yuna-pdp__badges .yuna-extras__rating .yuna-rating__stars svg { width: 10px; height: 10px; }

@media (max-width: 781px) {
	.yuna-gallery__dots { display: flex; justify-content: center; padding-left: 0; }
	.yuna-pdp__badges .yuna-extras { flex-wrap: wrap; }
	.yuna-pdp__badges .yuna-extras__card { flex-basis: calc(50% - 4px); }
}

/* Dots: only on phones, dark enough to read on a light photo. */
@media (min-width: 782px) { .yuna-gallery__dots { display: none !important; } }
.yuna-gallery__dot { background: rgba(0, 0, 0, .3); border-color: rgba(255, 255, 255, .9); box-shadow: 0 0 0 1px rgba(0, 0, 0, .12); }
.yuna-gallery__dot.is-active { background: #000; border-color: #fff; }
.yuna-gallery__dot:hover { background: #000; }

/* ---- Thumbnail slider (desktop): up and down when there are many ---- */
@media (min-width: 782px) {
	.yuna-gallery .wc-block-product-gallery-thumbnails { position: relative; }
	.yuna-gallery .wc-block-product-gallery-thumbnails__scrollable { max-height: var(--yuna-main-h, min(86vh, 820px)); }
	.yuna-thumbs__btn {
		position: absolute;
		left: 50%;
		z-index: 4;
		display: flex;
		align-items: center;
		justify-content: center;
		width: 34px;
		height: 34px;
		margin-left: -17px;
		padding: 0;
		border: 0;
		border-radius: 50%;
		background: #fff;
		color: #000;
		box-shadow: 0 1px 6px rgba(0, 0, 0, .25);
		cursor: pointer;
	}
	.yuna-thumbs__btn[hidden] { display: none; }
	.yuna-thumbs__btn--up { top: 8px; }
	.yuna-thumbs__btn--down { bottom: 8px; }
	.yuna-thumbs__btn--down svg { transform: rotate(180deg); }
}
@media (max-width: 781px) { .yuna-thumbs__btn { display: none !important; } }

/* ---- Phones: tidy spacing, badges two per line ---- */
@media (max-width: 781px) {
	.yuna-pdp__badges .yuna-extras,
	.yuna-pdp__badges .yuna-extras.yuna-extras--grid { flex-wrap: wrap !important; }
	.yuna-pdp__badges .yuna-extras__card,
	.yuna-pdp__badges .yuna-extras--grid .yuna-extras__card { flex: 1 1 calc(50% - 4px) !important; max-width: calc(50% - 4px); }
	.yuna-pdp__badges .yuna-extras__label { font-size: 12px; }
	.yuna-pdp__badges { margin: 16px 0 20px; }

	.yuna-pdp__title-row { margin-bottom: 4px; }
	.yuna-pdp__price { margin-bottom: 10px; }
	.yuna-pdp__cart { margin-top: 0 !important; }
}

/* The variation form: no leftover grid, spacing or hidden "Clear" gap. */
.yuna-pdp__cart form.variations_form { display: block !important; margin: 0 !important; }
.yuna-pdp__cart table.variations { display: block; width: 100%; margin: 0 0 12px !important; }
.yuna-pdp__cart table.variations tbody,
.yuna-pdp__cart table.variations tr { display: block; }
.yuna-pdp__cart .reset_variations_alert { margin: 0; }
.yuna-pdp__cart .single_variation_wrap { margin: 0; }
.yuna-pdp__cart .woocommerce-variation { margin: 0; }
.yuna-pdp__cart .woocommerce-variation:empty { display: none; }
.yuna-pdp__cart .woocommerce-variation-add-to-cart,
.yuna-pdp__cart .single_variation_wrap .single_add_to_cart_button { width: 100% !important; }
.yuna-sizes { width: 100%; }

/* ---- Back to top: clear of the phone bar ---- */
@media (max-width: 781px) {
	.wp-block-yuna-blocks-back-to-top { margin: 0 14px 84px 0 !important; z-index: 90; }
}

/* ---- Thumbnail strip like the reference: chevrons above and below ---- */
@media (min-width: 782px) {
	.yuna-gallery .wc-block-product-gallery-thumbnails {
		display: flex !important;
		flex-direction: column;
		align-items: stretch;
		max-height: var(--yuna-main-h, min(86vh, 820px));
	}
	.yuna-gallery .wc-block-product-gallery-thumbnails__scrollable {
		flex: 1 1 auto;
		min-height: 0;
		max-height: none !important;
	}
	.yuna-thumbs__btn {
		position: static;
		flex: 0 0 30px;
		width: 100%;
		height: 30px;
		margin: 0;
		border-radius: 0;
		background: transparent;
		box-shadow: none;
		color: #000;
	}
	.yuna-thumbs__btn svg { transition: transform .2s ease; }
	.yuna-thumbs__btn:hover svg { transform: translateY(-2px); }
	.yuna-thumbs__btn--down:hover svg { transform: rotate(180deg) translateY(-2px); }
	.yuna-thumbs__btn--up { order: -1; }
	.yuna-thumbs__btn--down { order: 3; }
	/* The chosen thumbnail: a black frame. */
	.yuna-gallery .wc-block-product-gallery-thumbnails__thumbnail { position: relative; }
	.yuna-gallery .wc-block-product-gallery-thumbnails__thumbnail:has(.wc-block-product-gallery-thumbnails__thumbnail__image--is-active)::after { border: 3px solid #000; }
}

/* Phones: a tap on the photo does nothing, so no zoom cursor either. */
@media (max-width: 781px) {
	.yuna-gallery .wc-block-product-gallery-large-image__image,
	.yuna-gallery .wc-block-product-gallery-large-image img { cursor: default; -webkit-tap-highlight-color: transparent; }
}

/* Phones: cards share the width exactly, whatever their text. */
@media (max-width: 781px) {
	.yuna-pdp__badges .yuna-extras__card,
	.yuna-pdp__badges .yuna-extras--grid .yuna-extras__card {
		flex: 0 0 calc(50% - 4px) !important;
		width: calc(50% - 4px);
		min-width: 0 !important;
		box-sizing: border-box;
		overflow-wrap: anywhere;
	}
	.yuna-pdp__badges .yuna-extras__value { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 6px; }
	.yuna-pdp__cart table.variations th.label { margin-bottom: 6px; padding: 0; line-height: 1.2; }
}

/* Many photos: the thumbnail slider is 86% of the photo's height, centred on it. */
@media (min-width: 782px) {
	.yuna-gallery .wc-block-product-gallery-thumbnails.has-overflow {
		align-self: center;
		height: calc(var(--yuna-main-h, 820px) * .86);
		max-height: calc(var(--yuna-main-h, 820px) * .86);
	}
}

/* Drag to slide with the mouse. */
@media (hover: hover) and (pointer: fine) {
	.yuna-peek .wc-block-product-template { cursor: grab; }
	.yuna-peek .wc-block-product-template.is-dragging {
		cursor: grabbing;
		scroll-snap-type: none;   /* free while dragging; the script snaps to a card on release */
		user-select: none;
	}
	.yuna-peek .wc-block-product-template img { -webkit-user-drag: none; user-select: none; }
}

/* The chevrons keep their place at both ends, so the strip never changes height. */
.yuna-thumbs__btn.is-off { visibility: hidden; pointer-events: none; }
.wc-block-product-gallery-thumbnails:not(.has-overflow) .yuna-thumbs__btn { display: none; }

/* The slider's scroll box was clipping the button's soft shadow. */
.yuna-peek .wc-block-product-template { padding-bottom: 18px; margin-bottom: -18px; }

/* ---- Click to zoom, in place (desktop) ---- */
.yuna-gallery .wc-block-product-gallery-large-image { overflow: hidden; }
.yuna-gallery .wc-block-product-gallery-large-image img { transition: transform .35s ease; will-change: transform; }
@media (min-width: 782px) {
	.yuna-gallery .wc-block-product-gallery-large-image img.is-zoomed { transform: scale(2.2); cursor: zoom-out; }
	.yuna-gallery .wc-block-product-gallery-large-image.is-zoomed .yuna-gallery__dots { display: none; }
}
@media (prefers-reduced-motion: reduce) { .yuna-gallery .wc-block-product-gallery-large-image img { transition: none; } }

/* "Clear" and the stock note sit beside the SIZE label, so choosing a size
   never moves the button. */
.yuna-pdp__cart form.variations_form { position: relative; }
.yuna-pdp__cart .reset_variations {
	position: absolute;
	top: 0;
	right: 0;
	display: inline-block;
	margin: 0 !important;
	font-size: 12px;
	line-height: 1.2;
	color: #8a8a8a;
	text-decoration: underline;
	text-underline-offset: 3px;
}
.yuna-pdp__cart .reset_variations:hover { color: #000; }
.yuna-pdp__cart .woocommerce-variation {
	position: absolute;
	top: 0;
	right: 58px;
	margin: 0;
	font-size: 12px;
	line-height: 1.2;
	color: #8a8a8a;
	text-align: right;
}
.yuna-pdp__cart .woocommerce-variation > * { margin: 0; }
.yuna-pdp__cart .woocommerce-variation-price,
.yuna-pdp__cart .woocommerce-variation-description { display: none; }
.yuna-pdp__cart .woocommerce-variation-availability p { margin: 0; }

/* The carousel box clipped the cards' soft shadows (Recently Viewed). */
.yuna-carousel .swiper { padding-bottom: 20px; margin-bottom: -20px; }
.yuna-cart-error { margin: 10px 0 0; color: #b32d2e; font-size: 13px; }

/* The photo arrows always work (the gallery loops), so they never look switched off. */
.yuna-gallery .wc-block-next-previous-buttons .wc-block-next-previous-buttons__button[aria-disabled="true"] {
	background: var(--wp--preset--color--base, #fff) !important;
	opacity: 1 !important;
	cursor: pointer !important;
}

/* The last card snaps to the end of the row, so it is never left half in view. */
.yuna-peek .wc-block-product-template > li:last-child { scroll-snap-align: end; }

/* Desktop with a mouse: free, fluid scrolling (the script adds the momentum); snapping is for touch screens. */
@media (hover: hover) and (pointer: fine) {
	.yuna-peek .wc-block-product-template { scroll-snap-type: none !important; scroll-behavior: auto; }
}

/* "Sold out" beside the price on a sold-out product's own page (inc/sold-out.php). */
.yuna-sold-out-label {
	display: inline-block;
	margin: 6px 0 0;
	padding: 4px 12px;
	border: 1px solid #1a1a1a;
	border-radius: 999px;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: #1a1a1a;
}

/* ---- Categories, tags, brand, colour as chips, then the breadcrumb (under the boxes) ---- */
.yuna-pdp__terms { margin: 0 0 22px; }
.yuna-pdp__term-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.yuna-pdp__term {
	display: inline-block;
	padding: 7px 12px;
	background: #f4f4f4;
	color: #222;
	font-size: 12px;
	line-height: 1.3;
	letter-spacing: .02em;
	text-decoration: none;
	transition: background-color .15s ease;
}
.yuna-pdp__term:hover, .yuna-pdp__term:focus-visible { background: #e6e6e6; color: #000; }
/* The theme hides breadcrumbs on product pages elsewhere; this one, under the chips, stays. */
.single-product .yuna-pdp__breadcrumbs.wc-block-breadcrumbs, .single-product .yuna-pdp__breadcrumbs .woocommerce-breadcrumb { display: block; }
.yuna-pdp__breadcrumbs { color: #8a8a8a; margin: 0; }
.yuna-pdp__breadcrumbs a { color: inherit; text-decoration: none; }
.yuna-pdp__breadcrumbs a:hover { color: #222; text-decoration: underline; }
@media (max-width: 781px) {
	.yuna-pdp__terms { order: 4; margin: 24px 0 0; }
}
