html.vft-modal-open,
body.vft-modal-open {
	overflow: hidden !important;
}

.vft-modal[aria-hidden="true"] {
	display: none;
}

.vft-modal {
	position: fixed;
	z-index: 999999;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
}

.vft-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 12, 14, 0.76);
	backdrop-filter: blur(5px);
	-webkit-backdrop-filter: blur(5px);
}

.vft-modal__dialog {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	width: min(1120px, 100%);
	max-height: min(760px, calc(100vh - 48px));
	overflow: hidden;
	background: #ffffff;
	border-radius: 18px;
	box-shadow: 0 30px 80px rgba(0, 0, 0, 0.3);
	animation: vft-modal-enter 180ms ease-out;
}

.vft-modal__header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 24px;
	padding: 24px 28px;
	border-bottom: 1px solid #e8e8e8;
}

.vft-modal__heading {
	max-width: 720px;
}

.vft-modal__eyebrow {
	display: block;
	margin-bottom: 5px;
	color: #777777;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.vft-modal__header h2 {
	margin: 0 0 5px;
	font-size: clamp(22px, 3vw, 30px);
	line-height: 1.2;
}

.vft-modal__header p {
	margin: 0;
	color: #686868;
	line-height: 1.5;
}

.vft-modal__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	padding: 0;
	background: #f2f2f2;
	border: 0;
	border-radius: 50%;
	color: #202020;
	cursor: pointer;
	font-size: 28px;
	font-weight: 300;
	line-height: 1;
	transition:
		background-color 0.2s ease,
		transform 0.2s ease;
}

.vft-modal__close:hover {
	background: #e6e6e6;
	transform: rotate(4deg);
}

.vft-modal__body {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	min-height: 0;
	overflow: hidden;
}

.vft-viewer {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 520px;
	overflow: hidden;
	background:
		linear-gradient(
			135deg,
			rgba(255, 255, 255, 0.05),
			rgba(255, 255, 255, 0)
		),
		#18181b;
}

.vft-viewer__empty,
.vft-viewer__loading,
.vft-viewer__error {
	position: relative;
	z-index: 3;
	width: min(420px, calc(100% - 40px));
	padding: 30px;
	text-align: center;
}

.vft-viewer__empty {
	color: #ffffff;
}

.vft-viewer__empty-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 76px;
	height: 76px;
	margin-bottom: 18px;
	background: rgba(255, 255, 255, 0.08);
	border: 1px solid rgba(255, 255, 255, 0.13);
	border-radius: 50%;
}

.vft-viewer__empty h3 {
	margin: 0 0 8px;
	color: #ffffff;
	font-size: 22px;
}

.vft-viewer__empty p {
	margin: 0;
	color: rgba(255, 255, 255, 0.7);
	line-height: 1.6;
}

.vft-viewer__loading {
	color: #ffffff;
}

.vft-viewer__loading p {
	margin: 14px 0 0;
	color: rgba(255, 255, 255, 0.78);
}

.vft-spinner {
	display: inline-block;
	width: 42px;
	height: 42px;
	border: 3px solid rgba(255, 255, 255, 0.25);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: vft-spin 0.8s linear infinite;
}

.vft-viewer__error {
	padding: 22px;
	background: #fff2f2;
	border-radius: 12px;
	color: #a12020;
}

.vft-viewer__error strong {
	display: block;
	margin-bottom: 8px;
}

.vft-viewer__error p {
	margin: 0;
	line-height: 1.5;
}

.vft-camera-stage,
.vft-upload-stage {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
}

.vft-camera-stage__video,
.vft-upload-stage__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vft-camera-stage.is-mirrored .vft-camera-stage__video {
	transform: scaleX(-1);
}

.vft-camera-stage__canvas,
.vft-upload-stage__canvas {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	pointer-events: none;
}

.vft-camera-stage__guide {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: flex-end;
	justify-content: center;
	padding: 28px;
	pointer-events: none;
}

.vft-camera-stage__guide::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: min(46%, 310px);
	aspect-ratio: 0.76;
	border: 2px solid rgba(255, 255, 255, 0.72);
	border-radius: 48%;
	transform: translate(-50%, -52%);
	box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.08);
}

.vft-camera-stage__guide span {
	position: relative;
	z-index: 2;
	padding: 8px 13px;
	background: rgba(0, 0, 0, 0.58);
	border-radius: 999px;
	color: #ffffff;
	font-size: 12px;
}

.vft-controls {
	min-height: 0;
	padding: 26px;
	overflow-y: auto;
	background: #ffffff;
}

.vft-controls__label {
	display: block;
	margin-bottom: 10px;
	color: #777777;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.vft-controls__product-row {
	display: flex;
	align-items: center;
	gap: 12px;
}

.vft-controls__shade {
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	border: 3px solid #ffffff;
	border-radius: 50%;
	box-shadow: 0 0 0 1px #d8d8d8;
}

.vft-controls__product-row strong,
.vft-controls__product-row span {
	display: block;
}

.vft-controls__product-row > div > span {
	margin-top: 2px;
	color: #777777;
	font-size: 12px;
	line-height: 1.4;
}

/* Variation shade selector */

.vft-controls__shades {
	margin-top: 24px;
	padding-top: 22px;
	border-top: 1px solid #e8e8e8;
}

.vft-controls__section-heading {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	margin-bottom: 14px;
}

.vft-controls__section-heading > div {
	min-width: 0;
}

.vft-controls__section-heading .vft-controls__label {
	margin-bottom: 4px;
}

.vft-controls__section-heading strong {
	display: block;
	overflow: hidden;
	color: #29292c;
	font-size: 14px;
	line-height: 1.4;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vft-shade-list {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 12px 8px;
}

.vft-shade-button {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-start;
	gap: 7px;
	min-width: 0;
	margin: 0;
	padding: 6px 3px;
	background: transparent;
	border: 0;
	border-radius: 10px;
	color: #252525;
	cursor: pointer;
	font: inherit;
	text-align: center;
	appearance: none;
	-webkit-appearance: none;
}

.vft-shade-button__swatch {
	display: block;
	flex: 0 0 38px;
	width: 38px;
	height: 38px;
	border: 3px solid #ffffff;
	border-radius: 50%;
	box-shadow:
		0 0 0 1px #d6d6d6,
		0 2px 6px rgba(0, 0, 0, 0.08);
	transition:
		box-shadow 0.2s ease,
		transform 0.2s ease;
}

.vft-shade-button__label {
	display: block;
	width: 100%;
	overflow: hidden;
	color: #666666;
	font-size: 11px;
	line-height: 1.3;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.vft-shade-button:hover .vft-shade-button__swatch {
	transform: translateY(-1px);
	box-shadow:
		0 0 0 2px #929292,
		0 4px 10px rgba(0, 0, 0, 0.12);
}

.vft-shade-button.is-active .vft-shade-button__swatch {
	box-shadow:
		0 0 0 2px #202020,
		0 4px 10px rgba(0, 0, 0, 0.14);
}

.vft-shade-button.is-active .vft-shade-button__label {
	color: #202020;
	font-weight: 700;
}

.vft-shade-button:focus-visible {
	outline: 2px solid #202020;
	outline-offset: 3px;
}

.vft-shade-button:disabled {
	cursor: not-allowed;
	opacity: 0.38;
}

/* Camera and upload method cards */

.vft-controls__methods {
	display: grid;
	gap: 12px;
	margin-top: 26px;
}

.vft-method-card {
	display: flex;
	align-items: center;
	gap: 13px;
	width: 100%;
	margin: 0;
	padding: 15px;
	background: #f7f7f8;
	border: 1px solid #e4e4e6;
	border-radius: 11px;
	color: #202022;
	cursor: pointer;
	font: inherit;
	text-align: left;
	transition:
		border-color 0.2s ease,
		background-color 0.2s ease,
		transform 0.2s ease;
}

.vft-method-card:hover {
	background: #ffffff;
	border-color: #bdbdc2;
	transform: translateY(-1px);
}

.vft-method-card__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 42px;
	width: 42px;
	height: 42px;
	background: #ffffff;
	border-radius: 9px;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06);
}

.vft-method-card strong,
.vft-method-card small {
	display: block;
}

.vft-method-card small {
	margin-top: 3px;
	color: #777777;
	font-size: 11px;
	line-height: 1.4;
}

/* Active camera controls */

.vft-controls__active {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-top: 18px;
}

.vft-control-button {
	padding: 9px 13px;
	background: #ffffff;
	border: 1px solid #d7d7d9;
	border-radius: 7px;
	color: #29292c;
	cursor: pointer;
	font: inherit;
	font-size: 12px;
	font-weight: 600;
}

.vft-control-button:hover {
	background: #f6f6f7;
}

/* Product details */

.vft-controls__details {
	display: grid;
	gap: 12px;
	margin-top: 25px;
	padding-top: 22px;
	border-top: 1px solid #e8e8e8;
}

.vft-controls__details > div {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 15px;
}

.vft-controls__details span {
	color: #777777;
	font-size: 12px;
}

.vft-controls__details strong {
	color: #29292c;
	font-size: 12px;
	text-align: right;
}

/* Privacy */

.vft-controls__privacy {
	margin-top: 24px;
	padding: 14px;
	background: #f7f7f8;
	border-radius: 9px;
}

.vft-controls__privacy strong {
	display: block;
	margin-bottom: 6px;
	font-size: 12px;
}

.vft-controls__privacy p {
	margin: 0;
	color: #707070;
	font-size: 11px;
	line-height: 1.55;
}

@keyframes vft-modal-enter {
	from {
		opacity: 0;
		transform: translateY(10px) scale(0.985);
	}

	to {
		opacity: 1;
		transform: translateY(0) scale(1);
	}
}

@keyframes vft-spin {
	to {
		transform: rotate(360deg);
	}
}

@media screen and (max-width: 900px) {
	.vft-modal {
		padding: 12px;
	}

	.vft-modal__dialog {
		max-height: calc(100vh - 24px);
	}

	.vft-modal__body {
		grid-template-columns: 1fr;
		overflow-y: auto;
	}

	.vft-viewer {
		min-height: min(56vh, 500px);
	}

	.vft-controls {
		overflow: visible;
	}

	.vft-shade-list {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}
}

@media screen and (max-width: 600px) {
	.vft-modal {
		padding: 0;
	}

	.vft-modal__dialog {
		width: 100%;
		height: 100%;
		max-height: 100%;
		border-radius: 0;
	}

	.vft-modal__header {
		padding: 17px 18px;
	}

	.vft-modal__header p {
		display: none;
	}

	.vft-modal__close {
		flex-basis: 38px;
		width: 38px;
		height: 38px;
	}

	.vft-viewer {
		min-height: 52vh;
	}

	.vft-controls {
		padding: 20px 18px 28px;
	}

	.vft-camera-stage__guide::before {
		width: min(55%, 270px);
	}

	.vft-shade-list {
		grid-template-columns: repeat(5, minmax(0, 1fr));
	}

	.vft-shade-button__swatch {
		flex-basis: 34px;
		width: 34px;
		height: 34px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.vft-modal__dialog,
	.vft-spinner {
		animation: none;
	}

	.vft-method-card,
	.vft-modal__close,
	.vft-shade-button__swatch {
		transition: none;
	}
}
/* Virtual Try-On cart actions */

.vft-controls__commerce {
	margin-top: 22px;
	padding-top: 20px;
	border-top: 1px solid #e8e8e8;
}

.vft-controls__commerce[hidden] {
	display: none;
}

.vft-cart-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	padding: 12px 18px;
	background: #29292c;
	border: 1px solid #29292c;
	border-radius: 8px;
	color: #ffffff;
	cursor: pointer;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.2;
	transition:
		background-color 0.2s ease,
		border-color 0.2s ease,
		opacity 0.2s ease,
		transform 0.2s ease;
}

.vft-cart-button:hover:not(:disabled) {
	background: #111113;
	border-color: #111113;
	transform: translateY(-1px);
	color: #ffffff;
}

.vft-cart-button:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.vft-cart-button:disabled {
	cursor: not-allowed;
	opacity: 0.55;
}

.vft-cart-message {
	margin: 10px 0 0;
	padding: 10px 12px;
	border-radius: 7px;
	font-size: 12px;
	font-weight: 600;
	line-height: 1.45;
}

.vft-cart-message.is-success {
	background: #edf8f0;
	color: #1d6b36;
}

.vft-cart-message.is-error {
	background: #fff0f0;
	color: #9f2525;
}
