/* Santtoro Finish Visualizer — front-end
   Typography intentionally inherits from the theme so the tool matches
   whatever Elementor global fonts the site is using. */

.sfv {
	--sfv-accent: #b4642a;
	--sfv-ink: #1e1109;
	--sfv-surface: #efe8dd;
	--sfv-line: #ded4c4;
	--sfv-muted: #6f6459;
	--sfv-page: #f6f1ea;
	--sfv-card: #ffffff;
	--sfv-radius: 2px;
	--sfv-gap: clamp(28px, 4vw, 56px);

	color: var(--sfv-ink);
	font-family: inherit;
	line-height: 1.55;
	box-sizing: border-box;
}

.sfv *,
.sfv *::before,
.sfv *::after {
	box-sizing: inherit;
}

.sfv img,
.sfv canvas {
	max-width: 100%;
}

/* ---------------------------------------------------------------- Intro */

.sfv-intro {
	max-width: 780px;
	margin: 0 auto clamp(32px, 5vw, 64px);
	text-align: center;
}

.sfv-intro__eyebrow {
	margin: 0 0 18px;
	color: var(--sfv-accent);
	font-size: 12px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.sfv-intro__title {
	margin: 0 0 22px;
	font-size: clamp(34px, 5.2vw, 62px);
	font-weight: 600;
	line-height: 1.12;
	letter-spacing: -0.01em;
}

.sfv-intro__text {
	margin: 0;
	color: var(--sfv-muted);
	font-size: clamp(15px, 1.2vw, 18px);
}

/* ----------------------------------------------------------------- Grid */

.sfv__grid {
	display: grid;
	grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
	gap: var(--sfv-gap);
	align-items: start;
}

@media (max-width: 1024px) {
	.sfv__grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------------------------------------------------------------- Stage */

.sfv__stage {
	position: relative;
	min-width: 0;
}

.sfv-drop {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 520px;
	padding: 40px 24px;
	background: var(--sfv-surface);
	border: 1px solid var(--sfv-line);
	border-radius: var(--sfv-radius);
	text-align: center;
	transition: background 0.2s ease, border-color 0.2s ease;
}

@media (max-width: 640px) {
	.sfv-drop {
		min-height: 340px;
	}
}

.sfv-drop.is-dragging {
	background: #e8dfd1;
	border-color: var(--sfv-accent);
}

.sfv-drop__inner {
	max-width: 360px;
}

.sfv-drop__plus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 78px;
	height: 78px;
	margin-bottom: 26px;
	border: 1px solid rgba(30, 17, 9, 0.22);
	border-radius: 50%;
	color: var(--sfv-ink);
}

.sfv-drop__plus svg {
	width: 26px;
	height: 26px;
}

.sfv-drop__title {
	margin: 0 0 10px;
	font-size: 21px;
	font-weight: 600;
}

.sfv-drop__text {
	margin: 0 0 26px;
	color: var(--sfv-muted);
	font-size: 14px;
}

.sfv-drop__error {
	margin: 18px 0 0;
	color: #a3311f;
	font-size: 13px;
}

.sfv-file {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* -------------------------------------------------------------- Editor */

.sfv-editor[hidden],
.sfv-drop[hidden] {
	display: none;
}

.sfv-viewport {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	background: var(--sfv-surface);
	border: 1px solid var(--sfv-line);
	border-radius: var(--sfv-radius);
	overflow: hidden;
	touch-action: pan-y;
	cursor: crosshair;
}

.sfv-viewport.is-brush {
	touch-action: none;
}

.sfv-canvas {
	display: block;
	width: 100%;
	height: auto;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
}

.sfv-canvas--overlay {
	position: absolute;
	left: 50%;
	top: 50%;
	width: 100%;
	transform: translate(-50%, -50%);
	pointer-events: none;
}

.sfv-ring {
	position: absolute;
	top: 0;
	left: 0;
	border: 1px solid rgba(255, 255, 255, 0.9);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.45);
	border-radius: 50%;
	pointer-events: none;
	opacity: 0;
	transform: translate(-50%, -50%);
}

.sfv-viewport.is-brush .sfv-ring {
	opacity: 1;
}

.sfv-viewport.is-brush {
	cursor: none;
}

.sfv-coach {
	position: absolute;
	left: 50%;
	bottom: 16px;
	transform: translateX(-50%);
	margin: 0;
	padding: 8px 16px;
	max-width: calc(100% - 32px);
	background: rgba(30, 17, 9, 0.86);
	color: #fff;
	font-size: 12.5px;
	letter-spacing: 0.01em;
	text-align: center;
	border-radius: 2px;
	pointer-events: none;
	transition: opacity 0.35s ease;
}

.sfv-coach[hidden] {
	display: none;
}

.sfv-busy {
	position: absolute;
	top: 14px;
	left: 14px;
	padding: 6px 12px;
	background: rgba(30, 17, 9, 0.86);
	color: #fff;
	font-size: 12px;
	border-radius: 2px;
}

.sfv-busy[hidden] {
	display: none;
}

/* ------------------------------------------------------------ Controls */

.sfv-controls {
	display: grid;
	gap: 16px;
	margin-top: 16px;
}

.sfv-tools {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.sfv-tool {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 9px 14px;
	background: var(--sfv-card);
	border: 1px solid var(--sfv-line);
	border-radius: var(--sfv-radius);
	color: var(--sfv-ink);
	font: inherit;
	font-size: 13px;
	line-height: 1;
	cursor: pointer;
	transition: background 0.18s ease, border-color 0.18s ease, color 0.18s ease;
}

.sfv-tool svg {
	width: 16px;
	height: 16px;
}

.sfv-tool:hover {
	border-color: var(--sfv-accent);
}

.sfv-tool.is-active {
	background: var(--sfv-ink);
	border-color: var(--sfv-ink);
	color: #fff;
}

.sfv-sliders {
	display: flex;
	flex-wrap: wrap;
	gap: 20px 28px;
}

.sfv-slider {
	display: flex;
	align-items: center;
	gap: 10px;
	min-width: 190px;
	flex: 1 1 190px;
}

.sfv-slider[hidden] {
	display: none;
}

.sfv-slider__label {
	color: var(--sfv-muted);
	font-size: 11px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	white-space: nowrap;
}

.sfv-slider input[type="range"] {
	flex: 1;
	min-width: 90px;
	height: 2px;
	appearance: none;
	-webkit-appearance: none;
	background: var(--sfv-line);
	border-radius: 2px;
	cursor: pointer;
}

.sfv-slider input[type="range"]::-webkit-slider-thumb {
	appearance: none;
	-webkit-appearance: none;
	width: 14px;
	height: 14px;
	background: var(--sfv-ink);
	border-radius: 50%;
	cursor: grab;
}

.sfv-slider input[type="range"]::-moz-range-thumb {
	width: 14px;
	height: 14px;
	background: var(--sfv-ink);
	border: 0;
	border-radius: 50%;
	cursor: grab;
}

.sfv-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

.sfv-action {
	padding: 9px 14px;
	background: transparent;
	border: 1px solid var(--sfv-line);
	border-radius: var(--sfv-radius);
	color: var(--sfv-ink);
	font: inherit;
	font-size: 11px;
	letter-spacing: 0.09em;
	text-transform: uppercase;
	line-height: 1;
	cursor: pointer;
	transition: border-color 0.18s ease, color 0.18s ease, opacity 0.18s ease;
}

.sfv-action:hover:not(:disabled) {
	border-color: var(--sfv-ink);
}

.sfv-action:disabled {
	opacity: 0.4;
	cursor: default;
}

.sfv-action--quiet {
	border-color: transparent;
	color: var(--sfv-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.sfv-action.is-holding {
	background: var(--sfv-ink);
	border-color: var(--sfv-ink);
	color: #fff;
}

/* -------------------------------------------------------------- Palette */

.sfv__palette {
	min-width: 0;
}

.sfv-collection + .sfv-collection {
	margin-top: 34px;
}

.sfv-collection__label {
	margin: 0 0 6px;
	color: var(--sfv-accent);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.sfv-collection__title {
	margin: 0 0 16px;
	font-size: 21px;
	font-weight: 600;
	line-height: 1.2;
}

.sfv-swatches {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 12px;
}

@media (max-width: 480px) {
	.sfv-swatches {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.sfv-swatch {
	display: block;
	padding: 8px 8px 10px;
	background: var(--sfv-card);
	border: 1px solid var(--sfv-line);
	border-radius: var(--sfv-radius);
	text-align: left;
	font: inherit;
	color: var(--sfv-ink);
	cursor: pointer;
	transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.sfv-swatch:hover {
	border-color: rgba(30, 17, 9, 0.45);
	transform: translateY(-1px);
}

.sfv-swatch__color {
	display: block;
	height: 62px;
	border-radius: 1px;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.sfv-swatch__name {
	display: block;
	margin-top: 9px;
	font-size: 12.5px;
	font-weight: 500;
	line-height: 1.3;
}

.sfv-swatch[aria-pressed="true"] {
	border-color: var(--sfv-ink);
	box-shadow: 0 0 0 1px var(--sfv-ink);
}

.sfv-swatch[aria-pressed="true"] .sfv-swatch__name::after {
	content: "";
	display: inline-block;
	width: 5px;
	height: 5px;
	margin-left: 7px;
	background: var(--sfv-accent);
	border-radius: 50%;
	vertical-align: middle;
}

.sfv-note {
	margin: 40px 0 22px;
	padding-top: 26px;
	border-top: 1px solid var(--sfv-line);
	color: var(--sfv-muted);
	font-size: 13px;
	line-height: 1.6;
}

/* -------------------------------------------------------------- Buttons */

.sfv-btn {
	display: inline-block;
	padding: 15px 26px;
	font: inherit;
	font-size: 11.5px;
	font-weight: 500;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	text-decoration: none;
	line-height: 1;
	border-radius: var(--sfv-radius);
	cursor: pointer;
	transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sfv-btn--solid {
	background: #2c1508;
	border: 1px solid #2c1508;
	color: #fff;
}

.sfv-btn--solid:hover {
	background: var(--sfv-accent);
	border-color: var(--sfv-accent);
	color: #fff;
}

.sfv-btn--outline {
	background: transparent;
	border: 1px solid var(--sfv-ink);
	color: var(--sfv-ink);
}

.sfv-btn--outline:hover {
	background: var(--sfv-ink);
	color: #fff;
}

/* ---------------------------------------------------------------- Toast */

.sfv-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	z-index: 9999;
	transform: translateX(-50%);
	padding: 11px 20px;
	background: var(--sfv-ink);
	color: #fff;
	font-size: 13px;
	border-radius: 2px;
	box-shadow: 0 8px 26px rgba(0, 0, 0, 0.2);
}

.sfv-toast[hidden] {
	display: none;
}

/* ------------------------------------------------------------- A11y */

.sfv :focus-visible {
	outline: 2px solid var(--sfv-accent);
	outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
	.sfv * {
		transition-duration: 0.01ms !important;
		animation-duration: 0.01ms !important;
	}
}


/* ------------------------------------------------------------- Mobile */

@media (max-width: 1024px) {
	/* Keep the photo in view while the visitor scrolls the palette. */
	.sfv__stage {
		position: sticky;
		top: 0;
		z-index: 5;
		padding: 10px 0 12px;
		margin-bottom: 4px;
		background: var(--sfv-page);
	}

	.sfv-viewport {
		max-height: 42vh;
	}

	.sfv-canvas {
		width: auto;
		height: auto;
		max-width: 100%;
		max-height: 42vh;
		margin: 0 auto;
	}

	.sfv-canvas--overlay {
		width: auto;
	}

	.sfv-controls {
		gap: 10px;
		margin-top: 10px;
	}

	/* One scrollable row each, so the pinned block stays short. */
	.sfv-tools,
	.sfv-actions {
		flex-wrap: nowrap;
		overflow-x: auto;
		scrollbar-width: none;
		-webkit-overflow-scrolling: touch;
		padding-bottom: 2px;
	}

	.sfv-tools::-webkit-scrollbar,
	.sfv-actions::-webkit-scrollbar {
		display: none;
	}

	.sfv-tool,
	.sfv-action {
		flex: 0 0 auto;
		min-height: 44px;
	}

	.sfv-sliders {
		gap: 12px 20px;
	}

	.sfv-slider {
		min-width: 150px;
		flex: 1 1 150px;
	}

	/* Easier to grab with a thumb. */
	.sfv-slider input[type="range"] {
		height: 22px;
		background: transparent;
		background-image: linear-gradient(var(--sfv-line), var(--sfv-line));
		background-size: 100% 2px;
		background-position: center;
		background-repeat: no-repeat;
	}

	.sfv-slider input[type="range"]::-webkit-slider-thumb {
		width: 20px;
		height: 20px;
	}

	.sfv-slider input[type="range"]::-moz-range-thumb {
		width: 20px;
		height: 20px;
	}

	.sfv-drop {
		min-height: 300px;
	}

	.sfv-btn {
		display: block;
		width: 100%;
		padding: 17px 22px;
		text-align: center;
	}
}


/* The outline tool places points, so the crosshair stays. */
.sfv-viewport.is-poly {
	touch-action: pan-y;
}

.sfv .sfv-action--primary,
.sfv .sfv-action--primary:hover,
.sfv .sfv-action--primary:focus,
.sfv .sfv-action--primary:active {
	background-color: var(--sfv-ink);
	border-color: var(--sfv-ink);
	color: #fff;
}

/* ---------------------------------------------------------------------
 * Theme guards
 *
 * Themes and Elementor kits style bare <button> elements, including their
 * focus and active states. Every button in the tool declares its own colours
 * for all states so an inherited style cannot leak in.
 * ------------------------------------------------------------------ */

.sfv button,
.sfv button:hover,
.sfv button:focus,
.sfv button:active {
	box-shadow: none;
	text-shadow: none;
	background-image: none;
}

.sfv .sfv-swatch,
.sfv .sfv-swatch:hover,
.sfv .sfv-swatch:focus,
.sfv .sfv-swatch:focus-visible,
.sfv .sfv-swatch:active,
.sfv .sfv-swatch[aria-pressed="true"] {
	background-color: var(--sfv-card);
	color: var(--sfv-ink);
}

.sfv .sfv-swatch .sfv-swatch__name {
	color: var(--sfv-ink);
}

.sfv .sfv-swatch[aria-pressed="true"] {
	border-color: var(--sfv-ink);
	box-shadow: 0 0 0 1px var(--sfv-ink);
}

.sfv .sfv-swatch:focus-visible {
	outline: 2px solid var(--sfv-accent);
	outline-offset: 2px;
}

.sfv .sfv-tool,
.sfv .sfv-tool:hover,
.sfv .sfv-tool:focus,
.sfv .sfv-tool:active {
	background-color: var(--sfv-card);
	color: var(--sfv-ink);
}

.sfv .sfv-tool.is-active,
.sfv .sfv-tool.is-active:hover,
.sfv .sfv-tool.is-active:focus,
.sfv .sfv-tool.is-active:active {
	background-color: var(--sfv-ink);
	border-color: var(--sfv-ink);
	color: #fff;
}

.sfv .sfv-action,
.sfv .sfv-action:hover,
.sfv .sfv-action:focus,
.sfv .sfv-action:active {
	background-color: transparent;
	color: var(--sfv-ink);
}

.sfv .sfv-action--quiet,
.sfv .sfv-action--quiet:hover,
.sfv .sfv-action--quiet:focus {
	color: var(--sfv-muted);
}

.sfv .sfv-action.is-holding,
.sfv .sfv-action.is-holding:hover,
.sfv .sfv-action.is-holding:focus,
.sfv .sfv-action.is-holding:active {
	background-color: var(--sfv-ink);
	border-color: var(--sfv-ink);
	color: #fff;
}

.sfv .sfv-btn--solid,
.sfv .sfv-btn--solid:focus,
.sfv .sfv-btn--solid:active {
	background-color: #2c1508;
	border-color: #2c1508;
	color: #fff;
}

.sfv .sfv-btn--solid:hover {
	background-color: var(--sfv-accent);
	border-color: var(--sfv-accent);
	color: #fff;
}

.sfv .sfv-btn--outline,
.sfv .sfv-btn--outline:focus,
.sfv .sfv-btn--outline:active {
	background-color: transparent;
	color: var(--sfv-ink);
}

.sfv .sfv-btn--outline:hover {
	background-color: var(--sfv-ink);
	color: #fff;
}
