/*---------------------------
	Search
		- Live search
		- Search wrapper
		- Search button
		- Search toggle
		- Search dropdown
		- Fullscreen type
		- Dropdown position
		- Compativility with elementor

---------------------------*/
// Live search
.live-search-list {
	position: absolute;
	margin-top: 3px;
	left: 0;
	top: 100%;
	right: 0;
	box-shadow: 0 2px 35px rgba(0, 0, 0, 0.1);
	font-size: 1.3rem;
	font-weight: 400;
	letter-spacing: 0;
	background: var(--alpha-change-color-light-1);
	z-index: 1058;

	.autocomplete-suggestions {
		max-height: 272px;
		margin: .5rem 2rem;
		overflow-y: scroll;

		&::-webkit-scrollbar {
			width: 6px;
		}

		&::-webkit-scrollbar-thumb {
			background: rgba(#c2c2c2, 0.3);
			border-radius: var(--alpha-corner-md);
		}
	}

	.autocomplete-suggestion {
		position: relative;
		display: flex;
		align-items: center;
		padding: 1.5rem 0;
		border-bottom: 1px solid var(--alpha-change-border-color-light);
		cursor: pointer;
		transition: padding-#{$left} .3s;

		&:last-child {
			border-bottom: none;
		}
	}

	.search-name {
		color: var(--alpha-change-color-dark-1);
		word-break: break-word;
		transition: color .3s;
	}

	.search-info:hover .search-name {
		color: var(--alpha-primary-color);
	}

	.search-price {
		color: var(--alpha-change-color-dark-1);
		font-size: 1.5rem;

		del {
			margin-#{$left}: 5px;
			color: var(--alpha-grey-color);
		}

		ins {
			font-weight: 600;
			text-decoration: none;
		}
	}

	img {
		max-width: 60px;
		margin-#{$right}: 15px;
	}

	.search-wrapper & .d-loading {
		position: static;
		min-height: 80px;
		background: var(--alpha-change-color-light-1);
	}

	.search-info {
		text-align: left;
	}

	.autocomplete-selected {
		padding-#{$left}: 10px;
	}

	.autocomplete-selected .search-name {
		color: var(--alpha-primary-color);
	}

	.autocomplete-selected storng {
		font-weight: 700;
	}
}

// Search wrapper
.search-wrapper {
	position: relative;
	width: 100%;

	.input-wrapper {
		display: flex;
		position: relative;
	}

	input.form-control {
		padding: 1.1rem 1.9rem;
		border: none;
		color: inherit;
		letter-spacing: inherit;
	}

	form:first-child {
		border: 1px solid var(--alpha-change-border-color);
	}

	.btn-search {
		padding: 0;
		min-width: 4rem;
		background-color: transparent;
		border: 0;

		i {
			display: block;
			margin: 0;
		}
	}

	.select-box {
		select {
			max-width: 100%;
			width: 100%;
			padding: side-values(0 43px 0 15px);
			border: 0;
			z-index: 1;
			background: none !important;
		}

		&:before {
			content: '\e910';
			font-family: $framework-font;
			font-size: .8em;
			position: absolute;
			#{$right}: 10px;
			top: calc(50% + 1px);
			transform: translateY(-50%);
		}

		&:after {
			content: '';
			height: calc(100% - 10px);
			width: 1px;
			background: var(--alpha-change-border-color);
			position: absolute;
			#{$right}: -2px;
			top: 5px;
		}
	}

	&.hs-overlap {
		position: static;

		form {
			position: absolute;
			align-items: center;
			left: 0;
			right: 0;
			top: 0;
			bottom: 0;
			background-color: var(--alpha-white-color);
			padding: 0 3rem;
			opacity: 0;
			visibility: hidden;
			transition: opacity .3s, visibility .3s;

			&:before {
				content: '';
				position: absolute;
				left: 3rem;
				right: 3rem;
				bottom: 0;
				height: 2px;
				background-color: var(--alpha-change-border-color-light);
				transform: scale(0, 1);
				transition: transform .8s;
			}
		}

		input[type=search].form-control {
			max-width: calc(100% - 70px);
			padding-#{$left}: 1rem;
			transform: scale(0, 1);
			transition: transform .8s;
			font-size: var(--alpha-body-font-size);
			color: $grey-color-light;
		}

		.btn-search {
			display: none;
		}

		&.show {
			form {
				opacity: 1;
				visibility: visible;
			}

			form:before,
			input[type=search] {
				transform: scale(1, 1);
			}
		}
	}

	.hs-close {
		position: absolute;
		top: 50%;
		transform: translateY(-50%);
		right: 5rem;
		opacity: 0;
		visibility: hidden;
		transition: opacity 0.8s cubic-bezier(0.2, 1, 0.3, 1);

		a {
			position: absolute;
			right: 0;
			top: 0;
			display: block;
			line-height: 22px;
			z-index: 10;

			&:before {
				content: '';
				position: absolute;
				top: 0;
				left: 50%;
				display: block;
				transform: scale(0) translateZ(0);
				transition: all 0.6s cubic-bezier(.15, 0.2, .1, 1);
			}
		}

		.close-wrap {
			position: absolute;
			top: 0;
			left: 50%;
			transform: translateX(-50%) translateY(-50%) translateZ(0);
			transform-style: preserve-3d;
			transition: margin .2s ease, transform .2s ease 1s, opacity .3s ease;
			width: 20px;
			height: 20px;
			display: block;
			overflow: hidden;
		}

		.close-line {
			position: absolute;
			height: 100%;
			width: 1px;
			background: var(--alpha-change-color-light-1);
			backface-visibility: hidden;
			border-radius: var(--alpha-corner-md);
			left: 9px;
			background-color: #000;
			transition: opacity 0.2s ease, background-color 0.2s ease;
			animation-duration: .4s;
			animation-timing-function: cubic-bezier(0.52, 0.01, 0.16, 1);
			animation-fill-mode: forwards;
		}

		.close-line1 {
			transform: translateY(-30px) translateX(30px) rotate(45deg);
		}

		.close-line2 {
			transform: translateY(-30px) translateX(-30px) rotate(-45deg);
		}
	}

	&.show .hs-close {
		opacity: 1;
		visibility: visible;

		a:before {
			transform: scale(1);
		}

		.close-line1 {
			animation-name: crossRight;
			animation-delay: .49s;
		}

		.close-line2 {
			animation-name: crossLeft;
			animation-delay: .35s;
		}
	}

	.hs-close:hover {
		.close-line {
			background-color: var(--alpha-primary-color);
		}
	}

	@keyframes crossLeft {
		100% {
			transform: translateY(0px) translateX(0px) rotate(-45deg)
		}
	}

	@keyframes crossRight {
		100% {
			transform: translateY(0px) translateX(0px) rotate(45deg)
		}
	}
}

// Search button
.btn-search:hover,
.btn-search:focus {
	color: var(--alpha-primary-color);
}

// Search toggle
.search-toggle {
	position: relative;
	display: inline-block;
	vertical-align: middle;
	padding: 1rem 0;
	white-space: nowrap;
	transition: color .3s;

	span {
		cursor: pointer;
		vertical-align: middle;
	}

	i {
		display: inline-block;
		margin-#{$right}: .5rem;
		font-size: 1.6rem;
		font-weight: 400;
		line-height: .9;
		vertical-align: middle;

		&::before {
			margin: 0;
		}
	}
}

.search-wrapper a.search-toggle:hover {
	color: var(--alpha-primary-color);
}

// Search dropdown
.hs-dropdown {
	display: inline-block;
	width: auto;
	position: relative;

	form {
		padding: 2rem;
	}

	.input-wrapper {
		position: absolute;
		right: -1.5rem;
		top: 100%;
		background-color: var(--alpha-change-color-light-1);
		box-shadow: 0 3px 35px rgb(0 0 0 / 10%);
		visibility: hidden;
		opacity: 0;
		transform: translateY(-10px);
		z-index: 1069;
		transition: transform 0.4s, visibility 0.4s, opacity 0.4s;
		min-width: 31rem;
	}

	&.search-wrapper form input.form-control,
	.btn {
		border: 1px solid var(--alpha-change-border-color-light);
	}

	.btn {
		border-#{$right}-width: 1px;
		margin-#{$left}: -1px;
	}

	&.search-wrapper .input-wrapper input.form-control {
		border-#{$right}-width: 0;
		border-top-#{$right}-radius: 0;
		border-bottom-#{$right}-radius: 0;
	}

	&.search-wrapper .input-wrapper .btn {
		border-#{$left}-width: 0;
	}

	&.show .input-wrapper {
		transform: translateY(0);
		visibility: visible;
		// transition: transform 0.4s;
		opacity: 1;
	}

	&.hs-toggle {
		.search-toggle i:before {
			transition: visibility .3s, opacity .3s;
		}

		.search-toggle i:after {
			content: '\e96f';
			font-family: $framework-font;
			font-size: 1.22em;
			margin-top: -.05em;
			visibility: hidden;
			opacity: 0;
			position: absolute;
			left: 50%;
			transform: translateX(-50%);
		}

		&.show .search-toggle i:before {
			visibility: hidden;
			opacity: 0;
			transition: none;
		}

		&.show .search-toggle i:after {
			visibility: visible;
			opacity: 1;
			transition: visibility .3s, opacity .3s;
		}
	}
}

// Fullscreen type
.hs-fullscreen {
	&.show {

		.close-overlay,
		.search-form {
			opacity: 1;
			visibility: visible;
		}

		.search-form-wrapper {
			visibility: visible;

			&:before {
				transform: none;
			}
		}
	}

	.search-form-wrapper form {
		border-width: 0 0 2px;
	}

	.search-form-wrapper {
		position: fixed;
		left: 0;
		right: 0;
		top: 0;
		padding: 7rem 0;
		z-index: 1061;
		overflow: hidden;
		visibility: hidden;
		transition: visibility .3s;

		&:before {
			content: '';
			position: absolute;
			left: 0;
			top: 0;
			width: 100%;
			height: 100%;
			background: var(--alpha-change-color-light-1);
			transform: scaleY(0);
			transform-origin: top center;
			transition: transform 0.8s cubic-bezier(0.2, 1, 0.3, 1);
		}
	}

	.search-inner-wrapper {
		position: relative;
		z-index: 10;
	}

	.search-form {
		visibility: hidden;
		opacity: 0;
		transition: visibility 0.3s cubic-bezier(0.2, 1, 0.3, 1), opacity 0.3s cubic-bezier(0.2, 1, 0.3, 1);
	}

	.close-overlay {
		position: fixed;
		left: 0;
		top: 0;
		right: 0;
		bottom: 0;
		background-color: rgba(0, 0, 0, 0.3);
		z-index: 1061;
		opacity: 0;
		visibility: hidden;
		transition: opacity .3s, visibility .3s;
	}

	.hs-close {
		position: absolute;
		top: 13px;
		left: auto;
		#{$right}: 0;
		transform: none;

		.close-wrap {
			left: auto;
			right: 0;
			transform: translateY(-50%);
		}
	}

	.search-form,
	.search-container {
		padding-left: 4.5rem;
		padding-right: 4.5rem;
	}

	@include mq(xs, 'max') {

		.search-form,
		.search-container {
			padding-left: 2.5rem;
			padding-right: 2.5rem;
		}
	}

	.input-wrapper {
		position: static;
	}

	input.form-control {
		padding: 0;
		font-size: 2.4rem;
		color: $grey-color-light;
	}

	.search-header {
		text-align: $left;
		display: flex;
		align-items: center;
		justify-content: space-between;
		position: relative;
		margin-top: 1rem;
		padding-#{$right}: 2.5rem;
	}

	.btn-search {
		min-width: 0;
		font-size: 2rem;
		color: var(--alpha-change-color-dark-1);
		background: transparent;

		&:hover {
			color: var(--alpha-primary-color);
		}
	}

	.search-container {
		max-height: 0;
		overflow: hidden;
		background: var(--alpha-change-color-light-1);
		transition: max-height 0.8s cubic-bezier(0.13, 0.67, 0.9, 0.9);
	}

	&.results-shown .search-container {
		transition: max-height 0.2s cubic-bezier(0.13, 0.67, 0.9, 0.9);
	}

	.search-results .posts>li {
		list-style: none;
	}

	.search-results .product,
	.search-results .post-wrap {
		opacity: 0;
	}

	.scrollable {
		overflow-y: auto;
		margin-#{$right}: 28px;
		width: calc(100% + 28px);
		padding-#{$right}: 20px;
	}

	.scrollable::-webkit-scrollbar {
		background: var(--alpha-traffic-white-color);
		border-radius: var(--alpha-corner-md);
		width: 8px;
	}

	.scrollable::-webkit-scrollbar-thumb {
		background: var(--alpha-change-color-light-3);
	}
}

// Dropdown position
.hs-left {
	&.hs-dropdown form {
		left: -1.5rem;
		right: auto;
	}
}

.hs-center {
	text-align: center;

	form {
		margin-left: auto;
		margin-right: auto;
	}

	&.hs-dropdown .input-wrapper {
		left: 50%;
		right: auto;
		transform: translate3d(-50%, -10px, 0);
	}

	&.hs-dropdown:hover .input-wrapper,
	&.hs-dropdown.show .input-wrapper {
		transform: translate3d(-50%, 0, 0);
	}
}

.hs-right {
	text-align: right;

	form {
		margin-left: auto;
	}
}

.home.blog .entry-title,
.search-no-results .entry-title {
	font-size: 2.8rem;
}

// Compativility with elementor
.elementor-widget.elementor-widget_alpha_search_overlap {
	position: static;
	z-index: 99;
}

.custom-header .elementor .search-wrapper .select-box {
	width: auto;
}

.elementor-widget .search-wrapper input.form-control {
	border: none;
}