/* ===================================== */
/* ============ STYLES GÉNÉRAUX ======== */
/* ===================================== */
:root {
  --chip-type-w: 150px; /* “Appartement / Locaux …” */
  --layout-max-width: 1680px; /* largeur max du layout */
  --results-card-width: 533px; /* largeur fixe des cartes en desktop */
  --results-gap-desktop: 40px; /* gap horizontal/vertical desktop */
}

/* Page globale */
.search-page {
  background-color: #f8f4ec;
}

/* Wrapper de la section résultats */
section.search-results.container {
  padding: 34px 2rem 5rem;
  background: #fff;
}
.off-market .search-results.container {
  padding: 80px 2rem 5rem;
  background: #fff;
}

/* Hero search bar */
.home-search {
  position: initial;
  margin-top: 5rem;
}

/* ===================================== */
/* ======== SEARCH RESULTS GRID ======== */
/* ===================================== */

/* Base : mobile (1 colonne) */
.search-results .results-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: clamp(20px, 5vw, 28px);
  max-width: var(--layout-max-width);
  margin-inline: auto;
  justify-content: center;
}

.search-results .card {
  width: 100%;
  max-width: var(--results-card-width);
  margin-inline: auto;
}

.search-results .card-media {
  display: block;
  width: 100%;
  aspect-ratio: 533 / 608;
  height: auto;
  border-radius: 24px;
  overflow: hidden;
}

.search-results .card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* ===== Retirer le fond blanc des cards ===== */
.search-results .card,
.search-results .lp-card,
.search-results .listing-item,
.search-results .property-item {
  background: transparent;
  border: 0;
  box-shadow: none;
}

.search-results .card .card-body,
.search-results .lp-card__body,
.search-results .item-body,
.search-results .property-card-body {
  background: transparent;
}

.search-results .card a,
.search-results .lp-card a {
  background: transparent;
}

/* ===================================== */
/* ========== BLOC "AUCUN RÉSULTAT" ==== */
/* ===================================== */
.no-results {
  margin: 48px auto;
  text-align: center;
}

.no-results h2 {
  margin: 0 0 14px;
  line-height: 1.25;
  font: var(--h2-font);
}

.no-results p {
  margin: 0 auto 20px;
  color: rgba(18, 34, 46, 0.82);
}

.no-results .btn {
  display: inline-flex;
  margin: 8px auto 0;
}

/* ===================================== */
/* ========== FEATURED LISTINGS ======== */
/* ===================================== */
.featured-listings {
  background: transparent;
}

.featured-listings .header {
  margin-bottom: 0;
}

/* Container dédié */
.featured-listings .container {
  max-width: 1680px;
  width: 100%;
  margin: 0 auto;
  padding: 0 2rem;
  position: relative;
}

/* ===================================== */
/* =========== CAROUSEL SUGGEST ======== */
/* ===================================== */
.search-suggest .bleed-right {
  padding-right: 0;
  margin-right: 0;
}

.search-suggest .carousel-viewport {
  padding-right: 0;
  overflow: visible;
}

/* ===================================== */
/* ========== CONTAINER GLOBAL ========= */
/* ===================================== */
.container {
  width: 100%;
  margin-inline: auto;
  padding-inline: 1.5rem;
  position: relative;
  max-width: 1920px;
}

/* ===================================== */
/* ============ HERO SECTION =========== */
/* ===================================== */
.search-page .bloc__hero {
    height: auto;
    padding: 4rem 0 0 2rem;
    min-height: 17rem;
    margin-bottom: 3rem;
}

.search-page .newsletter {
  margin-bottom: 0;
  margin-top: 0;
  background: white;
  padding: 4rem 0 0;
}

/* ===================================== */
/* ======== PAGE RECHERCHE ONLY ======== */
/* ===================================== */
.bloc__hero--search .home-search {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  position: relative;
  top: 0;
  margin-top: 0;
}

.bloc__hero--search .home-search__form {
  margin: 0 auto;
}

.bloc__hero--search .search-bar-cta {
  order: 2;
  display: flex;
  justify-content: center;
  width: 100%;
}

.bloc__hero--search .search-bar-cta .btn {
  width: auto;
}

/* Champs du formulaire de recherche */
.home-search__field--mode {
  flex: 0 0 var(--chip-mode-w);
}
.home-search__field--type {
  flex: 0 0 var(--chip-type-w);
}

/* bouton = full width + align left */
.home-search__field--mode .home-search__chip,
.home-search__field--type .home-search__chip {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 10px;
}

.home-search__chip .home-search__chevron {
  margin-left: auto;
  flex: 0 0 auto;
}

.home-search__chip > img,
.home-search__chip > svg:not(.home-search__chevron) {
  flex: 0 0 auto;
}

.home-search__chip span,
#hs-type-label,
#hs-mode-label {
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

div#hs-type-listbox .home-search__option {
  padding: 12px 73px 12px 42px;
}

/* ===================================== */
/* ================ BOUTONS ============ */
/* ===================================== */
.btn--secondary svg {
  width: 16px;
  height: 16px;
}

.btn--secondary:hover svg {
  color: var(--color-brand-300);
}

/* ===================================== */
/* ============ TITRES SECTION ========= */
/* ===================================== */
.search-page .section-title {
  text-align: left;
  font-size: 1.5rem;
  margin-left: 0;
  max-width: var(--layout-max-width);
}

.search-suggest .section-title {
  font-size: 2rem;
}

.search-empty {
  padding: 0rem 0 2.5rem;
}

.search-suggestions {
  background: #fff;
  padding: 3rem 0 5rem;
}

.search-results-title {
  margin: 0 0 1.5rem;
  font: var(--h2-font);
}

.big-title-carrousel h2 {
  padding: 0;
  width: 100%;
  max-width: 1680px;
  margin: 0 auto;
  margin-bottom: 2.5rem;
  position: relative;
  font: var(--h2-font);
}
.search-results-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.search-sort {
  position: relative;
}
.search-sort__btn {
  display: flex;
  align-items: center;
  gap: 6px;
  background: #fff;
  border: 0;
  border-radius: 0;
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.95rem;
  line-height: 1.2;
  color: #222;
  box-shadow:none;
  border-bottom: 1px solid #d9d9d9;
}
.search-sort__btn:focus {
  outline: 2px solid #1f6d83;
  outline-offset: 2px;
}
.search-sort__chevron {
  font-size: 0.8rem;
  margin-left: 6.5rem;
}
.search-sort__menu {
  position: absolute;
  right: 0;
  top:100%;
  background: #fff;
  border: 0;
  border-radius: 10px;
  border-top-left-radius: 0;
  border-top-right-radius: 0;
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.12);
  padding: 8px 0;
  min-width: 210px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  z-index: 5;
  border-bottom: 1px solid #ddd;
}
.search-sort__menu[hidden] {
  display: none;
}
.search-sort__option {
  padding: 10px 14px;
  color: #222;
  text-decoration: none;
  display: block;
  font-size: 0.95rem;
  position: relative;
  overflow: hidden;
  transition: color 0.2s ease, font-weight 0.2s ease;
}
.search-sort__option:hover {
  color: var(--color-brand, #004c66);
}
.search-sort__option[aria-current="true"] {
  font-weight: 600;
}
.search-sort__option::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--color-light-green, #dcf6f0);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 0.3s ease;
  z-index: -1;
}
.search-sort__option:hover::after,
.search-sort__option:focus-visible::after,
.search-sort__option[aria-current="true"]::after {
  transform: scaleX(1);
}
/* ===================================== */
/* ============ MEDIA QUERIES ========= */
/* ===================================== */

/* ------------------------------- */
/* 1) Layout de la grille         */
/* ------------------------------- */
@media (min-width: 1680px) {
  .search-page .section-title {
    margin-left: 5rem;
  }
}
/* ≥ 768px : 2 colonnes */
@media (min-width: 768px) {
  .search-results .results-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 100%;
  }

  .search-results .card {
    max-width: none;
    margin-inline: 0;
  }
}

/* ≥ 1025px : 3 colonnes fixes (DESKTOP) */
@media (min-width: 1025px) {
  .search-results .results-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: var(--results-gap-desktop);
    max-width: var(--layout-max-width);
    margin-inline: auto;
    justify-content: center;
  }
}

/* ------------------------------- */
/* 2) Tablet-only (768–1024px)    */
/* ------------------------------- */
@media (min-width: 768px) and (max-width: 1023px) {
  .search-results .card-media {
    aspect-ratio: 533 / 608;
  }
  button#hs-launcher {
    /* position: absolute; */
    /* top: 2rem; */
    min-width: 30rem;
    justify-content: center;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1rem;
    border-radius: 999px;
    border: 1px solid #e1e5ea;
    background: #fff;
    box-shadow: 0 6px 22px rgba(18, 34, 46, 0.12);
    font: 500 14px / 1 "Montserrat", sans-serif;
    color: #1c2d3d;
  }
  .search-results .badge {
    height: auto;
    min-height: 1.75rem;
    padding: 0.3rem 0.75rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
  }

  .section-title {
    margin-left: 0.5rem;
  }

  .home-search__dropdown {
    min-width: 132px;
  }

  div#hs-type-listbox .home-search__option {
    padding: 12px 58px 12px 42px;
  }
  button#hs-launcher {
    position: initial;
  }
}

/* ------------------------------- */
/* 3) Mobile ≤ 767px (1 colonne)  */
/* ------------------------------- */
@media (max-width: 767px) {
  .search-results .badge {
    height: auto;
    min-height: 1.75rem;
    padding: 0.3rem 0.75rem;
    line-height: 1.2;
    white-space: nowrap;
  }

  .search-results .card-media {
    aspect-ratio: 533 / 608;
  }
}

/* ------------------------------- */
/* 4) Formulaire & divers         */
/* ------------------------------- */

/* Ajustements form ≤ 1024px */
@media (max-width: 1024px) {
  .home-search {
    top: 1rem;
    padding-top: 2rem;
  }
  .bloc__hero {
    min-height: auto;
    padding: 1rem 0;
  }
  .home-search__form {
    flex-wrap: wrap;
    padding: 0 8px 0 1rem;
    gap: 0.5rem;
    width: min(94%, 1058px);
  }

  .featured-listings .container {
    padding: 0 clamp(16px, 5vw, 24px);
  }
}

/* ≤ 640px : champs full width */
@media (max-width: 640px) {
  .home-search__field {
    width: 100%;
  }

  .home-search__submit {
    margin-left: 0;
    align-self: flex-end;
  }
}

/* ≤ 480px */
@media (max-width: 480px) {
  .home-search__form {
    padding: clamp(16px, 5vw, 20px);
  }

  .home-search__chip span {
    white-space: normal;
  }
}

/* ≤ 375px */
@media (max-width: 375px) {
  .home-search {
    margin-top: 1.5rem;
  }
}

/* ≤ 320px */
@media (max-width: 320px) {
  .home-search__form {
    width: 100%;
  }
}

a.aleart-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    font: var(--cta-secondary-font);
    text-decoration: none;
    border-radius: var(--radius-sm);
    color: #0a4a5a;
    background: #fff;
    padding: 11px 40px;
    border: 1px solid #0a4a5a;
}

a.aleart-btn svg {
    width: 20px;
}

.aleart-btn-wrap {
  margin-top: 3rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

a.aleart-btn svg * {
    fill: #0a4a5a;
}

a.aleart-btn:hover{
  color: #fff;
    background: #0a4a5a;
}

a.aleart-btn:hover svg * {
    fill: #fff;
}