/**
 * Products Finder Component Styles
 *
 * "Trouvez votre bonheur" - Vehicle search tool
 *
 * @package joacamp
 */

 .who-section-products-finder {
	padding: 4rem 0;
 }

.who-section-products-finder__inner {
	position: relative;
}

.who-section-products-finder__search {
	/* text-products-finder mixin */
	font-size: 1.5em;
	color: black;
	font-weight: 400;
	margin-top: 1.5em;
	margin-bottom: 1.5em;
}

.who-section-products-finder__title {
	color: black;
}

.who-section-products-finder__buttons {
	.who-section-products-finder__button-link {
		align-items: center;
		background-color: black;
		color: #ffffff;
		display: inline-flex;
		text-decoration: none;
		border-radius: 10px;
		padding: 1rem 2rem;
	}
	.who-section-products-finder__button-link:hover {
		background-color: white;
		color: black;
	}
}

@media (max-width: 768px) {
	.who-section-products-finder__search {
		font-size: var(--joa-fs-25, 1.25rem);
		margin-top: 2em;
		margin-bottom: 0;
	}
}

.who-section-products-finder__words {
	display: inline-block;
	line-height: 1em;
	padding: 0.6em 0;
	vertical-align: middle;
}

@media (max-width: 768px) {
	.who-section-products-finder__words {
		display: block;
	}
}

.who-section-products-finder__select {
	position: relative;
	display: inline-block;
	vertical-align: middle;
	appearance: none;
	border: none;
	background: transparent;
	font-size: 1.09em;
	color: inherit;
	line-height: 1.16em;
	box-shadow: inset 0 0 0 2px black;
	border-radius: 8px;
	max-width: 100%;
}

@media (max-width: 768px) {
	.who-section-products-finder__select {
		margin-bottom: 1em;
	}
}

.who-section-products-finder__select::before {
	content: "";
	display: block;
	position: absolute;
	right: calc(0.6 * 0.4em);
	margin: auto;
	top: 0;
	bottom: 0;
	width: 20px;
	height: 12px;
	background: transparent url("../img/products-finder-dropdown-close.svg") center center / 20px 12px no-repeat;
	pointer-events: none;
}

.who-section-products-finder__select--is-open::before {
	background: transparent url("../img/products-finder-dropdown-open.svg") center center / 20px 12px no-repeat;
}

.who-section-products-finder__select-option {
	position: relative;
	display: block;
	line-height: 1.3em;
	padding: 0.20em 0.6em;
	cursor: pointer;
	text-align: left;
	max-width: 100%;
}

@media (max-width: 768px) {
	.who-section-products-finder__select-option {
		text-align: center;
		font-size: 2em;
	}
}

@media (max-width: 520px) {
	.who-section-products-finder__select-option {
		font-size: 1.2em;
	}
}

.who-section-products-finder__select-option--selected {
	position: static;
	display: block;
	text-transform: lowercase;
}

.who-section-products-finder__select-option-list {
	position: absolute;
	z-index: 1;
	overflow: hidden;
	min-width: 100%;
	top: calc(100% - 6px);
	background-color: black;
	color: #ffffff;
	box-shadow: 0px 20px 30px rgba(104, 104, 104, 0.06);
	max-height: 0;
	opacity: 0;
	transform: translateY(8px);
	transition: opacity 0.3s, transform 0.3s;
	list-style: none;
	margin: 0;
	padding: 0;
}

.who-section-products-finder__select-option-list .who-section-products-finder__select-option {
	font-size: 0.6em;
	padding: 0.4em 1em;
	transition: all 0.3s;
}

@media (max-width: 768px) {
	.who-section-products-finder__select-option-list .who-section-products-finder__select-option {
		font-size: 1em;
	}
}

@media (max-width: 520px) {
	.who-section-products-finder__select-option-list .who-section-products-finder__select-option {
		font-size: 0.8em;
	}
}

.who-section-products-finder__select-option-list .who-section-products-finder__select-option:hover,
.who-section-products-finder__select-option-list .who-section-products-finder__select-option:focus,
.who-section-products-finder__select-option-list .who-section-products-finder__select-option:active {
	background-color: rgba(255, 255, 255, 0.5);
}

.who-section-products-finder__select-option-list-item {
	list-style: none;
}

.who-section-products-finder__select-option-list-item:first-of-type .who-section-products-finder__select-option {
	padding-top: 0.8em;
}

.who-section-products-finder__select-option-list-item:last-of-type .who-section-products-finder__select-option {
	padding-bottom: 0.8em;
}

/* Open state */
.who-section-products-finder__select--is-open .who-section-products-finder__select-option {
	display: block;
}

.who-section-products-finder__select--is-open .who-section-products-finder__select-option-list {
	max-height: 600px;
	opacity: 1;
	transform: translateY(0);
}

.who-section-products-finder__button-link {
	position: relative;
}

.who-section-products-finder--has-result {
	margin-bottom: 0 !important;
}

/* Results section */
.who-section-products-finder__result {
	margin-top: 0 !important;
	padding: 0 var(--joa-site-global-margin, 1rem);
	background-color: var(--global-color-19, #fffaf0);
}

.who-section-products-finder__result-inner {
	position: relative;
	padding-top: var(--joa-site-global-margin, 1rem);
	padding-bottom: var(--joa-site-global-margin, 1rem);
}

@media (max-width: 768px) {
	.who-section-products-finder__result-inner {
		padding-top: calc(3 * var(--joa-site-global-margin, 1rem));
	}
}

.who-section-products-finder__result-close-button {
	position: absolute;
	right: 0;
	top: calc(var(--joa-content-margin, 1rem) / 2);
	display: block;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	cursor: pointer;
	appearance: none;
	border: none;
	background: transparent url("../img/products-finder-close.svg") center center / 28px 29px no-repeat;
	transition: all 0.3s;
	transform: rotate(0);
}

@media (max-width: 768px) {
	.who-section-products-finder__result-close-button {
		top: calc(2 * var(--joa-content-margin, 1rem));
	}
}

.who-section-products-finder__result-close-button:hover,
.who-section-products-finder__result-close-button:focus,
.who-section-products-finder__result-close-button:active {
	transform: rotate(90deg);
	background-color: transparent;
}

.who-section-products-finder__result-title {
	margin-bottom: 1em !important;
	padding-right: 40px;
	text-align: left;
	font-size: 1.6rem;
    font-weight: 600;
    color: var(--contrast-2);
}

/* Loader */
.who-section-products-finder .products-finder__loader {
	position: absolute;
	display: flex;
	justify-content: center;
	align-items: center;
	margin: auto;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	color: var(--joa-color-white, #fff);
	border-radius: 8px;
	background-color: var(--global-color-18, #4fc3d5);
}

.who-section-products-finder .products-finder__loader-image {
	display: block;
	width: 40px;
	height: 40px;
}

/* Error message */
.who-section-products-finder .finder-error {
	position: absolute;
	margin: auto;
	top: 0;
	bottom: 0;
	left: 0;
	right: 0;
	display: flex;
	justify-content: center;
	align-items: center;
	text-align: center;
	background-color: var(--joa-color-green-yellow, #d4e157);
}

.who-section-products-finder .finder-error.fadeInUp {
	animation-duration: 0.3s;
	animation-fill-mode: both;
	animation-name: fadeInUp;
}

.who-section-products-finder .finder-error__message {
	position: relative;
	margin: 0;
	cursor: pointer;
}

.who-section-products-finder .finder-error__message::after {
	content: "";
	display: block;
	position: absolute;
	left: 0;
	right: 0;
	width: 0%;
	height: 2px;
	background-color: currentColor;
	bottom: -10px;
	animation-duration: 4s;
	animation-fill-mode: both;
	animation-name: progressBarLoad;
}

.who-section-products-finder .finder-error.fadeOutDown {
	animation-duration: 0.3s;
	animation-fill-mode: both;
	animation-name: fadeOutDown;
}

/* Animations */
@keyframes fadeInUp {
	from {
		opacity: 0;
		transform: translate3d(0, 100%, 0);
	}
	to {
		opacity: 1;
		transform: translate3d(0, 0, 0);
	}
}

@keyframes fadeOutDown {
	from {
		opacity: 1;
	}
	to {
		opacity: 0;
		transform: translate3d(0, 100%, 0);
	}
}

@keyframes progressBarLoad {
	from {
		width: 0%;
	}
	to {
		width: 100%;
	}
}
