/**
 * KMZero Cart Messages — front-end styles.
 */

:root {
	--kmcm-radius: 6px;
}

.kmcm-message {
	display: flex;
	align-items: flex-start;
	gap: 12px;
	padding: 14px 16px;
	margin: 0 0 16px;
	border: 1px solid transparent;
	border-left-width: 4px;
	border-radius: var(--kmcm-radius);
	font-size: 15px;
	line-height: 1.45;
	position: relative;
	box-sizing: border-box;
}

.kmcm-message .kmcm-icon {
	flex: 0 0 auto;
	font-size: 20px;
	line-height: 1.3;
}

.kmcm-message .kmcm-body {
	flex: 1 1 auto;
	min-width: 0;
}

.kmcm-message .kmcm-text > :last-child {
	margin-bottom: 0;
}

.kmcm-message .kmcm-text p {
	margin: 0 0 .4em;
}

.kmcm-message a {
	color: inherit;
	text-decoration: underline;
}

/* Dismiss button */
.kmcm-message .kmcm-dismiss {
	flex: 0 0 auto;
	background: transparent;
	border: 0;
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	opacity: .6;
	padding: 0 2px;
}

.kmcm-message .kmcm-dismiss:hover {
	opacity: 1;
}

/* ------------------------------------------------------------------ *
 * The four base palettes
 * ------------------------------------------------------------------ */

/* Green — positive */
.kmcm-style-green {
	background: #e7f6ec;
	border-color: #1f7a3d;
	color: #14532d;
}

/* Mustard yellow — warning */
.kmcm-style-yellow {
	background: #fdf6e3;
	border-color: #b58b00;
	color: #6b4f00;
}

/* Red — alert */
.kmcm-style-red {
	background: #fdecea;
	border-color: #c0392b;
	color: #7d1a13;
}

/* Light blue — generic */
.kmcm-style-blue {
	background: #e7f3fb;
	border-color: #1c7ed6;
	color: #0b4a78;
}

/* ------------------------------------------------------------------ *
 * Progress bar
 * ------------------------------------------------------------------ */

.kmcm-progress {
	margin-top: 10px;
	width: 100%;
	height: 8px;
	background: rgba(0, 0, 0, .12);
	border-radius: 999px;
	overflow: hidden;
}

.kmcm-progress-fill {
	display: block;
	height: 100%;
	border-radius: 999px;
	background: currentColor;
	transition: width .5s ease;
}

/* ------------------------------------------------------------------ *
 * Animations
 * ------------------------------------------------------------------ */

.kmcm-anim-fade {
	animation: kmcm-fade .4s ease both;
}

.kmcm-anim-slide {
	animation: kmcm-slide .4s ease both;
}

@keyframes kmcm-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes kmcm-slide {
	from { opacity: 0; transform: translateY(-8px); }
	to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
	.kmcm-anim-fade,
	.kmcm-anim-slide {
		animation: none;
	}
}

/* Mini-cart tweaks */
.widget_shopping_cart .kmcm-message,
.woocommerce-mini-cart .kmcm-message {
	font-size: 13px;
	padding: 10px 12px;
	margin-bottom: 10px;
}
