/* Better Homes: every message on the site in one style (WooCommerce notices, the theme's notices,
 * contact form results), matching the alerts on the sign-in page (assets/css/account-page.css).
 *
 *   success   soft green        info / notice   soft sand        error   soft red        warning   soft amber
 *
 * The icon is drawn with a mask, so it takes the colour of its message. */

body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .wd-notice, div.wpcf7-response-output) {
	--bh-n-bg: var(--bh-brand-soft, #f7f0f3);
	--bh-n-line: #e3e1d8;
	--bh-n-ink: #242424;
	--bh-n-icon: #6b6b6b;
	--bh-n-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 11v5.5M12 7.5v.1'/%3E%3C/svg%3E");
	position: relative;
	display: block;
	margin: 0 0 20px;
	padding: 14px 18px 14px 52px !important;
	border: 1px solid var(--bh-n-line) !important;
	border-radius: 10px;
	background: var(--bh-n-bg) !important;
	box-shadow: none;
	color: var(--bh-n-ink) !important;
	font-family: "Poppins", "Poppins Fallback", Arial, Helvetica, sans-serif;
	font-size: 14px;
	font-weight: 400;
	line-height: 1.55;
	text-align: start;
}

/* Success: brand colour */
body :is(.woocommerce-message, .wd-notice.wd-success, .wpcf7 form.sent div.wpcf7-response-output) {
	--bh-n-bg: var(--bh-brand-soft, #f7f0f3);
	--bh-n-line: var(--bh-brand-line, #e5d3da);
	--bh-n-ink: var(--bh-brand, #370d1d);
	--bh-n-icon: var(--bh-brand, #370d1d);
	--bh-n-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M8 12.5l2.8 2.8L16.5 9.5'/%3E%3C/svg%3E");
}

/* Error: red */
body :is(.woocommerce-error, .wpcf7 form:is(.invalid, .failed, .unaccepted, .spam, .aborted) div.wpcf7-response-output) {
	--bh-n-bg: #fdf3f5;
	--bh-n-line: #f1c7cf;
	--bh-n-ink: #5c1020;
	--bh-n-icon: #c4314b;
	--bh-n-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7.5v5.5M12 16.5v.1'/%3E%3C/svg%3E");
}

/* Warning: amber */
body .wd-notice.wd-warning {
	--bh-n-bg: #fff9e8;
	--bh-n-line: #f0e2b6;
	--bh-n-ink: #5a4a12;
	--bh-n-icon: #b8860b;
	--bh-n-glyph: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M12 4l9 15.5H3z'/%3E%3Cpath d='M12 10v4.5M12 17.2v.1'/%3E%3C/svg%3E");
}

body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .wd-notice, div.wpcf7-response-output)::before {
	content: "";
	position: absolute;
	top: 15px;
	inset-inline-start: 18px;
	width: 22px;
	height: 22px;
	background: var(--bh-n-icon);
	-webkit-mask: var(--bh-n-glyph) center / contain no-repeat;
	mask: var(--bh-n-glyph) center / contain no-repeat;
	font-family: inherit;
	font-size: 0;
	line-height: 1;
}

/* The error list: one line per message. */
body ul.woocommerce-error {
	margin-left: 0;
	margin-right: 0;
	list-style: none;
}

body ul.woocommerce-error li {
	margin: 0 0 6px;
	padding: 0;
	list-style: none;
}

body ul.woocommerce-error li:last-child {
	margin-bottom: 0;
}

body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .wd-notice, div.wpcf7-response-output) :is(strong, b) {
	font-weight: 600;
}

body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .wd-notice, div.wpcf7-response-output) a:not(.button):not(.wc-forward):not(.wc-backward) {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .wd-notice, div.wpcf7-response-output) .amount {
	color: inherit;
}

/* Buttons inside a message ("View cart", "Confirm email address"): small outlined pills. */
body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .wd-notice) :is(.button, .wc-forward, .wc-backward) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 34px;
	margin: 0 12px 0 0;
	padding: 0 16px;
	border: 1.5px solid currentColor !important;
	border-radius: var(--btn-default-brd-radius, 5px); /* the site's button corners */
	background: transparent;
	box-shadow: none;
	color: inherit;
	font-family: inherit;
	font-size: 13px;
	font-weight: 600;
	letter-spacing: 0;
	line-height: 1.2;
	text-decoration: none;
	text-transform: none;
	vertical-align: middle;
	transition: background .2s ease, color .2s ease;
}

body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .wd-notice) :is(.button, .wc-forward, .wc-backward):hover {
	background: var(--bh-n-icon);
	color: #fff;
}

/* Contact form: the messages under each field. */
body .wpcf7-not-valid-tip {
	margin-top: 6px;
	color: #c4314b;
	font-size: 13px;
	line-height: 1.4;
}

@media (max-width: 575px) {
	body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .wd-notice, div.wpcf7-response-output) {
		padding: 13px 14px 13px 46px !important;
	}

	body :is(.woocommerce-message, .woocommerce-info, .woocommerce-error, .wd-notice, div.wpcf7-response-output)::before {
		inset-inline-start: 14px;
	}
}

/* Marker for messages that stay until closed (e.g. "… has gone out of stock", inc/basket.php). */
.bh-notice-keep {
	display: none;
}
