@import "popover-api";

// checkbox label
.#{$eps-prefix}popover {
	padding: $eps-popover-padding-block 0;
	background-color: var(--popover-background-color);
	box-shadow: var(--popover-box-shadow-size) var(--popover-box-shadow-color);
	list-style: none;
	display: flex;
	flex-direction: column;
	min-width: 120px;
	border-radius: $eps-popover-border-radius;
	position: absolute;
	z-index: $eps-zindex-popover;
	margin-block-start: $eps-popover-arrow-height;
	transform: translateX(-50%);
	inset-inline-start: px-to-rem(4);

	&__background {
		position: fixed;
		inset: 0;
		z-index: $eps-zindex-modal-backdrop;
	}

	&__container {
		position: relative;
	}

	&::before {
		content: "";
		display: block;
		position: absolute;
		width: $eps-popover-arrow-width;
		height: $eps-popover-arrow-height;
		margin: 0 $eps-popover-border-radius $eps-popover-arrow-height;
		inset-block-start: -$eps-popover-arrow-height;
		inset-inline-start: 50%;
		transform: translateX(-50%);
		border-color: transparent;
		border-style: solid;
		border-width: 0 calc(#{$eps-popover-arrow-width} / 2) $eps-popover-arrow-height calc(#{$eps-popover-arrow-width} / 2);
		border-block-end-color: var(--popover-arrow-color);
	}

	&--arrow-start {
		&::before {
			inset-inline-start: #{$eps-popover-border-radius};
			transform: none;
		}
	}

	&--arrow-end {
		&::before {
			inset-inline-start: auto;
			inset-inline-end: #{$eps-popover-border-radius};
			transform: none;
		}
	}

	&--arrow-none {
		&::before {
			display: none;
		}
	}

	&__item {
		padding: $eps-popover-item-spacing-y $eps-popover-item-spacing-x;
		background-color: var(--popover-item-background-color);
		color: var(--popover-item-color);
		font-size: $eps-popover-item-font-size;
		font-weight: $eps-popover-font-weight;
		line-height: $eps-popover-item-line-height;
		width: 100%;
		align-items: center;
		cursor: pointer;

		&:hover {
			color: var(--popover-item-hover-color);
		}

		&--danger {
			&:hover {
				color: var(--popover-item-danger-hover-color);
			}
		}

		.#{$eps-prefix}icon {
			font-size: inherit;
			margin-inline-end: spacing(5);
		}
	}
}
