/* Piumarte - Promo a soglia: messaggi di stato e sticky bar */

.pps-promo-msg {
	box-sizing: border-box;
	margin: 0 0 1em;
	padding: 10px 14px;
	border-radius: 4px;
	background: #f6f4ef;
	border-left: 4px solid #b8a36a;
	font-size: 14px;
	line-height: 1.45;
	color: #222;
}

.pps-promo-msg--sidecart {
	margin: 0 0 10px;
	font-size: 13px;
}

.pps-promo-msg--empty {
	display: none !important;
}

.pps-promo-msg.pps-state-s03,
.pps-promo-msg.pps-state-s04,
.pps-promo-msg.pps-state-s06 {
	background: #eef6ee;
	border-left-color: #3c8a3f;
}

.pps-promo-msg.pps-state-s08 {
	background: #f3f3f3;
	border-left-color: #999;
}

.pps-promo-msg__text {
	display: block;
}

.pps-progress {
	display: block;
	height: 6px;
	margin-top: 8px;
	border-radius: 3px;
	background: rgba(0, 0, 0, 0.1);
	overflow: hidden;
}

.pps-progress > span {
	display: block;
	height: 100%;
	background: #b8a36a;
	transition: width 0.3s ease;
}

/* Errore di aggiornamento: si nasconde lo sconto non confermato, si mostra il testo neutro */
.pps-stale-text {
	display: none;
}

.pps-is-stale[data-pps-eligible="1"] .pps-promo-msg__text,
.pps-is-stale[data-pps-eligible="1"] .pps-progress,
.pps-is-stale[data-pps-eligible="1"] .pps-sticky__text {
	display: none;
}

.pps-is-stale[data-pps-eligible="1"] .pps-stale-text {
	display: block;
}

.pps-sticky.pps-is-stale[data-pps-eligible="1"] .pps-stale-text {
	padding: 10px 50px 10px 16px;
	text-align: center;
}

/* Sticky bar */
.pps-sticky {
	position: fixed;
	left: 0;
	right: 0;
	z-index: 9990;
	background: #222;
	color: #fff;
	font-size: 14px;
	line-height: 1.4;
}

.pps-sticky--bottom {
	bottom: 0;
}

.pps-sticky--top {
	top: 0;
}

body.admin-bar .pps-sticky--top {
	top: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar .pps-sticky--top {
		top: 46px;
	}
}

.pps-sticky--empty,
.pps-sticky--closed {
	display: none !important;
}

.pps-sticky__inner {
	position: relative;
	box-sizing: border-box;
	padding: 10px 90px 10px 16px;
	text-align: center;
}

.pps-sticky--top .pps-sticky__inner {
	padding-right: 50px;
}

.pps-sticky__text .woocommerce-Price-amount,
.pps-sticky__text .woocommerce-Price-amount bdi,
.pps-sticky__text .woocommerce-Price-currencySymbol {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

.pps-reload {
	color: inherit;
	text-decoration: underline;
	font-weight: 600;
}

/* Mobile: il basket fluttuante XootiX sta sopra l'angolo destro della barra in basso */
@media screen and (max-width: 480px) {
	.pps-sticky--bottom .pps-sticky__inner {
		padding-right: 96px;
	}
}

.pps-sticky__close {
	position: absolute;
	top: 50%;
	right: 10px;
	transform: translateY(-50%);
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font-size: 22px;
	line-height: 32px;
	cursor: pointer;
}

/* Il basket fluttuante del side cart sta in basso a destra: la X della barra in basso si sposta a sinistra */
.pps-sticky--bottom .pps-sticky__close {
	right: auto;
	left: 10px;
}

.pps-sticky--bottom .pps-sticky__inner {
	padding-left: 50px;
}

.pps-sticky__close:hover,
.pps-sticky__close:focus {
	background: rgba(255, 255, 255, 0.15);
	color: inherit;
}

/* Popup dell'icona carrello: posizione calcolata dal JS (sotto l'icona visibile, o fisso in alto a destra) */
.pps-popup-src,
.pps-popup[hidden] {
	display: none !important;
}

.pps-popup {
	position: fixed;
	top: 0;
	left: 0;
	z-index: 99990; /* sopra header e sticky bar (9990) */
	box-sizing: border-box;
	width: 320px;
	max-width: calc(100vw - 16px);
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity 0.15s ease, transform 0.15s ease;
	font-size: 14px;
	line-height: 1.45;
	text-align: left;
}

.pps-popup--in {
	opacity: 1;
	transform: none;
}

.pps-popup__inner {
	position: relative;
	box-sizing: border-box;
	padding: 8px 40px 8px 8px;
	background: #fff;
	border: 1px solid rgba(0, 0, 0, 0.1);
	border-radius: 6px;
	box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.pps-popup__body .pps-promo-msg {
	margin: 0;
}

.pps-popup__body .woocommerce-Price-amount,
.pps-popup__body .woocommerce-Price-amount bdi,
.pps-popup__body .woocommerce-Price-currencySymbol {
	font: inherit;
	color: inherit;
	letter-spacing: inherit;
}

.pps-popup__arrow {
	position: absolute;
	top: -7px;
	left: var(--pps-arrow-x, 90%);
	width: 14px;
	height: 14px;
	margin-left: -7px;
	background: #fff;
	border-top: 1px solid rgba(0, 0, 0, 0.1);
	border-left: 1px solid rgba(0, 0, 0, 0.1);
	transform: rotate(45deg);
	box-sizing: border-box;
}

/* Icona fuori schermo o assente: popup fisso in alto, senza freccia */
.pps-popup--floating .pps-popup__arrow {
	display: none;
}

.pps-popup__close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: #222;
	font-size: 20px;
	line-height: 28px;
	text-align: center;
	cursor: pointer;
}

.pps-popup__close:hover,
.pps-popup__close:focus {
	background: rgba(0, 0, 0, 0.08);
	color: #222;
}

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

body.pps-has-sticky--bottom {
	padding-bottom: var(--pps-sticky-h, 44px);
}

body.pps-has-sticky--top {
	padding-top: var(--pps-sticky-h, 44px);
}
