/* Virtual Try-On — standalone gallery */

.vto-gallery {
	--vto-accent: #6c47ff;
	--vto-bg: #0f1220;
	--vto-card: #1a1f2e;
	--vto-line: #2a3042;
	--vto-text: #eceef5;
	--vto-muted: #9aa3b5;
	direction: rtl;
	color: var(--vto-text);
	background: var(--vto-bg);
	border-radius: 16px;
	padding: 18px;
	box-sizing: border-box;
}

.vto-gallery *,
.vto-gallery *::before,
.vto-gallery *::after {
	box-sizing: border-box;
}

/* Tabs */
.vto-g-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 16px;
}

.vto-g-tab {
	background: var(--vto-card);
	color: var(--vto-muted);
	border: 1px solid var(--vto-line);
	border-radius: 999px;
	padding: 7px 16px;
	font-size: 0.9rem;
	cursor: pointer;
	transition: all 0.15s ease;
}

.vto-g-tab:hover {
	color: var(--vto-text);
}

.vto-g-tab.is-active {
	background: var(--vto-accent);
	border-color: var(--vto-accent);
	color: #fff;
}

/* Layout */
.vto-g-grid {
	display: grid;
	grid-template-columns: 1.1fr 1fr 1fr;
	gap: 14px;
}

.vto-g-col {
	background: var(--vto-card);
	border: 1px solid var(--vto-line);
	border-radius: 14px;
	padding: 14px;
	min-width: 0;
}

.vto-g-heading {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 12px;
	font-size: 0.98rem;
	color: var(--vto-text);
	font-weight: 700;
}

.vto-g-step {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--vto-accent);
	color: #fff;
	font-size: 0.8rem;
	flex: 0 0 auto;
}

/* Product cards */
.vto-g-cards {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 10px;
	max-height: 460px;
	overflow-y: auto;
	padding-left: 4px;
}

.vto-g-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 6px;
	background: #11162300;
	border: 1px solid var(--vto-line);
	border-radius: 12px;
	padding: 8px;
	cursor: pointer;
	text-align: center;
	color: var(--vto-text);
	transition: border-color 0.15s ease, transform 0.15s ease;
}

.vto-g-card:hover {
	border-color: var(--vto-accent);
	transform: translateY(-2px);
}

.vto-g-card.is-selected {
	border-color: var(--vto-accent);
	box-shadow: 0 0 0 2px var(--vto-accent) inset;
}

.vto-g-thumb {
	display: block;
	aspect-ratio: 1 / 1;
	background: #fff;
	border-radius: 8px;
	overflow: hidden;
}

.vto-g-thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.vto-g-name {
	font-size: 0.82rem;
	line-height: 1.3;
	max-height: 2.6em;
	overflow: hidden;
}

.vto-g-price {
	font-size: 0.8rem;
	color: var(--vto-muted);
}

.vto-g-price ins,
.vto-g-price bdi {
	text-decoration: none;
	color: var(--vto-text);
}

.vto-g-check {
	position: absolute;
	top: 6px;
	left: 6px;
	width: 22px;
	height: 22px;
	border-radius: 50%;
	background: var(--vto-accent);
	color: #fff;
	display: none;
	align-items: center;
	justify-content: center;
	font-size: 0.8rem;
}

.vto-g-card.is-selected .vto-g-check {
	display: flex;
}

/* Upload column */
.vto-g-preview-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	background: #0c0f1a;
	border: 1px dashed var(--vto-line);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
}

.vto-g-preview-wrap img,
.vto-g-preview-wrap video,
.vto-g-preview-wrap canvas {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.vto-g-placeholder {
	text-align: center;
	color: var(--vto-muted);
	padding: 12px;
}

.vto-g-placeholder span {
	font-size: 2.6rem;
	display: block;
	opacity: 0.5;
}

.vto-g-hint {
	display: block;
	margin-top: 8px;
	font-size: 0.82rem;
	font-style: normal;
}

.vto-g-controls {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

.vto-g-btn {
	appearance: none;
	border: 1px solid var(--vto-line);
	background: #0c0f1a;
	color: var(--vto-text);
	border-radius: 10px;
	padding: 10px 14px;
	font-size: 0.9rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	text-decoration: none;
	transition: background 0.15s ease, opacity 0.15s ease;
}

.vto-g-btn:hover {
	background: #141a2b;
}

.vto-g-file-btn {
	position: relative;
}

.vto-g-primary {
	width: 100%;
	background: var(--vto-accent);
	border-color: var(--vto-accent);
	color: #fff;
	font-weight: 700;
	padding: 12px;
}

.vto-g-primary:hover {
	background: #5a37e0;
}

.vto-g-btn:disabled {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Result column */
.vto-g-result-wrap {
	position: relative;
	width: 100%;
	aspect-ratio: 3 / 4;
	background: #0c0f1a;
	border: 1px solid var(--vto-line);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 12px;
}

.vto-g-result-img {
	width: 100%;
	height: 100%;
	object-fit: contain;
}

.vto-g-result-empty span {
	font-size: 2.6rem;
	opacity: 0.4;
}

.vto-g-loading {
	text-align: center;
	color: var(--vto-muted);
	padding: 12px;
}

.vto-g-spinner {
	width: 42px;
	height: 42px;
	margin: 0 auto 12px;
	border: 4px solid var(--vto-line);
	border-top-color: var(--vto-accent);
	border-radius: 50%;
	animation: vto-g-spin 0.9s linear infinite;
}

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

.vto-g-download {
	width: 100%;
}

.vto-g-error {
	margin-top: 10px;
	padding: 9px 12px;
	background: rgba( 220, 60, 60, 0.12 );
	border: 1px solid rgba( 220, 60, 60, 0.4 );
	color: #ff9d9d;
	border-radius: 8px;
	font-size: 0.85rem;
}

/* Responsive */
@media ( max-width: 900px ) {
	.vto-g-grid {
		grid-template-columns: 1fr;
	}
	.vto-g-cards {
		grid-template-columns: repeat(3, 1fr);
		max-height: 320px;
	}
}

@media ( max-width: 480px ) {
	.vto-g-cards {
		grid-template-columns: repeat(2, 1fr);
	}
}
