@use "@wordpress/base-styles/variables" as *;

.components-button-group {
	display: inline-block;

	.components-button {
		border-radius: 0;
		display: inline-flex;
		// Outline grouped buttons that do not have their own variant border.
		border-color: var(--wpds-color-stroke-interactive-neutral);

		& + .components-button {
			margin-left: -1px;
		}

		&:first-child {
			border-radius: $radius-small 0 0 $radius-small;
		}

		&:last-child {
			border-radius: 0 $radius-small $radius-small 0;
		}

		// The focused button should be elevated so the focus ring isn't cropped,
		// as should the active button, because it has a different border color.
		&:focus,
		&.is-primary {
			position: relative;
			z-index: 1;
		}
	}
}
