/**
 * Styles pour le formulaire de recherche de logements
 * Utilisé sur l'archive ET sur la page d'accueil
 */

/* Barre de recherche */
.search-bar-wrapper {
	position: relative;
	padding-top: 160px;
	padding-bottom: max(3vw,30px);
	border-radius: 30px;
}

.search-bar-wrapper .banner-background-1{
	position: absolute; 
	top: 0; 
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 30px;
	z-index: 1;
}

.search-bar-wrapper .banner-background-2{
	position: absolute; 
	top: 0; 
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 30px;
	z-index: 2;
	opacity: .25;
	mix-blend-mode: multiply;
}

.search-bar-wrapper .banner-filter{
	position: absolute; 
	top: 0; 
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: 30px;
	z-index: 3;
}

.search-bar-wrapper-content{
	z-index: 4;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.accommodation-search-form {
	background: white;
	padding: 15px 20px;
	border-radius: 10px;
	box-shadow: 0 2px 10px rgba(0,0,0,0.1);
	width: fit-content;
	max-width: min(900px,100%);
	margin-left: auto;
	margin-right: auto; 
}

.search-main-fields {
	display: flex;
	justify-content: center;
	gap: 15px;
}

.search-field {
	display: flex;
	flex-direction: column;
	width: fit-content;
	justify-content: end;
}

.search-field label {
	font-size: 0.85rem;
	font-weight: 600;
	color: #333;
	margin-bottom: 5px;
}

/* Conteneur pour les champs avec bouton de réinitialisation */
.field-with-clear {
	position: relative;
	display: flex;
	align-items: center;
	width: 100%;
}

.field-with-clear input {
	padding-right: 35px !important; /* Espace pour le bouton clear */
}

.clear-field {
	position: absolute;
	right: 10px;
	background: none;
	border: none;
	font-size: 20px;
	color: #999;
	cursor: pointer;
	padding: 0;
	width: 20px;
	height: 20px;
	line-height: 1;
	transition: color 0.2s;
	z-index: 10;
}

.clear-field:hover {
	color: #333;
}

.search-field input[type="text"],
.search-field input[type="date"],
.search-field input[type="number"],
.search-field select,
.field-with-clear input[type="text"] {
	padding: 5px 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	font-size: 0.95rem;
	max-width: 100%;
	height: 40px;
}

.search-field input[type="text"],
.search-field input[type="date"],
.field-with-clear input[type="text"] {
	width: 290px;
}

.btn-search:hover {
	background: #000;
}

/* Riders field avec dropdown */
.riders-field {
	position: relative;
}

.riders-selector {
	position: relative;
}

.riders-toggle {
	width: 100px;
	padding: 5px 10px;
	border: 1px solid #ddd;
	border-radius: 4px;
	background: white;
	font-size: 0.95rem;
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-top: auto;
	transition: border-color 0.3s ease;
	height: 40px;
	cursor: pointer;
}

.riders-dropdown {
	position: absolute;
	top: calc(100% + 5px);
	left: 50%;
	transform: translate(-50%);
	background: white;
	border: 1px solid #ddd;
	border-radius: 4px;
	box-shadow: 0 8px 6px rgba(0,0,0,.2);
	z-index: 1000;
}

.riders-row {
	padding: 10px;
}

.riders-row:not(:last-child) {
	border-bottom: 1px solid #f0f0f0;
}

.riders-row label {
	display: block;
	text-align: center;
	margin-left: auto; 
	margin-right: auto;
}

.number-control {
	display: flex;
	align-items: center;
	gap: 10px;
}

.number-control button {
	width: 32px;
	height: 32px;
	border: 1px solid #ddd;
	border-radius: 50%;
	background: white;
	color: #333;
	font-size: 1.1rem;
	font-weight: 600;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.number-control button:hover {
	background: #333;
	color: white;
	border-color: #333;
}

.number-control button:disabled {
	opacity: 0.3;
	cursor: not-allowed;
}

.number-control button:disabled:hover {
	background: white;
	color: #333;
	border-color: #ddd;
}

.number-control input {
	width: 50px;
	padding: 5px;
	border: 1px solid #ddd;
	border-radius: 4px;
	text-align: center;
	font-size: 0.95rem;
	font-weight: 600;
}

.number-control input::-webkit-inner-spin-button, 
.number-control input::-webkit-outer-spin-button { 
    -webkit-appearance: none;
    margin: 0;
}

/* Toggle filtres avancés */
.advanced-filters-toggle {
	text-align: center;
	margin-top: 10px;
}

.btn-toggle-filters {
	background: transparent;
	border: none;
	color: #666;
	font-size: 0.9rem;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 8px 15px;
	border-radius: 4px;
	transition: all 0.3s ease;
}

.btn-toggle-filters:hover {
	background: #f0f0f0;
	color: #333;
}

.btn-toggle-filters .icon {
	font-size: 1.1rem;
}

.btn-toggle-filters .arrow {
	font-size: 0.8rem;
	transition: transform 0.3s ease;
}

/* Badge du nombre de filtres actifs */
.filters-count-badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	background: #1D2B01;
	color: white;
	font-size: 0.75rem;
	font-weight: 600;
	border-radius: 10px;
}

/* Filtres avancés */
.advanced-filters {
	background: #FFFFFF;
	box-shadow: 0 12px 10px rgba(0,0,0,.3);
	display: flex;
	justify-content: center;
	flex-wrap: wrap;
	gap: 20px;
	align-items: start;
	position: absolute;
	top: calc(100% - 10px);
	left: 0;
	width: 100%;
	padding: 15px 20px 20px;
	border-bottom-left-radius: 10px;
	border-bottom-right-radius: 10px;
	z-index: 1;
}

.advanced-filters .filter-actions {
	grid-column: 1 / -1;
	display: flex;
	gap: 10px;
	justify-content: flex-end;
}

.filter-group {
	flex: 0 0 calc((100% - 20px) / 2);
	max-width: calc((100% - 20px) / 2);
	width: calc((100% - 20px) / 2);
	display: flex;
	flex-direction: column;
}

.filter-group > label {
	font-size: 0.9rem;
	font-weight: 600;
	color: #333;
	margin-bottom: 10px;
}

.filter-group .select2-container .selection .select2-selection--multiple{
	padding: 3px 5px 10px;
    border: 1px solid #ddd;
    border-radius: 4px;
    max-width: 100%;
}

.filter-group .select2-container .selection .select2-selection--multiple .select2-selection__rendered .select2-search--inline{
	float: unset;
}

/* Permettre le clic sur les boutons de suppression Select2 */
.select2-selection__choice__remove,
.select2-selection__clear {
	z-index: 10;
	pointer-events: auto !important;
	position: relative;
}

.select2-selection__choice__remove{
	bottom: 0;
}

.select2-selection__clear {
	font-size: 20px !important;
    color: #999;
    width: 20px;
    font-weight: 400 !important;
	transition: color 0.2s;
}

.select2-selection__clear:hover {
	color: #333;
}

.select2-selection__choice {
	position: relative;
	z-index: 1;
	background: #1D2B01 !important;
	color: #FFFFFF;
	font-size: .9rem !important;
}

.select2-search__field {
	z-index: 0 !important;
	height: 25px !important;
	font-size: .9rem !important;
	font-family: "Manrope", sans-serif !important;
	padding-top: 3px !important; 
}


/* Slider de prix */
.price-slider-container {
	padding: 10px 0;
	margin-top: 5px;
}

#price-slider {
	margin: 0 20px;
	height: 13px;
}

#price-slider .noUi-base .noUi-connects .noUi-connect{
	background: #FF9100;
}

.price-slider-values {
	text-align: center;
	font-weight: 600;
	color: #333;
	position: absolute;
    top: -20px;
    left: 50%;
    transform: translate(-50%);
}

/* Personnalisation du slider noUiSlider */
.noUi-connect {
	background: #FF9100;
}

.noUi-handle {
    height: 23px !important;
}

.noUi-handle::before,
.noUi-handle::after {
    top: 4px !important;
}

.noUi-handle:hover {
	background: #f8f8f8;
}

.noUi-handle:active {
	background: #e8e8e8;
}

.filter-checkboxes {
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.checkbox-label {
	display: flex;
	align-items: center;
	gap: 8px;
	cursor: pointer;
	font-size: 0.9rem;
}

.checkbox-label input[type="checkbox"] {
	cursor: pointer;
}

.filter-actions {
	grid-column: 1 / -1;
	display: flex;
	justify-content: flex-end;
	gap: 10px;
	margin-top: 10px;
}

.btn-reset-filters,
.btn-apply-filters {
	padding: 10px 20px;
	border: none;
	border-radius: 4px;
	font-weight: 600;
	cursor: pointer;
	transition: all 0.3s ease;
}

.btn-reset-filters {
	background: #f0f0f0;
	color: #666;
}

.btn-reset-filters:hover {
	background: #e0e0e0;
	color: #333;
}

.btn-apply-filters {
	background: #333;
	color: white;
}

.btn-apply-filters:hover {
	background: #000;
}
