@import "./global/colors.css";

:root {

	@media ( min-width: 768px ) {
		--ep-range-slider-thumb-size: 1.25em;
		--ep-range-slider-track-size: 0.5em;
	}
}

.widget_ep-facet,
.wp-block-elasticpress-facet {

	& input[type="search"] {
		margin-bottom: 1rem;
	}

	& .searchable .inner {
		max-height: 20em;
		overflow: scroll;
	}

	& .term.hide {
		display: none;
	}

	& .empty-term {
		opacity: 0.5;
		position: relative;
	}

	& .empty-term::after {
		bottom: 0;
		content: " ";
		display: block;
		left: 0;
		position: absolute;
		right: 0;
		top: 0;
		width: 100%;
		z-index: 2;
	}

	& .level-1 {
		padding-left: 20px;
	}

	& .level-2 {
		padding-left: 40px;
	}

	& .level-3 {
		padding-left: 60px;
	}

	& .level-4 {
		padding-left: 80px;
	}

	& .level-5 {
		padding-left: 100px;
	}

	& input[disabled] {
		cursor: pointer;
		opacity: 1;
	}

	& .term a {
		align-items: center;
		display: flex;
		position: relative;
	}

	& .term a:hover .ep-checkbox {
		background-color: var(--ep-c-white-gray);
	}
}

.ep-checkbox {
	align-items: center;
	background-color: var(--ep-c-medium-white);
	display: flex;
	flex-shrink: 0;
	height: 1em;
	justify-content: center;
	margin-right: 0.25em;
	width: 1em;
}

.ep-checkbox::after {
	border: solid #fff;
	border-width: 0 0.125em 0.125em 0;
	content: "";
	display: none;
	height: 0.5em;
	transform: rotate(45deg);
	width: 0.25em;
}

.ep-checkbox.checked {
	background-color: var(--ep-c-medium-gray);
}

.ep-checkbox.checked::after {
	display: block;
}

.ep-range-facet {
	align-items: center;
	display: grid;
	grid-template-columns: 1fr max-content;
}

.ep-range-facet__slider {
	grid-column: 1 / -1;
}

.ep-range-facet__actions {
	justify-content: end;
}

.ep-range-slider {
	align-items: center;
	display: flex;
	margin: 0.5em 0;
	min-height: var(--ep-range-slider-thumb-size);
}

.ep-range-slider__track {
	background: var(--ep-c-medium-white);
	border-radius: calc(var(--ep-range-slider-track-size) / 2);
	height: var(--ep-range-slider-track-size);
}

.ep-range-slider__track-1 {
	background-color: currentcolor;
}

.ep-range-slider__thumb {
	background-color: currentcolor;
	border-radius: calc(var(--ep-range-slider-thumb-size) / 2);
	box-shadow:
		inset 0 0 0 calc(var(--ep-range-slider-thumb-size) / 10) currentcolor,
		inset 0 0 0 calc((var(--ep-range-slider-thumb-size) - var(--ep-range-slider-track-size)) / 2) var(--ep-c-white);
	height: var(--ep-range-slider-thumb-size);
	width: var(--ep-range-slider-thumb-size);
}

.ep-facet-date-option {

	& label {
		align-items: center;
		display: flex;

		& .ep-radio {
			appearance: none;
			border: 1px solid var(--ep-c-medium-white);
			border-radius: 50%;
			height: 1em;
			margin-right: 0.25em;
			outline: transparent;
			position: relative;
			width: 1em;

			&:checked {
				background-color: transparent;
				border: 5px solid var(--ep-c-medium-gray);

				&::after {
					opacity: 0;
				}
			}
		}
	}
}

.ep-date-range-picker {
	column-gap: 1rem;
	display: grid;
	grid-template-columns: 1fr 1fr;
	margin-top: 1rem;

	&.is-hidden {
		display: none;
	}

	& label {
		margin-right: 0.5rem;
	}
}

.ep-date-range-picker__from,
.ep-date-range-picker__to {
	align-items: baseline;
	display: grid;
	grid-template-columns: max-content 1fr;
}

.ep-date-range-picker__action {
	grid-column: 1 / -1;
	text-align: right;
}

.ep-facet-date-form__action {
	align-items: center;
	display: flex;
	gap: 1.5rem;
	margin-top: 0.75rem;
}
