/* Hide Astra and WooCommerce's default sale badges. */
.ast-onsale-card,
.onsale,
.woocommerce span.onsale,
.astra-shop-summary-wrap .onsale {
	display: none !important;
}

/* Defensive cleanup for older cached card markup: descriptions belong only on
 * the single-product view, never inside shop/category grids. */
body.woocommerce-shop .kuhu-product-card-offer-details,
body.tax-product_cat .kuhu-product-card-offer-details,
body.tax-product_tag .kuhu-product-card-offer-details,
body.post-type-archive-product .kuhu-product-card-offer-details {
	display: none !important;
}

/* The controller's selected offer badge. The surrounding theme remains in charge
 * of card dimensions, columns, images, and the top-right Add to Cart control. */
.kuhu-product-card-offer {
	position: absolute !important;
	top: 10px;
	left: 10px;
	z-index: 8;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	max-width: calc(100% - 20px);
	min-height: 30px;
	padding: 6px 10px;
	border: 2px solid rgba(255, 255, 255, .95);
	border-radius: 999px;
	background: linear-gradient(135deg, #d93663, #a91543);
	box-shadow: 0 4px 12px rgba(40, 20, 40, .22);
	color: #fff !important;
	font-size: 10px;
	font-weight: 800;
	letter-spacing: .04em;
	line-height: 1.05;
	overflow: hidden;
	text-align: center;
	text-overflow: ellipsis;
	text-transform: uppercase;
	white-space: nowrap;
}

.kuhu-product-card-offer--short_sale {
	background: linear-gradient(135deg, #ef8d43, #c94e1a);
}

.kuhu-product-card-offer--bulk_sale {
	background: linear-gradient(135deg, #8e63dc, #55319f);
}

.kuhu-product-card-offer--any_offer {
	background: linear-gradient(135deg, #16a085, #08725f);
}

/* Keep the replacement action compact inside any existing WooCommerce card. */
.kuhu-product-card-buy-now {
	min-width: 0;
	white-space: nowrap;
}

.kuhu-product-card-purchase {
	display: inline-flex;
	align-items: center;
	justify-content: flex-start;
	gap: 6px;
	max-width: 100%;
}

.kuhu-product-card-quantity {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 38px;
	border: 1px solid #d8dbe3;
	border-radius: 7px;
	background: #fff;
	overflow: hidden;
}

.kuhu-product-card-quantity-button {
	width: 28px;
	height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: #2b7fbd;
	cursor: pointer;
	font-size: 17px;
	font-weight: 700;
	line-height: 36px;
}

.kuhu-product-card-quantity-button:hover,
.kuhu-product-card-quantity-button:focus-visible {
	background: #f0f6fb;
}

.kuhu-product-card-quantity-input {
	width: 34px !important;
	height: 36px !important;
	margin: 0 !important;
	padding: 0 2px !important;
	border: 0 !important;
	background: #fff !important;
	box-shadow: none !important;
	color: #1f2937 !important;
	font-size: 13px !important;
	font-weight: 700;
	line-height: 36px !important;
	text-align: center;
	-moz-appearance: textfield;
}

.kuhu-product-card-quantity-input::-webkit-outer-spin-button,
.kuhu-product-card-quantity-input::-webkit-inner-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.kuhu-product-card-free-label {
	color: #16835f;
	font-size: 11px;
	font-weight: 700;
}

/* Keep the offer selector independent from WooCommerce's sorting control. */
.kuhu-product-card-offer-filter {
	display: flex;
	align-items: center;
	gap: 8px;
	margin: 0 0 16px;
	padding: 10px 12px;
	border: 1px solid #e2e5eb;
	border-radius: 8px;
	background: #fff;
}

.kuhu-product-card-offer-filter-label {
	color: #263244;
	font-size: 13px;
	font-weight: 700;
}

.kuhu-product-card-offer-filter-select {
	min-width: 185px;
	margin: 0;
	padding: 7px 28px 7px 9px;
	border: 1px solid #cfd5df;
	border-radius: 6px;
	background: #fff;
	color: #263244;
	font-size: 13px;
}

/* Offer information is intentionally shown on the single-product page only. */
.kuhu-product-single-offer {
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	margin: 16px 0;
	padding: 15px 17px;
	border: 2px solid #2b7fbd;
	border-left-width: 6px;
	border-radius: 10px;
	background: #fff;
	box-shadow: 0 4px 14px rgba(0, 0, 0, .15);
}

.kuhu-product-single-offer-title {
	margin: 0 0 8px;
	color: #102a43;
	font-size: 18px;
	font-weight: 800;
	line-height: 1.25;
}

.kuhu-product-single-offer-badge {
	display: inline-flex;
	align-items: center;
	min-height: 27px;
	padding: 5px 10px;
	border-radius: 999px;
	background: #d93663;
	box-shadow: 0 2px 5px rgba(0, 0, 0, .16);
	color: #fff !important;
	font-size: 11px;
	font-weight: 800;
	letter-spacing: .03em;
	line-height: 1.1;
	text-transform: uppercase;
}

.kuhu-product-single-offer-badge--short_sale {
	background: #c94e1a;
}

.kuhu-product-single-offer-badge--bulk_sale {
	background: #55319f;
}

.kuhu-product-single-offer-badge--any_offer {
	background: #08725f;
}

.kuhu-product-single-offer-details {
	margin: 12px 0 0;
	padding: 10px 12px;
	border: 1px solid #d3dfeb;
	border-radius: 7px;
	background: #f3f7fb;
	color: #142133;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.5;
}

.kuhu-product-single-offer-details-text {
	display: block;
	color: #142133;
	white-space: normal;
	overflow-wrap: anywhere;
}

@media (max-width: 700px) {
	.kuhu-product-card-offer {
		top: 7px;
		left: 7px;
		min-height: 26px;
		padding: 5px 7px;
		font-size: 8px;
	}

	.kuhu-product-card-purchase {
		gap: 4px;
	}

	.kuhu-product-card-quantity-button {
		width: 24px;
	}

	.kuhu-product-card-quantity-input {
		width: 28px !important;
	}

	.kuhu-product-card-offer-filter {
		align-items: stretch;
		flex-wrap: wrap;
	}

	.kuhu-product-card-offer-filter-select {
		flex: 1 1 180px;
		min-width: 0;
	}

	.kuhu-product-single-offer {
		padding: 11px 12px;
	}

	.kuhu-product-single-offer-title {
		font-size: 16px;
	}

	.kuhu-product-single-offer-details {
		font-size: 14px;
	}
}
