/* Rosestone Core widgets. Colours come from Elementor globals via CSS variables. */

/* Colour Studio */
.rsc-cs {
	--rsc-gap: 12px;
	--rsc-radius: 24px;
	--rsc-active: currentColor;
	--rsc-text: inherit;
	--rsc-card: #fff;
	display: grid;
	grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
	gap: calc(var(--rsc-gap) * 4);
	align-items: start;
	color: var(--rsc-text);
}
.rsc-cs__stage {
	position: relative;
	aspect-ratio: 1 / 1;
	border-radius: var(--rsc-radius);
	overflow: hidden;
	background: rgba(0, 0, 0, .06);
}
.rsc-cs__preview {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: opacity .25s ease;
}
.rsc-cs__preview.is-loading { opacity: .35; }
.rsc-cs__badge {
	position: absolute;
	left: 20px;
	bottom: 20px;
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 18px 12px 12px;
	background: var(--rsc-card);
	border-radius: 14px;
	box-shadow: 0 12px 30px -12px rgba(0, 0, 0, .35);
}
.rsc-cs__badge-thumb {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	object-fit: cover;
}
.rsc-cs__badge-label {
	display: block;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
	opacity: .75;
}
.rsc-cs__badge-name { display: block; font-size: 20px; font-weight: 800; line-height: 1.2; }
.rsc-cs__filters {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: calc(var(--rsc-gap) * 1.5);
}
/* Reset theme / kit button styles inside the widget. */
.rsc-cs .rsc-cs__filter,
.rsc-cs .rsc-cs__swatch {
	-webkit-appearance: none;
	appearance: none;
	box-shadow: none;
	text-transform: none;
	letter-spacing: normal;
	line-height: 1.25;
	white-space: normal;
}
.rsc-cs .rsc-cs__filter {
	min-height: 44px;
	padding: 8px 18px;
	border-radius: 999px;
	border: 1px solid rgba(0, 0, 0, .18);
	background: transparent;
	color: var(--rsc-text);
	font-size: 15px;
	font-weight: 700;
	cursor: pointer;
}
.rsc-cs .rsc-cs__filter:hover,
.rsc-cs .rsc-cs__filter:focus {
	background: rgba(0, 0, 0, .05);
	color: var(--rsc-text);
}
.rsc-cs .rsc-cs__filter[aria-pressed="true"] {
	background: var(--rsc-active);
	border-color: var(--rsc-active);
	color: #fff;
}
.rsc-cs__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--rsc-gap);
	max-height: 420px;
	overflow-y: auto;
	padding: 4px;
	scrollbar-width: thin;
}
.rsc-cs .rsc-cs__swatch {
	display: flex;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	width: 100%;
	padding: 6px 6px 10px;
	border: 2px solid transparent;
	border-radius: 14px;
	background: var(--rsc-card);
	color: var(--rsc-text);
	text-align: left;
	cursor: pointer;
	transition: border-color .2s ease, box-shadow .2s ease, transform .2s ease;
}
.rsc-cs .rsc-cs__swatch:hover,
.rsc-cs .rsc-cs__swatch:focus {
	background: var(--rsc-card);
	color: var(--rsc-text);
	transform: translateY(-2px);
}
.rsc-cs .rsc-cs__swatch[aria-pressed="true"] {
	border-color: var(--rsc-active);
	box-shadow: 0 8px 20px -10px rgba(0, 0, 0, .45);
}
.rsc-cs__swatch[hidden] { display: none; }
.rsc-cs__swatch img {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	border-radius: 10px;
	display: block;
}
.rsc-cs__swatch-name {
	display: block;
	font-size: 13px;
	font-weight: 700;
	line-height: 1.25;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.rsc-cs__grid { overflow-x: hidden; }
.rsc-cs__note { margin: 14px 0 0; font-size: 13px; opacity: .8; }
.rsc-cs button:focus-visible { outline: 3px solid var(--rsc-active); outline-offset: 2px; }

@media (max-width: 1024px) {
	.rsc-cs { grid-template-columns: 1fr; }
}

/* Before / After */
.rsc-ba {
	--rsc-pos: 50%;
	--rsc-handle: currentColor;
	position: relative;
	height: 480px;
	overflow: hidden;
	border-radius: 22px;
	user-select: none;
	isolation: isolate;
}
.rsc-ba__img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}
.rsc-ba__after { clip-path: inset(0 0 0 var(--rsc-pos)); }
.rsc-ba__label {
	position: absolute;
	top: 18px;
	z-index: 2;
	padding: 7px 12px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 800;
	letter-spacing: .12em;
	text-transform: uppercase;
	pointer-events: none;
}
.rsc-ba__label--before { left: 18px; background: rgba(7, 10, 38, .8); color: #fff; }
.rsc-ba__label--after { right: 18px; background: #fff; color: #0b1033; }
.rsc-ba__divider {
	position: absolute;
	top: 0;
	bottom: 0;
	left: var(--rsc-pos);
	width: 3px;
	margin-left: -1.5px;
	background: #fff;
	z-index: 2;
	pointer-events: none;
}
.rsc-ba__handle {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 52px;
	height: 52px;
	margin: -26px 0 0 -26px;
	border-radius: 50%;
	background: #fff;
	color: var(--rsc-handle);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .35);
	display: flex;
	align-items: center;
	justify-content: center;
}
.rsc-ba__range {
	-webkit-appearance: none;
	appearance: none;
	position: absolute;
	inset: 0;
	z-index: 3;
	width: 100%;
	height: 100%;
	margin: 0;
	background: transparent;
	opacity: 0;
	cursor: ew-resize;
}
.rsc-ba__range:focus-visible + .rsc-ba__divider,
.rsc-ba:focus-within .rsc-ba__handle { outline: 3px solid #e9b949; outline-offset: 3px; }

@media (prefers-reduced-motion: reduce) {
	.rsc-cs__preview, .rsc-cs__swatch { transition: none; }
	.rsc-cs__swatch:hover { transform: none; }
}
