/*
 * Messages across the site (inc/notices.php): WooCommerce's notices, the theme's toasts and the
 * product cards' messages, in one look. Four kinds: success, info, warning, error.
 *
 * Research (2026-11-20): the shape follows the established design systems (IBM Carbon, Shopify
 * Polaris, Atlassian): a coloured status icon, so colour never carries the meaning alone; dark,
 * readable text on a light surface instead of coloured text on a coloured box; the action as a
 * separate link; errors announced at once (role="alert"), success and info politely (role="status").
 * Messages appear next to what caused them (Nielsen Norman Group): at the top of the page for page
 * actions, on the card for a card's size chip.
 */

:root {
	--wb-notice-radius: 10px; /* The site's photos and cards (inputs and buttons use 8 px). */
	--wb-notice-ink: #111111;
	--wb-notice-text: #2b2b2b;

	--wb-success: #1e7b4b;
	--wb-success-bg: #f2f8f4;
	--wb-success-line: #d3e8da;
	--wb-info: #111111;
	--wb-info-bg: #f6f6f6;
	--wb-info-line: #e6e6e6;
	--wb-warning: #a35f00;
	--wb-warning-bg: #fdf7ed;
	--wb-warning-line: #f1e0c2;
	--wb-error: #c8372d;
	--wb-error-bg: #fdf4f3;
	--wb-error-line: #f3d3cf;

	/* 20 px status icons (filled, with the mark cut out), used as masks so they take the kind's colour. */
	--wb-icon-success: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20ZM5.6 10.2 7 8.8l2 2 4-4 1.4 1.4L9 13.6l-3.4-3.4Z'/%3E%3C/svg%3E");
	--wb-icon-info: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20ZM9 8.5h2V15H9V8.5Zm1-4a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4Z'/%3E%3C/svg%3E");
	--wb-icon-warning: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M8.7 1.8a1.5 1.5 0 0 1 2.6 0l8.5 15A1.5 1.5 0 0 1 18.5 19h-17a1.5 1.5 0 0 1-1.3-2.2l8.5-15ZM9 7h2v5.5H9V7Zm1 7.3a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4Z'/%3E%3C/svg%3E");
	--wb-icon-error: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 20 20'%3E%3Cpath fill-rule='evenodd' d='M10 0a10 10 0 1 1 0 20 10 10 0 0 1 0-20ZM9 5h2v6.5H9V5Zm1 8.2a1.2 1.2 0 1 1 0 2.4 1.2 1.2 0 0 1 0-2.4Z'/%3E%3C/svg%3E");
	--wb-icon-close: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M3.5 2.4 8 6.9l4.5-4.5 1.1 1.1L9.1 8l4.5 4.5-1.1 1.1L8 9.1l-4.5 4.5-1.1-1.1L6.9 8 2.4 3.5l1.1-1.1Z'/%3E%3C/svg%3E");
}

/* ---------- The message ---------- */

.wb-notice {
	--wb-n: var(--wb-info);
	--wb-n-bg: var(--wb-info-bg);
	--wb-n-line: var(--wb-info-line);
	--wb-n-icon: var(--wb-icon-info);
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	column-gap: 20px;
	row-gap: 6px;
	margin: 0 0 20px;
	padding: 14px 18px 14px 48px;
	border: 1px solid var(--wb-n-line);
	border-radius: var(--wb-notice-radius);
	background: var(--wb-n-bg);
	color: var(--wb-notice-text);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	list-style: none;
	text-align: start;
	outline: none;
}
.wb-notice--success {
	--wb-n: var(--wb-success);
	--wb-n-bg: var(--wb-success-bg);
	--wb-n-line: var(--wb-success-line);
	--wb-n-icon: var(--wb-icon-success);
}
.wb-notice--warning {
	--wb-n: var(--wb-warning);
	--wb-n-bg: var(--wb-warning-bg);
	--wb-n-line: var(--wb-warning-line);
	--wb-n-icon: var(--wb-icon-warning);
}
.wb-notice--error {
	--wb-n: var(--wb-error);
	--wb-n-bg: var(--wb-error-bg);
	--wb-n-line: var(--wb-error-line);
	--wb-n-icon: var(--wb-icon-error);
}

.wb-notice::before {
	content: "";
	position: absolute;
	top: 15px;
	inset-inline-start: 16px;
	width: 20px;
	height: 20px;
	background: var(--wb-n);
	-webkit-mask: var(--wb-n-icon) center / contain no-repeat;
	mask: var(--wb-n-icon) center / contain no-repeat;
}
/* The theme's clearfix would be an empty flex item. */
.wb-notice::after {
	display: none !important;
}

.wb-notice__text {
	flex: 1 1 260px;
	min-width: 0;
	margin: 0;
}
.wb-notice__actions {
	display: flex;
	flex: 0 0 auto;
	gap: 16px;
}

/* An error list: one row per error. */
ul.wb-notice {
	display: block;
}
ul.wb-notice > li {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	column-gap: 20px;
	row-gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}
ul.wb-notice > li + li {
	margin-top: 8px;
}
ul.wb-notice > li::marker {
	content: none;
}

/* Links read as links; the action ("View cart") is the strongest. The theme floated it and styled it as a button. */
.wb-notice a {
	color: var(--wb-notice-ink);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	line-height: inherit;
}
.wb-notice a:hover {
	text-decoration-thickness: 2px;
}
.wb-notice .wb-notice__actions a,
.wb-notice a.button {
	float: none;
	display: inline;
	height: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	box-shadow: none;
	color: var(--wb-notice-ink);
	font-size: 14px;
	font-weight: 600;
	line-height: inherit;
	white-space: nowrap;
}
.wb-notice .wb-notice__actions a::after,
.wb-notice a.button::after {
	display: none;
}

/* An action as a button (floating messages): it reads as the message's link. The theme fills every
   button:hover dark, hence the !important. */
.wb-notice__action {
	display: inline;
	width: auto;
	height: auto;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none !important;
	box-shadow: none;
	color: var(--wb-notice-ink) !important;
	font: inherit;
	font-weight: 600;
	line-height: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
	white-space: nowrap;
	cursor: pointer;
}
.wb-notice__action:hover {
	text-decoration-thickness: 2px;
}

/* Close button (floating messages). */
.wb-notice__close {
	position: absolute;
	top: 10px;
	inset-inline-end: 8px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 28px;
	height: 28px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent !important;
	color: #6b6b6b;
	cursor: pointer;
}
.wb-notice__close::before {
	content: "";
	width: 14px;
	height: 14px;
	background: currentColor;
	-webkit-mask: var(--wb-icon-close) center / contain no-repeat;
	mask: var(--wb-icon-close) center / contain no-repeat;
}
.wb-notice__close:hover,
.wb-notice__close:focus-visible {
	color: var(--wb-notice-ink);
}
.wb-notice__close:focus-visible,
.wb-notice button:focus-visible,
.wb-notice a:focus-visible {
	outline: 2px solid var(--wb-notice-ink);
	outline-offset: 2px;
}

/* Floating messages: white, raised, the kind shown by the icon alone. */
.wb-notice--float {
	--wb-n-bg: #ffffff;
	--wb-n-line: #e8e8e8;
	padding-inline-end: 44px;
	box-shadow: 0 10px 30px rgba(17, 17, 17, 0.14);
}

@media (max-width: 767px) {
	.wb-notice {
		padding: 12px 14px 12px 42px;
	}
	.wb-notice::before {
		top: 13px;
		inset-inline-start: 14px;
	}
}

/* Where the theme designs the message as part of the page, keep its look: checkout's "Returning
   customer?" and coupon links, the empty cart, the empty wishlist and compare pages. */
:is(.woocommerce-form-login-toggle, .woocommerce-form-coupon-toggle, .wishlist-empty, .wcboost-products-compare--empty) .wb-notice::before,
.cart-empty.wb-notice::before {
	display: none;
}
:is(.woocommerce-form-login-toggle, .woocommerce-form-coupon-toggle, .wishlist-empty, .wcboost-products-compare--empty) .wb-notice,
.cart-empty.wb-notice {
	display: block;
}

/* ---------- WooCommerce's block cart and checkout (React notices, not the templates) ---------- */

/* The doubled class outranks the block styles (theirs set each kind's colours with two classes). Their own icon is
   masked into ours. */
body .wc-block-components-notice-banner.wc-block-components-notice-banner {
	--wb-n: var(--wb-info);
	--wb-n-bg: var(--wb-info-bg);
	--wb-n-line: var(--wb-info-line);
	--wb-n-icon: var(--wb-icon-info);
	align-items: flex-start;
	gap: 12px;
	border: 1px solid var(--wb-n-line);
	border-radius: var(--wb-notice-radius);
	background-color: var(--wb-n-bg);
	color: var(--wb-notice-text);
	font-size: 14px;
	line-height: 1.5;
	padding: 14px 16px !important;
}
body .wc-block-components-notice-banner.wc-block-components-notice-banner.is-success {
	--wb-n: var(--wb-success);
	--wb-n-bg: var(--wb-success-bg);
	--wb-n-line: var(--wb-success-line);
	--wb-n-icon: var(--wb-icon-success);
}
body .wc-block-components-notice-banner.wc-block-components-notice-banner.is-warning {
	--wb-n: var(--wb-warning);
	--wb-n-bg: var(--wb-warning-bg);
	--wb-n-line: var(--wb-warning-line);
	--wb-n-icon: var(--wb-icon-warning);
}
body .wc-block-components-notice-banner.wc-block-components-notice-banner.is-error {
	--wb-n: var(--wb-error);
	--wb-n-bg: var(--wb-error-bg);
	--wb-n-line: var(--wb-error-line);
	--wb-n-icon: var(--wb-icon-error);
}
body .wc-block-components-notice-banner.wc-block-components-notice-banner > svg {
	width: 20px;
	height: 20px;
	margin-top: 1px;
	padding: 0;
	border-radius: 0;
	background-color: var(--wb-n);
	fill: transparent;
	transform: none;
	-webkit-mask: var(--wb-n-icon) center / contain no-repeat;
	mask: var(--wb-n-icon) center / contain no-repeat;
}
body .wc-block-components-notice-banner.wc-block-components-notice-banner a {
	color: var(--wb-notice-ink);
	text-decoration: underline;
	text-underline-offset: 3px;
}
body .wc-block-components-notice-banner.wc-block-components-notice-banner > .wc-block-components-notice-banner__content .wc-forward {
	color: var(--wb-notice-ink) !important;
	font-weight: 600;
	opacity: 1;
}

/* ---------- The theme's toasts (notify.js): added to wishlist, the product page's add-to-cart errors ---------- */

body .notifyjs-glozin-base {
	--wb-n: var(--wb-success);
	--wb-n-icon: var(--wb-icon-success);
	max-width: 400px;
	margin-bottom: 10px;
	padding: 14px 44px 14px 48px;
	border: 1px solid #e8e8e8;
	border-radius: 12px;
	background: #ffffff;
	color: var(--wb-notice-text);
	box-shadow: 0 10px 30px rgba(17, 17, 17, 0.14);
	font-size: 14px;
	line-height: 1.5;
}
body .notifyjs-glozin-error {
	--wb-n: var(--wb-error);
	--wb-n-icon: var(--wb-icon-error);
}
body .notifyjs-glozin-info {
	--wb-n: var(--wb-info);
	--wb-n-icon: var(--wb-icon-info);
}
body .notifyjs-glozin-base .message-icon {
	top: 15px;
	inset-inline-start: 16px;
	width: 20px;
	height: 20px;
	background: var(--wb-n);
	-webkit-mask: var(--wb-n-icon) center / contain no-repeat;
	mask: var(--wb-n-icon) center / contain no-repeat;
}
body .notifyjs-glozin-base .message-icon svg {
	visibility: hidden;
}
body .notifyjs-glozin-base .message-box {
	font-size: 14px;
}
body .notifyjs-glozin-base .message-box ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
body .notifyjs-glozin-base .btn-button,
body .notifyjs-glozin-base a {
	color: var(--wb-notice-ink);
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}
body .notifyjs-glozin-base .svg-active {
	top: 17px;
	inset-inline-end: 16px;
	color: #6b6b6b;
	cursor: pointer;
}
body .notifyjs-glozin-base .svg-active path {
	stroke: currentColor;
}
/* Bottom right, clear of the header's search, account, wishlist and cart icons (the theme put them top right,
   over the icons); on tablets and phones full width, on phones above the bottom menu bar. */
body .notifyjs-corner {
	top: auto !important;
	bottom: 24px !important;
	right: 24px !important;
	left: auto !important;
	transform: none !important;
}
@media (max-width: 1024px) {
	body .notifyjs-corner {
		bottom: 16px !important;
		left: 12px !important;
		right: 12px !important;
	}
	body .notifyjs-glozin-base {
		max-width: none;
	}
}
@media (max-width: 767px) {
	body .notifyjs-corner {
		bottom: 78px !important; /* The theme's bottom menu bar is 66 px tall on phones. */
	}
}
