/**
 * /build-your-entourage/ builder page. Server renders the neutral skeleton;
 * builder.js paints session state. Dark system: bg #0a0a0a · cards #141414 ·
 * cream #f0ece4 · brand-purple ladder/deal chrome · green boost/unlock.
 */

.pf-bb-builder {
	--pf-bb-gold: #d4af37;
	--pf-bb-purple: #c084fc; /* brand label purple (#703080) lifted for 7.5:1 on black */
	--pf-bb-green: #4ade80;
	--pf-bb-cream: #f0ece4;
}

/* ---------- builder bar ---------- */
.pf-bb-bar {
	position: sticky;
	top: 0;
	z-index: 30;
	background: #141414;
	border: 1px solid rgba(192, 132, 252, 0.3);
	border-radius: 14px;
	padding: clamp(12px, 2vw, 20px);
	margin: 0 0 var(--wp--preset--spacing--m, 24px);
	display: grid;
	gap: 10px;
}

.pf-bb-slots {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	min-height: 60px;
	align-items: center;
}
.pf-bb-slot {
	width: 144px;
	height: 144px;
	border-radius: 14px;
	background: #0a0a0a;
	border: 1px solid rgba(240, 236, 228, 0.15);
	overflow: hidden;
	position: relative;
	flex: none;
}
.pf-bb-slot img {
	width: 100%;
	height: 100%;
	object-fit: contain; /* full-size product shots: show the whole bottle */
	display: block;
}
.pf-bb-slot-bundle {
	border-color: rgba(192, 132, 252, 0.55);
}
.pf-bb-slot-count {
	position: absolute;
	right: 6px;
	bottom: 6px;
	font-size: 0.85rem;
	font-weight: 800;
	background: rgba(10, 10, 10, 0.85);
	color: var(--pf-bb-purple);
	border-radius: 8px;
	padding: 1px 7px;
}
.pf-bb-slots-empty {
	color: rgba(240, 236, 228, 0.55);
	font-size: 0.9rem;
}
/* Remove control: full-slot overlay revealed on hover (mouse devices)… */
.pf-bb-slot-remove {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 3px;
	background: rgba(10, 10, 10, 0.74);
	color: var(--pf-bb-cream, #f0ece4);
	border: none;
	cursor: pointer;
	font-family: inherit;
	font-weight: 700;
	font-size: 0.78rem;
	opacity: 0;
	transition: opacity 140ms ease;
}
.pf-bb-slot-remove-x {
	font-size: 1.35rem;
	line-height: 1;
	color: var(--pf-bb-purple, #c084fc);
}
@media (hover: hover) {
	.pf-bb-slot:hover .pf-bb-slot-remove,
	.pf-bb-slot-remove:focus-visible {
		opacity: 1;
	}
}
/* …and an always-visible ✕ badge on touch devices, where hover doesn't exist. */
@media (hover: none) {
	.pf-bb-slot-remove {
		opacity: 1;
		inset: auto;
		top: 5px;
		right: 5px;
		width: 28px;
		height: 28px;
		border-radius: 999px;
		background: rgba(10, 10, 10, 0.85);
		border: 1px solid rgba(192, 132, 252, 0.5);
		padding: 0;
	}
	.pf-bb-slot-remove-x {
		font-size: 0.95rem;
	}
	.pf-bb-slot-remove-label {
		display: none;
	}
}
.pf-bb-slot-removing {
	opacity: 0.35;
	pointer-events: none;
}

/* ---------- ladder — P1 "purple ladder, green summit" (see
   .agent/audits/2026-07-02-ladder-variants/previews.md for the options) ---------- */
.pf-bb-ladder {
	display: flex;
	gap: 6px;
	flex-wrap: wrap;
	margin-top: 6px; /* room for the BEST DEAL chip on the last rung */
}
.pf-bb-rung {
	flex: 1 1 0;
	min-width: 64px;
	text-align: center;
	border: 1px solid rgba(240, 236, 228, 0.14);
	border-radius: 10px;
	padding: 6px 4px;
	position: relative;
	transition: all 160ms ease;
}
.pf-bb-rung-at::after {
	content: ' drops';
	font-size: 0.66em;
}
.pf-bb-rung-at {
	display: block;
	font-size: 0.72rem;
	color: rgba(240, 236, 228, 0.55);
}
/* Readability floor: the percentages are the sales pitch — never dim them. */
.pf-bb-rung-pct {
	display: block;
	font-weight: 800;
	font-size: 1.05rem;
	color: var(--pf-bb-cream);
}
/* Purple intensity ramps with the tier, so escalation is visible at a glance.
   Unknown percentages (config changes) fall back to the cream floor above. */
.pf-bb-rung[data-pct="10"] .pf-bb-rung-pct { color: #e4d4f7; }
.pf-bb-rung[data-pct="15"] .pf-bb-rung-pct { color: #dcc4f5; }
.pf-bb-rung[data-pct="20"] .pf-bb-rung-pct { color: #d4b4f9; }
.pf-bb-rung[data-pct="25"] .pf-bb-rung-pct { color: #cba0fa; }
.pf-bb-rung[data-pct="30"] .pf-bb-rung-pct { color: var(--pf-bb-purple); }
/* Green summit: the top rung wears the site's savings color + BEST DEAL chip. */
.pf-bb-rung:last-child {
	border-color: rgba(74, 222, 128, 0.55);
}
.pf-bb-rung:last-child .pf-bb-rung-pct {
	color: var(--pf-bb-green);
}
.pf-bb-rung:last-child::before {
	content: 'BEST DEAL';
	position: absolute;
	top: -9px;
	left: 50%;
	transform: translateX(-50%);
	font-size: 9px;
	font-weight: 800;
	letter-spacing: 0.08em;
	background: var(--pf-bb-green);
	color: #0a0a0a;
	border-radius: 999px;
	padding: 1px 8px;
	white-space: nowrap;
}
/* Earned rungs fill with soft purple, so the bar visibly fills left-to-right. */
.pf-bb-rung.is-earned {
	background: linear-gradient(180deg, rgba(192, 132, 252, 0.24), rgba(192, 132, 252, 0.10));
	border-color: rgba(192, 132, 252, 0.5);
}
.pf-bb-rung.is-earned .pf-bb-rung-at {
	color: var(--pf-bb-cream);
}
/* The current rung is solid purple with dark text — the strongest "you are here".
   Declared last so it wins over the ramp/summit colors when they overlap. */
.pf-bb-rung.is-current {
	background: var(--pf-bb-purple);
	border-color: var(--pf-bb-purple);
	transform: translateY(-2px);
	box-shadow: 0 4px 18px rgba(192, 132, 252, 0.35);
}
.pf-bb-rung.is-current .pf-bb-rung-pct,
.pf-bb-rung.is-current .pf-bb-rung-at {
	color: #0a0a0a;
}

.pf-bb-nudge {
	font-size: 0.95rem;
	color: var(--pf-bb-cream);
	font-weight: 600;
}
.pf-bb-math {
	display: flex;
	gap: 14px;
	font-size: 0.85rem;
	color: rgba(240, 236, 228, 0.75);
}
.pf-bb-math-savings {
	color: var(--pf-bb-green);
	font-weight: 700;
}

/* ---------- per-card tier pricing ---------- */
.pf-bb-card-tier {
	font-size: 0.82rem;
	color: var(--pf-bb-cream);
	min-height: 1.2em;
}
.pf-bb-card-tier s {
	color: rgba(240, 236, 228, 0.45);
}
.pf-bb-card-tier strong {
	color: var(--pf-bb-purple);
}
.pf-bb-card-tier-label,
.pf-bb-card-counts {
	color: rgba(240, 236, 228, 0.55);
	font-size: 0.9em;
}
.pf-bb-card-unlock {
	display: block;
	margin-top: 3px;
	color: var(--pf-bb-green);
	font-weight: 700;
	font-size: 0.9em;
}
.pf-card.pf-bb-unlock {
	outline: 1px solid rgba(74, 222, 128, 0.45);
	outline-offset: 2px;
	border-radius: 12px;
}

/* ---------- floating "View cart" pill ----------
   Adds on this page don't open the drawer (quiet mode); this is the way in. */
#pf-bb-fab {
	position: fixed;
	right: 18px;
	top: 50%;
	transform: translateY(-50%);
	z-index: 900; /* over the page, under the drawer (9998/9999) */
	display: flex;
	align-items: center;
	gap: 9px;
	background: var(--pf-bb-purple, #c084fc);
	color: #0a0a0a;
	border: none;
	border-radius: 999px;
	padding: 12px 18px;
	font-weight: 800;
	font-size: 0.95rem;
	font-family: inherit;
	cursor: pointer;
	box-shadow: 0 6px 24px rgba(192, 132, 252, 0.35);
}
#pf-bb-fab:hover {
	filter: brightness(1.08);
}
/* display:flex above beats the UA's [hidden]{display:none} — restate it. */
#pf-bb-fab[hidden] {
	display: none;
}
.pf-bb-fab-count {
	background: #0a0a0a;
	color: var(--pf-bb-purple, #c084fc);
	border-radius: 999px;
	min-width: 24px;
	height: 24px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 6px;
	font-size: 0.85rem;
}
@keyframes pf-bb-fab-bump {
	0% { transform: translateY(-50%) scale(1); }
	40% { transform: translateY(-50%) scale(1.12); }
	100% { transform: translateY(-50%) scale(1); }
}
#pf-bb-fab.pf-bb-fab-bump {
	animation: pf-bb-fab-bump 320ms ease;
}

/* ---------- mobile ---------- */
@media (max-width: 600px) {
	.pf-bb-bar {
		position: static;
	}
	.pf-bb-rung {
		min-width: 52px;
	}
	.pf-bb-slot {
		width: 96px;
		height: 96px;
	}
	#pf-bb-fab {
		top: auto;
		bottom: 18px;
		transform: none;
	}
	#pf-bb-fab.pf-bb-fab-bump {
		animation: none;
	}
}
