:root {
	--grd3d-accent: var(--wd-primary-color, #17666f);
	--grd3d-ink: #1b1f22;
	--grd3d-muted: #6b7378;
	--grd3d-line: #e3e6e8;
	--grd3d-stage: radial-gradient(120% 90% at 50% 20%, #ffffff 0%, #eef0f1 60%, #e1e4e6 100%);
}

/* ------------------------------------------------------------ ürün sayfası butonları */

.grd3d-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin: 18px 0 22px;
}

.grd3d-actions button.grd3d-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 44px;
	padding: 10px 20px;
	border: 2px solid var(--grd3d-accent);
	border-radius: var(--btn-accented-brd-radius, 4px);
	background: #fff;
	color: var(--grd3d-accent);
	font: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	line-height: 1;
	box-shadow: none;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

.grd3d-actions button.grd3d-btn svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
	flex: none;
}

.grd3d-actions button.grd3d-btn:hover,
.grd3d-actions button.grd3d-btn:focus-visible {
	background: var(--grd3d-accent);
	color: #fff;
}

.grd3d-actions button.grd3d-btn-ar {
	background: var(--grd3d-accent);
	color: #fff;
}

.grd3d-actions button.grd3d-btn-ar:hover,
.grd3d-actions button.grd3d-btn-ar:focus-visible {
	background: var(--grd3d-accent);
	color: #fff;
	box-shadow: 0 6px 18px -6px var(--grd3d-accent);
}

.grd3d-actions button.grd3d-btn:focus-visible,
.grd3d-bar button.grd3d-tool:focus-visible,
.grd3d-bar button.grd3d-chip:focus-visible,
.grd3d-head button.grd3d-close:focus-visible,
.grd3d-stage button.grd3d-ar-slot:focus-visible {
	outline: 2px solid var(--grd3d-accent);
	outline-offset: 2px;
}

/* ------------------------------------------------------------ modal */

html.grd3d-lock,
html.grd3d-lock body {
	overflow: hidden;
}

.grd3d-modal {
	position: fixed;
	inset: 0;
	z-index: 100000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 24px;
	opacity: 0;
	transition: opacity 0.2s ease;
}

.grd3d-modal[hidden] {
	display: none;
}

.grd3d-modal.is-open {
	opacity: 1;
}

.grd3d-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(12, 16, 18, 0.72);
}

.grd3d-dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: min(1120px, 100%);
	height: min(820px, 100%);
	background: #fff;
	border-radius: 10px;
	box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.5);
	overflow: hidden;
	transform: translateY(12px) scale(0.985);
	transition: transform 0.25s ease;
	outline: none;
}

.grd3d-modal.is-open .grd3d-dialog {
	transform: none;
}

.grd3d-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 12px 12px 12px 22px;
	border-bottom: 1px solid var(--grd3d-line);
}

.grd3d-title {
	margin: 0;
	font-size: 17px;
	font-weight: 600;
	color: var(--grd3d-ink);
	line-height: 1.3;
}

.grd3d-head button.grd3d-close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 42px;
	min-width: 42px;
	height: 42px;
	min-height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--grd3d-ink);
	cursor: pointer;
}

.grd3d-head button.grd3d-close:hover {
	background: #f1f3f4;
}

.grd3d-head button.grd3d-close svg {
	flex: none;
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.grd3d-body {
	position: relative;
	display: flex;
	flex-direction: column;
	flex: 1;
	min-height: 0;
	background: #fff;
}

.grd3d-body:fullscreen {
	background: #fff;
}

.grd3d-loading {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	padding: 24px;
	color: var(--grd3d-muted);
	background: var(--grd3d-stage);
	text-align: center;
}

/* ------------------------------------------------------------ sahne */

.grd3d-stage {
	position: relative;
	flex: 1;
	min-height: 0;
	background: var(--grd3d-stage);
}

.grd3d-stage model-viewer {
	width: 100%;
	height: 100%;
	--poster-color: transparent;
	--progress-bar-color: transparent;
}

.grd3d-progress {
	position: absolute;
	left: 0;
	right: 0;
	top: 0;
	height: 3px;
	overflow: hidden;
	transition: opacity 0.4s;
}

.grd3d-progress span {
	display: block;
	height: 100%;
	background: var(--grd3d-accent);
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.2s;
}

.grd3d-progress.is-done {
	opacity: 0;
}

.grd3d-stage button.grd3d-ar-slot {
	position: absolute;
	left: 50%;
	bottom: 18px;
	transform: translateX(-50%);
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 12px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--grd3d-accent);
	color: #fff;
	font: inherit;
	min-height: 44px;
	font-size: 14px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: 0 10px 24px -10px rgba(0, 0, 0, 0.5);
	cursor: pointer;
	white-space: nowrap;
}

.grd3d-stage button.grd3d-ar-slot:hover {
	background: var(--grd3d-accent);
	color: #fff;
}

.grd3d-stage button.grd3d-ar-slot svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.grd3d-stage button.grd3d-ar-slot.is-pulse {
	animation: grd3d-pulse 1.6s ease-out infinite;
}

@keyframes grd3d-pulse {
	0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--grd3d-accent) 55%, transparent); }
	100% { box-shadow: 0 0 0 18px transparent; }
}

.grd3d-hint {
	position: absolute;
	left: 50%;
	top: 14px;
	transform: translateX(-50%);
	padding: 6px 12px;
	border-radius: 999px;
	background: rgba(255, 255, 255, 0.85);
	color: var(--grd3d-muted);
	font-size: 12px;
	white-space: nowrap;
	pointer-events: none;
	transition: opacity 0.4s;
}

.grd3d-hint.is-hidden {
	opacity: 0;
}

.grd3d-status {
	position: absolute;
	left: 16px;
	right: 16px;
	top: 50%;
	transform: translateY(-50%);
	margin: 0 auto;
	max-width: 420px;
	padding: 14px 16px;
	border-radius: 8px;
	background: #fff4f4;
	color: #8a1f1f;
	font-size: 14px;
	text-align: center;
	box-shadow: 0 8px 24px -12px rgba(0, 0, 0, 0.35);
	display: none;
}

.grd3d-status.is-visible {
	display: block;
}

.grd3d-status.is-info {
	top: auto;
	bottom: 80px;
	transform: none;
	background: #fff;
	color: var(--grd3d-ink);
}

/* ------------------------------------------------------------ alt çubuk */

.grd3d-bar {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 18px;
	padding: 12px 16px;
	border-top: 1px solid var(--grd3d-line);
	background: #fff;
}

.grd3d-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	flex: 1 1 auto;
	min-width: 0;
}

.grd3d-bar button.grd3d-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	min-height: 36px;
	padding: 5px 12px 5px 6px;
	border: 1px solid var(--grd3d-line);
	border-radius: 999px;
	background: #fff;
	color: var(--grd3d-ink);
	font: inherit;
	font-size: 13px;
	font-weight: 400;
	text-transform: none;
	letter-spacing: 0;
	line-height: 1;
	box-shadow: none;
	cursor: pointer;
	transition: border-color 0.15s, box-shadow 0.15s;
}

.grd3d-bar button.grd3d-chip:hover {
	background: #fff;
	color: var(--grd3d-ink);
	border-color: #c5cbcf;
}

.grd3d-bar button.grd3d-chip[aria-pressed="true"] {
	border-color: var(--grd3d-accent);
	box-shadow: inset 0 0 0 1px var(--grd3d-accent);
}

.grd3d-chip-dot {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.15);
	flex: none;
}

.grd3d-chip-dot.is-original {
	background: conic-gradient(#161616 0 25%, #c9a14a 0 50%, #e8e8e8 0 75%, #3b3e42 0);
}

.grd3d-dims {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	color: var(--grd3d-muted);
	font-size: 13px;
	white-space: nowrap;
}

.grd3d-dims svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

.grd3d-tools {
	display: flex;
	gap: 6px;
	margin-left: auto;
}

.grd3d-bar button.grd3d-tool {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 40px;
	height: 40px;
	padding: 0 10px;
	border: 1px solid var(--grd3d-line);
	border-radius: 6px;
	background: #fff;
	color: var(--grd3d-ink);
	font: inherit;
	min-height: 40px;
	font-size: 13px;
	font-weight: 600;
	text-transform: none;
	letter-spacing: 0;
	box-shadow: none;
	cursor: pointer;
}

.grd3d-bar button.grd3d-tool:hover {
	background: #fff;
	color: var(--grd3d-ink);
	border-color: #c5cbcf;
}

.grd3d-bar button.grd3d-tool[aria-pressed="true"] {
	background: #eef6f7;
	border-color: var(--grd3d-accent);
	color: var(--grd3d-accent);
}

.grd3d-bar button.grd3d-tool svg {
	width: 20px;
	height: 20px;
	fill: currentColor;
}

.grd3d-bar button.grd3d-tool-text {
	background: var(--grd3d-accent);
	border-color: var(--grd3d-accent);
	color: #fff;
}

.grd3d-bar button.grd3d-tool-text:hover {
	background: var(--grd3d-accent);
	color: #fff;
	border-color: var(--grd3d-accent);
	filter: brightness(1.08);
}

/* ------------------------------------------------------------ QR paneli */

.grd3d-qr {
	position: absolute;
	right: 16px;
	bottom: 16px;
	width: 240px;
	padding: 18px 18px 16px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 18px 40px -16px rgba(0, 0, 0, 0.45);
	text-align: center;
	z-index: 2;
}

.grd3d-qr[hidden] {
	display: none;
}

.grd3d-qr-code {
	width: 168px;
	height: 168px;
	margin: 0 auto 10px;
}

.grd3d-qr-code svg {
	width: 100%;
	height: 100%;
}

.grd3d-qr strong {
	display: block;
	margin-bottom: 4px;
	color: var(--grd3d-ink);
	font-size: 14px;
}

.grd3d-qr p {
	margin: 0;
	color: var(--grd3d-muted);
	font-size: 12px;
	line-height: 1.45;
}

.grd3d-qr button.grd3d-qr-close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 30px;
	min-width: 30px;
	height: 30px;
	min-height: 30px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	box-shadow: none;
	cursor: pointer;
}

.grd3d-qr button.grd3d-qr-close svg {
	width: 18px;
	height: 18px;
	fill: var(--grd3d-muted);
}

/* ------------------------------------------------------------ sayfa içi (kısa kod) */

.grd3d-inline {
	display: flex;
	flex-direction: column;
	height: var(--grd3d-height, 520px);
	border: 1px solid var(--grd3d-line);
	border-radius: 10px;
	overflow: hidden;
	background: #fff;
}

.grd3d-inline-placeholder {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	background: var(--grd3d-stage);
	color: var(--grd3d-muted);
	font-size: 14px;
}

.grd3d-inline-placeholder img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	opacity: 0.35;
}

.grd3d-inline-placeholder span {
	position: relative;
}

/* ------------------------------------------------------------ mobil */

@media (max-width: 767px) {
	.grd3d-actions {
		display: grid;
		grid-template-columns: 1fr 1fr;
	}

	.grd3d-actions button.grd3d-btn {
		padding: 10px 12px;
	}

	.grd3d-modal {
		padding: 0;
	}

	.grd3d-dialog {
		width: 100%;
		height: 100%;
		border-radius: 0;
	}

	.grd3d-head {
		padding: 8px 8px 8px 16px;
	}

	.grd3d-bar {
		padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
	}

	.grd3d-swatches {
		flex-wrap: nowrap;
		overflow-x: auto;
		flex-basis: 100%;
		scrollbar-width: none;
	}

	.grd3d-bar button.grd3d-chip {
		flex: none;
	}

	.grd3d-tools {
		margin-left: auto;
	}
}

@media (prefers-reduced-motion: reduce) {
	.grd3d-modal,
	.grd3d-dialog,
	.grd3d-stage button.grd3d-ar-slot.is-pulse {
		transition: none;
		animation: none;
	}
}

/* ------------------------------------------------------------ AR ekranı (Android, WebXR) */

.grd3d-xr {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	flex-direction: column;
	color: #fff;
	font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	font-size: 13px;
	line-height: 1.35;
	background: transparent;
	touch-action: none;
	user-select: none;
	-webkit-user-select: none;
	-webkit-touch-callout: none;
	-webkit-tap-highlight-color: transparent;
}

.grd3d-xr-top {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 12px;
	padding: calc(12px + env(safe-area-inset-top)) 12px 0 14px;
}

.grd3d-xr-title,
.grd3d-xr-msg,
.grd3d-xr-group {
	background: rgba(17, 24, 28, 0.66);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}

.grd3d-xr-title {
	min-width: 0;
	padding: 8px 12px;
	border-radius: 10px;
}

.grd3d-xr-title strong {
	display: block;
	font-size: 14px;
	font-weight: 600;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.grd3d-xr-size {
	display: block;
	font-size: 12px;
	opacity: 0.85;
}

.grd3d-xr-msg {
	align-self: center;
	max-width: min(420px, calc(100% - 32px));
	margin: 10px 16px auto;
	padding: 8px 14px;
	border-radius: 999px;
	text-align: center;
}

.grd3d-xr-msg.is-error {
	background: rgba(160, 30, 30, 0.88);
}

.grd3d-xr-bottom {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 0 8px calc(14px + env(safe-area-inset-bottom));
}

.grd3d-xr-row {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 6px;
}

.grd3d-xr-group {
	display: flex;
	align-items: center;
	padding: 2px;
	border-radius: 999px;
}

.grd3d-xr-group-label {
	min-width: 30px;
	font-size: 11px;
	font-weight: 600;
	text-align: center;
}

.grd3d-xr button.grd3d-xr-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	height: 44px;
	min-height: 44px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: 999px;
	background: rgba(17, 24, 28, 0.66);
	color: #fff;
	font: 600 13px/1 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	letter-spacing: 0;
	text-transform: none;
	box-shadow: none;
	cursor: pointer;
	touch-action: none;
}

.grd3d-xr-group button.grd3d-xr-btn {
	width: 38px;
	min-width: 38px;
	height: 38px;
	min-height: 38px;
	padding: 0;
	background: transparent;
}

.grd3d-xr button.grd3d-xr-btn:hover {
	background: rgba(17, 24, 28, 0.66);
	color: #fff;
}

.grd3d-xr-group button.grd3d-xr-btn:hover {
	background: transparent;
}

.grd3d-xr button.grd3d-xr-btn:active {
	background: rgba(255, 255, 255, 0.28);
}

.grd3d-xr button.grd3d-xr-btn.is-primary {
	background: var(--grd3d-accent);
}

.grd3d-xr.is-locked button.grd3d-xr-btn.is-primary {
	background: rgba(17, 24, 28, 0.66);
	box-shadow: inset 0 0 0 2px var(--grd3d-accent);
}

.grd3d-xr button.grd3d-xr-btn svg {
	flex: none;
	width: 22px;
	height: 22px;
	fill: currentColor;
}

.grd3d-xr button.grd3d-xr-close {
	flex: none;
	width: 44px;
	padding: 0;
}
