.pnm-builder {
	max-width: 900px;
	margin: 0 auto;
	font-family: inherit;
	background: var(--white, #fff);
	border-radius: var(--radius-lg, 20px);
	box-shadow: var(--shadow-soft, 0 24px 64px rgba(58, 18, 96, 0.12));
	padding: 40px;
	position: relative;
	overflow: hidden;
}

.pnm-builder::before,
.pnm-builder::after {
	content: "";
	position: absolute;
	font-size: 2.4rem;
	opacity: 0.5;
	pointer-events: none;
	animation: pnm-float 6s ease-in-out infinite;
}

.pnm-builder::before {
	content: "🍬";
	top: 18px;
	right: 28px;
}

.pnm-builder::after {
	content: "🍭";
	bottom: 18px;
	left: 24px;
	animation-delay: 1.2s;
}

@keyframes pnm-float {
	0%, 100% { transform: translateY(0) rotate(0deg); }
	50% { transform: translateY(-10px) rotate(-6deg); }
}

@media (prefers-reduced-motion: reduce) {
	.pnm-builder::before,
	.pnm-builder::after {
		animation: none;
	}
}

.pnm-step {
	margin-bottom: 36px;
	position: relative;
	z-index: 1;
}

.pnm-step-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 10px;
	font-family: var(--font-serif, inherit);
	font-size: 1.25em;
	font-weight: 700;
	margin-bottom: 16px;
}

.pnm-step-num {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	margin-right: 6px;
	border-radius: 50%;
	background: var(--sp-pink, #d91f7e);
	color: #fff;
	font-family: var(--font-serif, inherit);
	font-size: 0.85rem;
	font-weight: 700;
	flex-shrink: 0;
}

.pnm-counter {
	font-size: 0.6em;
	font-weight: 600;
	background: #f3e9e0;
	border-radius: 999px;
	padding: 4px 12px;
}

.pnm-diet-filters,
.pnm-weight-options,
.pnm-variety-options {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
}

.pnm-diet-pill {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 9px 16px;
	border: 2px solid #eee;
	border-radius: 999px;
	cursor: pointer;
	font-size: 0.9em;
	font-weight: 600;
	user-select: none;
	box-shadow: 0 2px 6px rgba(0, 0, 0, 0.04);
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), background 0.2s ease, border-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.pnm-diet-pill:hover {
	transform: translateY(-2px);
	box-shadow: 0 6px 14px rgba(0, 0, 0, 0.08);
}

/* The real checkbox stays in the DOM (native label-click toggling, keyboard
   access, screen readers) but is visually hidden - the whole pill already
   shows selected/unselected state via .is-active / :has(input:checked). */
.pnm-diet-pill input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.pnm-diet-emoji {
	font-size: 2.5em;
	line-height: 1;
}

.pnm-diet-pill.is-active,
.pnm-diet-pill:has(input:checked) {
	background: var(--sp-purple, #3a1260);
	border-color: var(--sp-purple, #3a1260);
	color: #fff;
	transform: scale(1.04);
}

.pnm-weight-option,
.pnm-variety-option {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	padding: 16px 22px;
	border: 2px solid #eee;
	border-radius: 14px;
	cursor: pointer;
	min-width: 90px;
	text-align: center;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.pnm-weight-option:hover,
.pnm-variety-option:hover {
	transform: translateY(-3px);
	box-shadow: 0 8px 18px rgba(0, 0, 0, 0.08);
}

.pnm-weight-option input,
.pnm-variety-option input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}

.pnm-weight-option:has(input:checked),
.pnm-variety-option:has(input:checked),
.pnm-weight-option.is-selected,
.pnm-variety-option.is-selected {
	border-color: var(--sp-pink, #c2185b);
	background: #fdf1f5;
	transform: scale(1.06);
	box-shadow: 0 8px 20px rgba(217, 31, 126, 0.18);
}

.pnm-option-label {
	font-weight: 700;
}

.pnm-option-price {
	font-size: 0.85em;
	color: #666;
}

.pnm-sweets-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	gap: 16px;
}

.pnm-sweet-item {
	display: block;
	border: 2px solid #eee;
	border-radius: 16px;
	padding: 10px;
	text-align: center;
	cursor: pointer;
	user-select: none;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.2s ease, background 0.2s ease, box-shadow 0.2s ease, opacity 0.15s ease;
}

.pnm-sweet-item:hover:not(.is-disabled):not(.is-out-of-stock) {
	transform: translateY(-4px);
	box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
}

.pnm-sweet-item:has(input:checked),
.pnm-sweet-item.is-selected {
	border-color: #2f6f4f;
	background: #f2f8f4;
	transform: scale(1.03);
	box-shadow: 0 10px 22px rgba(47, 111, 79, 0.2);
}

.pnm-sweet-item.is-out-of-stock {
	cursor: default;
	opacity: 0.45;
}

.pnm-sweet-item.is-filtered-out {
	display: none;
}

.pnm-sweet-item.is-disabled {
	cursor: default;
	opacity: 0.4;
	pointer-events: none;
}

/* The real checkbox stays in the DOM (for native label-click toggling and
   keyboard access) but is visually replaced by the tick in .pnm-sweet-add-row. */
.pnm-sweet-input {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.pnm-sweet-image img {
	width: 100%;
	height: auto;
	border-radius: 10px;
	margin-bottom: 8px;
	transition: transform 0.3s ease;
}

.pnm-sweet-item:hover:not(.is-disabled):not(.is-out-of-stock) .pnm-sweet-image img {
	transform: scale(1.06);
}

.pnm-sweet-name {
	font-weight: 600;
	font-size: 0.9em;
	margin-bottom: 6px;
}

.pnm-sweet-add-row {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	font-size: 0.85em;
}

/* Hidden - the whole card already shows selected state (border/background/
   scale via .pnm-sweet-item:has(input:checked)), so the little tick box next
   to "Add" was redundant. Kept in the DOM/CSS (rather than deleted) in case
   it's wanted back, just not displayed. */
.pnm-sweet-tick {
	display: none;
}

.pnm-sweet-item:has(input:checked) .pnm-sweet-tick,
.pnm-sweet-item.is-selected .pnm-sweet-tick {
	border-color: #2f6f4f;
	background: #2f6f4f;
	animation: pnm-pop 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.pnm-sweet-item:has(input:checked) .pnm-sweet-tick::after,
.pnm-sweet-item.is-selected .pnm-sweet-tick::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 4px;
	height: 8px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg);
}

@keyframes pnm-pop {
	0% { transform: scale(0.7); }
	60% { transform: scale(1.2); }
	100% { transform: scale(1); }
}

.pnm-no-matches {
	text-align: center;
	color: #8a6d5c;
	font-style: italic;
}

.pnm-summary {
	position: sticky;
	bottom: 0;
	background: var(--white, #fff);
	border-top: 2px solid #f0eee9;
	padding: 20px 0 4px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 16px;
}

.pnm-total-row {
	display: flex;
	align-items: baseline;
	gap: 8px;
	font-family: var(--font-serif, inherit);
	font-size: 1.4em;
	font-weight: 700;
	color: var(--sp-purple, #3a1260);
}

.pnm-total-price {
	color: var(--sp-pink, #d91f7e);
	font-size: 1.15em;
}

.pnm-add-to-cart {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	white-space: nowrap;
	background-image: linear-gradient(135deg, var(--sp-gold-light, #e8c878), var(--sp-gold, #c9a44e));
	color: var(--sp-purple, #3a1260);
	border: none;
	padding: 15px 34px;
	border-radius: 999px;
	font-family: var(--font-sans, inherit);
	font-weight: 700;
	font-size: 0.85rem;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(201, 164, 78, 0.35);
	transition: transform 0.2s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.2s ease, opacity 0.2s ease;
}

.pnm-add-to-cart:hover:not(:disabled) {
	transform: translateY(-2px) scale(1.02);
	box-shadow: 0 10px 26px rgba(201, 164, 78, 0.45);
}

.pnm-add-to-cart:active:not(:disabled) {
	transform: translateY(0) scale(0.97);
}

.pnm-add-to-cart:disabled {
	background-image: none;
	background: #ece7dd;
	color: #a89f8f;
	box-shadow: none;
	cursor: not-allowed;
}

.pnm-add-to-cart.is-ready {
	animation: pnm-pulse-glow 1.8s ease-in-out infinite;
}

.pnm-add-to-cart.is-ready:hover {
	animation: none;
}

@keyframes pnm-pulse-glow {
	0%, 100% { box-shadow: 0 6px 18px rgba(201, 164, 78, 0.35); }
	50% { box-shadow: 0 6px 26px rgba(201, 164, 78, 0.7); }
}

@media (prefers-reduced-motion: reduce) {
	.pnm-add-to-cart.is-ready {
		animation: none;
	}
}

.pnm-message {
	width: 100%;
	padding: 10px 14px;
	border-radius: 10px;
	font-size: 0.9em;
}

.pnm-message.is-success {
	background: #eaf6ee;
	color: #1e5631;
}

.pnm-message.is-error {
	background: #fbeaea;
	color: #8a1f1f;
}

@media (max-width: 600px) {
	.pnm-builder {
		padding: 24px 18px;
	}
	.pnm-builder::before,
	.pnm-builder::after {
		display: none;
	}
}
