/* ── Badge container ─────────────────────────────────────────────────── */

.tdb-badge {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;           /* overridden by inline style from settings */
	vertical-align: middle;
}

.tdb-badge--inline {
	margin-left: 0.4em;
}

/* ── Price wrap (groups range spans into one flex item in block mode) ─── */

.tdb-price-wrap {
	display: inline;
}

/* ── Block layout (badge below the original price) ───────────────────── */

/*
 * Force the .price wrapper to stack when the badge is in block mode.
 * :has() covers both <span class="price"> (archive/shortcode) and
 * <p class="price"> (single product), regardless of Blocksy's flex overrides.
 * Fallback for browsers without :has(): display:block on the badge itself.
 */
.price:has(.tdb-badge--block) {
	display: flex !important;
	flex-direction: column !important;
	align-items: flex-start !important;
}

.tdb-badge--block {
	display: flex;       /* must stay flex so gap works; block-level flex still breaks to its own line */
	width: fit-content;
	margin-left: 0;
	margin-top: 0.3em;   /* overridden by inline style from settings */
}

/* ── [icon][label] tag group ─────────────────────────────────────────── */

.tdb-badge__tag {
	display: inline-flex;
	align-items: stretch;
	border: 1.5px solid;   /* border-color set by inline style (icon_bg) */
	border-radius: 3px;
	overflow: hidden;
	line-height: 1;
}

.tdb-badge__icon {
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0.3em 0.35em;
	line-height: 1;
	font-size: var(--tdb-icon-size, 1.2em);
}

.tdb-badge__icon svg {
	display: block;
	width: 1em;
	height: 1em;
	flex-shrink: 0;
}

.tdb-badge__label {
	display: flex;
	align-items: center;
	padding: 0.3em 0.5em;
	font-size: var(--tdb-label-size, 0.75em);
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	white-space: nowrap;
}

/* ── Price amount ────────────────────────────────────────────────────── */

.tdb-badge__price {
	font-size: var(--tdb-price-size, 1em);
	font-weight: 600;
	white-space: nowrap;
}

.tdb-badge__prefix {
	font-weight: 400;
	opacity: 0.8;
	margin-right: 0.15em;
}
