/* ============================================================
   Priority Crafting — cart toggle (Figma pixel spec)
   Rendered inside the bsw-cart-skin card utility row.
   ============================================================ */

.wkpt-priority { width: 100%; }

.wkpt-priority-box {
	position: relative;
	isolation: isolate;
	overflow: hidden;
	display: flex;
	align-items: center;
	gap: 16px;
	width: 100%;
	background: #f4f4f4;
	border-radius: 12px;
	padding: 12px;
	margin: 0;
	cursor: pointer;
	transition: background .28s ease, box-shadow .28s ease;
}

.wkpt-priority-box::before {
	content: "";
	position: absolute;
	z-index: 0;
	inset: 0;
	opacity: 0;
	pointer-events: none;
	background: linear-gradient(105deg, transparent 24%, rgba(255, 255, 255, .78) 47%, transparent 69%);
	transform: translateX(-115%);
}

.wkpt-priority-box.is-on {
	background: #e7f5eb;
	box-shadow: inset 0 0 0 1px rgba(64, 138, 84, .13);
}

.wkpt-priority-box.is-launching::before { animation: wkpt-priority-sheen .62s cubic-bezier(.18, .73, .27, 1) both; }

.wkpt-priority-boost {
	position: relative;
	z-index: 1;
	display: grid;
	place-items: center;
	flex: 0 0 25px;
	width: 25px;
	height: 28px;
	color: #111;
}

.wkpt-priority-boost svg { width: 17px; height: 22px; fill: currentColor; }
.wkpt-priority-speed-lines { position: absolute; right: 14px; top: 5px; width: 18px; height: 18px; opacity: 0; }
.wkpt-priority-speed-lines i { position: absolute; right: 0; height: 1.5px; border-radius: 2px; background: currentColor; transform-origin: right; }
.wkpt-priority-speed-lines i:nth-child(1) { top: 2px; width: 9px; }
.wkpt-priority-speed-lines i:nth-child(2) { top: 8px; width: 15px; }
.wkpt-priority-speed-lines i:nth-child(3) { top: 14px; width: 6px; }
.wkpt-priority-box.is-on .wkpt-priority-boost { color: #17723a; }
.wkpt-priority-box.is-launching .wkpt-priority-boost { animation: wkpt-priority-boost .54s cubic-bezier(.17, .8, .28, 1) both; }
.wkpt-priority-box.is-launching .wkpt-priority-speed-lines { animation: wkpt-priority-lines .43s ease-out .06s both; }

.wkpt-priority-text {
	position: relative;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 0;
	flex: 1 1 auto;
	min-width: 0;
}

.wkpt-priority-title {
	font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 14px;
	line-height: 20px;
	color: #000;
}
.wkpt-priority-title strong { font-weight: 700; }
.wkpt-priority-title .wkpt-priority-pct { font-weight: 400; color: #5d5f5f; }
.wkpt-priority-box.is-on .wkpt-priority-title .wkpt-priority-pct { color: #267b48; }

.wkpt-priority-desc {
	font-family: "Hanken Grotesk", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
	font-size: 11px;
	line-height: 16.5px;
	color: #444748;
	margin-top: 2px;
}

/* hide native checkbox; drive the switch with :checked */
.wkpt-priority-toggle {
	position: absolute;
	opacity: 0;
	width: 0;
	height: 0;
	margin: 0;
	pointer-events: none;
}

/* switch track */
.wkpt-switch {
	z-index: 1;
	flex: 0 0 auto;
	position: relative;
	display: inline-block;
	width: 40px;
	height: 20px;
	border-radius: 9999px;
	background: #f1edec;
	border: 2px solid transparent;
	transition: background 0.18s ease;
}

/* knob */
.wkpt-switch .wkpt-knob {
	position: absolute;
	top: 50%;
	left: 2px;
	transform: translateY(-50%);
	width: 16px;
	height: 16px;
	border-radius: 9999px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1), 0 1px 2px -1px rgba(0, 0, 0, 0.1);
	transition: left 0.18s ease;
}

/* on state */
.wkpt-priority-toggle:checked ~ .wkpt-switch { background: #17723a; }
.wkpt-priority-toggle:checked ~ .wkpt-switch .wkpt-knob { left: 20px; }

.wkpt-priority-toggle:focus-visible ~ .wkpt-switch {
	outline: 2px solid #111;
	outline-offset: 2px;
}

/* busy state during AJAX */
.wkpt-priority.is-busy { pointer-events: none; }
.wkpt-priority.is-busy .wkpt-priority-box { cursor: wait; }
.wkpt-priority.is-busy .wkpt-switch {
	background: transparent;
	border-color: transparent;
}
.wkpt-priority.is-busy .wkpt-switch .wkpt-knob {
	left: 50%;
	width: 20px;
	height: 20px;
	background: transparent;
	border: 2px solid rgba(17, 17, 17, 0.18);
	border-top-color: #111;
	box-shadow: none;
	transform: translate(-50%, -50%);
	animation: wkpt-priority-spin 0.72s linear infinite;
}

@keyframes wkpt-priority-spin {
	to { transform: translate(-50%, -50%) rotate(360deg); }
}

@keyframes wkpt-priority-sheen {
	0% { opacity: 0; transform: translateX(-115%); }
	16% { opacity: .65; }
	100% { opacity: 0; transform: translateX(125%); }
}

@keyframes wkpt-priority-boost {
	0% { transform: translateX(0); }
	42% { transform: translateX(5px) scale(1.07); }
	100% { transform: translateX(0) scale(1); }
}

@keyframes wkpt-priority-lines {
	0% { opacity: 0; transform: translateX(5px) scaleX(.2); }
	22% { opacity: .72; }
	100% { opacity: 0; transform: translateX(-9px) scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
	.wkpt-priority-box *, .wkpt-priority-box::before {
		animation: none !important;
		transition-duration: .01ms !important;
	}
}
