/* Happy Candy – Pick'n'Mix */
.hcpm {
	--hcpm-primary: #FF5FA2;
	--hcpm-accent: #9B5DE5;
	--hcpm-ink: #2B1B3D;
	--hcpm-cream: #FFF8F3;
	margin: 1.25rem 0;
	padding: 1.25rem;
	border-radius: 24px;
	background: var(--hcpm-cream);
	box-shadow: 0 10px 30px -12px color-mix(in srgb, var(--hcpm-primary) 45%, transparent);
	color: var(--hcpm-ink);
}
.hcpm [hidden] { display: none !important; }

.hcpm__head { display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: .5rem; }
.hcpm__title { margin: 0; font-size: 1.25rem; font-weight: 800; }
.hcpm__counter { margin: 0; font-size: 1rem; }
.hcpm__counter strong { color: var(--hcpm-primary); }

.hcpm__bar { height: 10px; margin: .75rem 0 .5rem; border-radius: 99px; background: #fff; overflow: hidden; }
.hcpm__bar span { display: block; height: 100%; width: 0; border-radius: inherit; background: linear-gradient(90deg, var(--hcpm-primary), var(--hcpm-accent)); transition: width .35s cubic-bezier(.34, 1.56, .64, 1); }
.hcpm.is-over .hcpm__bar span { background: #FF7B3A; }

.hcpm__hint { margin: 0 0 .75rem; font-size: .95rem; opacity: .85; }
.hcpm__hint.is-flash { animation: hcpm-wiggle .45s; color: var(--hcpm-primary); opacity: 1; font-weight: 700; }
.hcpm.is-over .hcpm__hint { color: #c2410c; font-weight: 700; }

.hcpm__search { width: 100%; margin-bottom: .75rem; padding: .65rem 1rem; border: 2px solid #f3dce8; border-radius: 99px; background: #fff; font: inherit; }
.hcpm__search:focus { outline: none; border-color: var(--hcpm-primary); }

.hcpm__tabs { display: flex; gap: .5rem; margin-bottom: .75rem; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
.hcpm__tabs::-webkit-scrollbar { display: none; }
.hcpm__tab { flex: 0 0 auto; padding: .45rem .9rem; border: 2px solid transparent; border-radius: 99px; background: #fff; color: var(--hcpm-ink); font: inherit; font-size: .9rem; font-weight: 700; cursor: pointer; transition: transform .15s; }
.hcpm__tab:hover { transform: translateY(-1px); }
.hcpm__tab.is-active { background: var(--hcpm-primary); color: #fff; }
.hcpm__tab-n { font-weight: 600; opacity: .85; }

.hcpm__grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .65rem; max-height: 460px; overflow-y: auto; padding: 4px; }
.hcpm.is-searching .hcpm__panels { display: grid; grid-template-columns: repeat(auto-fill, minmax(104px, 1fr)); gap: .65rem; max-height: 460px; overflow-y: auto; padding: 4px; }
.hcpm.is-searching .hcpm__grid { display: contents; }

.hcpm__item { position: relative; }
.hcpm__add { display: flex; flex-direction: column; align-items: center; gap: .35rem; width: 100%; height: 100%; padding: .5rem; border: 2px solid transparent; border-radius: 18px; background: #fff; color: var(--hcpm-ink); font: inherit; cursor: pointer; transition: transform .15s cubic-bezier(.34, 1.56, .64, 1), border-color .15s; }
.hcpm__add:hover { transform: translateY(-2px) scale(1.02); }
.hcpm__add:active { transform: scale(.96); }
.hcpm__add img { width: 100%; height: auto; aspect-ratio: 1; object-fit: cover; border-radius: 12px; }
.hcpm__name { font-size: .78rem; font-weight: 700; line-height: 1.2; text-align: center; }
.hcpm__item.is-picked .hcpm__add { border-color: var(--hcpm-primary); }
.hcpm.is-full .hcpm__item:not(.is-picked) .hcpm__add { opacity: .55; }

.hcpm__qty, .hcpm__minus { position: absolute; top: -6px; display: none; align-items: center; justify-content: center; min-width: 26px; height: 26px; border-radius: 99px; font-size: .8rem; font-weight: 800; }
.hcpm__qty { right: -6px; padding: 0 6px; background: var(--hcpm-primary); color: #fff; pointer-events: none; }
.hcpm__minus { left: -6px; border: 0; background: var(--hcpm-ink); color: #fff; cursor: pointer; padding: 0; }
.hcpm__item.is-picked .hcpm__qty, .hcpm__item.is-picked .hcpm__minus { display: inline-flex; }

.hcpm__noresult { margin: .5rem 0; font-style: italic; }
.hcpm__summary { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .5rem; margin-top: 1rem; padding: .75rem 1rem; border-radius: 16px; background: #fff; }
.hcpm__summary p { margin: 0; font-size: .9rem; }
.hcpm__reset { padding: .35rem .8rem; border: 0; border-radius: 99px; background: transparent; color: var(--hcpm-accent); font: inherit; font-weight: 700; text-decoration: underline; cursor: pointer; }
.hcpm-empty { padding: 1rem; border-radius: 16px; background: #FFF8F3; }

@keyframes hcpm-wiggle {
	0%, 100% { transform: translateX(0); }
	25% { transform: translateX(-4px); }
	75% { transform: translateX(4px); }
}
@media (prefers-reduced-motion: reduce) {
	.hcpm *, .hcpm *::before { animation: none !important; transition: none !important; }
}
