.fm-qp-tier-selector {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: 1rem 0;
	color: #222;
}

/* Replace the main price in classic WooCommerce and Elementor product templates. */
.single-product div.product:has(.fm-qp-tier-selector:not([hidden])) .summary > .price,
.single-product div.product:has(.fm-qp-tier-selector:not([hidden])) .elementor-widget-woocommerce-product-price,
.single-product div.product:has(.fm-qp-tier-selector:not([hidden])) .woocommerce-variation-price .price {
	display: none !important;
}

.single-product div.product .fm-qp-tier-selector {
	margin: .5rem 0 1rem;
}

.fm-qp-tier-selector,
.fm-qp-tier-selector * {
	box-sizing: border-box;
}

.fm-qp-tier-selector h3 {
	margin: 0 0 .75rem;
	font-size: 1.1rem;
}

.fm-qp-tier-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: .75rem;
}

.fm-qp-tier-card {
	position: relative;
	display: flex;
	min-width: 0;
	flex-direction: column;
	align-items: flex-start;
	gap: .35rem;
	width: 100%;
	padding: 1rem;
	border: 1px solid #d7d7d7;
	border-radius: 8px;
	background: #fff;
	color: #222;
	text-align: left;
	cursor: pointer;
	transition: border-color .15s ease, box-shadow .15s ease, background-color .15s ease;
}

.fm-qp-tier-card:hover,
.fm-qp-tier-card:focus-visible,
.fm-qp-tier-card.is-selected {
	border-color: #df5b17;
	box-shadow: 0 0 0 2px rgb(223 91 23 / 16%);
	outline: none;
}

.fm-qp-tier-card.is-selected {
	background: #fff8f3;
}

.fm-qp-tier-card-best {
	border-color: #df5b17;
}

.fm-qp-tier-badge {
	align-self: flex-start;
	padding: .2rem .45rem;
	border-radius: 3px;
	background: #df5b17;
	color: #fff;
	font-size: .75rem;
	font-weight: 700;
}

.fm-qp-tier-label {
	font-size: 1.05rem;
	font-weight: 700;
	overflow-wrap: anywhere;
}

.fm-qp-tier-detail {
	color: #555;
	font-size: .88rem;
	overflow-wrap: anywhere;
}

.fm-qp-tier-unit {
	font-weight: 700;
}

.fm-qp-tier-total {
	font-size: .9rem;
	overflow-wrap: anywhere;
}

.fm-qp-tier-saving {
	color: #b64310;
	font-size: .85rem;
	font-weight: 700;
}

.fm-qp-tier-stock-note {
	margin: .65rem 0 0;
	color: #b42318;
	font-weight: 700;
}

.fm-qp-tier-admin-note {
	margin: .75rem 0 0;
	padding: .75rem .9rem;
	border-left: 4px solid #df5b17;
	border-radius: 4px;
	background: #fff8f3;
	color: #8f390d;
	font-size: .85rem;
	font-weight: 700;
	line-height: 1.5;
}

.fm-qp-tier-note {
	margin: .65rem 0 0;
	color: #555;
	font-size: .82rem;
}

.fm-qp-tier-selector-empty {
	padding: .5rem 0;
}

.fm-qp-loop-prices {
	width: 100%;
	max-width: 100%;
	min-width: 0;
	margin: .75rem 0 .9rem;
	padding: 0;
	color: #222;
	font-size: .9rem;
	line-height: 1.4;
}

.fm-qp-loop-prices,
.fm-qp-loop-prices * {
	box-sizing: border-box;
}

.fm-qp-loop-prices-title {
	margin: 0 0 .55rem;
	font-size: 1rem;
	font-weight: 700;
}

.fm-qp-loop-prices-list {
	display: grid !important;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	grid-auto-flow: row !important;
	align-items: stretch;
	gap: .35rem;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
}

.fm-qp-loop-prices-row {
	position: relative;
	display: flex;
	float: none !important;
	min-width: 0;
	width: auto !important;
	flex-direction: column;
	align-items: flex-start;
	gap: .3rem;
	clear: none !important;
	margin: 0 !important;
	padding: .55rem .4rem;
	border: 1px solid #d7d7d7;
	border-radius: 9px;
	background: #fff;
	text-align: left;
	box-shadow: 0 2px 7px rgb(0 0 0 / 6%);
}

.fm-qp-loop-prices-row-best {
	border: 2px solid #df5b17;
	background: #fff8f3;
	box-shadow: 0 3px 10px rgb(223 91 23 / 14%);
}

.fm-qp-loop-prices-badge {
	display: inline-block;
	max-width: 100%;
	padding: .2rem .38rem;
	border-radius: 4px;
	background: #df5b17;
	color: #fff;
	font-size: .6rem;
	font-weight: 800;
	line-height: 1.25;
	overflow-wrap: anywhere;
}

.fm-qp-loop-prices-label {
	display: block;
	font-size: .85rem;
	font-weight: 800;
	line-height: 1.2;
}

.fm-qp-loop-prices-value {
	display: block;
	width: 100%;
	min-width: 0;
	text-align: left;
}

.fm-qp-loop-prices-value strong {
	display: block;
	font-size: clamp(.72rem, .45rem + .35vw, .92rem);
	font-weight: 800;
	line-height: 1.25;
	color: #222;
	overflow-wrap: anywhere;
}

.fm-qp-loop-prices-value small {
	display: block;
	margin-top: .2rem;
	font-size: .68rem;
	line-height: 1.3;
}

.fm-qp-loop-prices-saving {
	color: #b64310;
	font-weight: 700;
}

.fm-qp-tier-selector[hidden] {
	display: none !important;
}

/* Center and widen a lone product in the shop grid; leave multi-product grids untouched. */
.woocommerce ul.products > li.product:only-child,
.woocommerce-page ul.products > li.product:only-child,
.woocommerce-shop .wc-block-product-template > .wc-block-product:only-child,
.woocommerce-page .wc-block-product-template > .wc-block-product:only-child {
	box-sizing: border-box;
	grid-column: 1 / -1;
	float: none !important;
	clear: none !important;
	width: 100% !important;
	max-width: 760px !important;
	margin-right: auto !important;
	margin-left: auto !important;
}

@media (max-width: 640px) {
	.fm-qp-tier-grid {
		grid-template-columns: 1fr;
	}

	.fm-qp-loop-prices-row {
		padding: .6rem .45rem;
		gap: .25rem;
	}

	.fm-qp-loop-prices-list {
		grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
		gap: .25rem;
	}

	.fm-qp-loop-prices-label {
		font-size: .76rem;
	}

	.fm-qp-loop-prices-value strong {
		font-size: .68rem;
	}

	.fm-qp-loop-prices-value small {
		font-size: .62rem;
	}
}
