/* =======================================================
   WooCommerce notices, site-wide (Core\Assets)
   - classic notices: .woocommerce-message / -info / -error
     (product pages, account, classic templates)
   - block notices: .wc-block-components-notice-banner
     (block cart / checkout, booking errors from the Store API)
   Dark card with pixel corners and a pixel icon in the type
   colour; replaces the green/blue/red theme defaults.
   "html body" outranks the theme (GeneratePress inline CSS)
   and WooCommerce selectors without !important; block notices
   additionally need "[class]" against ".…-banner.is-error".
   ======================================================= */

html body .woocommerce-message,
html body .woocommerce-info,
html body .woocommerce-error,
html body .wc-block-components-notice-banner[class] {
	--mt-notice: var(--mf-color-brand, #ff3c00);
	--mt-notice-pix: polygon(0 4px, 2px 4px, 2px 2px, 4px 2px, 4px 0, calc(100% - 4px) 0, calc(100% - 4px) 2px, calc(100% - 2px) 2px, calc(100% - 2px) 4px, 100% 4px, 100% calc(100% - 4px), calc(100% - 2px) calc(100% - 4px), calc(100% - 2px) calc(100% - 2px), calc(100% - 4px) calc(100% - 2px), calc(100% - 4px) 100%, 4px 100%, 4px calc(100% - 2px), 2px calc(100% - 2px), 2px calc(100% - 4px), 0 calc(100% - 4px));
	--mt-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath d='M0 3h1v2H0zM1 4h1v2H1zM2 5h1v2H2zM3 4h1v2H3zM4 3h1v2H4zM5 2h1v2H5zM6 1h1v2H6z'/%3E%3C/svg%3E");
	clip-path: var(--mt-notice-pix);
	border: 0;
	border-radius: 0;
	background: #1a1a1a;
	color: var(--mf-color-base, #fff);
	text-align: left;
}

/* Type colours and icons (success = brand, info = grey, error = red). */
html body .woocommerce-info,
html body .wc-block-components-notice-banner[class].is-info {
	--mt-notice: #bbb;
	--mt-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath d='M3 0h1v1H3zM2 2h2v1H2zM3 3h1v3H3zM2 6h3v1H2z'/%3E%3C/svg%3E");
}

html body .woocommerce-error,
html body .wc-block-components-notice-banner[class].is-error {
	--mt-notice: var(--mf-color-danger, #dc2626);
	--mt-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath d='M3 0h1v4H3zM3 5h1v2H3z'/%3E%3C/svg%3E");
}

html body .wc-block-components-notice-banner[class].is-warning {
	--mt-notice: var(--mf-color-warning, #d97706);
	--mt-notice-icon: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 7 7' shape-rendering='crispEdges'%3E%3Cpath d='M3 0h1v4H3zM3 5h1v2H3z'/%3E%3C/svg%3E");
}

/* ---------- Classic notices ---------- */
html body .woocommerce-message,
html body .woocommerce-info,
html body .woocommerce-error {
	position: relative;
	display: block;
	margin: 0 0 24px;
	padding: 16px 20px 16px 64px;
	font-size: 16px;
	line-height: 1.5;
	list-style: none;
}

/* With a button ("Warenkorb anzeigen"): text left, button right. */
html body .woocommerce-message:has(> a.button),
html body .woocommerce-info:has(> a.button) {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 24px;
	align-items: center;
}

/* Error lists: one line per message. */
html body .woocommerce-error li {
	margin: 0;
	padding: 0;
}

html body .woocommerce-error li + li {
	margin-top: 6px;
}

html body .woocommerce-message::before,
html body .woocommerce-info::before,
html body .woocommerce-error::before {
	content: "";
	position: absolute;
	top: 14px; /* at the first line of text */
	left: 20px;
	display: block;
	width: 28px;
	height: 28px;
	clip-path: var(--mt-notice-pix);
	background: var(--mt-notice) var(--mt-notice-icon) center / 14px no-repeat;
}

/* Next to a button the box is taller: icon centred. */
html body .woocommerce-message:has(> a.button)::before,
html body .woocommerce-info:has(> a.button)::before {
	top: 50%;
	margin-top: -14px;
}

/* Notices are focused by WooCommerce for screen readers only. */
html body .woocommerce-message:focus,
html body .woocommerce-info:focus,
html body .woocommerce-error:focus {
	outline: none;
}

html body .woocommerce-message a:not(.button),
html body .woocommerce-info a:not(.button),
html body .woocommerce-error a:not(.button) {
	color: var(--mf-color-brand, #ff3c00);
	font-weight: 700;
	text-decoration: underline;
}

/* "Warenkorb anzeigen" etc.: brand button on the right, pixel corners
   as the buttons on monkeyfactory.at (.button-primary-pixel).
   "a.button.button": GP Premium resets padding and background in
   "div.woocommerce-message a.button:hover" (0,3,2); without the doubled
   class the button collapsed on hover. */
html body .woocommerce-message a.button.button,
html body .woocommerce-info a.button.button,
html body .woocommerce-error a.button.button {
	order: 2;
	float: none;
	margin: 0 0 0 auto;
	padding: 14px 18px 13px;
	clip-path: polygon(0 calc(100% - 8px), 4px calc(100% - 8px), 4px calc(100% - 4px), 8px calc(100% - 4px), 8px 100%, calc(100% - 8px) 100%, calc(100% - 8px) calc(100% - 4px), calc(100% - 4px) calc(100% - 4px), calc(100% - 4px) calc(100% - 8px), 100% calc(100% - 8px), 100% 8px, calc(100% - 4px) 8px, calc(100% - 4px) 4px, calc(100% - 8px) 4px, calc(100% - 8px) 0, 8px 0, 8px 4px, 4px 4px, 4px 8px, 0 8px);
	border: 0;
	border-radius: 0;
	background: var(--mf-color-brand, #ff3c00);
	color: #000;
	font-size: 14px;
	font-weight: 700;
	line-height: 1;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	white-space: nowrap;
}

html body .woocommerce-message a.button.button:hover,
html body .woocommerce-message a.button.button:focus-visible,
html body .woocommerce-info a.button.button:hover,
html body .woocommerce-info a.button.button:focus-visible,
html body .woocommerce-error a.button.button:hover,
html body .woocommerce-error a.button.button:focus-visible {
	background: #fff;
	color: #000;
}

/* Product pages: notices as wide as the product (1240px incl. 20px
   padding, see voucher-product.css), not the full window. */
html body.single-product .woocommerce-notices-wrapper:not(:empty) {
	max-width: 1240px;
	margin: 0 auto;
	padding: 32px 20px 0;
}

html body.single-product .woocommerce-notices-wrapper > :last-child {
	margin-bottom: 0;
}

/* ---------- Block notices (cart, checkout) ----------
   Layout stays WooCommerce's; only colours, corners and the icon. */
html body .wc-block-components-notice-banner[class] {
	gap: 14px;
	font-size: 15px;
}

html body .wc-block-components-notice-banner[class] > svg {
	width: 28px;
	height: 28px;
	padding: 0;
	clip-path: var(--mt-notice-pix);
	border-radius: 0;
	background: var(--mt-notice) var(--mt-notice-icon) center / 14px no-repeat;
	fill: transparent;
	transform: none;
}

/* WooCommerce sets link and close-button colours with !important. */
html body .wc-block-components-notice-banner[class] > .wc-block-components-notice-banner__content a {
	color: var(--mf-color-brand, #ff3c00) !important;
	font-weight: 700;
	opacity: 1;
}

html body .wc-block-components-notice-banner[class] > .wc-block-components-button {
	color: #fff !important;
}

html body .wc-block-components-notice-banner[class] > .wc-block-components-button svg {
	fill: currentcolor;
}

/* ---------- Mobile (GenerateBlocks: up to 767px) ---------- */
@media (max-width: 767px) {

	html body .woocommerce-message,
	html body .woocommerce-info,
	html body .woocommerce-error {
		padding: 14px 16px 14px 56px;
		font-size: 15px;
	}

	html body .woocommerce-message::before,
	html body .woocommerce-info::before,
	html body .woocommerce-error::before {
		top: 13px;
		left: 16px;
		width: 26px;
		height: 26px;
	}

	/* Button below the text, full width; icon stays at the text. */
	html body .woocommerce-message a.button.button,
	html body .woocommerce-info a.button.button,
	html body .woocommerce-error a.button.button {
		flex-basis: 100%;
		margin: 0;
		padding: 14px 16px;
		text-align: center;
	}

	html body .woocommerce-message:has(> a.button)::before,
	html body .woocommerce-info:has(> a.button)::before {
		top: 13px;
		margin-top: 0;
	}
}
