/**
 * OnlySecurity training - WooCommerce notices reskin.
 *
 * Ported from os-marketplace-snippets 1.40.0 / ksec-labs-snippets
 * 1.0.32. Self-contained colour palette (no token dependency) so it
 * works on Shoptimizer without coupling to the training site's
 * `--os-c-*` design system.
 *
 * Loaded by front-end/onlysecurity-wc-notices.php. Toast behaviour
 * for the post-add-to-cart `.woocommerce-message` lives in the same
 * PHP via a `wp_footer` script.
 */

.woocommerce-notices-wrapper { margin: 16px 0; }
.woocommerce-notices-wrapper:empty { margin: 0; }

.woocommerce-message,
.woocommerce-error,
.woocommerce-info {
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
	background: #fff !important;
	border: 1px solid #e5e7eb !important;
	border-left-width: 4px !important;
	border-radius: 12px !important;
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06) !important;
	color: #1e293b !important;
	font-size: 14px !important;
	line-height: 1.5 !important;
	padding: 14px 18px !important;
	display: flex !important;
	align-items: center !important;
	gap: 14px !important;
	margin: 0 0 16px !important;
	list-style: none !important;
}
.woocommerce-message::before,
.woocommerce-error::before,
.woocommerce-info::before {
	content: "";
	display: inline-block;
	width: 22px;
	height: 22px;
	flex: 0 0 22px;
	background: currentColor;
	-webkit-mask: var(--os-c-notice-icon, none) center / contain no-repeat;
	        mask: var(--os-c-notice-icon, none) center / contain no-repeat;
}

.woocommerce-message {
	border-left-color: #22c55e !important;
	background: rgba(34, 197, 94, 0.06) !important;
}
.woocommerce-message::before {
	color: #22c55e;
	--os-c-notice-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><polyline points="20 6 9 17 4 12"/></svg>');
}
.woocommerce-error {
	border-left-color: #f59e0b !important;
	background: rgba(245, 158, 11, 0.06) !important;
}
.woocommerce-error::before {
	color: #f59e0b;
	--os-c-notice-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="8" x2="12" y2="13"/><line x1="12" y1="16.5" x2="12" y2="16.5"/></svg>');
}
.woocommerce-info {
	border-left-color: #0ea5e9 !important;
	background: rgba(14, 165, 233, 0.06) !important;
}
.woocommerce-info::before {
	color: #0ea5e9;
	--os-c-notice-icon: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="none" stroke="black" stroke-width="2.4" stroke-linecap="round" stroke-linejoin="round"><circle cx="12" cy="12" r="10"/><line x1="12" y1="11" x2="12" y2="16"/><line x1="12" y1="7.5" x2="12" y2="7.5"/></svg>');
}

.woocommerce-message > li,
.woocommerce-error > li,
.woocommerce-info > li {
	list-style: none !important;
	margin: 0 !important;
	padding: 0 !important;
	background: transparent !important;
}
.woocommerce-error > li + li,
.woocommerce-message > li + li,
.woocommerce-info > li + li { margin-top: 4px !important; }

.woocommerce-message .button,
.woocommerce-error .button,
.woocommerce-info .button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	margin-left: auto !important;
	padding: 7px 16px !important;
	border-radius: 999px !important;
	background: #2F62AF !important;
	color: #fff !important;
	font-weight: 600 !important;
	font-size: 13px !important;
	text-decoration: none !important;
	border: 1px solid #2F62AF !important;
	transition: background .15s ease, border-color .15s ease;
	flex-shrink: 0;
}
.woocommerce-message .button:hover,
.woocommerce-error .button:hover,
.woocommerce-info .button:hover {
	background: #244c87 !important;
	border-color: #244c87 !important;
}
.woocommerce-message .button {
	background: #f59e0b !important;
	border-color: #f59e0b !important;
	color: #1a1206 !important;
}
.woocommerce-message .button:hover {
	background: #c4790a !important;
	border-color: #c4790a !important;
	color: #fff !important;
}

/* Toast variant for the post-add-to-cart success notice */
.os-c-wc-notice-toast {
	position: fixed !important;
	top: 96px !important;
	right: 16px !important;
	z-index: 9000;
	max-width: 380px;
	box-shadow: 0 8px 24px rgba(15, 23, 42, 0.18) !important;
	animation: os-c-toast-in .25s ease-out;
}
.os-c-wc-notice-toast.os-c-toast-out { animation: os-c-toast-out .25s ease-in forwards; }
@keyframes os-c-toast-in  { from { opacity: 0; transform: translateX(20px); } to { opacity: 1; transform: translateX(0); } }
@keyframes os-c-toast-out { from { opacity: 1; transform: translateX(0); }    to { opacity: 0; transform: translateX(20px); } }
@media (max-width: 640px) {
	.os-c-wc-notice-toast {
		top: auto !important;
		bottom: 12px !important;
		left: 12px !important;
		right: 12px !important;
		max-width: none;
	}
}
