@use "../../tokens/variables";

/* Patterns - Numbers - Icon Badge */
////
/// @group Patterns-Icon_Badge
/// Patterns - Numbers - Icon Badge

///
.icon-badge {
	// ─── Component CSS API ─────────────────────────────────────────────
	--osui-icon-badge-ring-color: #{variables.$token-border-subtlest};
	--osui-icon-badge-shadow: 0 0 0 1px var(--osui-icon-badge-ring-color);
	// ───────────────────────────────────────────────────────────────────

	display: inline-block;
	position: relative;

	.badge {
		position: absolute;
		top: 0;
		right: 0;
		left: auto;

		align-items: center;
		border-radius: var(--border-radius-rounded);
		box-shadow: var(--osui-icon-badge-shadow);
		display: inline-flex;
		font-size: variables.$token-font-size-250;
		font-weight: variables.$token-font-weight-bold;
		height: variables.$token-scale-400;
		justify-content: center;
		min-width: variables.$token-scale-400;
		padding-block: variables.$token-scale-0;
		padding-inline: variables.$token-scale-100;
		transform: translate(50%, -50%);
		white-space: nowrap;

		[data-expression] {
			white-space: nowrap;
		}
	}

	.icon {
		font-size: variables.$token-font-size-550;
	}

	div:first-child:empty {
		// Service Studio Preview
		& {
			-servicestudio-height: 30px;
			-servicestudio-width: 30px;
		}
	}
}

///
.layout-native {
	.bottom-bar-wrapper {
		.icon-badge .icon {
			font-size: inherit;
		}
	}
}
