/* =========================================================
   Nelb WCMP — Mini carrello (v1.25.0)
   Pillola bianca (design system) + pannello card 14px.
   Floating desktop: FAB arancio in basso a destra, pannello
   verso l'alto. Motion §13: 350ms cubic-bezier(.22,1,.36,1).
   ========================================================= */

.nelb-mcart {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-family: 'Gudea', sans-serif;
}

/* ── Bottone pillola ── */
.nelb-mcart__btn {
	display: inline-flex;
	align-items: center;
	border: 2px solid #212121;
	border-radius: 14px;
	background: #fff;
	color: #212121;
	padding: 10px 16px;
	cursor: pointer;
	transition: transform 200ms ease, box-shadow 200ms ease;
}
.nelb-mcart__btn:hover {
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(20, 20, 20, .12);
}
.nelb-mcart__btn:active { transform: scale(.98); }
.nelb-mcart--dark .nelb-mcart__btn { background: #212121; color: #fff; border-color: #212121; }

.nelb-mcart__btn-inner { display: inline-flex; align-items: center; gap: 10px; }
.nelb-mcart__total {
	font-family: 'Libre Franklin', sans-serif;
	font-weight: 800;
	font-size: 16px;
	white-space: nowrap;
}
.nelb-mcart__total small { font-weight: 400; font-size: 11px; }
.nelb-mcart__ico { position: relative; display: inline-flex; }
.nelb-mcart__ico svg { width: 26px; height: 26px; }
.nelb-mcart__count {
	position: absolute;
	top: -9px;
	right: -10px;
	min-width: 18px;
	height: 18px;
	border-radius: 999px;
	background: #FE3F12;
	color: #fff;
	font-size: 10.5px;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0 4px;
}

/* ── Pannello ── */
.nelb-mcart__panel {
	position: absolute;
	top: calc(100% + 10px);
	right: 0;
	width: min(380px, calc(100vw - 24px));
	background: #fff;
	border: 1px solid #EDEDED;
	border-radius: 14px;
	box-shadow: 0 10px 30px rgba(20, 20, 20, .14);
	padding: 16px;
	z-index: 999;
	opacity: 0;
	transform: translateY(8px);
	pointer-events: none;
	transition: opacity 350ms cubic-bezier(.22, 1, .36, 1), transform 350ms cubic-bezier(.22, 1, .36, 1);
}
.nelb-mcart.is-open .nelb-mcart__panel {
	opacity: 1;
	transform: translateY(0);
	pointer-events: auto;
}

.nelb-mcart__items {
	max-height: min(48vh, 420px);
	overflow: auto;
	margin: 0 0 4px;
}
.nelb-mcart__item {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 12px 0;
	border-bottom: 1px solid #EDEDED;
}
.nelb-mcart__thumb img {
	width: 56px;
	height: 56px;
	object-fit: contain;
	border: 1px solid #EDEDED;
	border-radius: 10px;
	background: #fff;
}
.nelb-mcart__meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.nelb-mcart__name {
	font-family: 'Libre Franklin', sans-serif;
	font-weight: 800;
	font-size: 13.5px;
	line-height: 1.3;
	color: #212121;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.nelb-mcart__sku { font-size: 11.5px; color: #8C8C8C; }
.nelb-mcart__qty { font-size: 13px; color: #212121; }
.nelb-mcart__remove {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border: 1.5px solid #FE3F12;
	border-radius: 50%;
	color: #FE3F12 !important;
	text-decoration: none !important;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	font-size: 12px;
	transition: background 200ms ease, color 200ms ease;
}
.nelb-mcart__remove:hover { background: #FE3F12; color: #fff !important; }

.nelb-mcart__subtotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	padding: 12px 0;
	border-bottom: 1px solid #EDEDED;
	margin-bottom: 12px;
	font-size: 14px;
}
.nelb-mcart__subtotal strong { font-family: 'Libre Franklin', sans-serif; font-weight: 800; font-size: 17px; }
.nelb-mcart__subtotal small { font-weight: 400; font-size: 11px; color: #8C8C8C; }

.nelb-mcart__cta {
	display: flex;
	align-items: center;
	justify-content: center;
	background: #FE3F12;
	color: #fff !important;
	font-family: 'Libre Franklin', sans-serif;
	font-weight: 800;
	font-size: 14px;
	letter-spacing: .04em;
	text-transform: uppercase;
	text-decoration: none !important;
	border-radius: 10px;
	padding: 12px;
	margin-top: 8px;
	transition: background 200ms ease, transform 200ms ease;
}
.nelb-mcart__cta:hover { background: #E5380F; }
.nelb-mcart__cta:active { transform: scale(.98); }
.nelb-mcart__cta--ghost {
	background: #fff;
	color: #212121 !important;
	border: 1.5px solid #212121;
}
.nelb-mcart__cta--ghost:hover { background: #212121; color: #fff !important; }
.nelb-mcart__empty { padding: 8px 0 4px; color: #8C8C8C; }

/* ── Lente nel cluster (nascosta finché non floating) ── */
.nelb-mcart__search { display: none; }

/* ── FLOATING (solo desktop) ── */
@media (min-width: 1025px) {
	.nelb-mcart.is-floating {
		position: fixed;
		right: 24px;
		bottom: 24px;
		z-index: 9998;
		flex-direction: row-reverse; /* carrello a destra, lente a sinistra */
		animation: nelbMcartLand 350ms cubic-bezier(.22, 1, .36, 1) both;
	}
	@keyframes nelbMcartLand {
		from { opacity: 0; transform: translateY(14px); }
		to   { opacity: 1; transform: translateY(0); }
	}
	/* FAB: pillola → cerchio arancio, resta solo icona+badge */
	.nelb-mcart.is-floating .nelb-mcart__btn {
		width: 56px;
		height: 56px;
		border-radius: 50%;
		background: #FE3F12;
		border-color: #FE3F12;
		color: #fff;
		padding: 0;
		justify-content: center;
		box-shadow: 0 8px 22px rgba(20, 20, 20, .22);
	}
	.nelb-mcart.is-floating .nelb-mcart__btn:hover { background: #E5380F; border-color: #E5380F; }
	.nelb-mcart.is-floating .nelb-mcart__total { display: none; }
	.nelb-mcart.is-floating .nelb-mcart__count { background: #212121; }

	/* Pannello verso l'alto */
	.nelb-mcart.is-floating .nelb-mcart__panel {
		top: auto;
		bottom: calc(100% + 12px);
		transform: translateY(-8px);
	}
	.nelb-mcart.is-floating.is-open .nelb-mcart__panel { transform: translateY(0); }

	/* Lente ricerca nel cluster */
	.nelb-mcart.is-floating .nelb-mcart__search { display: block; position: relative; }
	.nelb-mcart.is-floating .nelb-mcart__search .nelb-search__toggle {
		width: 56px;
		height: 56px;
		border-radius: 50%;
		background: #fff;
		border: 2px solid #212121;
		box-shadow: 0 8px 22px rgba(20, 20, 20, .18);
	}
	/* Overlay del campo e dropdown verso l'alto e verso sinistra */
	.nelb-mcart.is-floating .nelb-mcart__search .nelb-search__box {
		top: auto;
		bottom: 0;
	}
	.nelb-mcart.is-floating .nelb-mcart__search .nelb-search__panel {
		top: auto;
		bottom: calc(56px + 8px);
	}
}

@media (prefers-reduced-motion: reduce) {
	.nelb-mcart__panel,
	.nelb-mcart__btn,
	.nelb-mcart__cta,
	.nelb-mcart__remove { transition: none; }
	.nelb-mcart.is-floating { animation: none; }
}
