/* ==========================================================================
   WeManage Promotions - Front-end product badges
   ========================================================================== */

/* Container variants ------------------------------------------------------ */

/* Shop loop: floats over the product image, horizontally centered.
   - position: absolute relative to Flatsome's `.box-image` (or whatever
     positioned ancestor exists in other themes).
   - z-index: 50 beats Flatsome's `.onsale` (20) and `.add-to-cart-grid` (30)
     and stays in front of the image even when the hover-fade effect runs.
   - isolation: isolate creates a fresh stacking context so parent transforms
     can't swallow us. */
.wmp-badges--overlay {
	position: absolute !important;
	top: 12px;
	left: 50%;
	transform: translateX(-50%);
	z-index: 50;
	isolation: isolate;
	display: flex !important;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	max-width: calc(100% - 16px);
	pointer-events: none;
	overflow: visible !important;
}

/* Single product page: inline pills above the title. */
.wmp-badges--inline {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin: 0 0 14px;
}

/* Badge ------------------------------------------------------------------- */

.wmp-badge {
	pointer-events: auto;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	gap: 5px;
	padding: 5px 12px;
	min-height: 24px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.01em;
	color: #fff;
	white-space: nowrap !important;
	text-align: center;
	box-shadow:
		0 2px 6px rgba(0, 0, 0, 0.18),
		inset 0 1px 0 rgba(255, 255, 255, 0.15);
	text-shadow: 0 1px 1px rgba(0, 0, 0, 0.12);
	transition: transform 180ms ease, box-shadow 180ms ease;
	flex-shrink: 0 !important;
	max-width: none !important;
	overflow: visible !important;
	text-overflow: clip !important;
	box-sizing: border-box;
}

/* Make sure the badge's positioned ancestor is the image card itself.
   Flatsome already gives `.box-image` position:relative, this just guards
   against custom child themes. */
.product .box-image,
.product-small .box-image,
.products .product .woocommerce-loop-product__link {
	position: relative;
}

.wmp-badge:hover {
	transform: translateY(-1px);
	box-shadow:
		0 4px 12px rgba(0, 0, 0, 0.22),
		inset 0 1px 0 rgba(255, 255, 255, 0.18);
}

.wmp-badge__icon {
	font-size: 13px;
	line-height: 1;
	display: inline-flex;
	align-items: center;
	filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.15));
}

.wmp-badge__text {
	display: inline;
	overflow: visible !important;
	text-overflow: clip !important;
	white-space: inherit !important;
	max-width: none !important;
}

/* Single-product page badges are slightly larger / weightier. */
.wmp-badges--inline .wmp-badge {
	padding: 7px 14px;
	font-size: 13px;
	min-height: 30px;
}

.wmp-badges--inline .wmp-badge__icon {
	font-size: 15px;
}

/* Style variants - hand-tuned gradients ----------------------------------- */

.wmp-badge--red    { background: linear-gradient(135deg, #ff5e62 0%, #ff9966 100%); }
.wmp-badge--green  { background: linear-gradient(135deg, #11998e 0%, #38ef7d 100%); }
.wmp-badge--blue   { background: linear-gradient(135deg, #2193b0 0%, #6dd5ed 100%); }
.wmp-badge--purple { background: linear-gradient(135deg, #654ea3 0%, #eaafc8 100%); }
.wmp-badge--gold {
	background: linear-gradient(135deg, #f7971e 0%, #ffd200 100%);
	color: #4a2e00;
	text-shadow: 0 1px 1px rgba(255, 255, 255, 0.35);
}
.wmp-badge--gold .wmp-badge__icon {
	filter: drop-shadow(0 1px 1px rgba(255, 255, 255, 0.4));
}
.wmp-badge--dark { background: linear-gradient(135deg, #232526 0%, #414345 100%); }

/* Subtle entrance animation. */
@media (prefers-reduced-motion: no-preference) {
	.wmp-badge {
		animation: wmp-pop 320ms cubic-bezier(0.34, 1.56, 0.64, 1) backwards;
	}
	.wmp-badges .wmp-badge:nth-child(2) { animation-delay: 70ms; }
	.wmp-badges .wmp-badge:nth-child(3) { animation-delay: 140ms; }

	@keyframes wmp-pop {
		from { opacity: 0; transform: scale(0.7) translateY(-3px); }
		to   { opacity: 1; transform: scale(1)   translateY(0); }
	}
}
