/**
 * Sale discount indicators — red badges and % OFF only; selling price stays theme default.
 *
 * @package techmarket-child
 */

:root {
	--ac-price-discount: #e11d48;
	--ac-price-discount-dark: #be123c;
	--ac-price-discount-bg: #fee2e2;
	--ac-price-sale: #2b67f6;
	--ac-price-mrp: #1a1a1a;
	--ac-price-mrp-muted: #1a1a1a;
	--ac-price-save: #198754;
	--ac-price-save-bg: #e6f4ea;
	--ac-price-save-border: #bbf7d0;
}

/* ── % OFF pills (stacked price layout) ── */

.altctrl-product-card__price-discount,
.altctrl-daily-deals__price-discount,
.altctrl-recently-viewed__price-discount,
.altctrl-related-card__price-discount,
.altctrl-single-product__price-discount {
	color: var(--ac-price-discount);
	background: var(--ac-price-discount-bg);
}

/* ── Sale / discount corner badges ── */

body.altctrl-deals-archive .altctrl-deal-card .onsale,
body.altctrl-deals-archive .altctrl-deal-card .altctrl-deals-save-badge,
.altctrl-daily-deals__discount-badge,
.altctrl-daily-deals__product-badge,
.single-product .product-images-wrapper .onsale,
body.altctrl-single-product-page.single-product .tm-related-products-carousel .onsale {
	background: var(--ac-price-discount-bg) !important;
	color: var(--ac-price-discount) !important;
}

/*
 * Techmarket hides .onsale on .product:hover. Keep discount badges visible
 * in the same corner during desktop hover without changing other hover UI.
 */
.products .product:hover .onsale,
.products .product:hover .altctrl-deals-save-badge,
.altctrl-deal-card:hover .onsale,
.altctrl-deal-card:hover .altctrl-deals-save-badge,
.altctrl-product-card:hover .onsale,
.altctrl-daily-deals__card:hover .altctrl-daily-deals__discount-badge,
.altctrl-daily-deals__card:hover .altctrl-daily-deals__product-badge,
.altctrl-recently-viewed__card:hover .onsale {
	display: inline-flex !important;
	visibility: visible !important;
	opacity: 1 !important;
	z-index: 8 !important;
	pointer-events: none;
}

/* ── Single product price stack layout (no colour overrides) ── */

.altctrl-purchase-block .altctrl-single-product__price {
	margin: 0 0 1rem;
}

.altctrl-single-product__price-stack {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 0.25rem;
}

.altctrl-single-product__price-stack:has(.altctrl-single-product__price-original) .altctrl-single-product__price-current,
.altctrl-single-product__price-stack:not(:has(.altctrl-single-product__price-original)) .altctrl-single-product__price-current {
	color: var(--ac-price-sale);
	font-weight: 800;
}

.altctrl-single-product__price-original,
.altctrl-single-product__price-original .woocommerce-Price-amount,
.altctrl-single-product__price-original .amount {
	display: block;
	color: var(--ac-price-mrp);
	font-size: clamp(0.9375rem, 2vw, 1.0625rem);
	font-weight: 400;
	line-height: 1.2;
	text-decoration: line-through;
}

.altctrl-single-product__price-discount {
	font-size: 0.8125rem;
	font-weight: 600;
}

/* ── Global MRP / regular price strikethrough ── */

.altctrl-product-card__price-original,
.altctrl-product-card__price-original .woocommerce-Price-amount,
.altctrl-product-card__price-original .amount,
.altctrl-daily-deals__price-original,
.altctrl-daily-deals__price-original .woocommerce-Price-amount,
.altctrl-daily-deals__price-original .amount,
.altctrl-recently-viewed__price-original,
.altctrl-recently-viewed__price-original .woocommerce-Price-amount,
.altctrl-recently-viewed__price-original .amount {
	text-decoration: line-through;
}

.woocommerce .price del,
.woocommerce .price del .amount,
.woocommerce .price del .woocommerce-Price-amount,
.woocommerce .price del bdi,
.woocommerce del .amount,
.woocommerce del .woocommerce-Price-amount,
.woocommerce del bdi,
.single-product .product-actions .price del,
.single-product .product-actions .price del .amount,
body.altctrl-single-product-page.single-product .price del,
body.altctrl-single-product-page.single-product .price del .amount,
body.altctrl-cart-page .product-price del,
body.altctrl-cart-page .product-subtotal del,
.woocommerce-checkout .altctrl-checkout-order__price del,
.woocommerce-checkout .altctrl-cart-table .product-price del,
.woocommerce-checkout .altctrl-cart-table .product-subtotal del,
.woocommerce-table--order-details .product-total del,
.woocommerce-order .woocommerce-table--order-details .product-total del,
body.altctrl-myaccount-page .woocommerce-table--order-details .product-total del,
body.woocommerce-view-order .woocommerce-table--order-details .product-total del,
body.woocommerce-order-received .woocommerce-table--order-details .product-total del,
.altctrl-wishlist .wishlist_table .product-price del,
.widget_shopping_cart .product_list_widget del,
.woocommerce-mini-cart-item del {
	color: var(--ac-price-mrp-muted);
	font-weight: 400;
	text-decoration: line-through;
}

.woocommerce .price ins,
.woocommerce .price ins .amount,
.woocommerce .price ins .woocommerce-Price-amount,
.woocommerce ins,
.woocommerce ins .amount,
.woocommerce ins .woocommerce-Price-amount {
	text-decoration: none;
}

/* ── Stacked line-item prices (cart, checkout, orders) ── */

.altctrl-line-price-stack {
	display: inline-flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 0.125rem;
	text-align: right;
}

.altctrl-line-price-stack__current,
.altctrl-line-price-stack__current .amount,
.altctrl-line-price-stack__current .woocommerce-Price-amount {
	text-decoration: none;
}

.altctrl-line-price-stack__original,
.altctrl-line-price-stack__original .amount,
.altctrl-line-price-stack__original .woocommerce-Price-amount {
	color: var(--ac-price-mrp-muted);
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.2;
	text-decoration: line-through;
}

body.altctrl-cart-page .altctrl-cart-table .product-price .altctrl-line-price-stack,
body.altctrl-cart-page .altctrl-cart-table .product-subtotal .altctrl-line-price-stack,
.woocommerce-checkout .altctrl-checkout-order__price .altctrl-line-price-stack,
.woocommerce-table--order-details .product-total .altctrl-line-price-stack {
	align-items: flex-start;
	text-align: left;
}

@media (max-width: 768px) {
	body.altctrl-cart-page .altctrl-cart-table .product-price .altctrl-line-price-stack,
	body.altctrl-cart-page .altctrl-cart-table .product-subtotal .altctrl-line-price-stack {
		align-items: flex-end;
		text-align: right;
	}
}
