/* ==========================================================================
   RICHMOND'S — Barra spedizione gratuita (inc/free-shipping-bar.php)
   Usa i token di assets/css/style.css (--rc-*).
   ========================================================================== */

.rc-fsb[hidden] { display: none; }

.rc-fsb { font-family: var(--rc-font); font-size: 13px; line-height: 1.4; color: var(--rc-dark); }
.rc-fsb__msg { margin: 0 0 6px; }
.rc-fsb__msg strong { color: var(--rc-red); font-weight: 700; }
.rc-fsb.is-reached .rc-fsb__msg { color: #15803d; font-weight: 600; }

.rc-fsb__track { height: 6px; background: #e5e7eb; overflow: hidden; }
.rc-fsb__fill { display: block; height: 100%; background: var(--rc-red); transition: width var(--rc-transition-slow); }
.rc-fsb.is-reached .rc-fsb__fill { background: #15803d; }

@media (prefers-reduced-motion: reduce) {
	.rc-fsb__fill { transition: none; }
}

/* --- badge: barra di navigazione (fondo navy) --- */
.rc-fsb--badge { color: rgba(255,255,255,.75); font-size: 12px; min-width: 190px; }
.rc-fsb--badge .rc-fsb__msg { margin: 0 0 4px; white-space: nowrap; }
.rc-fsb--badge .rc-fsb__msg strong { color: var(--rc-white); }
.rc-fsb--badge.is-reached .rc-fsb__msg { color: var(--rc-white); }
.rc-fsb--badge .rc-fsb__track { height: 3px; background: rgba(255,255,255,.2); }
.rc-fsb--badge .rc-fsb__fill { background: var(--rc-white); }
.rc-fsb--badge.is-reached .rc-fsb__fill { background: #4ade80; }

/* --- compact: mini carrello --- */
.rc-mini-cart-content .rc-fsb--compact { padding: 12px 20px; border-top: 1px solid #e5e7eb; background: var(--rc-white); }

/* --- compact: scheda prodotto --- */
.summary .rc-fsb--compact { margin: 16px 0 20px; max-width: 420px; }

/* --- full: pagina carrello --- */
.rc-fsb--full {
	margin: 0 0 var(--rc-space-md);
	padding: var(--rc-space-sm) 20px;
	border: 1px solid #e5e7eb;
	background: var(--rc-white);
	font-size: 14px;
}
.rc-fsb--full .rc-fsb__track { height: 8px; }

.rc-fsb__hint { margin: var(--rc-space-sm) 0 10px; font-weight: 600; }

.rc-fsb__suggest {
	display: grid;
	gap: 12px;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
}

.rc-fsb__item { display: grid; grid-template-columns: 56px 1fr auto; gap: 12px; align-items: center; }
.rc-fsb__thumb img { width: 56px; height: 56px; object-fit: contain; }
.rc-fsb__info { display: grid; gap: 2px; font-size: 13px; }
.rc-fsb__info a { color: var(--rc-dark); font-weight: 500; }
.rc-fsb__info a:hover { color: var(--rc-navy); }
.rc-fsb__price { font-weight: 700; }
.rc-fsb__add.rc-btn { padding: 8px 14px; font-size: 12px; white-space: nowrap; }
.rc-fsb__item .added_to_cart { display: none; } /* la tabella del carrello si aggiorna da sola */

/* ==========================================================================
   float: box flottante in basso a sinistra (richmonds_fsb_float)
   ========================================================================== */

.rc-fsb-float {
	--rc-fsb-offset: 16px;
	--rc-fsb-green: #15803d;
	position: fixed;
	left: calc(var(--rc-fsb-offset) + env(safe-area-inset-left, 0px));
	bottom: calc(var(--rc-fsb-offset) + env(safe-area-inset-bottom, 0px));
	z-index: 9998; /* sotto header sticky e menu mobile (9999) */
	font-family: var(--rc-font);
	animation: rc-fsb-in .6s cubic-bezier(.2, .9, .25, 1.15) .4s both;
}
.rc-fsb-float.is-empty { display: none; }

/* --- Pannello espanso --- */
.rc-fsb-float__panel {
	position: relative;
	display: grid;
	grid-template-columns: 40px 1fr 24px;
	gap: 12px;
	align-items: center;
	width: min(330px, calc(100vw - 2 * var(--rc-fsb-offset)));
	padding: 14px 12px 14px 14px;
	background: var(--rc-white);
	border: 1px solid rgba(2, 70, 156, .12);
	box-shadow: 0 14px 34px rgba(2, 70, 156, .18), 0 2px 6px rgba(17, 24, 39, .08);
	overflow: hidden;
	transform-origin: bottom left;
	transition: opacity .25s ease, transform .3s cubic-bezier(.2, .8, .2, 1);
}
/* filetto superiore navy/rosso, verde a soglia raggiunta */
.rc-fsb-float__panel::before {
	content: '';
	position: absolute;
	inset: 0 0 auto 0;
	height: 3px;
	background: linear-gradient(90deg, var(--rc-navy) 0 50%, var(--rc-red) 50% 100%);
}
.rc-fsb-float.is-reached .rc-fsb-float__panel::before { background: var(--rc-fsb-green); }

.rc-fsb-float__icon {
	position: relative;
	display: grid;
	place-items: center;
	width: 40px;
	height: 40px;
	background: var(--rc-navy);
	color: var(--rc-white);
	transition: background .4s ease;
}
.rc-fsb-float.is-reached .rc-fsb-float__icon { background: var(--rc-fsb-green); }

.rc-fsb-float svg { width: 22px; height: 22px; }

/* camion ↔ spunta */
.rc-fsb-float__check { display: none; }
.rc-fsb-float.is-reached .rc-fsb-float__truck { display: none; }
.rc-fsb-float.is-reached .rc-fsb-float__check { display: block; animation: rc-fsb-pop .5s cubic-bezier(.2, 1.6, .4, 1) both; }

.rc-fsb--float { font-size: 13px; min-width: 0; }
.rc-fsb--float .rc-fsb__msg { margin: 0 0 8px; line-height: 1.35; }
.rc-fsb--float .rc-fsb__msg strong { display: inline-block; }
.rc-fsb--float.is-reached .rc-fsb__msg { margin: 0; color: var(--rc-fsb-green); }
.rc-fsb--float .rc-fsb__track { position: relative; height: 6px; background: #eef0f3; }
.rc-fsb--float .rc-fsb__fill {
	position: relative;
	width: var(--rc-fsb-p, 0%);
	background: linear-gradient(90deg, var(--rc-red-dark), var(--rc-red-light));
	animation: rc-fsb-grow 1.1s cubic-bezier(.3, .8, .2, 1) .8s both;
	transition: width .8s cubic-bezier(.3, .8, .2, 1);
	overflow: hidden;
}
/* riflesso che scorre sulla barra */
.rc-fsb--float .rc-fsb__fill::after {
	content: '';
	position: absolute;
	inset: 0;
	background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
	transform: translateX(-100%);
	animation: rc-fsb-shine 2.6s ease-in-out 2s infinite;
}
.rc-fsb--float.is-reached .rc-fsb__track { display: none; }

.rc-fsb-float__close {
	align-self: start;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--rc-gray);
	cursor: pointer;
	transition: color var(--rc-transition), background var(--rc-transition);
}
.rc-fsb-float__close:hover { color: var(--rc-navy); background: var(--rc-gray-light); }
.rc-fsb-float__close svg { width: 16px; height: 16px; }

/* --- Pulsante ridotto --- */
.rc-fsb-float__toggle {
	position: absolute;
	left: 0;
	bottom: 0;
	display: grid;
	place-items: center;
	width: 52px;
	height: 52px;
	padding: 0;
	border: 0;
	background: var(--rc-navy);
	color: var(--rc-white);
	box-shadow: 0 10px 24px rgba(2, 70, 156, .3);
	cursor: pointer;
	overflow: hidden;
	opacity: 0;
	visibility: hidden;
	transform: scale(.6);
	transition: opacity .25s ease, transform .3s cubic-bezier(.2, 1.4, .4, 1), visibility 0s .3s, background .4s ease;
}
.rc-fsb-float.is-reached .rc-fsb-float__toggle { background: var(--rc-fsb-green); }
.rc-fsb-float__toggle:hover .rc-fsb-float__truck { animation: rc-fsb-drive .6s ease-in-out 2; }
/* mini barra di avanzamento sul bordo inferiore */
.rc-fsb-float__mini {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 4px;
	width: var(--rc-fsb-p, 0%);
	background: var(--rc-red-light);
	transition: width .8s cubic-bezier(.3, .8, .2, 1);
}
.rc-fsb-float.is-reached .rc-fsb-float__mini { width: 100%; background: #4ade80; }

/* Stato ridotto */
.rc-fsb-float.is-collapsed .rc-fsb-float__panel {
	opacity: 0;
	visibility: hidden;
	transform: scale(.85) translateY(8px);
	pointer-events: none;
	transition: opacity .2s ease, transform .25s ease, visibility 0s .25s;
}
.rc-fsb-float.is-collapsed .rc-fsb-float__toggle {
	opacity: 1;
	visibility: visible;
	transform: scale(1);
	transition: opacity .25s ease .1s, transform .35s cubic-bezier(.2, 1.4, .4, 1) .1s, visibility 0s, background .4s ease;
}

/* --- Rimbalzo quando il carrello cambia --- */
.rc-fsb-float.is-bump .rc-fsb-float__panel,
.rc-fsb-float.is-bump.is-collapsed .rc-fsb-float__toggle { animation: rc-fsb-bump .5s cubic-bezier(.2, 1.4, .4, 1); }
.rc-fsb-float.is-bump .rc-fsb-float__truck { animation: rc-fsb-drive .5s ease-in-out 2; }
.rc-fsb-float.is-bump .rc-fsb__msg strong { animation: rc-fsb-flash .7s ease; }

/* --- Coriandoli al raggiungimento della soglia --- */
.rc-fsb-float__confetti { position: absolute; left: 34px; bottom: 34px; width: 0; height: 0; pointer-events: none; }
.rc-fsb-float__confetti i {
	position: absolute;
	width: 7px;
	height: 7px;
	opacity: 0;
	background: var(--rc-red);
}
.rc-fsb-float__confetti i:nth-child(3n+2) { background: var(--rc-navy); }
.rc-fsb-float__confetti i:nth-child(3n) { background: #fbbf24; width: 5px; height: 9px; }
.rc-fsb-float.is-celebrate .rc-fsb-float__confetti i { animation: rc-fsb-confetti 1s cubic-bezier(.1, .7, .3, 1) var(--d, 0s) both; }
.rc-fsb-float__confetti i:nth-child(1) { --x: -40px; --y: -70px;  --r: 120deg; }
.rc-fsb-float__confetti i:nth-child(2) { --x: 10px;  --y: -90px;  --r: -80deg;  --d: .04s; }
.rc-fsb-float__confetti i:nth-child(3) { --x: 55px;  --y: -75px;  --r: 200deg;  --d: .08s; }
.rc-fsb-float__confetti i:nth-child(4) { --x: 95px;  --y: -45px;  --r: -150deg; }
.rc-fsb-float__confetti i:nth-child(5) { --x: -25px; --y: -40px;  --r: 90deg;   --d: .06s; }
.rc-fsb-float__confetti i:nth-child(6) { --x: 130px; --y: -80px;  --r: 260deg;  --d: .1s; }
.rc-fsb-float__confetti i:nth-child(7) { --x: 70px;  --y: -110px; --r: -220deg; --d: .02s; }
.rc-fsb-float__confetti i:nth-child(8) { --x: 160px; --y: -50px;  --r: 140deg;  --d: .12s; }

@keyframes rc-fsb-in {
	from { opacity: 0; transform: translateY(24px) scale(.96); }
	to   { opacity: 1; transform: none; }
}
@keyframes rc-fsb-grow {
	from { width: 0; }
}
@keyframes rc-fsb-shine {
	0%        { transform: translateX(-100%); }
	40%, 100% { transform: translateX(100%); }
}
@keyframes rc-fsb-bump {
	0%   { transform: scale(1); }
	35%  { transform: scale(1.04); }
	100% { transform: scale(1); }
}
@keyframes rc-fsb-drive {
	0%, 100% { transform: translateX(0); }
	30%      { transform: translateX(3px) rotate(-3deg); }
	60%      { transform: translateX(-1px); }
}
@keyframes rc-fsb-flash {
	0%   { color: var(--rc-red); }
	30%  { color: var(--rc-white); background: var(--rc-red); box-shadow: 0 0 0 3px var(--rc-red); }
	100% { color: var(--rc-red); }
}
@keyframes rc-fsb-pop {
	from { transform: scale(0) rotate(-30deg); }
	to   { transform: none; }
}
@keyframes rc-fsb-confetti {
	0%   { opacity: 1; transform: translate(0, 0) rotate(0); }
	80%  { opacity: 1; }
	100% { opacity: 0; transform: translate(var(--x), var(--y)) rotate(var(--r)); }
}

@media (max-width: 767px) {
	.rc-fsb-float { --rc-fsb-offset: 12px; }
	.rc-fsb-float__panel { padding: 12px 10px 12px 12px; gap: 10px; grid-template-columns: 36px 1fr 24px; }
	.rc-fsb-float__icon { width: 36px; height: 36px; }
	.rc-fsb--float { font-size: 12px; }
}

/* Nascosto con il menu mobile aperto */
body:has(.rc-mobile-menu.is-open) .rc-fsb-float { opacity: 0; pointer-events: none; }

@media (prefers-reduced-motion: reduce) {
	.rc-fsb-float,
	.rc-fsb-float *,
	.rc-fsb-float *::after { animation: none !important; transition: none !important; }
}

@media print {
	.rc-fsb-float { display: none !important; }
}
