.mewepak-3d-container {
	width: 100%;
	border-radius: 8px;
	overflow: hidden;
	position: relative;
}

.mewepak-3d-container canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
	cursor: grab;
	touch-action: none;
}

.mewepak-3d-container canvas:active {
	cursor: grabbing;
}

/* Loading */
.mewepak-3d-loading {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	color: #6b7280;
	font-size: 14px;
	z-index: 10;
}

/* Control panel */
.mewepak-3d-panel {
	width: 240px;
	flex-shrink: 0;
	padding: 20px;
	background: #111827;
	border-left: 1px solid #374151;
}

.mewepak-3d-panel h4 {
	margin: 0 0 18px;
	color: #f9fafb;
	font-size: 15px;
	font-weight: 600;
}

.mewepak-3d-field {
	margin-bottom: 14px;
}

/* Image guide tip */
.mewepak-3d-tip {
	background: rgba(0, 207, 202, 0.08);
	border: 1px solid rgba(0, 207, 202, 0.3);
	border-radius: 6px;
	padding: 10px 12px;
	margin-bottom: 16px;
}

.mewepak-3d-tip strong {
	color: #00cfca;
	font-size: 12px;
	display: block;
	margin-bottom: 4px;
}

.mewepak-3d-tip p {
	color: #9ca3af;
	font-size: 11px;
	line-height: 1.5;
	margin: 0;
}

.mewepak-3d-tip b {
	color: #d1d5db;
}

.mewepak-3d-field label {
	display: block;
	color: #d1d5db;
	font-size: 12px;
	margin-bottom: 6px;
}

/* Upload area */
.mewepak-3d-upload {
	position: relative;
	border: 2px dashed #374151;
	border-radius: 6px;
	padding: 14px;
	text-align: center;
	cursor: pointer;
	transition: all 0.2s;
}

.mewepak-3d-upload:hover,
.mewepak-3d-upload.dragover {
	border-color: #00cfca;
	background: rgba(0, 207, 202, 0.05);
}

.mewepak-3d-upload.has-file {
	border-color: #00cfca;
	border-style: solid;
	background: rgba(0, 207, 202, 0.08);
}

.mewepak-3d-upload input[type="file"] {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.mewepak-3d-upload span {
	color: #9ca3af;
	font-size: 12px;
}

.mewepak-3d-upload.has-file span {
	color: #00cfca;
}

/* Clear button */
.mewepak-3d-btn-clear {
	margin-top: 10px;
	width: 100%;
	padding: 8px;
	background: #1f2937;
	border: 1px solid #374151;
	border-radius: 4px;
	color: #ef4444;
	font-size: 12px;
	cursor: pointer;
}

.mewepak-3d-btn-clear:hover {
	background: #374151;
}

/* Color swatches */
.mewepak-3d-colors {
	display: flex;
	gap: 8px;
}

.color-swatch {
	width: 28px;
	height: 28px;
	border-radius: 50%;
	cursor: pointer;
	transition: transform 0.15s;
	box-sizing: border-box;
}

.color-swatch:hover {
	transform: scale(1.15);
}

.color-swatch.active {
	outline: 2px solid #00cfca;
	outline-offset: 2px;
}

/* Toggle switch */
.mewepak-toggle {
	position: relative;
	display: inline-block;
	width: 36px;
	height: 20px;
	cursor: pointer;
}

.mewepak-toggle input {
	opacity: 0;
	width: 0;
	height: 0;
}

.mewepak-toggle span {
	position: absolute;
	inset: 0;
	background: #374151;
	border-radius: 20px;
	transition: 0.2s;
}

.mewepak-toggle span::before {
	content: '';
	position: absolute;
	width: 16px;
	height: 16px;
	left: 2px;
	bottom: 2px;
	background: #fff;
	border-radius: 50%;
	transition: 0.2s;
}

.mewepak-toggle input:checked + span {
	background: #00cfca;
}

.mewepak-toggle input:checked + span::before {
	transform: translateX(16px);
}

/* Divider */
.mewepak-3d-divider {
	height: 1px;
	background: #374151;
	margin: 16px 0;
}

.mewepak-3d-hint {
	margin-top: 20px;
	color: #6b7280;
	font-size: 11px;
	text-align: center;
}

.mewepak-home-3d {
	position: relative;
	width: 100%;
	height: 100%;
	min-height: 360px;
	border-radius: 1.25rem;
	overflow: hidden;
	background: #f8fafc;
}

.mewepak-home-3d__canvas {
	display: block;
	width: 100% !important;
	height: 100% !important;
	cursor: grab;
}

.mewepak-home-3d__canvas:active {
	cursor: grabbing;
}

.mewepak-home-3d__loading {
	position: absolute;
	top: 50%;
	left: 50%;
	z-index: 2;
	transform: translate(-50%, -50%);
	color: rgba(0, 207, 202, 0.7);
	font-size: 0.875rem;
	font-weight: 600;
	pointer-events: none;
}

.mewepak-home-3d-tab {
	padding: 0.5rem 1.25rem;
	border: 1px solid transparent;
	border-radius: 0.75rem;
	background: transparent;
	color: #9ca3af;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
	transition: color 0.2s ease, background-color 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}

.mewepak-home-3d-tab:hover,
.mewepak-home-3d-tab.is-active {
	background: #fff;
	border-color: #f3f4f6;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
	color: #111827;
}

/* Responsive */
@media (max-width: 768px) {
	.mewepak-3d-container > div {
		flex-direction: column-reverse !important;
	}

	.mewepak-3d-panel {
		width: 100%;
		border-left: none;
		border-top: 1px solid #374151;
		padding: 16px;
		max-height: 280px;
	}
}

/* Packaging preview studio */
.preview-page .preview-tool-section {
	padding-block: clamp(36px, 5vw, 68px);
	scroll-margin-top: 16px;
}
.preview-page .preview-tool-head { align-items: baseline; margin-bottom: 18px; }
.preview-page .preview-tool-head h2 { font-size: clamp(1.7rem, 3vw, 2.45rem); }

.mewepak-3d-formats {
	display: grid;
	grid-template-columns: repeat(6, minmax(0, 1fr));
	gap: 8px;
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}
.mewepak-3d-formats li { min-width: 0; }
.mewepak-3d-formats a {
	display: flex;
	align-items: center;
	gap: 8px;
	min-height: 64px;
	height: 100%;
	padding: 7px 9px;
	border: 1px solid #cbdad4;
	border-radius: 11px;
	background: #fff;
	color: #13363b;
	font-size: .82rem;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
}
.mewepak-3d-formats a:hover { border-color: #47877b; }
.mewepak-3d-formats a[aria-current="true"] {
	border-color: #007c72;
	box-shadow: inset 0 0 0 1px #007c72;
	background: #e6f3ee;
	color: #095b54;
}
.mewepak-3d-formats img {
	display: block;
	flex-shrink: 0;
	width: 48px;
	height: 45px;
	border-radius: 6px;
	object-fit: cover;
	background: #eef2ee;
}
.preview-page .mewepak-3d-container {
	min-height: 0;
	overflow: hidden;
	border-radius: 16px;
	background: #eff3f0;
}
.mewepak-3d-container > .mewepak-3d-poster { position: static; height: 560px; }
.mewepak-3d-workspace {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(260px, 310px);
	min-width: 0;
}
.mewepak-3d-viewport {
	position: relative;
	min-width: 0;
	height: 560px;
	background: #eff3f0;
}
.mewepak-3d-poster {
	display: block;
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: contain;
	pointer-events: none;
}
.mewepak-3d-poster[hidden],
.mewepak-3d-workspace [hidden] { display: none; }
.mewepak-3d-workspace .mewepak-3d-loading {
	inset: auto 12px 13px;
	transform: none;
	margin: 0;
	padding: 8px 12px;
	border-radius: 8px;
	background: #fff;
	color: #143b40;
	text-align: center;
}
.mewepak-3d-loading button { color: #00665f; font-weight: 700; text-decoration: underline; }
.mewepak-3d-workspace .mewepak-3d-panel {
	display: flex;
	flex-direction: column;
	gap: 13px;
	width: auto;
	max-height: none;
	min-width: 0;
	padding: 25px;
	border: 0;
	border-left: 1px solid #d5e3d9;
	background: #fff;
	color: #143b40;
}
.mewepak-3d-panel h3 { margin: 0; color: #12343b; font-size: 1.45rem; line-height: 1.17; }
.mewepak-3d-guide { margin: 0; color: #426064; font-size: .875rem; line-height: 1.45; }
.mewepak-3d-artwork { display: grid; gap: 9px; }
.mewepak-3d-workspace .mewepak-3d-upload {
	display: grid;
	gap: 4px;
	min-width: 0;
	border: 1px dashed #8cafaa;
	background: #f8fbf9;
	color: #193f44;
	padding: 10px 12px;
	text-align: left;
}
.mewepak-3d-workspace .mewepak-3d-upload:hover,
.mewepak-3d-workspace .mewepak-3d-upload.dragover,
.mewepak-3d-workspace .mewepak-3d-upload.has-file {
	border-color: #007c72;
	background: #eaf5ef;
}
.mewepak-3d-workspace .mewepak-3d-upload:focus-within { outline: 2px solid #007c72; outline-offset: 2px; }
.mewepak-3d-workspace .mewepak-3d-upload input[type="file"] { width: 100%; height: 100%; }
.mewepak-3d-workspace .mewepak-3d-upload strong { font-size: .9rem; line-height: 1.2; }
.mewepak-3d-workspace .mewepak-3d-upload span {
	overflow: hidden;
	color: #426064;
	text-overflow: ellipsis;
	white-space: nowrap;
}
.mewepak-3d-workspace .mewepak-3d-btn-clear {
	align-self: start;
	width: auto;
	padding: 0;
	margin: 0;
	border: none;
	background: none;
	color: #7e3831;
	text-align: left;
	text-decoration: underline;
}
.mewepak-3d-upload-status { margin: 0; color: #7e3831; font-size: .85rem; }
.mewepak-3d-view-settings { border-top: 1px solid #dae5df; font-size: .875rem; color: #345458; }
.mewepak-3d-view-settings summary { padding-block: 10px; color: #143b40; cursor: pointer; font-weight: 700; }
.mewepak-3d-view-settings .mewepak-3d-field { display: grid; gap: 6px; }
.mewepak-3d-view-settings .color-swatch { border: 1px solid #849b94; }
.mewepak-3d-view-settings .color-swatch[aria-pressed="true"] { outline: 2px solid #007c72; outline-offset: 2px; }
.mewepak-3d-rotate { display: flex; align-items: center; gap: 8px; }
.mewepak-3d-rotate input { accent-color: #007c72; }
.mewepak-3d-quote {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	min-height: 45px;
	padding: 8px 16px;
	border-radius: 8px;
	background: #006f66;
	color: #fff !important;
	font-weight: 700;
	text-decoration: none !important;
}
.mewepak-3d-quote:hover { background: #085950; }
.mewepak-3d-formats a:focus-visible,
.mewepak-3d-quote:focus-visible { outline: 2px solid #007c72; outline-offset: 2px; }
.mewepak-3d-fallback {
	display: grid;
	justify-items: center;
	align-content: center;
	gap: 12px;
	min-height: 300px;
	padding: 20px;
	color: #143b40;
	text-align: center;
}
.mewepak-3d-fallback img { max-height: 300px; width: auto; max-width: 100%; border-radius: 10px; }
.mewepak-3d-fallback p { margin: 0; }

@media (max-width: 1030px) {
	.mewepak-3d-formats { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
	.preview-page .preview-tool-head { display: grid; gap: 6px; }
	.mewepak-3d-formats {
		grid-template-columns: none;
		grid-template-rows: repeat(2, minmax(51px, auto));
		grid-auto-columns: minmax(137px, 42%);
		grid-auto-flow: column;
		overflow-x: auto;
		gap: 6px;
		margin-inline: -3px;
		padding: 3px 3px 8px;
		scroll-snap-type: x proximity;
	}
	.mewepak-3d-formats li { scroll-snap-align: start; }
	.mewepak-3d-formats a { min-height: 51px; padding: 5px 7px; font-size: .76rem; }
	.mewepak-3d-formats img { width: 40px; height: 37px; }
	.mewepak-3d-workspace { grid-template-columns: minmax(0, 1fr); }
	.mewepak-3d-viewport,
	.mewepak-3d-container > .mewepak-3d-poster { height: clamp(295px, 85vw, 415px); }
	.mewepak-3d-workspace .mewepak-3d-panel { padding: 17px; border: 0; border-top: 1px solid #d5e3d9; }
}
