/**
 * Strickset color viewer — left drawer (WOLLKE CI).
 */

.wollke-color-viewer,
.wollke-color-viewer-trigger-wrap {
	--wollke-cv-accent: #7ab38b;
	--wollke-cv-title: #242424;
	--wollke-cv-text: #777777;
	--wollke-cv-link: #333333;
	--wollke-cv-border: #e5e5e5;
	--wollke-cv-bg: #ffffff;
	--wollke-cv-muted: #f7f7f7;
	--wollke-cv-panel-w: min(420px, 92vw);
	--wollke-cv-panel-top: var(--wd-admin-bar-h, 0px);
	--wollke-cv-ease: cubic-bezier(0.19, 1, 0.22, 1);
}

/* —— Per-slot trigger: title left, link right, one line —— */
.woosb-products .woosb-product .woosb-title .woosb-name:has(> .wollke-color-viewer-trigger-wrap) {
	display: flex;
	flex-wrap: nowrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	overflow: visible;
	width: 100%;
}

.woosb-products .woosb-product .woosb-title .woosb-name > a {
	min-width: 0;
	flex: 1 1 auto;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wollke-color-viewer-trigger-wrap {
	display: inline-flex;
	align-items: center;
	flex: 0 0 auto;
	margin: 0 0 0 auto;
	white-space: nowrap;
}

button.wollke-color-viewer-trigger,
.wollke-color-viewer-trigger {
	display: inline-flex !important;
	align-items: center;
	gap: 6px;
	padding: 0 !important;
	margin: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: var(--wollke-cv-link, #333) !important;
	font-size: 13px !important;
	font-weight: 500 !important;
	line-height: 1.3;
	letter-spacing: 0;
	text-transform: none !important;
	text-decoration: underline;
	text-underline-offset: 2px;
	cursor: pointer;
}

button.wollke-color-viewer-trigger:hover,
button.wollke-color-viewer-trigger:focus-visible,
.wollke-color-viewer-trigger:hover,
.wollke-color-viewer-trigger:focus-visible {
	color: var(--wollke-cv-accent, #7ab38b) !important;
	background: transparent !important;
	opacity: 1;
	outline: none;
}

.wollke-color-viewer-trigger__icon {
	flex: 0 0 auto;
	display: block;
}

.wollke-color-viewer-trigger__label {
	line-height: 1;
}

/* Wool Farbe label row: label left, action links right */
.single-product .variations .wollke-farbe-label-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 8px 12px;
	width: 100%;
}

.single-product .variations .wollke-farbe-label-row > label {
	margin: 0;
	flex: 0 1 auto;
}

.single-product .variations .wollke-farbe-actions {
	display: inline-flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: flex-end;
	gap: 8px 14px;
	margin-left: auto;
}

.single-product .variations .wollke-farbe-actions .wollke-color-viewer-trigger-wrap,
.single-product .variations .wollke-farbe-actions .wollke-color-compare-trigger-wrap {
	margin: 0;
}

.single-product .variations .wollke-farbe-actions .wollke-farbe-actions__sep {
	color: #cfcfcf;
	font-size: 13px;
	line-height: 1;
	user-select: none;
}

/* Give the Farbe label cell room for the action links */
.single-product .variations tr:has(.wollke-farbe-label-row) > th.label {
	width: auto;
	min-width: 0;
	vertical-align: middle;
}

@media (max-width: 768px) {
	.single-product .variations tr:has(.wollke-farbe-label-row) > th.label {
		display: block;
		width: 100%;
		padding-bottom: 4px;
	}
}

/* Yarn mobile: Strickset-style select instead of the swatch grid */
.wollke-wool-color-select {
	display: none;
	width: 100%;
	margin: 0 0 12px;
}

button.wollke-wool-color-select__btn,
.wollke-wool-color-select__btn {
	display: flex !important;
	align-items: center;
	width: 100%;
	min-height: 58px;
	padding: 8px 36px 8px 8px !important;
	margin: 0 !important;
	background: #fff !important;
	border: 1px solid #ccc !important;
	border-radius: 2px !important;
	box-shadow: none !important;
	gap: 10px;
	text-align: left;
	cursor: pointer;
	position: relative;
	color: inherit !important;
	font: inherit;
	text-transform: none !important;
	letter-spacing: normal !important;
}

button.wollke-wool-color-select__btn:hover,
button.wollke-wool-color-select__btn:focus-visible,
.wollke-wool-color-select__btn:hover,
.wollke-wool-color-select__btn:focus-visible {
	border-color: var(--wollke-cv-accent, #7ab38b) !important;
	background: #fff !important;
	outline: none;
}

.wollke-wool-color-select.is-open .wollke-wool-color-select__btn {
	border-color: var(--wollke-cv-accent, #7ab38b) !important;
}

.wollke-wool-color-select__img {
	display: block;
	width: 42px;
	height: 42px;
	flex: 0 0 42px;
	object-fit: cover;
	border-radius: 3px;
	background: var(--wollke-cv-muted, #f7f7f7);
}

.wollke-wool-color-select__img[hidden] {
	display: none !important;
}

.wollke-wool-color-select__text {
	flex: 1 1 auto;
	min-width: 0;
	color: #6d6d6d;
	font-size: 14px;
	font-weight: 600;
	line-height: 1.3;
}

.wollke-wool-color-select__pointer {
	position: absolute;
	right: 12px;
	top: 50%;
	width: 0;
	height: 0;
	margin-top: -3px;
	border: 5px solid transparent;
	border-top-color: #242424;
}

.wollke-wool-color-select.is-open .wollke-wool-color-select__pointer {
	margin-top: -8px;
	border-top-color: transparent;
	border-bottom-color: #242424;
}

@media (max-width: 1024px) {
	.wollke-wool-color-select {
		display: block;
	}

	.single-product .variations .value.wollke-has-wool-select .wd-swatches-product {
		position: absolute !important;
		width: 1px !important;
		height: 1px !important;
		overflow: hidden !important;
		clip: rect(0, 0, 0, 0) !important;
		clip-path: inset(50%) !important;
		white-space: nowrap !important;
		border: 0 !important;
		padding: 0 !important;
		margin: -1px !important;
	}

	.single-product .variations .value.wollke-has-wool-select {
		position: relative;
		width: 100%;
	}

	.single-product .variations .value.wollke-has-wool-select > select {
		display: none !important;
	}
}

/* —— Shell —— */
.wollke-color-viewer {
	position: fixed;
	inset: 0;
	z-index: 100050;
	pointer-events: none;
}

.wollke-color-viewer[hidden] {
	display: none !important;
}

.wollke-color-viewer.is-open {
	pointer-events: none;
}

.wollke-color-viewer__backdrop {
	display: none;
}

.wollke-color-viewer__panel {
	position: absolute;
	top: var(--wollke-cv-panel-top);
	left: 0;
	bottom: 0;
	width: var(--wollke-cv-panel-w);
	max-width: 100%;
	display: flex;
	flex-direction: column;
	background: var(--wollke-cv-bg);
	box-shadow: 4px 0 24px rgba(0, 0, 0, 0.12);
	transform: translate3d(-105%, 0, 0);
	transition: transform 0.3s var(--wollke-cv-ease);
	outline: none;
	padding-bottom: env(safe-area-inset-bottom, 0px);
	pointer-events: auto;
}

.wollke-color-viewer.is-open .wollke-color-viewer__panel {
	transform: translate3d(0, 0, 0);
}

.wollke-color-viewer__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	flex: 0 0 auto;
	padding: 18px 16px 14px;
	border-bottom: 1px solid var(--wollke-cv-border);
}

.wollke-color-viewer__header-text {
	min-width: 0;
}

.wollke-color-viewer__title {
	margin: 0;
	color: var(--wollke-cv-title);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.25;
}

.wollke-color-viewer__hint {
	margin: 6px 0 0;
	color: var(--wollke-cv-text);
	font-size: 13px;
	line-height: 1.4;
}

.wollke-color-viewer__hint:empty {
	display: none;
}

button.wollke-color-viewer__close,
.wollke-color-viewer__close {
	flex: 0 0 auto;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	padding: 0 !important;
	margin: -4px -4px 0 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	color: var(--wollke-cv-title) !important;
	font-size: 28px !important;
	font-weight: 300 !important;
	line-height: 1;
	cursor: pointer;
}

button.wollke-color-viewer__close:hover,
button.wollke-color-viewer__close:focus-visible,
.wollke-color-viewer__close:hover,
.wollke-color-viewer__close:focus-visible {
	color: var(--wollke-cv-accent) !important;
	background: transparent !important;
	outline: none;
}

.wollke-color-viewer__body {
	flex: 1 1 auto;
	min-height: 0;
	overflow-x: hidden;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior: contain;
	padding: 16px 16px 28px;
	scroll-padding-block: 24px;
}

/* —— Color cards —— */
button.wollke-color-viewer__item,
.wollke-color-viewer__item {
	display: block !important;
	width: 100%;
	margin: 0 0 20px !important;
	padding: 0 !important;
	background: transparent !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	text-align: center;
	cursor: pointer;
	color: inherit !important;
	font: inherit;
	text-transform: none !important;
	letter-spacing: normal !important;
}

button.wollke-color-viewer__item:last-child,
.wollke-color-viewer__item:last-child {
	margin-bottom: 0 !important;
}

.wollke-color-viewer__img-wrap {
	position: relative;
	display: block;
	border: 2px solid transparent;
	background: var(--wollke-cv-muted);
	transition: border-color 0.15s ease;
}

.wollke-color-viewer__item.is-selected .wollke-color-viewer__img-wrap,
.wollke-color-viewer__item.is-previewed .wollke-color-viewer__img-wrap {
	border-color: var(--wollke-cv-accent);
}

.wollke-color-viewer__item:hover .wollke-color-viewer__img-wrap,
.wollke-color-viewer__item:focus-visible .wollke-color-viewer__img-wrap {
	border-color: var(--wollke-cv-accent);
	outline: none;
}

.wollke-color-viewer__item.is-oos {
	cursor: not-allowed;
	opacity: 0.55;
}

.wollke-color-viewer__item.is-oos:hover .wollke-color-viewer__img-wrap,
.wollke-color-viewer__item.is-oos:focus-visible .wollke-color-viewer__img-wrap {
	border-color: transparent;
}

.wollke-color-viewer__img {
	display: block;
	width: 100%;
	height: auto;
}

.wollke-color-viewer__name {
	display: block;
	margin: 0;
	padding: 10px 8px;
	background: var(--wollke-cv-bg);
	border-top: 1px solid var(--wollke-cv-border);
	color: var(--wollke-cv-title);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

.wollke-color-viewer__badge,
.wollke-color-viewer__oos {
	position: absolute;
	left: 8px;
	top: 8px;
	padding: 4px 8px;
	background: rgba(36, 36, 36, 0.82);
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.2;
}

.wollke-color-viewer__badge {
	background: var(--wollke-cv-accent);
}

.wollke-color-viewer__oos {
	left: auto;
	right: 8px;
	background: rgba(36, 36, 36, 0.72);
}

@media (max-width: 575px) {
	.wollke-color-viewer {
		--wollke-cv-panel-w: min(280px, 70vw);
	}

	.wollke-color-viewer__header {
		padding: 14px 12px 12px;
	}

	.wollke-color-viewer__body {
		padding: 12px 12px 24px;
	}

	button.wollke-color-viewer__item,
	.wollke-color-viewer__item {
		margin-bottom: 16px !important;
	}

	.woosb-products .woosb-product .woosb-title .woosb-name:has(> .wollke-color-viewer-trigger-wrap) {
		gap: 8px;
	}

	button.wollke-color-viewer-trigger,
	.wollke-color-viewer-trigger {
		font-size: 12px !important;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wollke-color-viewer__backdrop,
	.wollke-color-viewer__panel,
	.wollke-color-viewer__img-wrap {
		transition: none;
	}
}
