/* ==========================================================================
   WooCommerce Product Custom Label — Frontend Badge Styles
   MarufLabs
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS custom properties (overridden per-badge via inline style)
   -------------------------------------------------------------------------- */
:root {
	--wpcl-radius: 4px;
	--wpcl-font-size: 9px;
	--wpcl-default-bg: #222222;
	--wpcl-default-text: #ffffff;
}

/* --------------------------------------------------------------------------
   Badge wrapper
   Must be absolutely positioned inside a relatively-positioned product card.
   WooCommerce's .product class and the li.product wrapper are already relative
   in most themes. We add position:relative as a fallback on .product.
   -------------------------------------------------------------------------- */
ul.products li.product,
.products .product,
.woocommerce-page .product {
	position: relative;
}

.wpcl-badge {
	position: absolute;
	z-index: 9;
	display: inline-block;
	padding: 4px 10px;
	font-size: var(--wpcl-font-size, 9px);
	border-radius: var(--wpcl-radius);
	background: #ffffff;
	color: #000000;
	border: 1px solid #e5e5e5;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: 1;
	pointer-events: none;
	white-space: nowrap;
	box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

@keyframes wpcl-badge-in {
	from {
		opacity: 0;
		transform: scale(0.85);
	}

	to {
		opacity: 1;
		transform: scale(1);
	}
}

.wpcl-badge__inner {
	display: block;
}

/* --------------------------------------------------------------------------
   Position variants
   -------------------------------------------------------------------------- */
.wpcl-badge--top-left {
	top: 10px;
	left: 10px;
}

.wpcl-badge--top-right {
	top: 10px;
	right: 10px;
}

.wpcl-badge--bottom-left {
	bottom: 10px;
	left: 10px;
}

.wpcl-badge--bottom-right {
	bottom: 10px;
	right: 10px;
}

/* --------------------------------------------------------------------------
   Single product page: badge is inline (not absolutely positioned)
   -------------------------------------------------------------------------- */
.single-product .wpcl-badge {
	position: absolute;
	top: 15px;
	left: 15px;
}

/* --------------------------------------------------------------------------
   Backwards compat: old .custom-label class from v1.x
   Keep it working in case a theme outputs the old markup.
   -------------------------------------------------------------------------- */
.custom-label {
	display: inline-block;
	padding: 4px 10px;
	font-size: var(--wpcl-font-size, 12px);
	border-radius: var(--wpcl-radius, 4px);
	background: var(--wpcl-badge-bg, var(--wpcl-default-bg, #222222));
	color: var(--wpcl-badge-text, var(--wpcl-default-text, #ffffff));
	font-weight: 600;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	line-height: 1.3;
}

/* ==========================================================================
   Secondary text label ("Trending Now", "Best Seller", etc.)
   Appears below product title/price on the archive loop and single page.
   ========================================================================== */

.wpcl-text-label {
	display: block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.4;
	margin-top: 6px;
	padding: 0;
	border: none;
	background: none;
	cursor: default;
}

/* In archive loop: ensure the text label renders at the bottom of the card
   outside the image link but inside the li.product wrapper */
ul.products li.product .wpcl-text-label,
.products .product .wpcl-text-label {
	display: block;
	margin-top: 4px;
}

/* Single product: push label to its own line after summary content */
.single-product .wpcl-text-label {
	display: block;
	margin-top: 8px;
	margin-bottom: 4px;
}