/**
 * Hlásenia WooCommerce vo vizuáli Potlačto (Etapa 2.12, 25. 10. 2026).
 *
 * Šablóny woocommerce/block-notices/*.php skladajú:
 *   .pt-hlasenie (+ .is-success | .is-error | .is-info)
 *     .pt-hlasenie__ikona   – kruh s ikonou
 *     .wc-block-components-notice-banner__content – text
 *     .pt-hlasenie__akcie   – odkazy „Vrátiť späť", „Zobraziť košík"… ako pilulky
 *     .pt-hlasenie__zavriet – ×
 * Triedy wc-block-components-notice-banner / is-* ostávajú kvôli cart.js
 * a checkout.js (podľa nich hlásenia mažú a vkladajú).
 */

body .wc-block-components-notice-banner.pt-hlasenie {
	--pt-h-bg: var(--wp--preset--color--panel, #f4f4f0);
	--pt-h-okraj: var(--wp--preset--color--rule, #d9d9d0);
	--pt-h-ikona-bg: var(--wp--preset--color--ink, #1b1b1b);
	--pt-h-ikona: var(--wp--preset--color--yellow, #f0c419);

	display: grid;
	grid-template-columns: 28px minmax(0, 1fr) auto auto;
	grid-template-areas: "ikona text akcie zavriet";
	align-items: center;
	column-gap: 14px;
	row-gap: 10px;
	box-sizing: border-box;
	width: 100%;
	margin: 0 0 16px;
	padding: 10px 8px 10px 12px;
	background: var(--pt-h-bg);
	border: 1px solid var(--pt-h-okraj);
	border-radius: var(--pt-radius-card-sm, 12px);
	box-shadow: none;
	color: var(--wp--preset--color--ink, #1b1b1b);
	font-size: 15px;
	line-height: 1.45;
	animation: pt-hlasenie-in .22s ease-out;
}

body .wc-block-components-notice-banner.pt-hlasenie.is-error {
	--pt-h-bg: #fcefec;
	--pt-h-okraj: #f0c6bf;
	--pt-h-ikona-bg: #c43d2b;
	--pt-h-ikona: #fff;
}

body .wc-block-components-notice-banner.pt-hlasenie.is-info {
	--pt-h-bg: var(--wp--preset--color--yellow-soft, #fbf1cc);
	--pt-h-okraj: #efdc94;
}

.pt-hlasenie__ikona {
	grid-area: ikona;
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	border-radius: 50%;
	background: var(--pt-h-ikona-bg);
	color: var(--pt-h-ikona);
}

.pt-hlasenie__ikona svg {
	display: block;
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.6;
	stroke-linecap: round;
	stroke-linejoin: round;
}

body .pt-hlasenie .wc-block-components-notice-banner__content {
	grid-area: text;
	margin: 0;
	padding: 2px 0;
	color: inherit;
	font-size: inherit;
}

body .pt-hlasenie .wc-block-components-notice-banner__content a:not(.pt-hlasenie__akcia) {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 2px;
}

body .pt-hlasenie .wc-block-components-notice-banner__summary {
	margin: 0;
	font-weight: 600;
}

body .pt-hlasenie .wc-block-components-notice-banner__content ul {
	margin: 4px 0 0;
	padding-left: 18px;
}

.pt-hlasenie__akcie {
	grid-area: akcie;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

body .pt-hlasenie .pt-hlasenie__akcie a,
body .pt-hlasenie .pt-hlasenie__akcie button {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	height: 34px;
	margin: 0;
	padding: 0 14px;
	border: 0;
	border-radius: var(--pt-radius-pill, 99px);
	background: var(--wp--preset--color--ink, #1b1b1b);
	color: #fff;
	font-family: inherit;
	font-size: 14px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}

body .pt-hlasenie .pt-hlasenie__akcie a:hover,
body .pt-hlasenie .pt-hlasenie__akcie a:focus-visible,
body .pt-hlasenie .pt-hlasenie__akcie button:hover,
body .pt-hlasenie .pt-hlasenie__akcie button:focus-visible {
	background: var(--wp--preset--color--yellow, #f0c419);
	color: var(--wp--preset--color--ink, #1b1b1b);
}

.pt-hlasenie__zavriet {
	grid-area: zavriet;
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--wp--preset--color--muted, #6e6e66);
	font-size: 20px;
	line-height: 1;
	cursor: pointer;
}

.pt-hlasenie__zavriet:hover,
.pt-hlasenie__zavriet:focus-visible {
	background: rgba(27, 27, 27, .07);
	color: var(--wp--preset--color--ink, #1b1b1b);
}

.pt-hlasenie.is-odchadza {
	opacity: 0;
	transform: translateY(-4px);
	transition: opacity .18s, transform .18s;
}

@keyframes pt-hlasenie-in {
	from { opacity: 0; transform: translateY(-4px); }
	to   { opacity: 1; transform: none; }
}

/* Košík a pokladňa: hlásenia medzi krokmi a nadpisom. */
.pt-kosik > .woocommerce-notices-wrapper:not(:empty) { margin: 0 0 8px; }
.woocommerce-cart .pt-kosik > .woocommerce-notices-wrapper:not(:empty) { margin-bottom: 8px; }

@media (max-width: 640px) {
	body .wc-block-components-notice-banner.pt-hlasenie {
		grid-template-columns: 28px minmax(0, 1fr) auto;
		grid-template-areas:
			"ikona text zavriet"
			".     akcie akcie";
	}
}

@media (prefers-reduced-motion: reduce) {
	body .wc-block-components-notice-banner.pt-hlasenie { animation: none; }
}

/* Chyba zľavového kódu (WooCommerce ju píše priamo pod pole). */
.pt-kosik__kupon { flex-wrap: wrap; }
.pt-kosik__kupon .coupon-error-notice {
	flex-basis: 100%;
	margin: 8px 0 0;
	color: #c43d2b;
	font-size: 13px;
	line-height: 1.4;
}

/* WooCommerce hlásenie po načítaní zameria (tabindex=-1) kvôli čítačkám — bez čierneho rámu. */
body .wc-block-components-notice-banner.pt-hlasenie:focus { outline: none; }
