/*
 * Colors read from the theme's own palette (theme.json: action/structure/accent)
 * via WP's generated custom properties, with a literal fallback in case global
 * styles haven't printed yet (e.g. a very early-loading stylesheet) — never a
 * hardcoded hex as the primary value, so this stays in sync if the palette changes.
 *
 * Right-anchored, not left — Cookiebot's own floating re-consent icon lives at
 * bottom-left, and sitting on the opposite side avoids even the appearance
 * that this notification is part of the consent/cookie UI.
 */
.afc-sp-toast {
	position: fixed;
	right: 20px;
	bottom: 20px;
	z-index: 9000;
	display: flex;
	align-items: center;
	gap: 14px;
	max-width: 340px;
	padding: 14px 38px 14px 14px;
	background: #fff;
	border: 1px solid #e2e6ea;
	border-radius: 14px;
	box-shadow: 0 12px 28px -8px rgba(20, 40, 60, 0.28);
	font-family: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
	opacity: 1;
	transform: translate(0, 0);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.afc-sp-toast.is-hidden {
	opacity: 0;
	transform: translate(12px, 10px);
	pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
	.afc-sp-toast {
		transition: opacity 0.15s linear;
	}
}

.afc-sp-pin {
	flex: none;
	position: relative;
	width: 72px;
	height: 72px;
	border-radius: 14px;
	overflow: hidden;
	background: var(--wp--preset--color--accent, #bee0ed);
}

.afc-sp-pin svg,
.afc-sp-pin-map {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	display: block;
}

.afc-sp-pin-map {
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.25s ease;
}

.afc-sp-pin.has-map .afc-sp-pin-map {
	opacity: 1;
}

.afc-sp-pin.has-map svg {
	opacity: 0;
}

.afc-sp-pin .afc-sp-tile {
	fill: var(--wp--preset--color--accent, #bee0ed);
}

.afc-sp-pin .afc-sp-tile-line {
	stroke: #fff;
}

.afc-sp-pin .afc-sp-radius {
	stroke: var(--wp--preset--color--structure, #315889);
}

.afc-sp-pin .afc-sp-pin-shape {
	fill: var(--wp--preset--color--structure, #315889);
}

.afc-sp-pin .afc-sp-pin-hole {
	fill: #fff;
}

.afc-sp-name {
	font-size: 16px;
	font-weight: 700;
	font-family: "IBM Plex Sans", "Inter", system-ui, sans-serif;
	color: var(--wp--preset--color--structure, #315889);
	line-height: 1.25;
}

.afc-sp-message {
	font-size: 14px;
	color: #1c2733;
	margin-top: 1px;
	line-height: 1.35;
}

.afc-sp-message strong {
	font-weight: 700;
	color: var(--wp--preset--color--action, #0099ce);
}

.afc-sp-meta {
	display: flex;
	align-items: center;
	gap: 5px;
	margin-top: 5px;
	font-size: 12px;
	color: #8fa0ae;
	line-height: 1.2;
}

.afc-sp-meta svg {
	flex: none;
	display: block;
}

.afc-sp-close {
	position: absolute;
	top: 6px;
	right: 6px;
	width: 20px;
	height: 20px;
	padding: 0;
	border: none;
	border-radius: 5px;
	background: transparent;
	color: #5b6b7d;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
}

.afc-sp-close:hover {
	background: var(--wp--preset--color--accent, #bee0ed);
	color: var(--wp--preset--color--structure, #315889);
}

.afc-sp-close:focus-visible {
	outline: 2px solid var(--wp--preset--color--action, #0099ce);
	outline-offset: 2px;
}

@media (max-width: 480px) {
	/* Full-width-minus-margins rather than the fixed 340px card, which would
	   otherwise crowd a narrow screen. Still right-anchored (see the base
	   rule). left:74px (not a symmetric 16px) is deliberate — Cookiebot's
	   own floating icon still lives at bottom-left (fixed, left:10px,
	   48x48px) regardless of which side THIS notification is anchored to,
	   so the card needs the same 10+48+16px clearance from it that the
	   original left-anchored layout had, or it overlaps the icon here. */
	.afc-sp-toast {
		left: 74px;
		right: 16px;
		/* Pinned independently of the base rule's desktop offset above. */
		bottom: 16px;
		max-width: none;
		gap: 10px;
		padding: 10px 32px 10px 10px;
	}

	/* The full-size 72px thumbnail is too much card for a narrow screen —
	   scale it down rather than dropping it. */
	.afc-sp-pin {
		width: 52px;
		height: 52px;
		border-radius: 11px;
	}

	.afc-sp-name {
		font-size: 14.5px;
	}

	.afc-sp-message {
		font-size: 13px;
	}

	.afc-sp-meta {
		font-size: 11.5px;
	}
}
