/**
 * MK Offers — storefront badges
 */

.mk-badge-stack {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 6px;
	pointer-events: none;
}

.mk-badge-stack .mk-badge {
	position: static;
}

.mk-product-card__media,
.woocommerce-product-gallery,
.woocommerce-product-gallery__image,
.woocommerce-product-gallery .flex-viewport {
	position: relative;
}

.mk-badge-stack--on_image.mk-badge-stack--collection,
.mk-badge-stack--on_image.mk-badge-stack--product {
	position: absolute;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 8;
}

/* Woo “Sale!” sits in the same corner — hide it when our stack is on the image. */
.mk-product-card:has(.mk-badge-stack) span.onsale,
.mk-collection-card:has(.mk-badge-stack) span.onsale,
.mk-pdp-gallery:has(.mk-badge-stack) span.onsale,
.woocommerce-product-gallery:has(.mk-badge-stack) span.onsale,
.woocommerce-product-gallery__wrapper:has(.mk-badge-stack) span.onsale,
.mk-studio-product-main:has(.mk-badge-stack) span.onsale {
	display: none !important;
}

.mk-badge-stack--above_title,
.mk-badge-stack--below_title {
	position: static;
	margin: 0 0 8px;
	pointer-events: auto;
}

.mk-badge-stack--below_title {
	margin: 6px 0 10px;
}

.woocommerce-product-gallery,
.woocommerce-product-gallery__image,
.woocommerce-product-gallery .flex-viewport {
	position: relative;
}

.mk-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	padding: 4px 10px;
	border-radius: 40px;
	line-height: 1.2;
	max-width: 12rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.mk-badge--offer {
	background: var(--mk-red, #ff6b35);
	color: #fff;
}

.mk-badge--sale {
	background: var(--mk-black, #000);
	color: var(--mk-white, #faeec2);
}

.mk-badge--type-bogo {
	background: #1a5f4a;
	color: #faeec2;
}

.mk-badge--type-free_gift {
	background: #5b2d8e;
	color: #fff;
}

/* Card must be positioned for absolute stack */
.mk-product-card {
	position: relative;
}

/* Hide legacy single Sale pill when stack present */
.mk-product-card .mk-product-card__badge {
	display: none;
}

.mk-offer-gift-label {
	font-weight: 600;
	opacity: 0.85;
}

.mk-offers-applied th,
.mk-offers-applied td {
	font-size: 0.9em;
}

.mk-offers-applied-note {
	margin: 0 0 12px;
	padding: 10px 12px;
	background: #113a2d;
	color: #faeec2;
	border-radius: 6px;
	font-size: 13px;
	font-weight: 600;
	line-height: 1.35;
}

.mk-mini-cart .mk-offers-applied-note,
.mk-mini-cart__footer .mk-offers-applied-note {
	margin: 0 0 10px;
}

.mk-offers-applied-save {
	font-weight: 500;
	opacity: 0.95;
}

/* Ensure offer badges sit above card media */
.mk-product-card .mk-badge-stack,
.mk-collection-card .mk-badge-stack {
	z-index: 5;
}

/* Percent-off catalog display (strikethrough + sale). Theme also styles del/ins. */
.mk-offer-price del {
	opacity: 0.55;
	font-weight: 400;
	margin-right: 0.35rem;
}
.mk-offer-price ins {
	text-decoration: none;
}

.mk-mini-cart__item-unit .mk-offer-price del,
.mk-mini-cart__item-total .mk-offer-price del,
.cart_item .mk-offer-price del {
	opacity: 0.55;
	font-weight: 400;
	margin-right: 0.35rem;
}

.mk-mini-cart__item-unit .mk-offer-price ins,
.mk-mini-cart__item-total .mk-offer-price ins,
.cart_item .mk-offer-price ins {
	text-decoration: none;
}
