/* =====================================================================
   RS Consulenza Informatica - Carrello mobile evidente (tema MyMedi)
   - pulsante carrello nell'header su smartphone
   - carrello in rilievo nella barra icone in basso
   - barra "Garanzia legale di conformita'" spostata sopra la barra icone
   Colori: giallo #f2d912 / blu #103178 / blu medio #3165ba
   ===================================================================== */

:root{
	--rs-cart-yellow: #f2d912;
	--rs-cart-blue: #103178;
	--rs-cart-blue-2: #3165ba;
	--rs-bottom-bar-h: 44px;   /* aggiornato dal JS */
	--rs-bottom-stack: 44px;   /* barra icone + barra garanzia, aggiornato dal JS */
}

/* Su desktop/tablet il pulsante dell'header mobile non serve */
.rs-mhc-wrap{ display: none; }

@media only screen and (max-width: 767px){

	/* ---------- 1. Pulsante carrello nell'header ---------- */
	.ts-header .header-middle .header-right > .rs-mhc-wrap.visible-phone{
		display: block !important;
		float: right; /*rtl*/
		margin-left: 6px; /*rtl*/
		line-height: 0;
	}
	.rs-mhc{
		position: relative;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		width: 46px;
		height: 46px;
		border-radius: 50%;
		background: var(--rs-cart-yellow);
		color: var(--rs-cart-blue) !important;
		box-shadow: 0 4px 12px rgba(16, 49, 120, .22);
		-webkit-tap-highlight-color: transparent;
		transition: transform .15s ease, box-shadow .15s ease;
	}
	.rs-mhc:active{
		transform: scale(.94);
		box-shadow: 0 2px 6px rgba(16, 49, 120, .25);
	}
	.rs-mhc .rs-mhc-icon{
		width: 26px;
		height: 26px;
		display: block;
	}
	.rs-mhc-count{
		position: absolute;
		top: -4px;
		right: -4px; /*rtl*/
		min-width: 21px;
		height: 21px;
		padding: 0 5px;
		border-radius: 11px;
		background: var(--rs-cart-blue);
		color: #fff;
		border: 2px solid #fff;
		font-size: 11px;
		font-weight: 700;
		line-height: 17px;
		text-align: center;
		box-sizing: border-box;
	}
	.rs-mhc-count.is-empty{
		display: none;
	}

	/* header un po' piu' compatto per far stare logo + lente + carrello */
	.ts-header .header-middle .header-right .search-button.visible-ipad{
		margin-left: 2px; /*rtl*/
	}

	/* ---------- 2. Carrello in rilievo nella barra icone in basso ---------- */
	body.rs-mobile-cart-enhanced .ts-group-icons-header{
		overflow: visible;
		box-shadow: 0 -2px 12px rgba(0, 0, 0, .06);
	}
	body.rs-mobile-cart-enhanced .ts-group-icons-header > .shopping-cart-wrapper.mobile-cart{
		position: relative;
		overflow: visible;
	}
	body.rs-mobile-cart-enhanced .ts-group-icons-header > .shopping-cart-wrapper.mobile-cart .cart-icon{
		width: 54px !important;
		height: 54px !important;
		margin: -18px auto 0 !important;
		border-radius: 50%;
		background: var(--rs-cart-yellow);
		box-shadow: 0 0 0 4px #fff, 0 6px 14px rgba(16, 49, 120, .35);
		position: relative;
		transition: transform .15s ease;
	}
	body.rs-mobile-cart-enhanced .ts-group-icons-header > .shopping-cart-wrapper.mobile-cart .cart-icon:active{
		transform: scale(.94);
	}
	body.rs-mobile-cart-enhanced .ts-group-icons-header > .shopping-cart-wrapper.mobile-cart .cart-control,
	body.rs-mobile-cart-enhanced .ts-group-icons-header > .shopping-cart-wrapper.mobile-cart .ic-cart{
		display: block;
		width: 54px;
		height: 54px;
		line-height: 0;
	}
	body.rs-mobile-cart-enhanced .ts-group-icons-header > .shopping-cart-wrapper.mobile-cart .cart-icon svg{
		width: 54px !important;
		height: 54px !important;
	}
	body.rs-mobile-cart-enhanced .ts-group-icons-header > .shopping-cart-wrapper.mobile-cart svg path,
	body.rs-mobile-cart-enhanced .ts-group-icons-header > .shopping-cart-wrapper.mobile-cart:hover svg path{
		stroke: var(--rs-cart-blue) !important;
		stroke-width: 2.3;
	}
	body.rs-mobile-cart-enhanced .ts-group-icons-header .shopping-cart-wrapper.mobile-cart .cart-control .cart-number{
		top: -3px;
		right: -3px; /*rtl*/
		width: auto;
		min-width: 20px;
		height: 20px;
		padding: 0 5px;
		border-radius: 10px;
		border: 2px solid #fff;
		background: var(--rs-cart-blue);
		color: #fff;
		font-size: 11px;
		font-weight: 700;
		line-height: 16px;
		box-sizing: border-box;
	}
	/* niente dropdown a tendina dal carrello in basso: il tocco porta alla pagina carrello */
	body.rs-mobile-cart-enhanced .ts-group-icons-header .shopping-cart-wrapper.mobile-cart .cart-drop-icon,
	body.rs-mobile-cart-enhanced .ts-group-icons-header .shopping-cart-wrapper.mobile-cart .dropdown-container{
		display: none !important;
	}

	/* ---------- 3. Barra "Garanzia legale di conformita'" sopra la barra icone ---------- */
	body.rs-mobile-cart-enhanced .eugln-bar.eugln-bar--bottom{
		bottom: var(--rs-bottom-bar-h);
		z-index: 99998; /* sotto la barra icone (99999), cosi' il carrello in rilievo resta sopra */
		font-size: 12px;
		box-shadow: 0 -2px 10px rgba(0, 0, 0, .06);
	}
	body.rs-mobile-cart-enhanced .eugln-bar--bottom .eugln-bar__inner{
		min-height: 0;
		padding: 5px 10px 14px; /* spazio sotto per il carrello in rilievo */
		gap: 2px 8px;
		line-height: 1.3;
	}
	body.rs-mobile-cart-enhanced .eugln-bar--bottom .eugln-bar__icon{
		width: 17px;
		height: 17px;
		font-size: 11px;
	}
	body.rs-mobile-cart-enhanced .eugln-bar--bottom .eugln-bar__text{
		flex: 0 1 auto;
	}
	body.rs-mobile-cart-enhanced .eugln-bar--bottom .eugln-bar__page{
		margin-left: 0; /*rtl*/
	}

	/* contenuti e footer non finiscono sotto le due barre */
	body.rs-mobile-cart-enhanced .ts-group-icons-header ~ footer > .footer-container{
		margin-bottom: var(--rs-bottom-stack) !important;
	}
	body.rs-mobile-cart-enhanced #to-top{
		bottom: calc(var(--rs-bottom-stack) + 10px) !important;
	}

	/* ---------- Animazione "prodotto aggiunto" ---------- */
	.rs-mhc.rs-bump,
	body.rs-mobile-cart-enhanced .ts-group-icons-header > .shopping-cart-wrapper.mobile-cart.rs-bump .cart-icon{
		animation: rs-cart-bump .6s ease;
	}
}

@keyframes rs-cart-bump{
	0%   { transform: scale(1); }
	30%  { transform: scale(1.22); }
	55%  { transform: scale(.92); }
	80%  { transform: scale(1.06); }
	100% { transform: scale(1); }
}

@media (prefers-reduced-motion: reduce){
	.rs-mhc.rs-bump,
	body.rs-mobile-cart-enhanced .ts-group-icons-header > .shopping-cart-wrapper.mobile-cart.rs-bump .cart-icon{
		animation: none;
	}
}
