/* Polaryx 3D components */
.px3d { position: relative; display: block; overflow: hidden; isolation: isolate; font-family: inherit; }
.px3d__stage { position: absolute; inset: 0; }
.px3d__canvas { display: block; width: 100% !important; height: 100% !important; touch-action: pan-y; cursor: grab; }
.px3d__canvas:active { cursor: grabbing; }
.px3d button { font: inherit; cursor: pointer; }
.px3d.is-fallback .px3d__stage { display: flex; align-items: center; justify-content: center; }
.px3d.is-fallback .px3d__stage img { max-width: 70%; max-height: 70%; object-fit: contain; }

/* luminaire demo */
.px3d--lum { background: #0d0e10; color: #fff; border-radius: var(--px3d-radius, 24px); min-height: 420px; }
.px3d--lum .px3d__stage { opacity: 0; transition: opacity .8s ease; }
.px3d--lum.is-ready .px3d__stage, .px3d--lum.is-fallback .px3d__stage { opacity: 1; }
.px3d__hud { position: absolute; left: 18px; top: 18px; right: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-start; pointer-events: none; z-index: 2; }
.px3d__status {
	display: inline-flex; align-items: center; gap: 10px; padding: 10px 14px; border-radius: 999px;
	background: rgba(14, 15, 17, .62); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px);
	font-size: 13px; font-weight: 600; letter-spacing: .01em;
}
.px3d__dot { width: 8px; height: 8px; border-radius: 50%; background: #3ddc84; box-shadow: 0 0 0 4px rgba(61, 220, 132, .18); }
.px3d__status[data-state="battery"] .px3d__dot { background: #ff6a3d; box-shadow: 0 0 0 4px rgba(255, 106, 61, .22); animation: px3dpulse 1.2s ease-in-out infinite; }
@keyframes px3dpulse { 50% { box-shadow: 0 0 0 8px rgba(255, 106, 61, 0); } }
.px3d__battery { padding: 10px 14px; border-radius: 14px; min-width: 190px; background: rgba(14, 15, 17, .62); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px); font-size: 12.5px; }
.px3d__batlabel { display: flex; justify-content: space-between; gap: 12px; color: #cfd2d6; }
.px3d__batlabel b { color: #fff; font-variant-numeric: tabular-nums; }
.px3d__bar { height: 6px; border-radius: 6px; background: rgba(255, 255, 255, .12); margin: 8px 0 6px; overflow: hidden; }
.px3d__bar i { display: block; height: 100%; width: 100%; background: linear-gradient(90deg, #ff6a3d, #ffb36b); border-radius: 6px; transition: width .4s linear; }
.px3d__batsub { color: #9da3a9; }
.px3d__batsub b { color: #fff; }
.px3d__controls { position: absolute; left: 18px; right: 18px; bottom: 18px; display: flex; flex-wrap: wrap; gap: 10px; align-items: center; z-index: 2; }
.px3d__power {
	display: inline-flex; align-items: center; gap: 10px; min-height: 48px; padding: 0 22px 0 16px; border-radius: 999px; border: 0;
	background: #e8462b; color: #fff; font-weight: 700; font-size: 15px; box-shadow: 0 10px 30px rgba(232, 70, 43, .35); transition: transform .2s ease, background .2s ease;
}
.px3d__power:hover { background: #cf3a20; transform: translateY(-1px); }
.px3d__power[aria-pressed="true"] { background: #fff; color: #111; box-shadow: 0 10px 30px rgba(255, 255, 255, .15); }
.px3d__poweri { width: 18px; height: 18px; border-radius: 50%; border: 2px solid currentColor; position: relative; }
.px3d__poweri::after { content: ""; position: absolute; left: 50%; top: -5px; width: 2px; height: 10px; background: currentColor; transform: translateX(-50%); box-shadow: 0 0 0 2px #e8462b; }
.px3d__power[aria-pressed="true"] .px3d__poweri::after { box-shadow: 0 0 0 2px #fff; }
.px3d__mode { display: inline-flex; padding: 4px; border-radius: 999px; background: rgba(14, 15, 17, .62); border: 1px solid rgba(255, 255, 255, .14); backdrop-filter: blur(10px); }
.px3d__mode[hidden] { display: none; }
.px3d__mode button { border: 0; background: transparent; color: #cfd2d6; padding: 9px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; min-height: 38px; }
.px3d__mode button[aria-pressed="true"] { background: #fff; color: #111; }
.px3d__picker { position: absolute; right: 18px; top: 18px; display: flex; flex-direction: column; gap: 6px; z-index: 3; }
.px3d__picker button {
	border: 1px solid rgba(255, 255, 255, .16); background: rgba(14, 15, 17, .55); color: #cfd2d6; font-size: 12px; font-weight: 700;
	letter-spacing: .04em; padding: 0 10px; min-height: 32px; border-radius: 9px; backdrop-filter: blur(8px); font-variant-numeric: tabular-nums;
}
.px3d__picker button[aria-pressed="true"] { background: #e8462b; border-color: #e8462b; color: #fff; }
.px3d__hint { position: absolute; right: 18px; bottom: 26px; z-index: 1; font-size: 12px; color: rgba(255, 255, 255, .55); letter-spacing: .04em; pointer-events: none; transition: opacity .4s; }
.px3d.was-dragged .px3d__hint { opacity: 0; }

/* carton viewer */
.px3d--carton { background: radial-gradient(120% 90% at 50% 35%, #fbfaf7 0%, #ecebe6 70%); border-radius: var(--px3d-radius, 24px); min-height: 460px; color: #111; }
.px3d--carton .px3d__stage { bottom: 0; }
.px3d__cap { position: absolute; left: 20px; top: 18px; z-index: 2; display: flex; flex-direction: column; gap: 2px; pointer-events: none; }
.px3d__code { font-size: 18px; font-weight: 800; letter-spacing: .02em; }
.px3d__dims { font-size: 13px; color: #555; font-variant-numeric: tabular-nums; }
.px3d__tools { position: absolute; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 2; display: flex; gap: 4px; padding: 5px; border-radius: 999px; background: rgba(255, 255, 255, .86); border: 1px solid rgba(17, 17, 17, .08); box-shadow: 0 8px 24px rgba(17, 17, 17, .08); backdrop-filter: blur(8px); max-width: calc(100% - 24px); overflow-x: auto; }
.px3d__tools button { border: 0; background: transparent; color: #333; font-size: 13px; font-weight: 600; padding: 0 13px; min-height: 36px; border-radius: 999px; white-space: nowrap; }
.px3d__tools button:hover { background: #f1f0ec; }
.px3d__tools button[aria-pressed="true"] { background: #111; color: #fff; }
.px3d__sep { width: 1px; background: rgba(17, 17, 17, .12); margin: 6px 4px; }
.px3d__thumbs { position: absolute; right: 14px; top: 14px; bottom: 70px; z-index: 2; display: flex; flex-direction: column; gap: 6px; overflow-y: auto; }
.px3d__thumbs button { display: flex; align-items: center; gap: 8px; width: 150px; padding: 6px 10px 6px 6px; border-radius: 12px; border: 1px solid rgba(17, 17, 17, .08); background: rgba(255, 255, 255, .8); text-align: left; font-size: 12px; font-weight: 700; color: #222; }
.px3d__thumbs img { width: 48px; height: 30px; object-fit: contain; }
.px3d__thumbs button[aria-pressed="true"] { border-color: #e8462b; box-shadow: 0 0 0 2px rgba(232, 70, 43, .2); background: #fff; }
.px3d button:focus-visible { outline: 3px solid #e8462b; outline-offset: 2px; }

@media (max-width: 700px) {
	.px3d__hud { left: 14px; right: 14px; top: 14px; }
	.px3d__status { font-size: 12px; padding: 8px 12px; }
	.px3d__battery { position: absolute; left: 0; top: 96px; min-width: 170px; }
	.px3d__picker { flex-direction: row; left: 14px; right: 14px; top: 54px; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
	.px3d__picker::-webkit-scrollbar { display: none; }
	.px3d__picker button { flex: 0 0 auto; }
	.px3d__controls { left: 14px; right: 14px; bottom: 14px; }
	.px3d__power { flex: 1 1 100%; justify-content: center; }
	.px3d__mode { flex: 1 1 100%; justify-content: center; }
	.px3d__mode button { flex: 1; }
	.px3d__hint { display: none; }
	.px3d--carton { display: flex; flex-direction: column; }
	.px3d--carton .px3d__stage { bottom: 132px; }
	.px3d__thumbs { position: static; flex-direction: row; overflow-x: auto; padding: 0 12px 12px; margin-top: auto; }
	.px3d__thumbs button { width: auto; flex: 0 0 auto; }
	.px3d__tools { bottom: 78px; left: 12px; right: 12px; transform: none; max-width: none; }
	.px3d--carton:not(:has(.px3d__thumbs)) .px3d__stage { bottom: 0; }
	.px3d--carton:not(:has(.px3d__thumbs)) .px3d__tools { bottom: 14px; }
}
@media (prefers-reduced-motion: reduce) { .px3d__status[data-state="battery"] .px3d__dot { animation: none; } }
.px3d--lum:has(.px3d__mode:not([hidden])) .px3d__hint { display: none; }
