/*
 * Wiked 3D Viewer: wygląd przeglądarki w stylu WIKĘD (wiked.pl, WIKĘD Connect).
 * Font Brockmann (dziedziczony ze strony), kwadratowe narożniki, czerń i biel,
 * jasnoszare tło sceny, zieleń WIKĘD jako akcent stanów aktywnych.
 * Wszystkie kolory są zmiennymi CSS, więc wygląd zmienia się bez zmian w modelach.
 */

.wk3d {
	--wk3d-accent: #91d500;
	--wk3d-bg: #f7f7f7;
	--wk3d-dim: #090402;
	--wk3d-h: 560px;
	--wk3d-ink: #090402;
	--wk3d-text: #090402;
	--wk3d-body: rgba( 0, 0, 0, 0.7 );
	--wk3d-muted: #6b7280;
	--wk3d-line: #d1d5db;
	--wk3d-line-soft: #ececf1;
	--wk3d-surface: #ffffff;
	--wk3d-hover: #f3f4f6;
	--wk3d-radius: 0;
	--wk3d-font: inherit;

	position: relative;
	container-type: inline-size;
	container-name: wk3d;
	font-family: var( --wk3d-font );
	color: var( --wk3d-text );
	line-height: 1.5;
	margin: 0 0 1.5em;
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}

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

.wk3d [hidden] {
	display: none !important;
}

/* Neutralizacja stylów przycisków motywu i Elementora */
.wk3d button {
	font-family: inherit;
	font-size: 14px;
	font-weight: 500;
	font-style: normal;
	color: inherit;
	text-decoration: none;
	text-transform: none;
	letter-spacing: normal;
	line-height: 1.2;
	min-width: 0;
	min-height: 0;
	margin: 0;
	border-radius: var( --wk3d-radius );
	box-shadow: none;
	text-shadow: none;
	appearance: none;
	-webkit-appearance: none;
}

.wk3d button:focus-visible,
.wk3d select:focus-visible,
.wk3d input:focus-visible {
	outline: 2px solid var( --wk3d-accent );
	outline-offset: 2px;
}

.wk3d svg {
	display: block;
	flex: 0 0 auto;
}

/* ---------- placeholder przed uruchomieniem silnika ---------- */

.wk3d .wk3d-placeholder {
	position: relative;
	height: var( --wk3d-h );
	max-height: 80vh;
	background: var( --wk3d-bg );
	overflow: hidden;
	display: flex;
	align-items: center;
	justify-content: center;
}

.wk3d .wk3d-placeholder img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	padding: 6%;
}

.wk3d .wk3d-placeholder__label {
	position: relative;
	padding: 10px 16px;
	background: var( --wk3d-surface );
	border: 1px solid var( --wk3d-ink );
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 2px;
	text-transform: uppercase;
}

.wk3d .wk3d-placeholder__error {
	position: absolute;
	inset: auto 16px 16px;
	padding: 12px 16px;
	background: var( --wk3d-surface );
	border-left: 3px solid #b42318;
	color: #b42318;
	font-size: 14px;
}

/* ---------- górny pasek: przełącznik modeli i akcje ---------- */

.wk3d .wk3d-top {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-bottom: 12px;
	flex-wrap: wrap;
}

.wk3d .wk3d-tabs {
	display: flex;
	gap: 8px;
	overflow-x: auto;
	flex: 1 1 auto;
	min-width: 0;
	padding: 2px;
	scroll-snap-type: x proximity;
	scrollbar-width: thin;
}

.wk3d .wk3d-tab {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	flex: 0 0 auto;
	height: 44px;
	padding: 0 18px 0 4px;
	border: 1px solid var( --wk3d-ink );
	background: var( --wk3d-surface );
	color: var( --wk3d-ink );
	cursor: pointer;
	scroll-snap-align: start;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wk3d .wk3d-tab:not( :has( img ) ) {
	padding-left: 18px;
}

.wk3d .wk3d-tab:hover {
	background: var( --wk3d-hover );
}

.wk3d .wk3d-tab.is-active {
	background: var( --wk3d-ink );
	color: #fff;
}

.wk3d .wk3d-tab.is-active::after {
	content: "";
	position: absolute;
	left: -1px;
	right: -1px;
	bottom: -1px;
	height: 3px;
	background: var( --wk3d-accent );
}

.wk3d .wk3d-tab__img {
	width: 34px;
	height: 34px;
	object-fit: cover;
	background: var( --wk3d-bg );
	display: block;
}

.wk3d .wk3d-actions {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	margin-left: auto;
}

/* przyciski w stylu wiked.pl: ramka 1 px, 14 px / 600, podkreślenie tekstu po najechaniu */
.wk3d .wk3d-pill {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 44px;
	padding: 0 20px;
	border: 1px solid var( --wk3d-ink );
	background: var( --wk3d-surface );
	color: var( --wk3d-ink );
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wk3d .wk3d-pill svg {
	width: 18px;
	height: 18px;
}

.wk3d .wk3d-pill span {
	position: relative;
	padding: 2px 0;
}

.wk3d .wk3d-pill span::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: currentColor;
	transform: scaleX( 0 );
	transition: transform 0.2s ease;
}

.wk3d .wk3d-pill:hover span::after {
	transform: scaleX( 1 );
}

.wk3d .wk3d-pill.is-active {
	background: var( --wk3d-ink );
	color: #fff;
	box-shadow: inset 0 -3px 0 var( --wk3d-accent );
}

/* ---------- scena ---------- */

.wk3d .wk3d-stage {
	display: grid;
	gap: 16px;
	grid-template-columns: 1fr;
}

.wk3d .wk3d-stage[data-count="2"] {
	grid-template-columns: 1fr 1fr;
}

.wk3d .wk3d-stage[data-count="3"] {
	grid-template-columns: 1fr 1fr 1fr;
}

.wk3d .wk3d-pane {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wk3d .wk3d-pane-head {
	display: flex;
}

.wk3d .wk3d-select {
	width: 100%;
	max-width: 100%;
	height: 44px;
	padding: 0 40px 0 16px;
	border: 1px solid var( --wk3d-ink );
	border-radius: var( --wk3d-radius );
	background: var( --wk3d-surface ) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23090402' stroke-width='1.6'/%3E%3C/svg%3E") no-repeat right 16px center;
	color: var( --wk3d-ink );
	font: inherit;
	font-size: 16px;
	font-weight: 500;
	appearance: none;
	-webkit-appearance: none;
	box-shadow: none;
	cursor: pointer;
}

.wk3d .wk3d-viewport {
	position: relative;
	height: var( --wk3d-h );
	max-height: 80vh;
	min-height: 280px;
	background: var( --wk3d-bg );
	overflow: hidden;
	isolation: isolate;
	user-select: none;
	-webkit-user-select: none;
}

.wk3d .wk3d-canvas {
	/* pionowe przesunięcie palcem przewija stronę, poziome obraca model */
	touch-action: pan-y !important;
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	display: block;
	outline: none;
	cursor: grab;
}

.wk3d .wk3d-canvas:active {
	cursor: grabbing;
}

.wk3d .wk3d-labels {
	position: absolute !important;
	inset: 0;
	pointer-events: none;
	overflow: hidden;
	z-index: 1;
}

/* ---------- etykiety wymiarów (styl rysunku technicznego) ---------- */

.wk3d .wk3d-dim {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	padding: 4px 8px;
	background: var( --wk3d-surface );
	border: 1px solid var( --wk3d-dim );
	color: var( --wk3d-dim );
	font-size: 13px;
	font-variant-numeric: tabular-nums;
	white-space: nowrap;
	line-height: 1.1;
}

.wk3d .wk3d-dim__l {
	font-size: 9px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 1.5px;
	opacity: 0.6;
}

.wk3d .wk3d-dim__v {
	font-weight: 600;
	letter-spacing: 0.3px;
}

/* ---------- punkty opisowe ---------- */

.wk3d .wk3d-hs {
	pointer-events: auto;
	width: 28px;
	height: 28px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: var( --wk3d-ink );
	color: #fff !important;
	font-size: 13px !important;
	font-weight: 600;
	cursor: pointer;
	box-shadow: 0 0 0 3px rgba( 255, 255, 255, 0.85 );
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wk3d .wk3d-hs:hover,
.wk3d .wk3d-hs:focus-visible {
	background: var( --wk3d-accent );
	color: var( --wk3d-ink ) !important;
}

/* ---------- pasek narzędzi ---------- */

.wk3d .wk3d-tools {
	position: absolute;
	right: 16px;
	bottom: 16px;
	z-index: 3;
	display: flex;
	background: var( --wk3d-surface );
	border: 1px solid var( --wk3d-line );
}

.wk3d .wk3d-btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 0;
	border-right: 1px solid var( --wk3d-line-soft );
	background: transparent;
	color: var( --wk3d-ink );
	cursor: pointer;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.5px;
	white-space: nowrap;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wk3d .wk3d-btn:last-child {
	border-right: 0;
}

.wk3d .wk3d-btn:hover {
	background: var( --wk3d-hover );
}

.wk3d .wk3d-btn.is-active {
	background: var( --wk3d-ink );
	color: #fff;
}

.wk3d .wk3d-btn.is-active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: var( --wk3d-accent );
}

.wk3d .wk3d-btn--text {
	padding: 0 16px 0 14px;
}

.wk3d .wk3d-btn svg {
	width: 20px;
	height: 20px;
}

/* ---------- strzałki poprzedni / następny ---------- */

.wk3d .wk3d-nav {
	position: absolute;
	top: 50%;
	z-index: 3;
	width: 44px;
	height: 44px;
	margin-top: -22px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 1px solid var( --wk3d-line );
	background: var( --wk3d-surface );
	color: var( --wk3d-ink );
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.wk3d .wk3d-nav:hover {
	background: var( --wk3d-ink );
	border-color: var( --wk3d-ink );
	color: #fff;
}

.wk3d .wk3d-nav--prev {
	left: 16px;
}

.wk3d .wk3d-nav--next {
	right: 16px;
}

/* ---------- karta informacji ---------- */

.wk3d .wk3d-info {
	position: absolute;
	left: 16px;
	top: 16px;
	z-index: 4;
	max-width: min( 360px, calc( 100% - 32px ) );
	padding: 16px 48px 16px 18px;
	background: var( --wk3d-surface );
	border: 1px solid var( --wk3d-line );
	border-left: 3px solid var( --wk3d-accent );
}

.wk3d .wk3d-info__title {
	display: block;
	font-size: 16px;
	font-weight: 500;
	color: var( --wk3d-ink );
	line-height: 1.3;
}

.wk3d .wk3d-info__text {
	margin: 6px 0 0;
	font-size: 14px;
	line-height: 1.5;
	color: var( --wk3d-body );
}

.wk3d .wk3d-info__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 36px;
	height: 36px;
	padding: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	background: transparent;
	color: var( --wk3d-ink );
	cursor: pointer;
}

.wk3d .wk3d-info__close:hover {
	background: var( --wk3d-hover );
}

/* ---------- przekrój ---------- */

.wk3d .wk3d-section {
	position: absolute;
	left: 50%;
	bottom: 80px;
	z-index: 3;
	transform: translateX( -50% );
	width: min( 380px, calc( 100% - 32px ) );
	padding: 12px 16px;
	background: var( --wk3d-surface );
	border: 1px solid var( --wk3d-line );
}

.wk3d .wk3d-section input[type="range"] {
	width: 100%;
	accent-color: var( --wk3d-ink );
	margin: 0;
	display: block;
}

/* ---------- wczytywanie, podpowiedź, błąd ---------- */

.wk3d .wk3d-loader {
	position: absolute;
	inset: 0;
	z-index: 5;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 14px;
	background: var( --wk3d-bg );
	transition: opacity 0.35s ease, visibility 0.35s ease;
}

.wk3d .wk3d-loader.is-hidden {
	opacity: 0;
	visibility: hidden;
}

.wk3d .wk3d-loader__poster {
	position: absolute;
	inset: 6%;
	background: center / contain no-repeat;
	opacity: 0.3;
	filter: grayscale( 0.4 );
}

.wk3d .wk3d-loader__text {
	position: relative;
	padding: 0 16px;
	font-size: 12px;
	font-weight: 500;
	letter-spacing: 2px;
	text-transform: uppercase;
	color: var( --wk3d-ink );
	text-align: center;
}

.wk3d .wk3d-loader__bar {
	position: relative;
	width: min( 240px, 60% );
	height: 2px;
	background: var( --wk3d-line );
	overflow: hidden;
}

.wk3d .wk3d-loader__bar span {
	display: block;
	height: 100%;
	width: 0;
	background: var( --wk3d-ink );
	transition: width 0.2s ease;
}

.wk3d .wk3d-loader__bar.is-indeterminate span {
	width: 35% !important;
	animation: wk3d-indet 1.1s ease-in-out infinite;
}

@keyframes wk3d-indet {
	from {
		transform: translateX( -100% );
	}
	to {
		transform: translateX( 300% );
	}
}

.wk3d .wk3d-hint {
	position: absolute;
	left: 50%;
	top: 16px;
	z-index: 2;
	transform: translateX( -50% );
	padding: 8px 14px;
	background: var( --wk3d-ink );
	color: #fff;
	font-size: 13px;
	white-space: nowrap;
	pointer-events: none;
	transition: opacity 0.4s ease;
}

.wk3d .wk3d-hint.is-hidden {
	opacity: 0;
}

.wk3d .wk3d-error {
	position: absolute;
	inset: 0;
	z-index: 6;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	text-align: center;
	background: var( --wk3d-bg );
	color: #b42318;
	font-size: 15px;
}

.wk3d .wk3d-stage > .wk3d-error {
	position: relative;
	min-height: 200px;
}

/* ---------- wykończenia i elementy ---------- */

.wk3d .wk3d-pane-foot {
	display: flex;
	flex-direction: column;
	gap: 12px;
}

.wk3d .wk3d-group {
	display: flex;
	align-items: center;
	gap: 8px 16px;
	flex-wrap: wrap;
}

.wk3d .wk3d-group__label {
	min-width: 110px;
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: var( --wk3d-ink );
}

.wk3d .wk3d-chips {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.wk3d .wk3d-chip {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	height: 40px;
	padding: 0 16px;
	border: 1px solid var( --wk3d-line );
	background: var( --wk3d-surface );
	color: var( --wk3d-ink );
	cursor: pointer;
	font-size: 14px;
	font-weight: 500;
	transition: border-color 0.2s ease, background-color 0.2s ease, color 0.2s ease;
}

.wk3d .wk3d-chip:hover {
	border-color: var( --wk3d-ink );
}

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

.wk3d .wk3d-chip--swatch {
	padding-left: 8px;
}

.wk3d .wk3d-chip--swatch.is-active {
	background: var( --wk3d-surface );
	color: var( --wk3d-ink );
	box-shadow: inset 0 0 0 1px var( --wk3d-ink );
}

.wk3d .wk3d-swatch {
	width: 24px;
	height: 24px;
	border: 1px solid rgba( 0, 0, 0, 0.15 );
	flex: 0 0 auto;
}

.wk3d .wk3d-chip--swatch.is-active .wk3d-swatch {
	box-shadow: inset 0 -4px 0 var( --wk3d-accent );
}

/* ---------- tabela danych ---------- */

.wk3d .wk3d-specs {
	margin-top: 32px;
}

.wk3d .wk3d-table-wrap {
	overflow-x: auto;
}

.wk3d .wk3d-table {
	width: 100%;
	border-collapse: collapse;
	border: 0;
	margin: 0;
	font-size: 15px;
	font-variant-numeric: tabular-nums;
	color: var( --wk3d-body );
}

.wk3d .wk3d-table caption {
	text-align: left;
	caption-side: top;
	padding: 0 0 12px;
	font-size: 20px;
	font-weight: 500;
	line-height: 1.3;
	color: var( --wk3d-ink );
}

.wk3d .wk3d-table th,
.wk3d .wk3d-table td {
	padding: 12px 16px 12px 0;
	border: 0;
	border-bottom: 1px solid var( --wk3d-line-soft );
	text-align: left;
	vertical-align: top;
	background: transparent;
}

.wk3d .wk3d-table thead th {
	padding-top: 0;
	font-size: 12px;
	font-weight: 500;
	text-transform: uppercase;
	letter-spacing: 2px;
	color: var( --wk3d-ink );
	border-bottom: 1px solid var( --wk3d-ink );
}

.wk3d .wk3d-table tbody th {
	font-weight: 400;
	color: var( --wk3d-muted );
	width: 32%;
}

.wk3d .wk3d-table tbody td {
	color: var( --wk3d-ink );
	font-weight: 500;
}

/* ---------- pełny ekran ---------- */

.wk3d.is-fullscreen,
.wk3d:fullscreen {
	background: var( --wk3d-surface );
	padding: 16px;
	margin: 0;
	overflow: auto;
}

.wk3d.is-fullscreen .wk3d-viewport {
	height: calc( 100vh - 140px );
	height: calc( 100dvh - 140px );
	max-height: none;
}

.wk3d.wk3d--touch-full .wk3d-canvas,
.wk3d.is-fullscreen .wk3d-canvas {
	touch-action: none !important;
}

.wk3d.is-fullscreen .wk3d-specs {
	display: none;
}

.wk3d.is-pseudo-fullscreen {
	position: fixed;
	inset: 0;
	z-index: 999999;
}

html.wk3d-lock,
html.wk3d-lock body {
	overflow: hidden !important;
}

/* ---------- tryb edytora (panel administracyjny) ---------- */

.wk3d.wk3d--editor .wk3d-hint {
	display: none;
}

/* ---------- wąskie kontenery i telefony ---------- */

@container wk3d ( max-width: 760px ) {
	.wk3d .wk3d-stage[data-count="2"],
	.wk3d .wk3d-stage[data-count="3"] {
		grid-template-columns: 1fr;
	}

	.is-compare .wk3d-viewport {
		height: calc( var( --wk3d-h ) * 0.7 );
	}

	.wk3d .wk3d-pill {
		padding: 0 14px;
	}

	.wk3d .wk3d-pill span {
		display: none;
	}

	.wk3d .wk3d-pill--compare span {
		display: inline;
	}

	.wk3d .wk3d-group__label {
		min-width: 0;
		width: 100%;
	}

	.wk3d .wk3d-hint {
		white-space: normal;
		width: max-content;
		max-width: calc( 100% - 32px );
		text-align: center;
	}
}

@container wk3d ( max-width: 420px ) {
	.wk3d .wk3d-btn--text span {
		display: none;
	}

	.wk3d .wk3d-btn--text {
		padding: 0 12px;
	}
}

@container wk3d ( max-width: 480px ) {
	.wk3d .wk3d-viewport,
	.wk3d .wk3d-placeholder {
		height: min( var( --wk3d-h ), 72vh );
	}

	.wk3d .wk3d-btn {
		min-width: 40px;
		height: 40px;
		padding: 0 10px;
	}

	.wk3d .wk3d-tools {
		right: 8px;
		bottom: 8px;
	}

	.wk3d .wk3d-nav {
		width: 38px;
		height: 38px;
		margin-top: -19px;
	}

	.wk3d .wk3d-nav--prev {
		left: 8px;
	}

	.wk3d .wk3d-nav--next {
		right: 8px;
	}

	.wk3d .wk3d-dim {
		font-size: 11px;
		padding: 3px 6px;
	}

	.wk3d .wk3d-dim__l {
		display: none;
	}

	.wk3d .wk3d-tab {
		height: 40px;
	}

	.wk3d .wk3d-tab__title {
		max-width: 9rem;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.wk3d .wk3d-table {
		font-size: 14px;
	}
}

@media ( prefers-reduced-motion: reduce ) {
	.wk3d * {
		transition: none !important;
		animation: none !important;
	}
}

/* przełączniki porównania (synchronizacja, skala): aktywne bez pełnego wypełnienia */
.wk3d .wk3d-pill--sync.is-active,
.wk3d .wk3d-pill--sameScale.is-active {
	background: var( --wk3d-surface );
	color: var( --wk3d-ink );
	box-shadow: inset 0 -3px 0 var( --wk3d-accent );
}
