/* Product page and the personalisation form (also in self-service): gallery, form, photo editor, size and frame,
   live preview. Loaded after theme.css on product pages and self-service (functions.php). */

/* Product page */
.llwd-product__top { margin-top: var(--wp--preset--spacing--30); }
@media (min-width: 782px) {
	.llwd-product__media { position: sticky; top: 6rem; align-self: flex-start; }
}
.llwd-gallery__slides {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 100%;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	scrollbar-width: none;
	border-radius: var(--llwd-radius-lg);
	background: var(--wp--preset--color--surface);
}
.llwd-gallery__slides::-webkit-scrollbar { display: none; }
.llwd-gallery__slide { scroll-snap-align: start; }
.llwd-gallery__slide img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.llwd-gallery__thumbs { list-style: none; padding: 0; margin: 0.75rem 0 0; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.llwd-gallery__thumbs a { display: block; width: 4.5rem; border-radius: var(--llwd-radius); overflow: hidden; outline: 2px solid transparent; outline-offset: 2px; }
.llwd-gallery__thumbs a:hover, .llwd-gallery__thumbs a:focus-visible { outline-color: var(--wp--preset--color--accent); }
.llwd-gallery__thumbs a[aria-current] { outline-color: var(--wp--preset--color--accent); }
/* Touch: no text selection, callout or tap highlight on slides and thumbnails. */
.llwd-gallery__slides, .llwd-gallery__thumbs { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; -webkit-tap-highlight-color: transparent; }
.llwd-gallery img { -webkit-user-drag: none; }
.llwd-gallery__thumbs img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }

.llwd-product__buy .wp-block-post-title { margin: 0 0 0.25rem; }
.llwd-product__tax { color: var(--wp--preset--color--muted); margin-top: 0.25rem; }
.llwd-product__trust { margin-top: var(--wp--preset--spacing--40); color: var(--wp--preset--color--muted); }

/* Personalisation form + variation selects (classic add-to-cart form) */
.llwd-personalisation {
	border: 0;
	margin: 0 0 1.25rem;
	padding: var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--surface);
	border-radius: var(--llwd-radius-lg);
	display: grid;
	gap: 0.9rem;
}
.llwd-personalisation__title { display: flex; align-items: center; margin: 0 0 0.25rem; font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--large); font-weight: 560; line-height: 1.3; }
/* Steps on the product page: 1 personalisation (collapses into a summary after the preview), 2 size and frame. */
.llwd-personalisation__fields { display: grid; gap: 0.9rem; }
.llwd-personalisation__fields[hidden], .llwd-personalisation__summary[hidden] { display: none; }
.llwd-stepnum {
	display: inline-grid; flex-shrink: 0; place-items: center; width: 1.65rem; height: 1.65rem; margin-right: 0.6rem; border-radius: 50%;
	background: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--body); font-size: 0.875rem; font-weight: 800; line-height: 1;
}
.llwd-personalisation.is-collapsed .llwd-stepnum { font-size: 0; color: transparent; background: #2f8a5b url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 0.9rem no-repeat; } /* Check as background: centred in every browser. */
.llwd-personalisation.is-collapsed { gap: 0.4rem; padding-block: 1rem; }
.llwd-personalisation__summary { display: flex; align-items: center; gap: 0.75rem; }
.llwd-personalisation__values {
	flex: 1; margin: 0; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted);
	display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.llwd-personalisation__edit {
	flex-shrink: 0; padding: 0.45rem 1rem; border: 1.5px solid var(--wp--preset--color--contrast); border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast); font: inherit; font-size: var(--wp--preset--font-size--small); font-weight: 650; cursor: pointer;
}
.llwd-personalisation__edit:hover { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
.llwd-step-title { display: flex; align-items: center; margin: 0.15rem 0.25rem 0.1rem; font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--large); font-weight: 560; }
.llwd-scene-card { scroll-margin-top: 6rem; }
/* Scene: while the motif in its new size or with the customer's values loads. */
.llwd-scene__canvas img { transition: opacity 0.3s ease, filter 0.3s ease; }
.llwd-scene__canvas.is-updating img { opacity: 0.6; filter: blur(1px); animation: llwd-pulse 1.2s ease-in-out infinite; }
@keyframes llwd-pulse { 50% { opacity: 0.85; } }
.llwd-field[hidden] { display: none; }
.llwd-field label, .llwd-field__label, form.variations_form table.variations th label {
	display: block;
	font-weight: 650;
	font-size: var(--wp--preset--font-size--small);
	margin-bottom: 0.3rem;
}
.llwd-field__optional { font-weight: 400; color: var(--wp--preset--color--muted); }
.llwd-field input, .llwd-field select, form.variations_form select {
	width: 100%;
	box-sizing: border-box;
	border: 1.5px solid #e2d6d3;
	border-radius: var(--llwd-radius);
	background-color: var(--wp--preset--color--base);
	padding: 0.75rem 0.9rem;
	font: inherit;
	line-height: 1.4;
	height: auto;
	min-height: 3rem;
	color: inherit;
}
form.variations_form td.value select { width: 100%; max-width: none; margin: 0; }
/* Same select look in every browser (Safari draws its own grey control otherwise). */
.llwd-field select, form.variations_form select { -webkit-appearance: none; appearance: none; padding-right: 2.5rem; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234a2a35' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 0.9rem center; background-size: 1rem; }
.llwd-field input:focus, .llwd-field select:focus, form.variations_form select:focus {
	outline: none;
	border-color: var(--wp--preset--color--accent);
	box-shadow: 0 0 0 3px rgb(255 114 99 / 0.25);
}
.llwd-photo { display: grid; gap: 0.6rem; }
/* Drop zone: the (invisible) file input covers it, so tapping and dropping work natively. */
.llwd-photo__drop {
	position: relative; display: grid; gap: 0.2rem; place-items: center; text-align: center;
	padding: 1.75rem 1rem; border: 2px dashed var(--wp--preset--color--accent); border-radius: var(--llwd-radius-lg);
	background: var(--wp--preset--color--surface); color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small); transition: background-color 0.15s ease, border-color 0.15s ease;
}
.llwd-photo__drop[hidden] { display: none; }
.llwd-photo__drop:hover, .llwd-photo__drop.is-over { background: var(--wp--preset--color--surface-strong); }
.llwd-photo__drop:focus-within { border-style: solid; box-shadow: 0 0 0 3px rgb(255 114 99 / 0.25); }
.llwd-photo__drop strong { color: var(--wp--preset--color--contrast); font-size: var(--wp--preset--font-size--medium); }
.llwd-field .llwd-photo__file { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; padding: 0; border: 0; opacity: 0; cursor: pointer; }
.llwd-photo__drop-icon {
	width: 3rem; height: 3rem; margin-bottom: 0.35rem; border-radius: 50%;
	background: var(--wp--preset--color--base) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8382b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Ccircle cx='9' cy='10' r='1.6'/%3E%3Cpath d='m21 16-5-5-9 8'/%3E%3C/svg%3E") center / 1.5rem no-repeat;
	box-shadow: 0 2px 8px rgb(74 42 53 / 0.08);
}
.llwd-photo__editor { display: grid; gap: 0.6rem; }
.llwd-photo__editor[hidden] { display: none; }
/* Frame in the slot's aspect ratio (inline style); portrait slots don't grow taller than the screen. */
.llwd-photo__stage {
	position: relative; width: min(100%, calc(55vh * var(--llwd-aspect, 1))); margin-inline: auto;
	border-radius: var(--llwd-radius); overflow: hidden; background: #efe7e4;
	box-shadow: 0 0 0 1px var(--wp--preset--color--line), var(--llwd-shadow);
	touch-action: none;
}
.llwd-photo__stage img { display: block; max-width: 100%; }
.llwd-photo .cropper-view-box { outline: 0; }
/* The motif's overlay (photo.js sets it as background) shows where the photo sits in the design. */
.llwd-photo .cropper-face { opacity: 1; background-color: transparent; background-size: 100% 100%; background-repeat: no-repeat; }
.llwd-photo.is-uploading .llwd-photo__stage { opacity: 0.75; }
.llwd-photo__guide { position: absolute; inset: 0; overflow: hidden; pointer-events: none; }
/* Safe area: shading outside (box-shadow), dashed line only on the edges with a strip. */
.llwd-photo__guide span {
	position: absolute; inset: var(--top) var(--right) var(--bottom) var(--left);
	border: 2px dashed transparent; box-shadow: 0 0 0 100vmax rgb(30 16 22 / 0.42);
}
.llwd-photo__guide.has-top span { border-top-color: #fff; }
.llwd-photo__guide.has-right span { border-right-color: #fff; }
.llwd-photo__guide.has-bottom span { border-bottom-color: #fff; }
.llwd-photo__guide.has-left span { border-left-color: #fff; }
.llwd-photo__hint--edge::before { content: ""; display: inline-block; width: 1.4em; margin-right: 0.4em; vertical-align: middle; border-top: 2px dashed currentColor; }
.llwd-photo__hint { margin: 0; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); text-align: center; }
.llwd-photo__tools { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }
.llwd-photo__tool, .llwd-photo__replace {
	font: inherit; font-size: var(--wp--preset--font-size--small); font-weight: 650; cursor: pointer;
	border: 1.5px solid #e2d6d3; background: var(--wp--preset--color--base); color: var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--pill); min-height: 2.75rem;
}
.llwd-photo__tool { width: 2.75rem; display: grid; place-items: center; padding: 0; }
.llwd-photo__replace { padding: 0 1rem; }
.llwd-photo__tool:hover, .llwd-photo__replace:hover { border-color: var(--wp--preset--color--accent); }
.llwd-photo__status { margin: 0; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); text-align: center; }
.llwd-photo__status:empty { display: none; }
.llwd-photo__status.is-error { color: var(--wp--preset--color--accent-ink); font-weight: 650; }
.llwd-photo[data-state="done"] .llwd-photo__status:not(.is-error)::before { content: "✓ "; color: #2f7a5a; font-weight: 700; }

form.variations_form table.variations { width: 100%; border-collapse: collapse; margin: 0 0 1rem; }
form.variations_form table.variations,
form.variations_form table.variations tbody { display: block; width: 100%; }
form.variations_form table.variations tr { display: block; margin-bottom: 0.9rem; }
form.variations_form table.variations th, form.variations_form table.variations td { display: block; padding: 0; text-align: left; }
form.variations_form .reset_variations { display: none !important; }

/* Size and frame cards (Llwd\\Shop\\Variations); WooCommerce's selects stay in the form, visually hidden. */
.llwd-choices ~ select, .llwd-frame-card ~ select, .llwd-size-card ~ select, .llwd-scene-card ~ select { position: absolute; width: 1px; height: 1px; min-height: 0; padding: 0; opacity: 0; pointer-events: none; }
form.variations_form td.value { position: relative; }
.llwd-choices { display: grid; gap: 0.5rem; }
.llwd-choices--size { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.llwd-choices--frame { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.llwd-choice {
	position: relative; display: grid; justify-items: center; align-content: start; gap: 0.15rem; padding: 0.75rem 0.4rem 0.65rem;
	text-align: center; line-height: 1.25; cursor: pointer;
	border: 1.5px solid #e2d6d3; border-radius: var(--llwd-radius); background: var(--wp--preset--color--base);
	transition: border-color 0.15s ease, box-shadow 0.15s ease, background-color 0.15s ease, transform 0.15s ease;
}
.llwd-choice:hover { border-color: var(--wp--preset--color--accent); }
.llwd-choice input { position: absolute; inset: 0; margin: 0; opacity: 0; cursor: inherit; }
.llwd-choice:has(input:focus-visible) { outline: 2px solid var(--wp--preset--color--accent); outline-offset: 2px; }
.llwd-choice:has(input:checked) { border-color: var(--wp--preset--color--accent); box-shadow: inset 0 0 0 1px var(--wp--preset--color--accent); background: #fff4f2; }
.llwd-choice:has(input:checked)::after {
	content: ""; position: absolute; top: -0.45rem; right: -0.45rem; width: 1.25rem; height: 1.25rem; border-radius: 50%;
	background: var(--wp--preset--color--accent);
}
.llwd-choice:has(input:checked)::before {
	content: ""; position: absolute; z-index: 1; top: -0.45rem; right: -0.45rem; width: 1.25rem; height: 1.25rem;
	background: #fff; -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 0.75rem no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E") center / 0.75rem no-repeat;
}
.llwd-choice.is-disabled { opacity: 0.45; cursor: not-allowed; }
form.variations_form .llwd-choice { margin: 0; text-align: center; font-weight: 400; } /* WooCommerce styles labels in .variations. */
.llwd-choice__name { font-weight: 650; }
.llwd-choice__meta { font-size: 0.8125rem; color: var(--wp--preset--color--muted); }
.llwd-choice__price { margin-top: 0.15rem; font-size: 0.8125rem; font-weight: 650; color: var(--wp--preset--color--accent-ink); }
/* Size list (variant "list", like the legacy shop): one row per size, price on the right. Next to the frame card
   it gets the same box, with the title inside. */
.llwd-size-card__title { display: none; margin: 0 0 0.75rem; font-weight: 750; font-size: var(--wp--preset--font-size--medium); }
form.variations_form:has(.llwd-frame-card) table.variations tr:has(.llwd-size-card) th { display: none; }
form.variations_form:has(.llwd-frame-card) .llwd-size-card { padding: 1rem; border: 1.5px solid #e2d6d3; border-radius: var(--llwd-radius-lg); background: var(--wp--preset--color--base); }
form.variations_form:has(.llwd-frame-card) .llwd-size-card__title { display: block; }
.llwd-choices--list { grid-template-columns: none; gap: 0.45rem; }
.llwd-choice--row { grid-template-columns: auto auto minmax(0, 1fr) auto; justify-items: start; align-items: center; gap: 0 0.75rem; padding: 0.8rem 1rem; text-align: left; }
form.variations_form .llwd-choice--row { text-align: left; }
.llwd-choice--row .llwd-choice__dot {
	width: 1.15rem; height: 1.15rem; border-radius: 50%; border: 2px solid #d9cbc7; background: var(--wp--preset--color--base);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.llwd-choice--row:has(input:checked) .llwd-choice__dot { border-color: var(--wp--preset--color--accent); box-shadow: inset 0 0 0 3px var(--wp--preset--color--base); background: var(--wp--preset--color--accent); }
.llwd-choice--row .llwd-choice__dims { font-weight: 650; font-variant-numeric: tabular-nums; white-space: nowrap; }
.llwd-choice--row .llwd-choice__name { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 0.8125rem; color: var(--wp--preset--color--muted); }
.llwd-choice--row .llwd-choice__price { margin: 0; font-size: var(--wp--preset--font-size--small); font-variant-numeric: tabular-nums; }
.llwd-choice--row:has(input:checked)::before, .llwd-choice--row:has(input:checked)::after { display: none; } /* The dot shows the choice. */

/* Frame card (variant "preview"): the motif in the chosen frame, buttons below. */
form.variations_form table.variations tr:has(.llwd-frame-card) th { display: none; }
.llwd-frame-card { display: grid; gap: 0.75rem; padding: 1rem; border: 1.5px solid #e2d6d3; border-radius: var(--llwd-radius-lg); background: var(--wp--preset--color--base); }
.llwd-frame-card__head { display: flex; align-items: center; gap: 0.75rem; }
.llwd-frame-card__head p { margin: 0; }
.llwd-frame-card__title { flex: 1; font-weight: 750; font-size: var(--wp--preset--font-size--medium); }
.llwd-frame-card__price { font-weight: 650; font-variant-numeric: tabular-nums; }
.llwd-frame-card__check {
	width: 1.5rem; height: 1.5rem; border-radius: 50%; border: 2px solid #d9cbc7; background: var(--wp--preset--color--base) no-repeat center / 0.9rem;
	transition: background-color 0.2s ease, border-color 0.2s ease;
}
.llwd-frame-card:not(.is-unframed) .llwd-frame-card__check { border-color: var(--wp--preset--color--accent); background-color: var(--wp--preset--color--accent); background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='white' stroke-width='3.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12.5l4.5 4.5L19 7.5'/%3E%3C/svg%3E"); }
.llwd-frame-card__text { margin: 0; line-height: 1.5; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.llwd-frame-card__media { position: relative; overflow: hidden; border-radius: 4px; background: var(--wp--preset--color--surface); }
.llwd-frame-card__media { display: grid; place-items: center; }
.llwd-frame-card__media img { display: block; width: 100%; height: auto; }
.llwd-frame-card.is-unframed .llwd-frame-card__media img { width: 94%; margin: 3%; box-shadow: 0 4px 12px rgb(74 36 48 / 0.25); } /* Plain motif as a canvas. */
.llwd-choices--buttons { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.llwd-choice--button { padding: 0.65rem 0.5rem; border-radius: var(--llwd-radius); }
.llwd-choice--button .llwd-choice__name { font-weight: 550; }
.llwd-choice--button:has(input:checked) { background: var(--wp--preset--color--base); border-color: var(--wp--preset--color--contrast); box-shadow: inset 0 0 0 1px var(--wp--preset--color--contrast); }
.llwd-choice--button:has(input:checked)::before, .llwd-choice--button:has(input:checked)::after { display: none; }

/* Combined selection (variant "scene"): the motif true to scale above a 2 m sofa, size chips and frame swatches. */
form.variations_form table.variations tr:has(.llwd-scene-card) th, form.variations_form table.variations tr:has(.llwd-scene-hidden) { display: none; }
.llwd-scene-card { display: grid; gap: 0.6rem; padding: 0.75rem 0.75rem 1rem; border: 1.5px solid #e2d6d3; border-radius: var(--llwd-radius-lg); background: var(--wp--preset--color--base); }
.llwd-scene {
	/* 1 cm = --llwd-cqw-per-cm % of the scene width. A thin floor, the sofa standing on it, the motif hanging 90 cm
	   above the floor; the height fits the largest size with frame plus a small margin. */
	--cm: calc(var(--llwd-cqw-per-cm) * 1cqw); --floor: 7.5cqw;
	position: relative; container-type: inline-size; aspect-ratio: 1 / 0.99; overflow: hidden; border-radius: var(--llwd-radius);
	background: radial-gradient(120% 90% at 50% 35%, #fdf9f5, #f1e6dd);
}
.llwd-scene--tall { aspect-ratio: 1 / 1.21; }
/* Floor (a child, so cqw refers to the scene). */
.llwd-scene::before { content: ""; position: absolute; inset: auto 0 0; height: var(--floor); background: #e9ddd3; border-top: 1px solid #dccbbf; }
.llwd-scene__canvas {
	/* The canvas itself is width × height; a shadow gap frame (0.9 cm free space, then a 2 cm profile) adds around it. */
	--frame: 0px; --gap: 0px; box-sizing: content-box;
	position: absolute; left: 50%; bottom: calc(var(--floor) + 90 * var(--cm)); translate: -50% 0;
	width: calc(var(--llwd-w) * var(--cm)); height: calc(var(--llwd-h) * var(--cm));
	padding: var(--gap); border: var(--frame) solid transparent; background: transparent;
	box-shadow: 0 0.6cqw 1.6cqw rgb(74 36 48 / 0.28);
	transition: width 0.45s var(--llwd-ease), height 0.45s var(--llwd-ease), padding 0.3s ease, border-width 0.3s ease;
}
.llwd-scene[data-frame="schwarz"] .llwd-scene__canvas, .llwd-scene[data-frame="weiss"] .llwd-scene__canvas {
	--frame: max(2px, calc(2 * var(--cm))); --gap: max(2px, calc(0.9 * var(--cm)));
}
/* The gap is free space: darker towards the frame (inset shadow), the canvas casts a small shadow into it. */
.llwd-scene[data-frame="schwarz"] .llwd-scene__canvas { border-color: #2b2424; background: #3a3331; box-shadow: inset 0 0 0 1px #120e0e, inset 0 0 max(2px, calc(0.8 * var(--cm))) rgb(0 0 0 / 0.55), 0 0.6cqw 1.6cqw rgb(74 36 48 / 0.28); }
.llwd-scene[data-frame="weiss"] .llwd-scene__canvas { border-color: #fbfaf8; background: #ece7e2; box-shadow: inset 0 0 0 1px #d6cec8, inset 0 0 max(2px, calc(0.8 * var(--cm))) rgb(74 36 48 / 0.22), 0 0 0 1px rgb(74 36 48 / 0.12), 0 0.6cqw 1.6cqw rgb(74 36 48 / 0.24); }
.llwd-scene__canvas img { display: block; width: 100%; height: 100%; object-fit: cover; box-shadow: 0 0 2px rgb(0 0 0 / 0.35); }
/* Size badge just above the piece (with frame: 0.9 cm gap + 2 cm profile on each side), kept inside the scene. */
.llwd-scene { --llwd-fx: 0; }
.llwd-scene[data-frame="schwarz"], .llwd-scene[data-frame="weiss"] { --llwd-fx: 2.9; }
.llwd-scene__label {
	position: absolute; z-index: 2; left: 50%; translate: -50% 0;
	bottom: min(calc(var(--floor) + (90 + var(--llwd-h) + 2 * var(--llwd-fx)) * var(--cm) + 1.5cqw), calc(100% - 1.6rem - 1.5cqw));
	padding: 0.1rem 0.55rem; border-radius: var(--wp--custom--radius--pill); background: rgb(255 255 255 / 0.95); color: var(--wp--preset--color--contrast);
	box-shadow: 0 1px 5px rgb(74 36 48 / 0.18); font-size: 0.75rem; font-weight: 750; line-height: 1.5; white-space: nowrap;
	transition: bottom 0.45s var(--llwd-ease);
}
.llwd-scene__canvas { z-index: 1; }
.llwd-scene__sofa { position: absolute; left: 50%; bottom: calc(var(--floor) - 1px); translate: -50% 0; width: calc(200 * var(--cm)); height: calc(90 * var(--cm)); fill: #cdb6a8; }
.llwd-scene__sofa .llwd-scene__seat { fill: #c0a797; }
/* Dimension line under the sofa, as wide as the sofa: |<— Sofa ca. 2 m —>| */
.llwd-scene__measure {
	--ink: #8a6f64; position: absolute; left: 50%; bottom: calc(var(--floor) / 2); translate: -50% 0;
	width: calc(200 * var(--cm)); height: 0; border-top: 1.5px solid var(--ink);
}
.llwd-scene__measure::before, .llwd-scene__measure::after {
	content: ""; position: absolute; top: -0.4rem; width: 0.55rem; height: 0.55rem; border: solid var(--ink); border-width: 0 0 1.5px 1.5px;
	box-sizing: border-box;
}
.llwd-scene__measure::before { left: 0; rotate: 45deg; translate: 1px 1px; }
.llwd-scene__measure::after { right: 0; rotate: -135deg; translate: -1px 1px; }
.llwd-scene__measure > span {
	position: absolute; left: 50%; top: 0; translate: -50% -55%; padding: 0 0.5rem; border-radius: var(--wp--custom--radius--pill);
	background: #e9ddd3; color: #6f574d; font-size: 0.75rem; font-weight: 700; line-height: 1.5; white-space: nowrap;
}
.llwd-scene-card__title { margin: 0.35rem 0.25rem 0; font-weight: 750; }
.llwd-scene-card__title span { font-weight: 400; font-size: 0.8125rem; color: var(--wp--preset--color--muted); }
.llwd-choices--chips { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.llwd-choice--chip { gap: 0; padding: 0.5rem 0.25rem; line-height: 1.3; }
.llwd-choice--chip .llwd-choice__dims { font-weight: 750; white-space: nowrap; font-variant-numeric: tabular-nums; }
.llwd-choice--chip .llwd-choice__meta { font-size: 0.75rem; }
.llwd-choice--chip .llwd-choice__price { margin: 0.1rem 0 0; font-size: 0.75rem; }
.llwd-choices--swatches { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0.4rem; }
.llwd-choice--swatch { gap: 0.15rem; padding: 0.55rem 0.25rem; line-height: 1.3; }
.llwd-choice--swatch .llwd-choice__dot { margin-bottom: 0.2rem; width: 1.4rem; height: 1.4rem; border-radius: 4px; border: 1.5px solid #d9cbc7; background: linear-gradient(135deg, var(--wp--preset--color--accent), #ffc2a8); }
.llwd-choice--swatch .llwd-choice__dot--schwarz { border: 4px solid #2b2424; box-shadow: inset 0 0 0 1.5px #fff; }
.llwd-choice--swatch .llwd-choice__dot--weiss { border: 4px solid #fff; box-shadow: 0 0 0 1px #d9cfcc, inset 0 0 0 1.5px #efe8e6; }
.llwd-choice--swatch .llwd-choice__price { margin: 0; font-size: 0.75rem; }
.llwd-choice--chip:has(input:checked)::before, .llwd-choice--chip:has(input:checked)::after,
.llwd-choice--swatch:has(input:checked)::before, .llwd-choice--swatch:has(input:checked)::after { display: none; }
@media (prefers-reduced-motion: reduce) { .llwd-scene__canvas, .llwd-scene__label { transition: none; } }

/* Size sketch to scale (150 cm = full box). */
.llwd-choice__sketch { display: grid; place-items: center; width: 4.75rem; height: calc(var(--llwd-sketch-height, 3rem) + 0.25rem); margin-bottom: 0.35rem; }
.llwd-choice__sketch span { border-radius: 2px; background: linear-gradient(135deg, var(--wp--preset--color--accent), #ffc2a8); box-shadow: 0 2px 4px rgb(74 36 48 / 0.18); }
/* Frame swatches: a canvas in a shadow gap frame. */
.llwd-choice__swatch { display: grid; place-items: center; width: 3.25rem; height: 2.5rem; margin-bottom: 0.3rem; }
.llwd-choice__swatch span { width: 2.1rem; height: 1.45rem; border-radius: 1px; background: linear-gradient(135deg, var(--wp--preset--color--accent), #ffc2a8); box-shadow: 0 2px 4px rgb(74 36 48 / 0.2); }
.llwd-choice__swatch--schwarz span { box-shadow: 0 0 0 2px #fff, 0 0 0 5px #2b2424, 0 3px 6px 5px rgb(74 36 48 / 0.18); }
.llwd-choice__swatch--weiss span { box-shadow: 0 0 0 2px #efe8e6, 0 0 0 5px #fff, 0 0 0 6px #d9cfcc, 0 3px 6px 6px rgb(74 36 48 / 0.12); }

/* Buy column rhythm: 1rem between its boxes (personalisation, selection, price, delivery, trust list); the margins
   of WooCommerce's table rows and form and the block gap are reset so they don't add up. */
.llwd-product__buy .llwd-personalisation { margin-bottom: 1rem; }
.llwd-product__buy .wp-block-add-to-cart-form form.cart.variations_form, .llwd-product__buy .wp-block-add-to-cart-form form.cart { margin-bottom: 0; }
.llwd-product__buy form.variations_form table.variations { margin-bottom: 1rem; }
.llwd-product__buy form.variations_form table.variations tr:last-child,
.llwd-product__buy form.variations_form table.variations tr:has(+ tr.llwd-hidden-row),
.llwd-product__buy form.variations_form table.variations tr:has(.llwd-scene-card) { margin-bottom: 0; }
.llwd-product__buy .single_variation_wrap { margin-top: 0; }
.llwd-product__buy > .llwd-delivery { margin-block-start: 1rem; }
.llwd-product__buy > .llwd-product__trust { margin-block: 1.25rem 0; }
/* The reviews start a new section: a larger, even gap (2.5rem phones, 4rem from tablets). */
.llwd-product .llwd-reviews { margin-top: 2.5rem; }
@media (min-width: 782px) { .llwd-product .llwd-reviews { margin-top: 4rem; } }
/* Price and add-to-cart in one row: price, note and choice on the left, the button on the right. */
.single_variation_wrap { display: grid; grid-template-columns: auto minmax(0, 1fr); align-items: center; gap: 0.5rem 1rem; margin-top: 1rem; padding: 1rem; border-radius: var(--llwd-radius-lg); background: var(--wp--preset--color--surface); }
.single_variation_wrap > .woocommerce-variation { min-width: 0; margin: 0 !important; } /* WooCommerce adds a bottom margin (more specific rule). */
.single_variation_wrap .woocommerce-variation > :not(.woocommerce-variation-price) { display: none; } /* Stock and description: always in stock, no variation texts. */
.single_variation_wrap .woocommerce-variation-price { margin: 0; }
.llwd-buy-price { display: grid; gap: 0.05rem; line-height: 1.3; }
.llwd-buy-price .price { font-size: 1.6rem; font-weight: 800; color: var(--wp--preset--color--contrast); font-variant-numeric: tabular-nums; white-space: nowrap; }
.llwd-buy-price__note, .llwd-buy-price__choice { font-size: 0.75rem; color: var(--wp--preset--color--muted); white-space: nowrap; }
.llwd-buy-price__choice { font-weight: 650; color: var(--wp--preset--color--contrast); }
@media (max-width: 479px) { .single_variation_wrap { grid-template-columns: 1fr; gap: 0.75rem; } }
.single_variation_wrap .single_add_to_cart_button { white-space: nowrap; }
.woocommerce-variation-add-to-cart, form.cart:not(.variations_form) { display: flex; gap: 0.75rem; align-items: stretch; }
form.cart .quantity { display: none; } /* Sold individually: only a hidden input is left. */
.single_add_to_cart_button {
	flex: 1;
	border: 0;
	border-radius: var(--wp--custom--radius--pill);
	background: var(--wp--preset--color--accent);
	color: var(--wp--preset--color--contrast);
	font: inherit;
	font-weight: 700;
	font-size: 1.0625rem;
	padding: 1rem 1.5rem;
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease;
}
.single_add_to_cart_button:hover { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
.single_add_to_cart_button.disabled, .single_add_to_cart_button:disabled { opacity: 0.55; cursor: not-allowed; }
.single_add_to_cart_button.loading, .single_add_to_cart_button.loading:disabled { opacity: 1; cursor: progress; background: var(--wp--preset--color--accent); color: var(--wp--preset--color--contrast); }
.single_add_to_cart_button.loading::after {
	content: "";
	display: inline-block;
	width: 1em;
	height: 1em;
	margin-left: 0.6em;
	vertical-align: -0.15em;
	border: 2px solid currentColor;
	border-right-color: transparent;
	border-radius: 50%;
	animation: llwd-spin 0.7s linear infinite;
}

/* WooCommerce's add-to-cart-form block styles size the form to its content; ours spans the buy column. */
.llwd-product__buy .wp-block-woocommerce-add-to-cart-form,
.llwd-product__buy .wp-block-woocommerce-add-to-cart-form form.cart { width: 100%; max-width: none; }
.llwd-product__buy .wp-block-woocommerce-add-to-cart-form form.variations_form { display: block; }
.llwd-product__buy .wp-block-woocommerce-add-to-cart-form .variations select { width: 100% !important; max-width: none !important; min-width: 0; }
.llwd-product__buy .wp-block-woocommerce-add-to-cart-form .variations_button { width: 100%; grid-template-columns: 1fr; } /* No quantity column. */
.llwd-product__buy .wp-block-woocommerce-add-to-cart-form .variations_button > .single_add_to_cart_button { justify-self: stretch; grid-column: 1 / -1; }

/* Related products: two columns on small screens instead of one. */
@media (max-width: 781px) {
	.wp-block-post-template.llwd-related { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; gap: var(--wp--preset--spacing--30); }
	.llwd-products .wc-block-product-template { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }
}

/* Personalisation: groups, switches, multiple names, preview */
.llwd-field-group { margin: 0.5rem 0 -0.25rem; font-weight: 700; color: var(--wp--preset--color--accent-ink); font-size: var(--wp--preset--font-size--small); text-transform: uppercase; letter-spacing: 0.08em; }
.llwd-field-group[hidden] { display: none; }
.llwd-field textarea { width: 100%; box-sizing: border-box; border: 1.5px solid #e2d6d3; border-radius: var(--llwd-radius); padding: 0.75rem 0.9rem; font: inherit; }
.llwd-field--multitext input + input { margin-top: 0.5rem; }
.llwd-field input[hidden] { display: none; }
.llwd-multitext-add { margin-top: 0.5rem; background: none; border: 0; padding: 0.25rem 0; color: var(--wp--preset--color--accent-ink); font: inherit; font-weight: 650; cursor: pointer; }
.llwd-switch { display: flex; gap: 0.6rem; align-items: center; font-size: var(--wp--preset--font-size--small); font-weight: 600; cursor: pointer; }
.llwd-switch input { width: 1.2rem; height: 1.2rem; accent-color: var(--wp--preset--color--accent); }
.llwd-preview-button {
	margin-top: 0.25rem;
	border: 2px solid var(--wp--preset--color--contrast);
	background: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
	border-radius: var(--wp--custom--radius--pill);
	padding: 0.75rem 1.25rem;
	font: inherit;
	font-weight: 700;
	cursor: pointer;
}
.llwd-preview-button:hover { background: var(--wp--preset--color--contrast); color: var(--wp--preset--color--base); }
.llwd-gallery { position: relative; }
/* Live preview loading: views still rendering are dimmed, an overlay over the main image says what's happening */
.llwd-gallery__slide img, .llwd-gallery__thumbs img { transition: opacity 0.3s ease, filter 0.3s ease; }
.llwd-gallery__slide.is-loading img { opacity: 0.35; filter: blur(6px) grayscale(0.4); }
.llwd-gallery__thumbs li { position: relative; }
.llwd-gallery__thumbs li.is-loading img { opacity: 0.35; filter: grayscale(0.6); }
.llwd-gallery__thumbs li.is-loading::after {
	content: ""; position: absolute; inset: 50% auto auto 50%; width: 1.25rem; height: 1.25rem; margin: -0.625rem 0 0 -0.625rem;
	border: 2px solid var(--wp--preset--color--accent); border-right-color: transparent; border-radius: 50%;
	animation: llwd-spin 0.8s linear infinite; pointer-events: none;
}
.llwd-gallery__thumbs li.is-failed::after {
	content: "!"; position: absolute; top: 0.2rem; right: 0.2rem; width: 1.1rem; height: 1.1rem; border-radius: 50%;
	background: #c0392b; color: #fff; font: 700 0.75rem/1.1rem sans-serif; text-align: center;
}
.llwd-preview-overlay {
	position: absolute; inset: 0 0 auto; aspect-ratio: 1; display: grid; place-items: center; padding: 1rem;
	pointer-events: none; z-index: 2;
}
.llwd-preview-overlay[hidden] { display: none; }
.llwd-preview-overlay__card {
	display: grid; justify-items: center; gap: 0.5rem; width: min(22rem, 100%); padding: 1.5rem 1.5rem 1.25rem; text-align: center;
	background: color-mix(in srgb, var(--wp--preset--color--base) 92%, transparent); backdrop-filter: blur(8px);
	border-radius: var(--llwd-radius-lg); box-shadow: 0 12px 40px rgb(74 36 48 / 0.18);
	transition: all 0.35s var(--llwd-ease);
}
.llwd-preview-overlay__icon {
	position: relative; width: 3.5rem; height: 3.5rem; border-radius: 50%;
	border: 3px solid var(--wp--preset--color--peach); border-top-color: var(--wp--preset--color--accent);
	animation: llwd-spin 1s linear infinite;
}
.llwd-preview-overlay__icon::after {
	content: ""; position: absolute; inset: 0.8rem; background: var(--wp--preset--color--accent);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.6 4.5c2.1 0 3.6 1.2 5.4 3.2 1.8-2 3.3-3.2 5.4-3.2 3.6 0 5.7 3.9 4.2 7.3C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat; mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M12 21s-7.5-4.6-9.6-9.2C.9 8.4 3 4.5 6.6 4.5c2.1 0 3.6 1.2 5.4 3.2 1.8-2 3.3-3.2 5.4-3.2 3.6 0 5.7 3.9 4.2 7.3C19.5 16.4 12 21 12 21z'/%3E%3C/svg%3E") center / contain no-repeat;
	animation: llwd-spin 1s linear infinite reverse, llwd-beat 1s ease-in-out infinite;
}
.llwd-preview-overlay__title { margin: 0.25rem 0 0; font-family: var(--wp--preset--font-family--display); font-size: var(--wp--preset--font-size--large); line-height: 1.2; color: var(--wp--preset--color--contrast); }
.llwd-preview-overlay__hint { margin: 0; font-size: var(--wp--preset--font-size--small); color: var(--wp--preset--color--muted); }
.llwd-preview-overlay__bar { display: block; width: 100%; height: 0.375rem; margin-top: 0.5rem; border-radius: 1rem; background: var(--wp--preset--color--peach); overflow: hidden; }
.llwd-preview-overlay__bar span { display: block; height: 100%; width: 8%; border-radius: inherit; background: var(--wp--preset--color--accent); transition: width 0.4s var(--llwd-ease); }
.llwd-preview-overlay__count { margin: 0; font-size: var(--wp--preset--font-size--small); font-weight: 600; color: var(--wp--preset--color--accent-ink); }
/* Once the view on screen is there: a small pill at the bottom, so the preview itself is visible. */
.llwd-preview-overlay.is-compact { place-items: end center; }
.llwd-preview-overlay.is-compact .llwd-preview-overlay__card {
	grid-template-columns: auto auto; align-items: center; gap: 0.25rem 0.6rem; width: auto; padding: 0.5rem 1rem 0.5rem 0.6rem;
	border-radius: var(--wp--custom--radius--pill); text-align: left;
}
.llwd-preview-overlay.is-compact .llwd-preview-overlay__icon { width: 1.5rem; height: 1.5rem; border-width: 2px; grid-row: span 2; }
.llwd-preview-overlay.is-compact .llwd-preview-overlay__icon::after { inset: 0.3rem; }
.llwd-preview-overlay.is-compact .llwd-preview-overlay__title { margin: 0; font-family: inherit; font-size: var(--wp--preset--font-size--small); font-weight: 600; }
.llwd-preview-overlay.is-compact .llwd-preview-overlay__hint, .llwd-preview-overlay.is-compact .llwd-preview-overlay__bar { display: none; }
.llwd-preview-overlay.is-compact .llwd-preview-overlay__count { font-weight: 400; color: var(--wp--preset--color--muted); }
.llwd-preview-overlay.is-done .llwd-preview-overlay__count { display: none; }
.llwd-preview-overlay.is-done .llwd-preview-overlay__icon { animation: none; border-color: var(--wp--preset--color--accent); background: var(--wp--preset--color--accent); grid-row: auto; }
.llwd-preview-overlay.is-done .llwd-preview-overlay__icon::after { animation: none; inset: 0.3rem; background: #fff; }
.llwd-preview-overlay.is-failed .llwd-preview-overlay__card { border-radius: var(--llwd-radius-lg); max-width: 22rem; }
.llwd-preview-overlay.is-failed .llwd-preview-overlay__icon { border-color: #c0392b; background: #c0392b; }
.llwd-preview-button.is-busy, .llwd-preview-button:disabled { cursor: progress; opacity: 0.75; }
.llwd-preview-button.is-busy::before {
	content: ""; display: inline-block; width: 0.9em; height: 0.9em; margin-right: 0.5em; vertical-align: -0.1em;
	border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: llwd-spin 0.8s linear infinite;
}
@keyframes llwd-spin { to { transform: rotate(360deg); } }
@keyframes llwd-beat { 50% { scale: 0.8; } }
@media (prefers-reduced-motion: reduce) {
	.llwd-preview-overlay__icon, .llwd-preview-overlay__icon::after, .llwd-gallery__thumbs li.is-loading::after, .llwd-preview-button.is-busy::before { animation-duration: 3s; }
}
/* Live region for screen readers only (the preview overlay shows the state visually). */
.llwd-gallery__status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.llwd-personalisation-unavailable { padding: 1rem; border-radius: var(--llwd-radius); background: #fde8e6; color: #7a2118; }
