/* Tweak these to match the client's exact brand palette. */
.pfl-bundle-tiers-wrap {
	--pfl-accent: #c9a227;        /* gold accent */
	--pfl-accent-text: #c9a227;
	--pfl-card-bg: transparent;
	--pfl-card-border: rgba(201, 162, 39, 0.55);
	--pfl-card-active-bg: rgba(201, 162, 39, 0.12);
	--pfl-card-active-border: #c9a227;
	--pfl-text: inherit;
	--pfl-muted: rgba(120, 120, 120, 0.9);

	margin: 16px 0 20px;
}

.pfl-bundle-tiers {
	display: flex;
	flex-wrap: nowrap;
	gap: 10px;
	overflow-x: auto;
	padding-bottom: 6px;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: thin;
	scrollbar-color: var(--pfl-card-active-border) transparent;
}

.pfl-bundle-tiers::-webkit-scrollbar {
	height: 6px;
}

.pfl-bundle-tiers::-webkit-scrollbar-thumb {
	background: var(--pfl-card-border);
	border-radius: 3px;
}

.pfl-bundle-tiers--empty {
	font-size: 0.9em;
	color: var(--pfl-muted);
	font-style: italic;
	padding: 10px 0;
}

.pfl-tier-card {
	position: relative;
	display: flex;
	flex: 0 0 120px;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	background: var(--pfl-card-bg);
	border: 1.5px solid var(--pfl-card-border);
	border-radius: 6px;
	padding: 10px 8px 12px;
	cursor: pointer;
	text-align: center;
	transition: border-color 0.15s ease, background-color 0.15s ease, transform 0.1s ease;
	color: var(--pfl-text);
	font-family: inherit;
}

.pfl-tier-card:hover {
	border-color: var(--pfl-card-active-border);
	transform: translateY(-1px);
}

.pfl-tier-card--active {
	background: var(--pfl-card-active-bg);
	border-color: var(--pfl-card-active-border);
	box-shadow: 0 0 0 1px var(--pfl-card-active-border);
}

.pfl-tier-card__label {
	font-size: 0.78em;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	opacity: 0.85;
	line-height: 1.3;
}

.pfl-tier-card__price {
	font-size: 1.05em;
	font-weight: 700;
	color: var(--pfl-accent-text);
	margin-top: 2px;
}

.pfl-tier-card__unit {
	font-size: 0.72em;
	color: var(--pfl-muted);
}

.pfl-tier-card__badge {
	position: absolute;
	top: -9px;
	right: -6px;
	background: var(--pfl-accent);
	color: #1a1a1a;
	font-size: 0.65em;
	font-weight: 700;
	padding: 2px 6px;
	border-radius: 10px;
	white-space: nowrap;
}

@media (max-width: 480px) {
	.pfl-tier-card {
		flex-basis: 105px;
	}
}

/*
 * Mobile fix: on some Elementor single-product layouts, a parent
 * section/column has "Overflow: Hidden" set (Advanced > Layout), which
 * clips this row instead of letting it scroll, and can also clip the
 * quantity box + Add to Cart button that sit right below it if that
 * row isn't allowed to wrap on small screens.
 *
 * This re-opens overflow on ancestors of the tier wrap specifically
 * (not site-wide), and forces the qty/button row to wrap so nothing
 * gets pushed off-screen. Scoped to single-product pages only.
 */
@media (max-width: 767px) {
	body.single-product .pfl-bundle-tiers-wrap {
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		overflow: visible;
	}

	body.single-product .elementor-widget-container:has(.pfl-bundle-tiers-wrap),
	body.single-product .e-con:has(.pfl-bundle-tiers-wrap),
	body.single-product .elementor-column:has(.pfl-bundle-tiers-wrap),
	body.single-product .elementor-element:has(form.cart) {
		overflow: visible !important;
	}

	body.single-product .pfl-bundle-tiers {
		display: grid !important;
		grid-template-columns: repeat(2, 1fr) !important;
		gap: 10px !important;
		overflow: visible !important;
		overflow-x: visible !important;
		flex-wrap: unset !important;
		padding-bottom: 0 !important;
	}

	body.single-product .pfl-tier-card {
		flex: unset !important;
		width: 100% !important;
		box-sizing: border-box !important;
	}

	body.single-product form.cart {
		flex-wrap: wrap !important;
		overflow: visible !important;
		width: 100% !important;
		max-width: 100% !important;
	}

	body.single-product form.cart .quantity,
	body.single-product form.cart .single_add_to_cart_button {
		flex: 1 1 100%;
		width: 100%;
		max-width: 100%;
		box-sizing: border-box;
		margin-left: 0 !important;
		margin-right: 0 !important;
	}

	body.single-product form.cart .quantity {
		margin-bottom: 8px;
	}
}
