/* WD Category Badge: all selectors are prefixed with .wdcb- to avoid theme conflicts. */

/* The badge lives on the category tile, outside the circular image, so the
   tile and its inner wrapper must not clip it. */
.wdcb-host,
.wdcb-host > .wd-cat-inner,
.wdcb-host > .wd-cat-inner > .wd-cat-content,
.wdcb-host.category-grid-item,
.category-grid-item.wdcb-host > .wd-cat-inner {
	overflow: visible !important;
}

/* The circular image wrapper keeps its own overflow:hidden (we never touch it);
   the badge is a sibling placed above it. */
.wdcb-host .wdcb-badge {
	z-index: 20;
}

.wdcb-host {
	position: relative;
}

.wdcb-badge {
	position: absolute;
	top: 3%;
	right: -12px;
	z-index: 9;
	display: inline-block;
	margin: 0;
	padding: 0;
	max-width: none;
	pointer-events: none; /* never block clicks on the category link */
	line-height: 1;
	transform: rotate(-13deg);
	transform-origin: center;
	animation: wdcb-float 2.5s ease-in-out infinite;
	will-change: transform;
}

.wdcb-badge__inner {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	padding: 7px 14px 7px 11px;
	border: 2px solid var(--wdcb-border, #fff);
	border-radius: 999px;
	background: linear-gradient(135deg, var(--wdcb-bg-light, #9f6bf5) 0%, var(--wdcb-bg, #7c3aed) 55%, var(--wdcb-bg-dark, #5f2eb8) 100%);
	color: var(--wdcb-color, #fff);
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.2px;
	white-space: nowrap;
	box-shadow:
		0 6px 14px rgba(0, 0, 0, 0.22),
		0 2px 4px rgba(0, 0, 0, 0.14),
		inset 0 1px 0 rgba(255, 255, 255, 0.35);
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.18);
}

.wdcb-badge__icon {
	flex: 0 0 auto;
	width: 14px;
	height: 14px;
	color: var(--wdcb-color, #fff);
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.wdcb-badge__text {
	color: inherit;
}

/* Rotation is repeated in every keyframe so the tilt is never lost. */
@keyframes wdcb-float {
	0%,
	100% {
		transform: translateY(0) rotate(-13deg);
	}
	50% {
		transform: translateY(-6px) rotate(-13deg);
	}
}

@media (prefers-reduced-motion: reduce) {
	.wdcb-badge {
		animation: none;
	}
}

@media (max-width: 767px) {
	.wdcb-badge__inner {
		padding: 5px 10px 5px 8px;
		font-size: 10px;
		gap: 4px;
	}
	.wdcb-badge__icon {
		width: 11px;
		height: 11px;
	}
}

/* Safety net: a badge still inside the clipped image wrapper (before the script
   moves it onto the tile) stays hidden so it never shows cut off. */
.wd-cat-thumb .wdcb-badge,
.category-image-wrapp .wdcb-badge {
	visibility: hidden;
}
