/*!
 * Site Demo Viewer by Spakses
 * Автор: Алексей Коваленко (Spakses) — https://spakses.ru/
 * Стили Elementor-виджета "Demo Viewer"
 */

.sdv-root {
	--sdv-main-color: #d51328;
	--sdv-main-color-darken: #b01022;
	--sdv-brad: 0.5vw;
	--sdv-bg-viewer: #f4f4f7;
	--sdv-bar-bg: #ffffff;
	--sdv-bar-left-color: #d51328;
	--sdv-device-btn-color: #b0b0b0;
	--sdv-device-btn-border: #eeeeee;
	--sdv-device-btn-active-color: #ffffff;
	--sdv-open-btn-bg: #ffffff;
	--sdv-open-btn-color: #d51328;
	--sdv-open-btn-hover-color: #ffffff;
	--sdv-mode-indicator-color: #333333;
	--sdv-loader-text-color: #999999;
	--sdv-iframe-bg: #ffffff;

	position: relative;
	font-family: 'Jost', sans-serif;
	background-color: var(--sdv-bg-viewer);
	width: 100%;
	box-sizing: border-box;
	overflow: hidden;
	display: flex;
	flex-direction: column;
}

.sdv-root *,
.sdv-root *::before,
.sdv-root *::after {
	box-sizing: border-box;
}

/* --- ПАНЕЛЬ УПРАВЛЕНИЯ --- */
.sdv-bar {
	min-height: 5.5vw;
	background-color: var(--sdv-bar-bg);
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 0 2vw;
	box-shadow: 0 0.1vw 0.5vw rgba(0, 0, 0, 0.05);
	position: relative;
	z-index: 1000;
	flex-wrap: wrap;
	gap: 0.5vw;
}

.sdv-bar-left {
	font-size: 1.2vw;
	font-weight: 600;
	color: var(--sdv-bar-left-color);
	letter-spacing: -0.01vw;
}

.sdv-bar-left a {
	text-decoration: none;
	color: inherit;
}

.sdv-device-selector {
	display: flex;
	gap: 1vw;
	margin: 0 auto;
}

.sdv-device-btn {
	background: transparent;
	border: 0.1vw solid var(--sdv-device-btn-border);
	cursor: pointer;
	padding: 0.8vw;
	border-radius: var(--sdv-brad);
	color: var(--sdv-device-btn-color);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: 0.3s ease;
}

.sdv-device-btn svg {
	width: 2.2vw;
	height: 2.2vw;
	fill: currentColor;
	max-width: 24px;
	max-height: 24px;
}

.sdv-device-btn:hover {
	color: var(--sdv-main-color);
	border-color: var(--sdv-main-color);
}

.sdv-device-btn.active {
	background-color: var(--sdv-main-color);
	color: var(--sdv-device-btn-active-color);
	border-color: var(--sdv-main-color-darken);
}

.sdv-open-direct-btn {
	text-decoration: none;
	background: var(--sdv-open-btn-bg);
	color: var(--sdv-open-btn-color);
	padding: 0.8vw 1.8vw;
	border-radius: var(--sdv-brad);
	font-size: 0.9vw;
	font-weight: 600;
	transition: 0.3s;
	border: 0.1vw solid var(--sdv-main-color);
	box-shadow: 0 0.2vw 0.5vw rgba(0, 0, 0, 0.05);
	display: inline-block;
	white-space: nowrap;
}

.sdv-open-direct-btn:hover {
	background: var(--sdv-main-color);
	color: var(--sdv-open-btn-hover-color);
}

/* --- ТЕКСТ НАД ФРЕЙМОМ --- */
.sdv-mode-indicator {
	text-align: center;
	font-size: 1.1vw;
	font-weight: 400;
	color: var(--sdv-mode-indicator-color);
	margin-bottom: 0.8vw;
	transition: opacity 0.3s;
	width: 100%;
}

/* --- КОНТЕЙНЕР ПРОСМОТРА --- */
.sdv-wrapper {
	width: 100%;
	flex: 1 1 auto;
	min-height: 0;
	display: flex;
	flex-direction: column;
	justify-content: flex-start;
	align-items: center;
	background-color: var(--sdv-bg-viewer);
	padding: 1vw;
	position: relative;
}

.sdv-frame-container {
	position: relative;
	display: flex;
	justify-content: center;
	width: 100%;
	height: 100%;
}

.sdv-frame {
	background: var(--sdv-iframe-bg);
	transition: width 0.5s ease, height 0.5s ease;
	border: 0.4vw solid #fff;
	border-radius: var(--sdv-brad);
	box-sizing: border-box;
	z-index: 1;
	height: 100%;
}

/* РЕЖИМЫ ШИРИНЫ (значения по умолчанию, переопределяются контролами Elementor) */
.sdv-wrapper.sdv-desktop .sdv-frame { width: 86vw; }
.sdv-wrapper.sdv-tablet .sdv-frame { width: 890px; }
.sdv-wrapper.sdv-mobile .sdv-frame { width: 425px; }

/* --- ЛОАДЕР --- */
.sdv-loader {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	background: var(--sdv-bg-viewer);
	display: flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	z-index: 100;
	transition: opacity 0.5s ease;
}

.sdv-spinner {
	width: 3vw;
	height: 3vw;
	max-width: 42px;
	max-height: 42px;
	border: 0.3vw solid rgba(213, 19, 40, 0.1);
	border-top-color: var(--sdv-main-color);
	border-radius: 50%;
	animation: sdv-spin 1s linear infinite;
}

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

.sdv-loader-text {
	margin-top: 1vw;
	font-size: 0.9vw;
	color: var(--sdv-loader-text-color);
	letter-spacing: 0.1vw;
	text-align: center;
}

/* Скрытие лоадера после загрузки iframe */
.sdv-root.sdv-loaded .sdv-loader {
	opacity: 0;
	pointer-events: none;
}

/* --- КРЕДИТ АВТОРА --- */
.sdv-credit {
	text-align: center;
	font-size: 11px;
	padding: 6px 0;
	color: #999;
	background: var(--sdv-bg-viewer);
}

.sdv-credit a {
	color: var(--sdv-main-color);
	text-decoration: none;
}

.sdv-credit a:hover {
	text-decoration: underline;
}

/* --- АДАПТИВНОСТЬ --- */
@media (max-width: 768px) {
	.sdv-bar {
		height: auto;
		padding: 3vw;
	}

	.sdv-bar-left {
		font-size: 3.2vw;
	}

	.sdv-device-btn svg {
		width: 5vw;
		height: 5vw;
	}

	.sdv-open-direct-btn {
		font-size: 2.8vw;
		padding: 2vw 3vw;
	}

	.sdv-mode-indicator {
		font-size: 3vw;
	}

	.sdv-wrapper.sdv-tablet .sdv-frame,
	.sdv-wrapper.sdv-mobile .sdv-frame {
		width: 100% !important;
		max-width: 100%;
	}
}
