.spp-packing {
	--spp-accent: #ff7029;
	margin: 0 0 18px;
	padding: 0;
	border: 0;
	width: 100%;
	min-width: 0;
}

/* The theme floats legends; keep it above the swatches. */
.spp-packing legend {
	float: none;
	display: block;
	width: 100%;
	padding: 0;
	margin: 0 0 8px;
	line-height: 1.3;
	font-weight: 600;
	font-size: 18px;
	color: #333;
}

/* Holds the "no packing" value; the theme's radio display rule would show it. */
.spp-packing .spp-none {
	display: none !important;
}

.spp-swatches {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(118px, 1fr));
	gap: 10px;
}

.spp-swatch {
	position: relative;
	display: block;
	margin: 0;
	cursor: pointer;
}

/* Visually hidden but still focusable and announced. The theme styles radios as
   relative 20px boxes, which pushed the card down, so this has to win. */
.spp-packing .spp-swatch input[type="radio"] {
	position: absolute !important;
	top: 0;
	left: 0;
	opacity: 0;
	width: 1px !important;
	height: 1px !important;
	margin: 0 !important;
	padding: 0 !important;
	pointer-events: none;
}

.spp-swatch-card {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	height: 100%;
	padding: 12px 8px 10px;
	border: 1.5px solid #dcdfe3;
	border-radius: 6px;
	background: #fff;
	text-align: center;
	line-height: 1.25;
	transition: border-color .15s ease, box-shadow .15s ease;
}

.spp-swatch:hover .spp-swatch-card {
	border-color: #b8bdc4;
}

.spp-swatch-icon {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: #8a9099;
}

.spp-swatch-icon svg {
	width: 34px;
	height: 34px;
	fill: currentColor;
}

/* Uploaded packing photos get a larger frame than the default icons. */
.spp-swatch-icon:has(img) {
	width: 100%;
	height: 72px;
}

.spp-swatch-icon img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 4px;
}

.spp-swatch-name {
	font-weight: 600;
	font-size: 14px;
	color: #222;
}

.spp-swatch-price {
	font-size: 13px;
	font-weight: 600;
	line-height: 1.25;
	color: #666;
}

/* The theme enlarges WooCommerce prices; match the "+" sign instead. */
.spp-packing .spp-swatch-price .amount,
.spp-packing .spp-swatch-price bdi {
	display: inline;
	font-size: inherit;
	font-weight: inherit;
	line-height: inherit;
	color: inherit;
}

.spp-swatch-check {
	position: absolute;
	top: 6px;
	right: 6px;
	display: none;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: var(--spp-accent);
}

.spp-swatch-check::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 3px;
	width: 5px;
	height: 9px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

.spp-swatch input:checked + .spp-swatch-card {
	border-color: var(--spp-accent);
	box-shadow: 0 0 0 1px var(--spp-accent);
	background: #fff8f4;
}

.spp-swatch input:checked + .spp-swatch-card .spp-swatch-check {
	display: block;
}

.spp-swatch input:checked + .spp-swatch-card .spp-swatch-icon,
.spp-swatch input:checked + .spp-swatch-card .spp-swatch-price {
	color: var(--spp-accent);
}

.spp-swatch input:focus-visible + .spp-swatch-card {
	outline: 2px solid var(--spp-accent);
	outline-offset: 2px;
}
