/**
 * Mesajele site-ului — vezi assets/js/notices.js.
 *
 * Se încarcă pe toate paginile, deci nu se bazează pe variabilele din
 * account.css. Selectorii cu element („button.") și cu părinte bat
 * resetările temei și ale WooCommerce, care se încarcă după noi.
 */

/* ---------- Caseta din pagină (erori, informări) ---------- */

.nfs-alert {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	box-sizing: border-box;
	width: 100%;
	margin: 0 0 18px;
	padding: 14px 14px 14px 16px;
	border-radius: 12px;
	border: 1px solid;
	font: 500 14.5px/1.55 'Public Sans', Arial, Helvetica, sans-serif;
	text-align: left;
}

.nfs-alert--error {
	background: #fdf0f0;
	border-color: #f1c6c6;
	color: #8a2a26;
}

.nfs-alert--info {
	background: #eef4fc;
	border-color: #c3d8f2;
	color: #0b3a7a;
}

.nfs-alert__icon {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	border-radius: 50%;
	color: #fff;
	font: 800 13px/1 'Public Sans', Arial, sans-serif;
}

.nfs-alert--error .nfs-alert__icon {
	background: #c0392b;
}

.nfs-alert--info .nfs-alert__icon {
	background: #0b3a7a;
}

.nfs-alert__body {
	flex: 1 1 auto;
	min-width: 0;
}

.nfs-alert .nfs-alert__body p {
	margin: 0;
	color: inherit;
	font: inherit;
}

.nfs-alert .nfs-alert__body p + p {
	margin-top: 4px;
}

.nfs-alert a,
.nfs-toast a {
	color: inherit !important;
	font-weight: 700;
	text-decoration: underline;
}

/* ---------- Notificarea de succes, în colț ---------- */

.nfs-toasts {
	position: fixed;
	top: 96px;
	right: 24px;
	z-index: 100000;
	display: flex;
	flex-direction: column;
	gap: 10px;
	width: min(380px, calc(100vw - 32px));
	pointer-events: none;
}

.nfs-toast {
	position: relative;
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 40px 16px 14px;
	overflow: hidden;
	border-radius: 12px;
	background: #fff;
	border: 1px solid #e3e8f0;
	border-left: 4px solid #0d8a4f;
	box-shadow: 0 18px 40px -12px rgba(3, 38, 87, 0.3);
	font: 500 14.5px/1.5 'Public Sans', Arial, Helvetica, sans-serif;
	color: #1f2a44;
	pointer-events: auto;
	animation: nfs-toast-in 0.25s ease-out;
}

.nfs-toast.is-leaving {
	opacity: 0;
	transform: translateX(16px);
	transition: opacity 0.25s ease, transform 0.25s ease;
}

/* Bifa albă pe cerc verde. */
.nfs-toast__icon {
	position: relative;
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	margin-top: 1px;
	border-radius: 50%;
	background: #0d8a4f;
}

.nfs-toast__icon::after {
	content: "";
	position: absolute;
	left: 8px;
	top: 4px;
	width: 5px;
	height: 10px;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg);
}

.nfs-toast__body {
	flex: 1 1 auto;
	min-width: 0;
}

/* WooCommerce pune „Vezi coșul" ca buton plutitor în mesaj; aici e un link. */
.nfs-toast .nfs-toast__body a.button,
.nfs-toast .nfs-toast__body a.wc-forward {
	display: inline !important;
	float: none !important;
	margin: 0 0 0 6px !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	font: inherit !important;
	font-weight: 700 !important;
	color: #032657 !important;
	text-decoration: underline !important;
}

/* Cât mai rămâne până dispare. */
.nfs-toast__bar {
	position: absolute;
	left: 0;
	bottom: 0;
	height: 3px;
	width: 100%;
	background: #0d8a4f;
	opacity: 0.35;
	transform-origin: left;
	animation: nfs-toast-bar var(--nfs-toast-ms, 10000ms) linear forwards;
}

.nfs-toast.is-paused .nfs-toast__bar {
	animation-play-state: paused;
}

@keyframes nfs-toast-in {
	from {
		opacity: 0;
		transform: translateY(-8px);
	}
}

@keyframes nfs-toast-bar {
	to {
		transform: scaleX(0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.nfs-toast {
		animation: none;
	}
}

/* ---------- Butoanele de închidere ---------- */

.nfs-alert button.nfs-alert__close,
.nfs-toast button.nfs-toast__close {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	margin: -2px 0 0;
	padding: 0;
	border: 0;
	border-radius: 6px;
	background: transparent;
	color: inherit;
	font: 400 20px/1 Arial, sans-serif;
	opacity: 0.6;
	cursor: pointer;
	box-shadow: none;
}

.nfs-toast button.nfs-toast__close {
	position: absolute;
	top: 10px;
	right: 8px;
	margin: 0;
}

.nfs-alert button.nfs-alert__close:hover,
.nfs-toast button.nfs-toast__close:hover {
	opacity: 1;
	background: rgba(3, 38, 87, 0.08);
}

/* ---------- Ce lăsăm în urmă ---------- */

/* Învelișul are deja spațiul lui de jos. */
.woocommerce-notices-wrapper > .nfs-alert:last-child {
	margin-bottom: 0;
}

/* Învelișul WooCommerce rămas fără mesaje. */
.woocommerce-notices-wrapper.nfs-notices-empty {
	display: none !important;
}

/* Al doilea mesaj de sub câmp, pus de WooCommerce: al nostru e deja acolo. */
form.checkout .checkout-inline-error-message {
	display: none !important;
}

@media (max-width: 600px) {
	/* Pe telefon, jos: sus ar acoperi antetul și butonul de meniu. */
	.nfs-toasts {
		top: auto;
		right: 16px;
		bottom: 16px;
		left: 16px;
		width: auto;
	}
}
