/**
 * Flash Promo - scheduled campaign styles.
 *
 * Colours arrive as custom properties set inline from the settings. Same
 * conventions as flash-promo.css: namespaced selectors, low specificity.
 */

.flash-campaign-bar,
.flash-campaign-price,
.flash-campaign-badge {
	--flash-campaign-bg: #000000;
	--flash-campaign-text: #ffffff;
	--flash-campaign-accent: #f59e0b;
}

[data-flash-campaign][hidden] {
	display: none;
}

/* --- Bar above the header --------------------------------------------- */

.flash-campaign-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 2px 14px;
	padding: 9px 16px;
	background: var(--flash-campaign-bg);
	color: var(--flash-campaign-text);
	/* A hairline in the text colour: keeps the bar apart from a header of
	   the same colour, and all but disappears on a light one. */
	box-shadow: inset 0 -1px 0 color-mix(in srgb, var(--flash-campaign-text) 14%, transparent);
	font-size: 14px;
	line-height: 1.4;
	text-align: center;
	text-decoration: none;
}

a.flash-campaign-bar:hover,
a.flash-campaign-bar:focus {
	color: var(--flash-campaign-text);
	text-decoration: none;
}

.flash-campaign-bar .flash-campaign__name {
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

.flash-campaign-bar .flash-campaign__name,
.flash-campaign-bar .flash-campaign__discount {
	color: var(--flash-campaign-accent);
	font-weight: 800;
}

.flash-campaign-bar__cta {
	font-weight: 700;
	white-space: nowrap;
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* --- Campaign price on the product page --------------------------------- */

.flash-campaign-price {
	margin: 12px 0 18px;
	padding: 14px 18px;
	border-radius: 12px;
	background: var(--flash-campaign-bg);
	color: var(--flash-campaign-text);
	line-height: 1.3;
}

.flash-campaign-price__head {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 6px 10px;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.flash-campaign-price .flash-campaign__name {
	color: var(--flash-campaign-accent);
	font-weight: 800;
}

.flash-campaign-price__badge {
	background: var(--flash-campaign-accent);
	color: var(--flash-campaign-bg);
	font-weight: 800;
	padding: 2px 9px;
	border-radius: 999px;
	letter-spacing: 0;
}

.flash-campaign-price__amount {
	margin: 6px 0 2px;
	font-size: 26px;
	font-weight: 700;
}

.flash-campaign-price__amount .amount {
	color: inherit;
}

.flash-campaign-price__note {
	font-size: 13px;
	opacity: 0.8;
}

.flash-campaign-price__note .flash-campaign__discount {
	color: inherit;
}

/* --- Badges: product cards and category tiles --------------------------- */

/* Accent background with the background colour as text: the same pairing as
   the "-25%" on the product page, and dark text on an orange accent reads
   far better than white. */
/* inline-block, not flex: in a flex box the text between the placeholders
   becomes separate items, and "-" drifts away from "25%". */
.flash-campaign-badge {
	display: inline-block;
	background: var(--flash-campaign-accent);
	color: var(--flash-campaign-bg);
	font-size: 11px;
	font-weight: 800;
	line-height: 1.2;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	padding: 4px 8px;
	border-radius: 3px;
	white-space: nowrap;
}

.flash-campaign-badge .flash-campaign__name,
.flash-campaign-badge .flash-campaign__discount {
	color: inherit;
	font-weight: inherit;
}

/* Bottom-left of the product image, next to the title and price. The top
   corners are where themes put their own labels (sale, warranty): there,
   on a four-column grid, two labels end up touching. */
.flash-campaign-badge--card {
	position: absolute;
	bottom: 8px;
	left: 0;
	z-index: 3;
	pointer-events: none;
	/* On the cards the text takes the campaign text colour (white on
	   faradshop.in), as the shop asked; tiles keep the dark pairing. */
	color: var(--flash-campaign-text);
}

/* Inside a tile laid out as a flex column, fit-content keeps the badge a
   pill instead of a full-width stripe, and lets the tile's own alignment
   (left or right) place it. */
.flash-campaign-badge--category {
	width: fit-content;
	margin-bottom: 14px;
	font-size: 14px;
	padding: 7px 14px;
	border-radius: 4px;
}

@media (max-width: 600px) {
	/* Every line counts above the header on a phone: one flowing line of
	   text, and since the whole bar is the link the arrow alone is enough
	   of a cue. */
	.flash-campaign-bar {
		display: block;
		font-size: 13px;
		padding: 8px 12px;
	}

	.flash-campaign-bar__cta {
		margin-left: 6px;
		text-decoration: none;
	}

	.flash-campaign-bar__cta-label {
		display: none;
	}

	.flash-campaign-price__amount {
		font-size: 22px;
	}
}
