/*
 * Sale bar and sale prices. Colors from PBF's theme variables where they exist; site tweaks go in the child theme.
 * --sale-red and --sale-highlight can be set per site (e.g. in :root of the child theme).
 */

/* Dark band at the very top (heading color, so it stands out from colored headers). */
.sale-bar {
	padding: 15px 0; /* on the bar, not the inner box: PBF's .wpbf-container loads later and resets its padding */
	background: var(--brand-color, #1e3148);
	color: #fff;
	font-size: 16px;
	line-height: 1.4;
}

.sale-bar-inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 10px 20px;
	text-align: center;
}

.sale-bar-message {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-weight: 700;
}

/* Lightning bolt in front of the text. */
.sale-bar-icon {
	flex: none;
	width: 22px;
	height: 22px;
	color: var(--sale-highlight, #facc15);
}

/* Time left as a soft pill. */
.sale-bar-countdown {
	padding: 5px 12px;
	border-radius: 100px;
	background: rgba(255, 255, 255, .12);
	font-size: 15px;
	font-variant-numeric: tabular-nums; /* digits don't jump while counting */
}

/* Small phones: countdown and button share one row under the text. */
@media screen and (max-width: 480px) {
	.sale-bar-inner {
		gap: 10px;
	}

	.sale-bar-countdown {
		padding: 5px 10px;
		font-size: 14px;
	}
}

/* Small button: beats the theme's own .wpbf-button padding, which also overrides wpbf-button-small. */
.sale-bar-link.wpbf-button {
	padding: 8px 18px;
	font-size: 14px;
	line-height: 1.4;
}

/* Countdown tiles ([sale_countdown style="tiles"]): see-through boxes in the surrounding text color, so they fit dark and light sections. */
.sale-tiles {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 10px;
}

.sale-tile {
	min-width: 110px;
	padding: 20px 15px;
	border-radius: var(--radius, 10px);
	background: color-mix(in srgb, currentColor 12%, transparent);
	font-size: 15px;
	line-height: 1.3;
	text-align: center;
}

.sale-tile-number {
	display: block;
	font-size: 44px;
	font-weight: 700;
	font-variant-numeric: tabular-nums; /* digits don't jump while counting */
	line-height: 1.1;
}

@media screen and (max-width: 480px) {
	.sale-tile {
		min-width: 70px;
		padding: 15px 10px;
		font-size: 14px;
	}

	.sale-tile-number {
		font-size: 28px;
	}
}

/*
 * Struck-through regular price during the sale, smaller than the sale price next to it (.43em: 24px next to a 56px price).
 * s + class beats a theme's price class whatever the file order.
 */
s.sale-strike {
	color: var(--sale-red, #e11d48);
	font-size: .43em;
	font-weight: 400;
	letter-spacing: normal;
	opacity: 1;
}
