/* ChromaLab Results Widget — Redesign v4 */

.chromalab-results {
	width: 100%;
	box-sizing: border-box;
}

.chromalab-results *,
.chromalab-results *::before,
.chromalab-results *::after {
	box-sizing: border-box;
}

/* --- Section --- */

.chromalab-results__section {
	margin-bottom: 48px;
}

/* --- Pill (above entire section) --- */

.chromalab-results__pill {
	display: inline-flex;
	align-self: flex-start;
	align-items: center;
	gap: 10px;
	padding: 8px 14px;
	border-radius: 0;
	background: #fff;
	border: 1px solid #000;
	margin-bottom: 16px;
	font-size: 13px;
}

.chromalab-results__pill-count {
	font-weight: 600;
	color: #000;
}

.chromalab-results__pill-sep {
	width: 1px;
	height: 18px;
	background: #ccc;
}

.chromalab-results__pill-btn {
	width: 26px;
	height: 26px;
	border-radius: 50%;
	border: 1px solid #ccc;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 14px;
	color: #444;
	line-height: 0;
	padding: 0;
	transition: border-color 0.15s, background 0.15s;
}

.chromalab-results__pill-btn:hover {
	border-color: #888;
	background: #f0f0f0;
}

.chromalab-results__pill-swatch {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px #ccc;
	flex-shrink: 0;
}

.chromalab-results__pill-pct {
	font-family: monospace;
	font-size: 12px;
	color: #555;
}

.chromalab-results__pill-reset {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	border: 1px solid #000;
	background: #000;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 12px;
	color: #fff;
	line-height: 0;
	padding: 0;
	transition: background 0.15s, border-color 0.15s;
}

.chromalab-results__pill-reset:hover {
	background: #c53030;
	border-color: #c53030;
}

/* Pill: add-all button (right end of pill) */

.chromalab-results__pill-add-all {
	margin-left: auto;
	align-self: stretch;
	padding: 0 16px;
	margin-right: -15px;
	margin-top: -9px;
	margin-bottom: -9px;
	background: #fff;
	color: #000;
	border: 1px solid #000;
	border-radius: 0;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	white-space: nowrap;
	transition: opacity 0.15s;
}

.chromalab-results__pill-add-all:hover:not(:disabled) {
	background: #000;
	color: #fff;
}

.chromalab-results__pill-add-all:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* --- Section inner (cat-box + grid) --- */

.chromalab-results__section-inner {
	display: flex;
	gap: 28px;
	align-items: flex-start;
}

/* --- Category box --- */

.chromalab-results__cat-box {
	width: 240px;
	flex-shrink: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
	background: #f9f9f9;
	border: 1px solid #e8e8e8;
	border-radius: 0;
	padding: 16px;
	position: sticky;
	top: 100px;
	align-self: flex-start;
}

/* Override The7 overflow:hidden that breaks sticky */
.closed-mobile-header {
	overflow: clip !important;
}

.chromalab-results .chromalab-results__cat-img {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 0;
	border: 1px solid #eee;
	background: #f0f0f0;
}

.chromalab-results__cat-title {
	font-size: 16px;
	font-weight: 700;
	color: #000;
	margin: 0;
	text-decoration: none;
}

.chromalab-results__cat-title:hover {
	text-decoration: underline;
}

.chromalab-results__cat-desc {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.45);
	line-height: 1.4;
	margin: 0;
}

.chromalab-results__view-range {
	display: block;
	padding: 10px 14px;
	border: 1px solid #000;
	border-radius: 0;
	background: #fff;
	color: #000;
	font-size: 12px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	transition: background 0.15s, color 0.15s;
	margin-top: auto;
	width: 100%;
	text-align: center;
	text-decoration: none;
}

.chromalab-results__view-range:hover {
	background: #000;
	color: #fff;
}

.chromalab-results__cart-icon,
.chromalab-results__check-icon {
	width: 13px;
	height: 13px;
	stroke: currentColor;
	fill: none;
	stroke-width: 2;
	stroke-linecap: round;
	stroke-linejoin: round;
	vertical-align: -2px;
	margin-right: 3px;
}

/* --- Section empty state (local tolerance dropped match count to zero) ---
   Container = layout only. Message inherits theme typography. Reset button uses
   The7's `.box-button .elementor-button` classes so the theme owns its styling. */

.chromalab-results__section-empty {
	padding: 12px 0;
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 10px;
}

.chromalab-results__section-empty-msg {
	margin: 0;
}

/* --- Cat-box with linked product (side by side, CSS grid) --- */

.chromalab-results__cat-box--linked {
	width: 480px;
	display: grid;
	grid-template-columns: 1fr 40px 1fr;
	grid-template-rows: auto auto;
	column-gap: 12px;
	row-gap: 0;
	align-items: start;
}

.chromalab-results__cat-box-col-left {
	grid-column: 1;
	grid-row: 1 / 3;
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.chromalab-results__cat-box-col-right {
	grid-column: 3;
	grid-row: 1 / 3;
	align-self: stretch;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 10px;
}

.chromalab-results__cat-box-divider {
	grid-column: 2;
	grid-row: 1 / 3;
	align-self: stretch;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.chromalab-results__cat-box-divider::before,
.chromalab-results__cat-box-divider::after {
	content: '';
	flex: 1;
	width: 1px;
	background: #ddd;
}

.chromalab-results__cat-box-divider-icon {
	padding: 3px;
	border-radius: 50%;
	background: #fff;
	border: 1px solid #ddd;
	display: flex;
	align-items: center;
	justify-content: center;
	font-size: 16px;
	color: #bbb;
	font-weight: 300;
	flex-shrink: 0;
}

.chromalab-results__linked-name {
	font-size: 14px;
	font-weight: 600;
	color: #000;
}

.chromalab-results__linked-display-name {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.45);
	line-height: 1.4;
}

.chromalab-results__linked-price {
	font-size: 13px;
	color: rgba(0, 0, 0, 0.45);
}

.chromalab-results__linked-btn {
	padding: 10px;
	border: none;
	border-radius: 0;
	background: #000;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	text-align: center;
	width: 100%;
	transition: opacity 0.15s;
}

.chromalab-results__linked-btn:hover:not(:disabled) {
	opacity: 0.85;
}

.chromalab-results__linked-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

/* --- Carousel strip (3+ linked products) --- */

.chromalab-results__carousel-strip {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 6px;
}

.chromalab-results__carousel-arrow {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	flex-shrink: 0;
	border: 1px solid #ccc;
	background: #fff;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	font-size: 11px;
	color: #666;
	padding: 0;
	transition: border-color 0.15s, background 0.15s;
}

.chromalab-results__carousel-arrow:hover {
	border-color: #888;
	background: #f0f0f0;
}

.chromalab-results__carousel-thumbs {
	display: flex;
	gap: 4px;
	overflow: hidden;
	flex: 1;
}

.chromalab-results__carousel-thumb {
	width: 32px;
	height: 32px;
	border-radius: 0;
	flex-shrink: 0;
	border: 2px solid transparent;
	background-size: cover;
	background-position: center;
	background-color: #eee;
	cursor: pointer;
	transition: border-color 0.15s;
}

.chromalab-results__carousel-thumb--active {
	border-color: #000;
}

.chromalab-results__carousel-thumb:hover {
	border-color: #888;
}

/* --- Results column (pill + grid) --- */

.chromalab-results__results-col {
	flex: 1;
	min-width: 0;
	display: flex;
	flex-direction: column;
}

/* --- Product cards grid --- */

.chromalab-results__grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(155px, 1fr));
	gap: 14px;
}

.chromalab-results[data-card-size="medium"] .chromalab-results__grid {
	grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
	gap: 18px;
}

.chromalab-results[data-card-size="large"] .chromalab-results__grid {
	grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
	gap: 22px;
}

/* --- Product card --- */

.chromalab-results__card {
	display: flex;
	flex-direction: column;
	border: 1px solid #eee;
	border-radius: 0;
	overflow: hidden;
	background: #fff;
	transition: box-shadow 0.15s;
}

.chromalab-results__card:hover {
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.chromalab-results__card--oos .chromalab-results__card-img-link,
.chromalab-results__card--oos .chromalab-results__card-info,
.chromalab-results__card--oos .chromalab-results__card-info-row,
.chromalab-results__card--oos .chromalab-results__add-btn,
.chromalab-results__card--oos .chromalab-results__match-badge,
.chromalab-results__card--oos .chromalab-results__sale-badge,
.chromalab-results__card--oos .chromalab-results__new-badge {
	opacity: 0.6;
}

.chromalab-results__card-img-wrap {
	position: relative;
	aspect-ratio: 1;
	overflow: hidden;
	background: #f5f5f5;
}

.chromalab-results__card-img-link {
	display: block;
	width: 100%;
	height: 100%;
}

.chromalab-results .chromalab-results__card-img {
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	display: block;
}

.chromalab-results__card-img-placeholder {
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, #e8e8e8 0%, #f5f5f5 50%, #e8e8e8 100%);
}

/* Match % badge */

.chromalab-results__match-badge {
	position: absolute;
	bottom: 6px;
	left: 6px;
	background: rgba(0, 0, 0, 0.75);
	color: #fff;
	padding: 0 7px;
	border-radius: 0;
	font-size: 10px;
	font-weight: 600;
	line-height: 1;
	height: 18px;
	min-width: 44px;
	display: inline-flex;
	align-items: center;
	gap: 5px;
	box-sizing: border-box;
}

.chromalab-results__match-badge-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	flex-shrink: 0;
	box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.chromalab-results__match-badge-pct {
	flex: 1;
	text-align: right;
}

/* Sale badge */

.chromalab-results__sale-badge {
	position: absolute;
	top: 6px;
	left: 6px;
	background: #c53030;
	color: #fff;
	padding: 2px 7px;
	border-radius: 0;
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
}

/* New badge */

.chromalab-results__new-badge {
	position: absolute;
	top: 6px;
	right: 6px;
	background: #000;
	color: #fff;
	padding: 2px 7px;
	border-radius: 0;
	font-size: 9px;
	font-weight: 700;
	text-transform: uppercase;
}

/* Out of stock badge */

.chromalab-results__oos-badge {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	background: rgba(0, 0, 0, 0.7);
	color: #fff;
	padding: 6px 14px;
	border-radius: 0;
	font-size: 12px;
	font-weight: 600;
	white-space: nowrap;
}

/* Card info */

.chromalab-results__card-info {
	padding: 8px 10px 4px;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.chromalab-results__card-title {
	font-size: 12px;
	font-weight: 600;
	color: #000;
	text-decoration: none;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.chromalab-results__card-title:hover {
	text-decoration: underline;
}

.chromalab-results__card-price {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.45);
}

/* --- Color display: border --- */

.chromalab-results__card--color-border {
	border-color: var(--card-color);
	border-width: 2px;
}

.chromalab-results__card--color-border-hover {
	border-color: #eee;
}
.chromalab-results__card--color-border-hover:hover {
	border-color: var(--card-color);
	border-width: 2px;
}

.chromalab-results__card--border-top {
	border-color: #eee;
	border-top: 3px solid var(--card-color);
}
.chromalab-results__card--border-top.chromalab-results__card--color-border-hover {
	border-top-color: #eee;
}
.chromalab-results__card--border-top.chromalab-results__card--color-border-hover:hover {
	border-top-color: var(--card-color);
}

.chromalab-results__card--border-bottom {
	border-color: #eee;
	border-bottom: 3px solid var(--card-color);
}
.chromalab-results__card--border-bottom.chromalab-results__card--color-border-hover {
	border-bottom-color: #eee;
}
.chromalab-results__card--border-bottom.chromalab-results__card--color-border-hover:hover {
	border-bottom-color: var(--card-color);
}

/* --- Color display: shadow --- */

.chromalab-results__card--color-shadow {
	box-shadow: 0 2px 12px color-mix(in srgb, var(--card-color) 40%, transparent);
}

.chromalab-results__card--color-shadow-hover:hover {
	box-shadow: 0 2px 12px color-mix(in srgb, var(--card-color) 40%, transparent);
}

/* --- Color display: swatch (clickable = search) --- */

.chromalab-results__color-swatch {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	border: 1px solid rgba(0, 0, 0, 0.15);
	flex-shrink: 0;
	cursor: pointer;
	padding: 0;
	font-family: inherit;
	background: none;
}

/* Search pill (white bg, icon + text) */
.chromalab-results__swatch-pill {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	background: rgba(255, 255, 255, 0.92);
	padding: 3px;
	border-radius: 50%;
	position: relative;
	z-index: 2;
	white-space: nowrap;
}

/* When text is present, pill becomes a rectangle */
.chromalab-results__swatch-pill:has(.chromalab-results__swatch-text) {
	padding: 2px 8px 2px 4px;
	border-radius: 0;
}

.chromalab-results__swatch-pill--hover {
	opacity: 0;
	transition: opacity 0.15s;
}
.chromalab-results__color-swatch:hover .chromalab-results__swatch-pill--hover {
	opacity: 1;
}
.chromalab-results__swatch-pill--mobile {
	display: none;
}
@media (max-width: 768px) {
	.chromalab-results__swatch-pill--mobile { display: inline-flex; }
}

.chromalab-results__swatch-icon {
	display: inline-flex;
	align-items: center;
	flex-shrink: 0;
}

.chromalab-results__swatch-icon svg {
	width: 12px;
	height: 12px;
	stroke: #333;
	fill: none;
	stroke-width: 2.5;
}

.chromalab-results__swatch-text {
	font-size: 10px;
	font-weight: 600;
	color: #333;
	white-space: nowrap;
}

/* --- Swatch: dot on image (top-left) --- */

.chromalab-results__color-swatch--image {
	position: absolute;
	top: 6px;
	left: 6px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
}
.chromalab-results__color-swatch--image:hover {
	width: auto;
	height: auto;
	padding: 4px 8px;
	border-radius: 0;
}

/* --- Swatch: dot before info --- */

.chromalab-results__card-info-row {
	display: flex;
	align-items: flex-start;
	gap: 0;
}

.chromalab-results__color-swatch--desc {
	width: 14px;
	height: 14px;
	border-radius: 50%;
	margin: 12px 0 0 10px;
}
.chromalab-results__color-swatch--desc:hover {
	width: auto;
	height: auto;
	padding: 2px 6px;
	border-radius: 0;
	margin-top: 10px;
}

.chromalab-results__card-info-row .chromalab-results__card-info {
	flex: 1;
	min-width: 0;
}

/* --- Swatch: bar above cart button --- */

.chromalab-results__color-swatch--button {
	--bar-h: 5px;
	width: 100%;
	border-radius: 0;
	border: none;
	height: var(--bar-h);
	margin-bottom: -1px;
	overflow: hidden;
	transition: height 0.2s ease, margin-top 0.2s ease;
	margin-top: 0;
}

/* Expand triggered by CARD hover */
.chromalab-results__card:hover .chromalab-results__color-swatch--button {
	height: 28px;
	margin-top: calc(var(--bar-h) - 28px);
}

/* Pill hidden, fade in on card hover */
.chromalab-results__color-swatch--button .chromalab-results__swatch-pill {
	opacity: 0;
	transition: opacity 0.12s 0.1s;
}
.chromalab-results__card:hover .chromalab-results__color-swatch--button .chromalab-results__swatch-pill {
	opacity: 1;
}

/* Size variants — just set the CSS var */
.chromalab-results[data-color-swatch-btn-size="big"] .chromalab-results__color-swatch--button { --bar-h: 15px; }
.chromalab-results[data-color-swatch-btn-size="large"] .chromalab-results__color-swatch--button { --bar-h: 10px; }
.chromalab-results[data-color-swatch-btn-size="medium"] .chromalab-results__color-swatch--button { --bar-h: 5px; }
.chromalab-results[data-color-swatch-btn-size="small"] .chromalab-results__color-swatch--button { --bar-h: 3px; }
.chromalab-results[data-color-swatch-btn-size="tiny"] .chromalab-results__color-swatch--button { --bar-h: 1px; }

/* Add to cart button */

.chromalab-results__add-btn {
	margin: auto 0 0;
	padding: 10px;
	border: none;
	border-radius: 0;
	background: #000;
	color: #fff;
	font-size: 11px;
	font-weight: 600;
	cursor: pointer;
	font-family: inherit;
	text-align: center;
	transition: opacity 0.15s;
}

.chromalab-results__add-btn:hover:not(:disabled) {
	opacity: 0.85;
}

.chromalab-results__add-btn:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

/* Load more (textual link) */

.chromalab-results__load-more {
	grid-column: 1 / -1;
	padding: 14px 0 2px;
	background: none;
	border: none;
	color: rgba(0, 0, 0, 0.45);
	font-size: 13px;
	cursor: pointer;
	text-align: left;
	font-family: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.chromalab-results__load-more:hover {
	color: #000;
}

/* Empty state */

.chromalab-results__empty {
	text-align: center;
	padding: 40px 20px;
	color: rgba(0, 0, 0, 0.45);
	font-size: 14px;
	font-style: italic;
}

/* --- Subcategory grid (parent category pages) --- */

.chromalab-results__subcat-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
	gap: 20px;
}

.chromalab-results__subcat-card {
	display: flex;
	flex-direction: column;
	border: 1px solid #eee;
	border-radius: 0;
	overflow: hidden;
	background: #fff;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 0.15s, transform 0.15s;
}

.chromalab-results__subcat-card:hover {
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

.chromalab-results .chromalab-results__subcat-img {
	width: 100%;
	height: auto;
	aspect-ratio: 1;
	object-fit: cover;
	display: block;
	background: #f5f5f5;
}

.chromalab-results__subcat-info {
	padding: 14px 16px;
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.chromalab-results__subcat-name {
	font-size: 15px;
	font-weight: 600;
	color: #000;
	margin: 0;
}

.chromalab-results__subcat-desc {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.45);
	line-height: 1.4;
	margin: 0;
}

.chromalab-results__subcat-count {
	font-size: 12px;
	color: rgba(0, 0, 0, 0.35);
}

/* --- Mobile --- */

@media (max-width: 600px) {
	.chromalab-results__section-inner {
		flex-direction: column;
	}

	.chromalab-results__cat-box {
		width: 100%;
	}

	.chromalab-results__cat-box--linked {
		width: 100%;
	}

	.chromalab-results__grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 10px;
	}

	.chromalab-results__pill {
		position: sticky;
		top: 0;
		z-index: 10;
		background: #fff;
		border-color: #ccc;
	}

	.chromalab-results__search-btn {
		opacity: 1;
	}

	.chromalab-results__subcat-grid {
		grid-template-columns: repeat(2, 1fr);
		gap: 12px;
	}
}
