/* ==================================================================
 * TF IMMO — recherche et cartes de biens (/nos-biens, listes de biens)
 * Charte : bleu marine #132C4C, doré #DB9B00, Open Sans.
 * Les sélecteurs sont volontairement précis : ils doivent passer devant
 * le CSS du plugin et le CSS personnalisé Divi (souvent en !important).
 * ================================================================== */

:root {
	--tf-navy: #132c4c;
	--tf-navy-2: #1d3d66;
	--tf-gold: #db9b00;
	--tf-gold-dark: #a87700;
	--tf-ink: #1b2533;
	--tf-muted: #5b6573;
	--tf-line: #e6ebf1;
	--tf-soft: #f3f6fa;
	--tf-radius: 14px;
	--tf-shadow: 0 1px 2px rgba(19, 44, 76, .06), 0 8px 24px rgba(19, 44, 76, .08);
	--tf-shadow-hover: 0 2px 4px rgba(19, 44, 76, .08), 0 16px 36px rgba(19, 44, 76, .16);
}

/* ------------------------------------------------------------------
 * Formulaire de recherche
 * ------------------------------------------------------------------ */
#search-property.search-property-form {
	max-width: 1040px;
	margin: 0 auto 40px;
	text-align: left;
}

#search-property .search-options.sample-page {
	text-align: left;
	background: #fff;
	border: 0 !important;
	border-radius: 18px;
	box-shadow: 0 12px 40px rgba(0, 0, 0, .18);
	padding: 24px 28px 20px;
}

#search-property .searcher > .row.margin-div {
	display: grid;
	grid-template-columns: minmax(240px, 1fr) minmax(280px, 1.5fr);
	gap: 20px 32px;
	align-items: start;
	margin: 0;
	padding: 0 !important;
}

#search-property .searcher > .row.margin-div::before,
#search-property .searcher > .row.margin-div::after {
	display: none;
}

#search-property .searcher > .row.margin-div > div {
	text-align: left;
	width: auto !important;
	height: auto !important;
	float: none;
	padding: 0;
	margin: 0 !important;
}

/* Libellés des champs (remplace le « Votre Budget » injecté en CSS sur le mauvais champ) */
#search-property .search-field::after {
	content: none !important;
}

#search-property .search-field::before,
#search-property .p-slide-wrap::before {
	display: block;
	margin-bottom: 8px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--tf-muted);
}

#search-property .search-field::before {
	content: "Type de bien";
}

#search-property .p-slide-wrap::before {
	content: "Budget";
}

/* Menu déroulant (easydropdown) */
#search-property .search-options .searcher .dropdown {
	box-sizing: border-box;
	width: 100% !important;
	margin: 0 !important;
	border: 1px solid var(--tf-line);
	border-radius: 10px;
	background: #fff;
	box-shadow: none;
}

#search-property .dropdown .selected {
	padding: 13px 44px 13px 16px;
	font-size: 15px;
	font-weight: 600;
	color: var(--tf-ink);
}

#search-property .dropdown.focus,
#search-property .dropdown:hover {
	border-color: var(--tf-navy-2);
}

#search-property .dropdown div {
	border-radius: 0 0 10px 10px;
}

#search-property .dropdown li {
	padding: 10px 16px;
	font-size: 15px;
}

#search-property .dropdown li.focus {
	background: var(--tf-navy);
	color: #fff;
}

/* Curseur de budget */
#search-property .p-slide-wrap {
	height: auto !important;
}

#search-property .price-range.noUi-target {
	height: 6px;
	margin: 14px 10px 0;
	border: 0;
	border-radius: 999px;
	background: var(--tf-line);
	box-shadow: none;
}

#search-property .price-range .noUi-connect {
	background: var(--tf-gold);
}

#search-property .price-range .noUi-handle {
	top: -8px;
	width: 22px;
	height: 22px;
	right: -11px;
	border: 3px solid var(--tf-gold);
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 2px 6px rgba(0, 0, 0, .2);
	cursor: grab;
}

#search-property .price-range .noUi-handle::before,
#search-property .price-range .noUi-handle::after {
	display: none;
}

#search-property .price-range .noUi-handle:focus-visible {
	outline: 3px solid rgba(219, 155, 0, .45);
	outline-offset: 2px;
}

#search-property .price-slider.price {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	margin-top: 14px;
	font-size: 15px;
	font-weight: 700;
	color: var(--tf-ink);
}

#search-property #price-value-min::after,
#search-property #price-value-max::after {
	content: " €";
}

#search-property .price-slider .separator {
	padding: 0;
	border: 0;
	font-size: 0;
}

#search-property .price-slider .separator::before {
	content: "à";
	font-size: 13px;
	font-weight: 400;
	color: var(--tf-muted);
}

/* Critères supplémentaires (« Plus de filtres ») */
#search-property .search-options .searcher .row.filter {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
	gap: 8px;
	margin: 20px 0 0;
	padding: 16px 0 0;
	border-top: 1px solid var(--tf-line);
	border-bottom: 0;
}

#search-property .search-options .searcher .row.filter.hide-filter {
	max-height: 0;
	margin: 0;
	padding: 0;
	overflow: hidden;
	border-top: 0;
}

#search-property .search-options .searcher .row.filter::before,
#search-property .search-options .searcher .row.filter::after {
	display: none;
}

#search-property .row.filter > div {
	width: auto;
	float: none;
	padding: 0;
	margin: 0;
}

#search-property .search-options .searcher .row.filter label {
	margin: 0;
	display: inline-flex;
	align-items: center;
	width: 100%;
	min-height: 38px;
	padding: 6px 12px;
	border: 1px solid var(--tf-line);
	border-radius: 999px;
	background: #fff;
	color: var(--tf-ink);
	font-size: 13px;
	box-shadow: none;
	transition: background-color .15s, border-color .15s, color .15s;
}

#search-property .search-options .searcher .row.filter input:checked + label {
	border-color: var(--tf-navy);
	background: var(--tf-navy);
	color: #fff;
}

/* Boutons */
#search-property .search-options .searcher .footer {
	display: flex !important;
	justify-content: flex-end !important;
	align-items: center;
	gap: 12px;
	margin: 20px 0 0;
	padding: 0 !important;
}

#search-property .searcher .footer .btn {
	max-width: none !important;
	margin: 0 !important;
	padding: 12px 22px !important;
	border: 2px solid transparent !important;
	border-radius: 10px !important;
	font-family: inherit !important;
	font-size: 15px !important;
	font-weight: 700 !important;
	letter-spacing: .02em !important;
	text-transform: none !important;
	line-height: 1.2;
	box-shadow: none;
	transition: background-color .15s, border-color .15s, color .15s, transform .15s;
}

#search-property .searcher .footer .search-button {
	min-width: 180px;
	background-color: var(--tf-gold) !important;
	color: #1b1300 !important;
}

#search-property .searcher .footer .search-button:hover,
#search-property .searcher .footer .search-button:focus-visible {
	background-color: #f0ac00 !important;
}

#search-property .searcher .footer .more-button,
#search-property .searcher .footer button[type="reset"] {
	background-color: transparent !important;
	border-color: var(--tf-line) !important;
	color: var(--tf-navy) !important;
}

#search-property .searcher .footer .more-button:hover,
#search-property .searcher .footer button[type="reset"]:hover {
	border-color: var(--tf-navy) !important;
}

#search-property .searcher .footer .btn:focus-visible {
	outline: 3px solid rgba(219, 155, 0, .45);
	outline-offset: 2px;
}

#search-property.tfimmo-is-loading .search-button {
	opacity: .75;
}

/* ------------------------------------------------------------------
 * En-tête des résultats
 * ------------------------------------------------------------------ */
.searched-properties .filter-title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 12px 20px;
	margin: 0 0 20px;
	padding: 0;
	border: 0;
	background: none;
}

.searched-properties .filter-title h2 {
	margin: 0;
	padding: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: #fff;
	text-align: left;
}

.searched-properties .filter-title .rem-results-count {
	color: var(--tf-gold);
}

.searched-properties .filter-title .rem-results-sort {
	width: auto;
	min-width: 220px;
	height: 44px;
	padding: 0 14px;
	border: 1px solid rgba(255, 255, 255, .25);
	border-radius: 10px;
	background-color: #fff;
	color: var(--tf-ink);
	font-size: 14px;
	font-weight: 600;
}

/* Chargement */
.ich-settings-main-wrap .loader {
	padding: 40px 0;
}

/* ------------------------------------------------------------------
 * Grille (remplace le positionnement Masonry : cartes de même hauteur)
 * ------------------------------------------------------------------ */
.searched-properties > .row,
.searched-properties > .row.masonry {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
	gap: 24px;
	height: auto !important;
	margin: 0 !important;
}

.searched-properties > .row::before,
.searched-properties > .row::after {
	display: none !important;
}

.searched-properties > .row > .rem-results-box,
.searched-properties > .row > [class*="col-"] {
	position: static !important;
	top: auto !important;
	left: auto !important;
	width: auto !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

/* Pagination */
.searched-properties .rem-load-more-wrap {
	margin-top: 32px;
}

.searched-properties .pagination {
	display: inline-flex;
	gap: 6px;
	margin: 0;
}

.searched-properties .pagination > li > a,
.searched-properties .pagination > li > span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 44px;
	height: 44px;
	padding: 0 12px;
	border: 1px solid rgba(255, 255, 255, .25) !important;
	border-radius: 10px !important;
	background: transparent;
	color: #fff;
	font-weight: 700;
}

.searched-properties .pagination > li > a:hover {
	background: rgba(255, 255, 255, .1);
}

.searched-properties .pagination > .active > span,
.searched-properties .pagination > .active > span:hover {
	border-color: var(--tf-gold) !important;
	background: var(--tf-gold);
	color: #1b1300;
}

/* ------------------------------------------------------------------
 * Carte de bien
 * ------------------------------------------------------------------ */
.tfimmo-card.rem-style-1 {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	margin: 0 !important;
	overflow: hidden;
	border: 0 !important;
	border-radius: var(--tf-radius);
	background: #fff;
	box-shadow: var(--tf-shadow) !important;
	font-family: inherit !important;
	text-align: left;
	transition: transform .2s ease, box-shadow .2s ease !important;
}

.tfimmo-card.rem-style-1:hover {
	transform: translateY(-3px);
	box-shadow: var(--tf-shadow-hover) !important;
}

.tfimmo-card.rem-style-1:focus-within {
	outline: 3px solid var(--tf-gold);
	outline-offset: 2px;
}

.tfimmo-card__media {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: hidden;
	background: var(--tf-soft);
}

.tfimmo-card__media img,
.tfimmo-card__media .rem-f-image {
	display: block;
	width: 100%;
	height: 100%;
	max-width: none;
	object-fit: cover;
	transition: transform .4s ease;
}

.tfimmo-card:hover .tfimmo-card__media img {
	transform: scale(1.04);
}

.tfimmo-card__badge,
.tfimmo-card__photos {
	position: absolute;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 10px;
	border-radius: 999px;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.2;
}

.tfimmo-card__badge {
	top: 12px;
	left: 12px;
	background: var(--tf-navy);
	color: #fff;
}

.tfimmo-card__photos {
	right: 12px;
	bottom: 12px;
	background: rgba(17, 24, 39, .7);
	color: #fff;
}

.tfimmo-card__body {
	display: flex;
	flex: 1;
	flex-direction: column;
	padding: 18px 20px 16px;
}

.tfimmo-card__price {
	margin: 0 0 6px;
	padding: 0;
	font-size: 22px;
	font-weight: 800;
	line-height: 1.2;
	color: var(--tf-navy);
}

.tfimmo-card__price .rem-price-amount,
.tfimmo-card__price .price {
	color: inherit !important;
}

.tfimmo-card__price .rem-currency-symbol {
	margin-left: .2em;
}

.tfimmo-card__title.property-title {
	margin: 0 0 6px;
	padding: 0;
	font-size: 16px;
	font-weight: 700;
	line-height: 1.35;
}

.tfimmo-card__link,
.tfimmo-card__link:visited {
	display: -webkit-box;
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	color: var(--tf-ink) !important;
	text-decoration: none;
}

/* Toute la carte est cliquable */
.tfimmo-card__link::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
}

.tfimmo-card__link:focus {
	outline: none;
}

.tfimmo-card__loc {
	display: flex;
	align-items: center;
	gap: 6px;
	margin: 0 0 14px;
	padding: 0;
	font-size: 14px;
	color: var(--tf-muted);
}

.tfimmo-card__loc svg {
	flex: none;
	color: var(--tf-gold-dark);
}

.tfimmo-card__facts {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 16px !important;
	padding: 0 !important;
	list-style: none !important;
}

.tfimmo-card__fact {
	margin: 0;
	padding: 5px 10px !important;
	border-radius: 999px;
	background: var(--tf-soft);
	color: var(--tf-ink);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.3;
	list-style: none;
}

.tfimmo-card__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 43px;
	margin-top: auto;
	padding-top: 14px;
	border-top: 1px solid var(--tf-line);
}

.tfimmo-card__cta {
	margin-left: auto;
	font-size: 14px;
	font-weight: 700;
	color: var(--tf-navy);
}

.tfimmo-card__arrow {
	display: inline-block;
	color: var(--tf-gold-dark);
	transition: transform .2s ease;
}

.tfimmo-card:hover .tfimmo-card__arrow {
	transform: translateX(4px);
}

/* Étiquette DPE (couleurs officielles) */
.tfimmo-dpe {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 4px 3px 10px;
	border-radius: 6px;
	background: var(--tf-soft);
	color: var(--tf-muted);
	font-size: 12px;
	font-weight: 700;
}

.tfimmo-dpe strong {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 22px;
	height: 22px;
	border-radius: 4px;
	color: #fff;
	font-size: 13px;
}

.tfimmo-dpe--a strong { background: #009036; }
.tfimmo-dpe--b strong { background: #55ab26; }
.tfimmo-dpe--c strong { background: #a6c000; }
.tfimmo-dpe--d strong { background: #f4d900; color: #1b2533; }
.tfimmo-dpe--e strong { background: #fbba00; color: #1b2533; }
.tfimmo-dpe--f strong { background: #eb6909; }
.tfimmo-dpe--g strong { background: #e2001a; }

/* Ruban du plugin (« Sous compromis »…) au-dessus de l'image */
.tfimmo-card__media [class*="ribbon"] {
	z-index: 2;
}

/* ------------------------------------------------------------------
 * Listes de biens hors recherche (page d'accueil : [rem_list_properties])
 * Ne s'applique qu'avec les nouvelles cartes (:has).
 * ------------------------------------------------------------------ */
.rem-listings-wrap-ajax-disable .masonry-properties:has(.tfimmo-card) {
	display: grid !important;
	grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
	gap: 24px;
	height: auto !important;
	margin: 0 !important;
}

.rem-listings-wrap-ajax-disable .masonry-properties:has(.tfimmo-card)::before,
.rem-listings-wrap-ajax-disable .masonry-properties:has(.tfimmo-card)::after {
	display: none !important;
}

.rem-listings-wrap-ajax-disable .masonry-properties:has(.tfimmo-card) > .m-item {
	position: static !important;
	top: auto !important;
	left: auto !important;
	width: auto !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.rem-listings-wrap-ajax-disable:has(.tfimmo-card) .rem-pagination-wrap {
	margin-top: 32px;
}

@media (max-width: 767px) {
	.rem-listings-wrap-ajax-disable .masonry-properties:has(.tfimmo-card) {
		grid-template-columns: 1fr;
		gap: 18px;
	}
}

/* ------------------------------------------------------------------
 * Mobile
 * ------------------------------------------------------------------ */
@media (max-width: 767px) {
	#search-property .search-options.sample-page {
		padding: 20px 16px 16px;
		border-radius: 14px;
	}

	#search-property .searcher > .row.margin-div {
		grid-template-columns: 1fr;
		gap: 22px;
	}

	#search-property .search-options .searcher .footer {
		flex-direction: column-reverse;
		align-items: stretch;
	}

	#search-property .searcher .footer .btn {
		width: 100%;
	}

	.searched-properties .filter-title h2 {
		font-size: 19px;
	}

	.searched-properties .filter-title .rem-results-sort {
		width: 100%;
	}

	.searched-properties > .row,
	.searched-properties > .row.masonry {
		grid-template-columns: 1fr;
		gap: 18px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.tfimmo-card.rem-style-1,
	.tfimmo-card__media img,
	.tfimmo-card__arrow {
		transition: none !important;
	}

	.tfimmo-card.rem-style-1:hover,
	.tfimmo-card:hover .tfimmo-card__media img {
		transform: none;
	}
}
