/**
 * Farben vergleichen — WOLLKE CI modal styles.
 * High specificity so Woodmart `button` defaults do not win.
 */

:root {
	--wollke-cc-accent: #7ab38b;
	--wollke-cc-title: #242424;
	--wollke-cc-text: #777777;
	--wollke-cc-link: #333333;
	--wollke-cc-border: #e5e5e5;
	--wollke-cc-bg: #ffffff;
	--wollke-cc-muted: #f7f7f7;
	--wollke-cc-btn-bg: #f3f3f3;
	--wollke-cc-btn-text: #3e3e3e;
}

/* —— PDP trigger (text link, matches größere Ansicht) —— */
.wollke-color-compare-trigger-wrap {
	display: inline-flex;
	align-items: center;
	margin: 0;
	white-space: nowrap;
}

.wollke-color-compare-trigger-wrap--strickset {
	display: flex;
	justify-content: flex-end;
	width: 100%;
	margin: 0 0 10px;
}

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

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

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

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

/* Wool Farbe row layout (also in viewer CSS when only viewer loads) */
.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;
}

body.wollke-color-compare-open {
	overflow: hidden;
}

/* —— Modal shell —— */
.wollke-color-compare-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
}

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

.wollke-color-compare-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.55);
}

.wollke-color-compare-modal__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(960px, 100%);
	max-height: min(92vh, 900px);
	overflow: hidden;
	background: var(--wollke-cc-bg);
	border-radius: 10px;
	box-shadow: 0 16px 48px rgba(0, 0, 0, 0.2);
	outline: none;
}

.wollke-color-compare-modal__header {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	flex: 0 0 auto;
	padding: 16px 18px 12px;
	border-bottom: 1px solid var(--wollke-cc-border);
	background: var(--wollke-cc-bg);
}

.wollke-color-compare-modal__header-text {
	min-width: 0;
	flex: 1;
}

.wollke-color-compare-modal button.wollke-color-compare-modal__close,
.wollke-color-compare-modal__close {
	position: static;
	flex: 0 0 auto;
	width: 32px;
	height: 32px;
	margin-top: 2px;
	border: none !important;
	background: var(--wollke-cc-btn-bg) !important;
	box-shadow: none !important;
	color: var(--wollke-cc-title) !important;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	border-radius: 4px !important;
	padding: 0 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	min-height: 0 !important;
}

.wollke-color-compare-modal__close:hover,
.wollke-color-compare-modal__close:focus {
	color: var(--wollke-cc-accent) !important;
	outline: none;
}

.wollke-color-compare-modal__title {
	margin: 0 0 6px;
	color: var(--wollke-cc-accent);
	font-size: 26px;
	font-weight: 400;
	line-height: 1.2;
	text-transform: none;
}

.wollke-color-compare-modal__hint {
	margin: 0;
	color: var(--wollke-cc-text);
	font-size: 13px;
	line-height: 1.45;
}

.wollke-color-compare-modal__body {
	flex: 1 1 auto;
	overflow: auto;
	-webkit-overflow-scrolling: touch;
	padding: 16px 18px 24px;
}

.wollke-color-compare-modal__max-hint {
	margin: 0 0 12px;
	padding: 8px 10px;
	background: #fff8e6;
	border-left: 3px solid #fbbc34;
	color: var(--wollke-cc-title);
	font-size: 13px;
}

.wollke-color-compare-modal__max-hint[hidden] {
	display: none !important;
}

.wollke-color-compare-modal__slots {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 14px;
	margin-bottom: 22px;
}

.wollke-cc-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
}

.wollke-cc-card.is-dragging {
	opacity: 0.35;
	cursor: grabbing;
}

.wollke-cc-card.is-dragging .wollke-cc-card__image-wrap {
	border-style: dashed;
}

.wollke-cc-card--ghost {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 100001;
	margin: 0;
	pointer-events: none;
	opacity: 0.95;
	box-shadow: 0 16px 40px rgba(0, 0, 0, 0.28);
	will-change: transform;
	background: #ffffff;
	border-radius: 8px;
	overflow: hidden;
}

.wollke-cc-card--ghost .wollke-cc-card__image-wrap {
	border-radius: 8px 8px 0 0;
}

.wollke-cc-card--ghost .wollke-cc-card__meta {
	padding: 8px 10px 10px;
	min-height: 0;
}

body.wollke-cc-dragging {
	cursor: grabbing !important;
	user-select: none !important;
	-webkit-user-select: none !important;
}

body.wollke-cc-dragging * {
	cursor: grabbing !important;
}

.wollke-cc-card__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	height: 36px;
	padding: 0 6px;
	background: var(--wollke-cc-btn-bg);
	border: 1px solid var(--wollke-cc-border);
	border-bottom: none;
	border-radius: 8px 8px 0 0;
}

.wollke-cc-card--empty .wollke-cc-card__toolbar {
	display: none;
}

.wollke-cc-card__image-wrap {
	position: relative;
	aspect-ratio: 1 / 1;
	border-radius: 0 0 8px 8px;
	overflow: hidden;
	background: var(--wollke-cc-muted);
	border: 1px solid var(--wollke-cc-border);
}

.wollke-cc-card--empty .wollke-cc-card__image-wrap {
	border-radius: 8px;
}

.wollke-cc-card__placeholder {
	width: 100%;
	height: 100%;
	background:
		repeating-linear-gradient(
			-45deg,
			#f0f0f0,
			#f0f0f0 8px,
			#f7f7f7 8px,
			#f7f7f7 16px
		);
}

.wollke-cc-card__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.wollke-color-compare-modal button.wollke-cc-card__drag,
.wollke-color-compare-modal button.wollke-cc-card__remove,
.wollke-cc-card__drag,
.wollke-cc-card__remove {
	position: static;
	width: 28px;
	height: 28px;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	border: none !important;
	border-radius: 4px !important;
	background: #ffffff !important;
	color: var(--wollke-cc-title) !important;
	box-shadow: none !important;
	cursor: pointer;
	padding: 0 !important;
	line-height: 1;
	min-height: 0 !important;
	-webkit-user-select: none;
	user-select: none;
}

.wollke-cc-card__drag {
	cursor: grab !important;
	touch-action: none;
}

.wollke-cc-card__drag:active {
	cursor: grabbing !important;
}

.wollke-cc-card__drag-icon {
	fill: currentColor;
	pointer-events: none;
}

.wollke-cc-card__remove {
	font-size: 20px;
	font-weight: 400;
}

.wollke-cc-card__drag:hover,
.wollke-cc-card__remove:hover,
.wollke-cc-card__drag:focus,
.wollke-cc-card__remove:focus {
	color: var(--wollke-cc-accent) !important;
	background: #ffffff !important;
	outline: none;
}

.wollke-cc-card__meta {
	margin-top: 10px;
	min-height: 52px;
}

.wollke-color-compare-modal--multi-wool .wollke-cc-card__meta {
	min-height: 68px;
}

.wollke-cc-card__slot-label {
	display: block;
	color: var(--wollke-cc-accent);
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin-bottom: 2px;
}

.wollke-cc-card__wool-name {
	display: block;
	color: var(--wollke-cc-text);
	font-size: 12px;
	font-weight: 500;
	line-height: 1.3;
	margin-bottom: 2px;
	word-break: break-word;
}

.wollke-cc-card__name {
	display: block;
	color: var(--wollke-cc-title);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.3;
	word-break: break-word;
}

.wollke-cc-card__oos {
	display: block;
	margin-top: 2px;
	color: var(--wollke-cc-text);
	font-size: 12px;
}

.wollke-color-compare-modal button.wollke-cc-card__btn,
.wollke-cc-card__btn {
	margin-top: 10px;
	width: 100%;
	padding: 10px 8px !important;
	border: 1px solid var(--wollke-cc-border) !important;
	border-radius: 0 !important;
	background: var(--wollke-cc-btn-bg) !important;
	color: var(--wollke-cc-btn-text) !important;
	box-shadow: none !important;
	font-weight: 600 !important;
	font-size: 11px !important;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1.2;
	cursor: pointer;
	text-align: center;
	min-height: 40px !important;
}

.wollke-color-compare-modal button.wollke-cc-card__btn:hover,
.wollke-color-compare-modal button.wollke-cc-card__btn:focus,
.wollke-cc-card__btn:hover,
.wollke-cc-card__btn:focus {
	background: #ebebeb !important;
	outline: none;
}

.wollke-color-compare-modal button.wollke-cc-card__btn--active,
.wollke-color-compare-modal button.wollke-cc-card__btn--active:hover,
.wollke-color-compare-modal button.wollke-cc-card__btn--active:focus,
.wollke-cc-card__btn--active,
.wollke-cc-card__btn--active:hover,
.wollke-cc-card__btn--active:focus {
	background: var(--wollke-cc-accent) !important;
	border-color: var(--wollke-cc-accent) !important;
	color: #ffffff !important;
	cursor: default;
}

.wollke-cc-card--empty .wollke-cc-card__name {
	color: var(--wollke-cc-text);
	font-weight: 400;
}

.wollke-color-compare-modal__palette {
	border-top: 1px dashed var(--wollke-cc-border);
	padding-top: 18px;
}

.wollke-cc-group + .wollke-cc-group {
	margin-top: 18px;
	padding-top: 16px;
	border-top: 1px dashed var(--wollke-cc-border);
}

.wollke-cc-group__title {
	margin: 0 0 12px;
	color: var(--wollke-cc-accent);
	font-size: 18px;
	font-weight: 400;
	line-height: 1.3;
}

.wollke-cc-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.wollke-color-compare-modal button.wollke-cc-thumb,
.wollke-cc-thumb {
	width: 52px;
	height: 52px;
	padding: 0 !important;
	border: 2px solid transparent !important;
	border-radius: 4px !important;
	overflow: hidden;
	background: var(--wollke-cc-muted) !important;
	box-shadow: none !important;
	cursor: pointer;
	opacity: 0.75;
	min-height: 0 !important;
	transition: opacity 0.15s ease, border-color 0.15s ease, transform 0.15s ease;
}

.wollke-cc-thumb img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 0;
	pointer-events: none;
}

.wollke-cc-thumb:hover,
.wollke-cc-thumb:focus {
	opacity: 1;
	outline: none;
	transform: scale(1.03);
}

.wollke-color-compare-modal button.wollke-cc-thumb.is-selected,
.wollke-cc-thumb.is-selected {
	opacity: 1;
	border-color: var(--wollke-cc-accent) !important;
}

.wollke-cc-thumb.is-oos {
	filter: grayscale(0.25);
}

@media (max-width: 900px) {
	.wollke-color-compare-modal__slots {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 560px) {
	.wollke-color-compare-modal {
		padding: 0;
		align-items: flex-end;
	}

	.wollke-color-compare-modal__dialog {
		width: 100%;
		max-height: 94vh;
		border-radius: 12px 12px 0 0;
	}

	.wollke-color-compare-modal__title {
		font-size: 22px;
	}

	.wollke-color-compare-modal__body {
		padding: 12px 14px 20px;
	}

	.wollke-color-compare-modal__slots {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 10px;
	}

	.wollke-cc-thumb {
		width: 44px;
		height: 44px;
	}

	.wollke-cc-card__btn {
		font-size: 10px !important;
		padding: 9px 6px !important;
	}
}
