/**
 * Komunikaty sklepu (modul `woo-notices`, DR-R3 S-A). Kontrakt: docs/woo-notices.md.
 *
 * Wylacznie wyglad typu komunikatu WooCommerce. Margines, zachowania (lista bledow pol, przesuniecie
 * pod naglowek) i wyjatki stanu (puste stany, ekrany odmowy) zostaja w projekcie - CSS poza
 * warstwami wygrywa z modulem. Sloty `--lukuro-notice-*` i `--lukuro-radius-control` deklaruje
 * projekt w `:root` (bricks-child-overrides/style.css); pakiet ich nie deklaruje.
 *
 * Specyficznosc: baza w `:where()` (0,1,0 z `:not(.cart-empty)`), warianty typu (0,2,0) po bazie.
 * `:not()` wewnatrz `:is()` podnosi baze do 0,3,0 i przykrywa warianty - tego ksztaltu nie uzywac.
 * Pusty koszyk (`.cart-empty`) to pusty stan, nie komunikat - modul go nie rusza.
 *
 * @package Lukuro
 * @author lukuro
 */

@layer lukuro.base {

:where(.woocommerce-error, .woocommerce-message, .woocommerce-info):not(.cart-empty) {
	padding: var(--lukuro-notice-pad, 16px 20px);
	list-style: none;
	border: 1px solid var(--lukuro-notice-border, var(--lukuro-color-hairline, #e0e0e0));
	border-radius: var(--lukuro-radius-control, 4px);
	background: var(--lukuro-notice-bg, var(--lukuro-color-surface, #fff));
	font-size: var(--lukuro-notice-font-size, 14px);
	line-height: var(--lukuro-notice-line-height, 22px);
	color: var(--lukuro-notice-text, var(--lukuro-color-text, #222));
}

.woocommerce-error:not(.cart-empty) {
	border-color: var(--lukuro-notice-error-border, var(--lukuro-color-danger, #b3261e));
}

.woocommerce-message:not(.cart-empty) {
	border: 0;
	background: var(--lukuro-notice-message-bg, var(--lukuro-color-surface-subtle, #f5f5f5));
}

/* Bez ikon: typ niesie tresc, ramka i tlo (Bricks wylacza woocommerce.css, ikon nie rysuje nikt). */
:where(.woocommerce-error, .woocommerce-message, .woocommerce-info):not(.cart-empty)::before {
	content: none;
}

.woocommerce-error:not(.cart-empty) > li {
	margin: 0;
	padding: 0;
}

/* Przycisk akcji ("Zobacz koszyk", "Wybierz opcje"): wariant drugorzedny - obrys w kolorze tekstu
   komunikatu, nie konkuruje z glownym przyciskiem strony. Obrys fokusu zostaje motywowi. */
:where(.woocommerce-error, .woocommerce-message, .woocommerce-info):not(.cart-empty) :is(a.button, .button, a.wc-forward) {
	border: 1px solid var(--lukuro-notice-action-border, currentColor);
	border-radius: var(--lukuro-radius-control, 4px);
	background: var(--lukuro-notice-action-bg, transparent);
	color: var(--lukuro-notice-action-text, currentColor);
	font-weight: inherit;
	line-height: var(--lukuro-notice-action-line-height, 1.2);
	min-height: 0;
	padding: var(--lukuro-notice-action-pad, 6px 12px);
	text-decoration: none;
	white-space: nowrap;
}

:where(.woocommerce-error, .woocommerce-message, .woocommerce-info):not(.cart-empty) :is(a.button, .button, a.wc-forward):hover {
	background: color-mix(in srgb, currentColor 8%, transparent);
}

:where(.woocommerce-error, .woocommerce-message, .woocommerce-info):not(.cart-empty) :is(a.button, .button, a.wc-forward).disabled {
	opacity: .5;
	cursor: not-allowed;
}

/* Link ("Cofnij?", kupon, logowanie, pole w bledzie kasy): link sklepu, bez skory przycisku Bricksa. */
:where(.woocommerce-error, .woocommerce-message, .woocommerce-info):not(.cart-empty) a:not(.button, .wc-forward) {
	min-height: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font-weight: inherit;
	text-decoration: underline;
}

@media (forced-colors: active) {
	.woocommerce-message:not(.cart-empty) {
		border: 1px solid CanvasText;
	}
}

} /* @layer lukuro.base */

@layer lukuro.modules {

/* Bricks: `.woocommerce-notices-wrapper a{float:right;display:block;margin-left:10px}` - bez plywania. */
:where(.woocommerce-error, .woocommerce-message, .woocommerce-info):not(.cart-empty) :is(a.button, .button, a.wc-forward) {
	float: none;
	flex-shrink: 0;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

:where(.woocommerce-error, .woocommerce-message, .woocommerce-info):not(.cart-empty) a:not(.button, .wc-forward) {
	float: none;
	display: inline;
	margin-left: 0;
}

} /* @layer lukuro.modules */
