
@use 'mixins.scss';
@use 'common.scss';

div.dt-buttons {
	div.btn-group {
		position: initial;
	}

	span.caret {
		margin-left: 0.5em;
	}

	span.dt-button-spacer {
		float: left;
		font-size: 1rem;
		padding-top: 4px;

		&.empty {
			margin: 2px;
		}

		&.bar {
			&:empty {
				height: inherit;
			}
		}
	}

	.btn.processing {
		@include mixins.dtb-processing();
	}

	div.dt-button-split {
		button:last-child span {
			margin-left: 0 !important;
			overflow: visible;
		}
	}
}

div.dt-button-collection {
	position: absolute;
	min-width: 200px;
	margin-top: 3px;
	z-index: 2002;

	// Need to move the dropdown styling to the container to allow for the title
	background-color: #fff;
	border: 1px solid rgba(0,0,0,.15);
	border-radius: 4px;
	box-shadow: 0 6px 12px rgba(0,0,0,.175);

	div.dt-button-collection-title {
		padding: 0.75em 0 0.25em;
	}

	.dropdown-menu {
		position: relative;
		margin-top: 4px;
		display: block;
		width: 100%;

		// Moved to collection container
		background-color: transparent;
		border: none;
		border-radius: 0;
		box-shadow: none;

		li {
			position: relative;

			span.caret {
				position: absolute;
				right: 9px;
				top: 14px;
			}
		}

		div.dt-button-split {
			display: flex;
			flex-direction: row;
			flex-wrap: wrap;
			justify-content: flex-start;
			align-content: flex-start;
			align-items: stretch;

			> *:first-child {
				min-width: auto;
				flex: 1 0 50px;
				padding: 3px 5px 3px 20px;

				a {
					color: #333;
					text-decoration: none;
				}

				&:hover {
					color: #262626;
					background-color: #f5f5f5;
				}
			}

			button:last-child {
				min-width: 33px;
				flex: 0;
				background: transparent;
				border: none;
				line-height: 1rem;
				color: rgb(33, 37, 41);
				padding: 0 16px;
				overflow: visible;

				&:hover {
					color: #16181b;
					background-color: #f8f9fa;
				}
			}
		}
	}

	@include mixins.dtb-fixed-collection();
}

div.dt-button-background {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	z-index: 999;
}

@media screen and (max-width: 767px) {
	div.dt-buttons {
		float: none;
		width: 100%;
		text-align: center;
		margin-bottom: 0.5em;

		a.btn {
			float: none;
		}
	}
}
