:root {
	--market3d-color-primary: #2b6cb0;
	--market3d-color-secondary: #1a202c;
	--market3d-color-sign-text: #ffffff;
}

.market3d-entry {
	margin: 10px 0;
	text-align: center;
}

.market3d-entry__button {
	display: inline-block;
	padding: 10px 24px;
	background: var(--market3d-color-primary);
	color: var(--market3d-color-sign-text);
	border-radius: 4px;
	font-weight: bold;
	text-decoration: none;
}

.market3d-header-btn {
	display: inline-block;
}

.market3d-header-btn__link {
	display: inline-block;
	margin-left: 10px;
	padding: 6px 14px;
	background: var(--market3d-color-primary);
	color: var(--market3d-color-sign-text);
	border-radius: 4px;
	font-size: 13px;
	text-decoration: none;
	vertical-align: middle;
}

.market3d {
	position: relative;
	width: 100%;
	height: 80vh;
	min-height: 360px;
	background: var(--market3d-color-secondary);
	overflow: hidden;
}

.market3d__canvas {
	display: block;
	width: 100%;
	height: 100%;
	touch-action: none;
}

.market3d__loading {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	color: #fff;
	background: var(--market3d-color-secondary);
	z-index: 20;
}

.market3d__loading-bar {
	width: 60%;
	max-width: 320px;
	height: 8px;
	background: rgba(255, 255, 255, 0.2);
	border-radius: 4px;
	overflow: hidden;
	margin-bottom: 12px;
}

.market3d__loading-bar-fill {
	height: 100%;
	width: 0;
	background: var(--market3d-color-primary);
	transition: width 0.2s ease-out;
}

.market3d__fallback {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 16px;
	color: #fff;
	background: var(--market3d-color-secondary);
	text-align: center;
	padding: 24px;
	z-index: 21;
}

.market3d__hud {
	position: absolute;
	inset: 0;
	pointer-events: none;
	z-index: 10;
}

.market3d__hud-top {
	position: absolute;
	top: 12px;
	left: 12px;
	right: 12px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	pointer-events: auto;
}

.market3d__department-label {
	color: #fff;
	background: rgba(0, 0, 0, 0.5);
	padding: 6px 12px;
	border-radius: 4px;
	font-size: 14px;
	flex: 1 1 auto;
	min-width: 0;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.market3d__minimap-toggle,
.market3d__cart-button {
	background: var(--market3d-color-primary);
	color: var(--market3d-color-sign-text);
	border: none;
	padding: 8px 12px;
	border-radius: 4px;
	font-size: 13px;
	cursor: pointer;
	white-space: nowrap;
}

.market3d__minimap {
	position: absolute;
	top: 56px;
	right: 12px;
	width: 140px;
	height: 140px;
	background: rgba(0, 0, 0, 0.6);
	border-radius: 6px;
	pointer-events: auto;
	cursor: pointer;
}

.market3d__joystick {
	position: absolute;
	bottom: 24px;
	left: 24px;
	pointer-events: auto;
}

.market3d__joystick-base {
	position: relative;
	width: 100px;
	height: 100px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.15);
}

.market3d__joystick-knob {
	position: absolute;
	top: 30px;
	left: 30px;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.5);
}

.market3d__modal {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	background: rgba(0, 0, 0, 0.6);
	z-index: 30;
	pointer-events: auto;
}

.market3d__modal[hidden] {
	display: none;
}

.market3d__modal-content {
	position: relative;
	width: 90%;
	max-width: 420px;
	max-height: 85%;
	overflow-y: auto;
	background: #fff;
	border-radius: 6px;
	padding: 20px;
}

.market3d__modal-close {
	position: absolute;
	top: 8px;
	right: 8px;
	border: none;
	background: transparent;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
}

.market3d__checkout-button {
	display: block;
	margin-top: 16px;
	padding: 10px;
	text-align: center;
	background: var(--market3d-color-primary);
	color: var(--market3d-color-sign-text);
	border-radius: 4px;
	text-decoration: none;
	font-weight: bold;
}

.market3d__product {
	text-align: center;
}

.market3d__product-image {
	max-width: 100%;
	max-height: 220px;
}

.market3d__product-options {
	text-align: left;
	margin: 12px 0;
}

.market3d__product-option {
	margin-bottom: 10px;
}

.market3d__product-add {
	width: 100%;
	padding: 10px;
	background: var(--market3d-color-primary);
	color: var(--market3d-color-sign-text);
	border: none;
	border-radius: 4px;
	cursor: pointer;
}

.market3d__product-add:disabled {
	background: #999;
	cursor: not-allowed;
}

.market3d__cart-line {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 8px 0;
	border-bottom: 1px solid #eee;
}

.market3d__cart-line-remove {
	background: none;
	border: none;
	color: #c0392b;
	cursor: pointer;
}

@media (max-width: 480px) {
	.market3d {
		height: 70vh;
	}

	.market3d__minimap {
		width: 100px;
		height: 100px;
	}

	.market3d__department-label {
		font-size: 12px;
	}
}

@media (min-width: 360px) and (max-width: 400px) {
	.market3d__joystick-base {
		width: 80px;
		height: 80px;
	}

	.market3d__joystick-knob {
		width: 32px;
		height: 32px;
		top: 24px;
		left: 24px;
	}
}
