/*
Theme Name: Agence Immo Portfolio
Theme URI: https://votre-portfolio.com
Author: Votre Nom
Description: Thème sur mesure ultra-léger pour agence immobilière.
Version: 1.0.0
Text Domain: theme-agence
*/

.immo-search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  background: #f1f5f9;
  padding: 20px;
  border-radius: 8px;
  margin-bottom: 30px;
  align-items: flex-end;
}

.search-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
  min-width: 180px;
}

/* Curseur pointeur sur les éléments de formulaire sélectionnables */
.immo-search-form select,
.immo-search-form button,
.btn-reset {
  cursor: pointer;
}

.search-field label {
  font-weight: bold;
  font-size: 0.9rem;
  color: #334155;
}

.search-field select,
.search-field input {
  padding: 10px;
  border: 1px solid #cbd5e1;
  border-radius: 4px;
  font-size: 1rem;
}

/* Masque le bouton de recherche car la soumission est automatique */
.btn-search {
  display: none;
}

/* Réajustement de l'alignement du bouton réinitialiser */
.search-submit {
  display: flex;
  align-items: center;
  padding-bottom: 10px;
}

.btn-reset {
  background: #e2e8f0;
  color: #475569;
  text-decoration: none;
  padding: 10px 20px;
  border-radius: 4px;
  font-weight: 600;
  font-size: 0.9rem;
  transition: background 0.2s;
}

.btn-reset:hover {
  background: #cbd5e1;
  color: #1e293b;
}

/* Styles Généraux */
body {
  font-family: "Segoe UI", Tahoma, Geneva, Verdana, sans-serif;
  color: #1e293b;
  background-color: #f8fafc;
  margin: 0;
  padding: 0;
}
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}
.site-main {
  padding: 40px 0;
}

/* Header & Footer */
.main-header {
  background: #ffffff;
  padding: 20px 0;
  border-bottom: 1px solid #e2e8f0;
}
.site-logo {
  font-size: 1.5rem;
  font-weight: bold;
  text-decoration: none;
  color: #0f172a;
}
.main-footer {
  background: #0f172a;
  color: #ffffff;
  text-align: center;
  padding: 20px 0;
  margin-top: 60px;
}

/* Grille des Biens */
.biens-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 30px;
}

/* Carte de Bien */
.bien-card {
  background: #ffffff;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 4px 6px -1px rgb(0 0 0 / 0.1);
  transition: transform 0.2s;
}
.bien-card:hover {
  transform: translateY(-5px);
}
.bien-card__image-container {
  position: relative;
  height: 220px;
  background: #cbd5e1;
}
.bien-card__img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.bien-card__badge {
  position: absolute;
  top: 15px;
  left: 15px;
  background: #10b981;
  color: white;
  padding: 4px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: bold;
}
.bien-card__content {
  padding: 20px;
}
.bien-card__title {
  margin: 0 0 10px 0;
  font-size: 1.25rem;
}
.bien-card__title a {
  color: #1f2937;
  text-decoration: none;
}
.bien-card__title a:hover {
  color: #0284c7;
}
.bien-card__location {
  color: #6b7280;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 5px;
  margin-bottom: 15px;
}
.bien-card__meta {
  display: flex;
  justify-content: space-between;
  font-weight: bold;
  color: #374151;
  border-top: 1px solid #f3f4f6;
  padding-top: 15px;
  margin-bottom: 15px;
}
.meta-prix {
  color: #0284c7;
}
.bien-card__dpe {
  display: inline-block;
  padding: 3px 8px;
  border-radius: 4px;
  color: white;
  font-weight: bold;
  font-size: 0.85rem;
  background: #10b981; /* Vert par défaut pour DPE A */
}

/* ==========================================================================
   JOUR 5 : DESIGN ET RESPONSIVE PAGE SINGLE BIEN
   ========================================================================== */

/* Structure de l'Article Unique */
.bien-unique {
  background: #ffffff;
  border-radius: 12px;
  padding: 30px;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.05);
  margin-top: 20px;
}

/* En-tête de la page */
.bien-header {
  margin-bottom: 25px;
  position: relative;
}
.badge-exclusif {
  display: inline-block;
  background: #f59e0b;
  color: #ffffff;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: bold;
  margin-bottom: 10px;
}
.bien-header h1 {
  font-size: 2.2rem;
  color: #0f172a;
  margin: 0 0 10px 0;
}
.bien-header__sub {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 2px solid #f1f5f9;
  padding-bottom: 15px;
}
.bien-ref {
  color: #64748b;
  font-family: monospace;
  font-size: 1rem;
  margin: 0;
}
.bien-prix-principal {
  font-size: 2rem;
  font-weight: 800;
  color: #0284c7;
  margin: 0;
}

/* Zone Média Principale Modifiée */
.bien-media-gallery {
  margin-bottom: 35px;
  border-radius: 8px;
  overflow: hidden;
  /* Suppression du max-height restrictif qui coupait l'image */
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  background: #f1f5f9; /* Fond neutre si l'image est sur fond transparent */
}

.bien-main-thumbnail img {
  width: 100%;
  height: auto; /* Permet à l'image de prendre toute sa hauteur naturelle */
  object-fit: contain; /* Garantit que l'image est affichée entièrement sans rognage */
  display: block;
}

/* Agencement en double colonne (Desktop par défaut) */
.bien-grid-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 40px;
}

/* Colonne de Gauche : Contenu & Caractéristiques */
.bien-content-column h2 {
  font-size: 1.4rem;
  color: #1e293b;
  border-bottom: 1px solid #e2e8f0;
  padding-bottom: 8px;
  margin-top: 0;
  margin-bottom: 15px;
}
.bien-description {
  margin-bottom: 35px;
  line-height: 1.7;
  color: #334155;
}
.bien-specs {
  margin-bottom: 35px;
}
.bien-specs ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px;
}
.bien-specs li {
  background: #f8fafc;
  padding: 12px 15px;
  border-radius: 6px;
  border: 1px solid #e2e8f0;
  color: #475569;
}

/* Équipements */
.bien-equipements {
  margin-bottom: 35px;
}
.equipements-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.equipements-list li {
  color: #0f172a;
  font-weight: 500;
}

/* Blocs de Diagnostics Énergétiques */
.bien-diagnostics {
  margin-bottom: 20px;
}
.diag-flex {
  display: flex;
  gap: 15px;
}
.diag-box {
  flex: 1;
  padding: 15px;
  text-align: center;
  border-radius: 6px;
  color: #ffffff;
  font-size: 1.1rem;
}
.dpe-a,
.ges-a {
  background-color: #22c55e;
} /* Variantes de couleurs dynamiques selon vos données */
.dpe-b,
.ges-b {
  background-color: #84cc16;
}
.dpe-c,
.ges-c {
  background-color: #eab308;
}
.dpe-d,
.ges-d {
  background-color: #f97316;
}
.dpe-e,
.ges-e {
  background-color: #ef4444;
}
.dpe-f,
.ges-f {
  background-color: #b91c1c;
}
.dpe-g,
.ges-g {
  background-color: #7f1d1d;
}

/* Colonne de Droite : Sidebar */
.bien-sidebar-column {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.sidebar-box {
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  padding: 20px;
  border-radius: 8px;
}
.sidebar-box h3 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.1rem;
  color: #0f172a;
}
.sidebar-box p {
  margin: 6px 0;
  color: #475569;
}
.contact-agent a {
  color: #0284c7;
  text-decoration: none;
  font-weight: bold;
}
.contact-agent a:hover {
  text-decoration: underline;
}

/* ==========================================================================
   MEDIA QUERIES (RESPONSIVE INVERSION)
   ========================================================================== */

/* Version Tablette (Écrans inférieurs à 992px) */
@media (max-width: 992px) {
  .bien-grid-layout {
    grid-template-columns: 1fr; /* Bascule la grille sur une seule colonne */
    gap: 30px;
  }
  .bien-sidebar-column {
    display: grid;
    grid-template-columns: repeat(
      auto-fit,
      minmax(250px, 1fr)
    ); /* Aligne les blocs de la sidebar côte à côte */
    gap: 20px;
  }
}

/* Version Mobile (Écrans inférieurs à 576px) */
@media (max-width: 576px) {
  .bien-unique {
    padding: 15px;
  }
  .bien-header h1 {
    font-size: 1.6rem;
  }
  .bien-header__sub {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
  }
  .bien-prix-principal {
    font-size: 1.6rem;
  }
  .bien-sidebar-column {
    grid-template-columns: 1fr; /* Remet la sidebar sur une seule colonne sur petit écran */
  }
  .diag-flex {
    flex-direction: column;
  }
}

/* Alignement du Header avec Menu */
.header-flex {
  display: flex;
  justify-content: space-between;
  align-items: center;
}
.main-menu {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  gap: 25px;
}
.main-menu a {
  text-decoration: none;
  color: #475569;
  font-weight: 600;
  transition: color 0.2s;
}
.main-menu a:hover {
  color: #0284c7;
}

/* Section Hero Home */
.hero-section {
  background:
    linear-gradient(rgba(15, 23, 42, 0.8), rgba(15, 23, 42, 0.8)),
    url("assets/images/placeholder.jpg") no-repeat center/cover;
  color: #ffffff;
  text-align: center;
  padding: 100px 0;
  margin-bottom: 50px;
}
.hero-content h1 {
  font-size: 2.8rem;
  margin-bottom: 15px;
}
.hero-content p {
  font-size: 1.2rem;
  color: #cbd5e1;
  margin-bottom: 30px;
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}
.btn-hero {
  display: inline-block;
  background: #0284c7;
  color: #ffffff;
  text-decoration: none;
  padding: 15px 30px;
  border-radius: 6px;
  font-weight: bold;
  font-size: 1.1rem;
  transition: background 0.2s;
}
.btn-hero:hover {
  background: #0369a1;
}

/* Section Titre */
.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 30px;
}
.section-header h2 {
  font-size: 1.8rem;
  color: #0f172a;
  margin: 0;
}
.view-all-link {
  color: #0284c7;
  text-decoration: none;
  font-weight: bold;
}

/* Container de badges */
.bien-badges-container {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 12px;
}

/* Style commun des badges de Taxonomie */
.badge-taxonomy {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 20px;
  font-size: 0.85rem;
  font-weight: 600;
  color: #1e293b;
}

.badge-type-bien {
  background-color: #e0f2fe; /* Bleu clair */
  color: #0369a1;
}

.badge-statut-bien {
  background-color: #f0fdf4; /* Vert clair */
  color: #15803d;
}

/* ==========================================================================
   BOUTON RETOUR CATALOGUE PROFESSIONNEL (SINGLE PAGE)
   ========================================================================== */
.bien-actions-footer {
  margin-top: 50px;
  padding-top: 30px;
  border-top: 2px solid #f1f5f9;
  display: flex;
  justify-content: center; /* Centre le bouton horizontalement */
}

.btn-retour-catalogue {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  background-color: #0f172a; /* Fond bleu nuit corporate */
  color: #ffffff;
  text-decoration: none;
  padding: 14px 32px;
  border-radius: 8px;
  font-weight: 600;
  font-size: 1rem;
  box-shadow: 0 4px 6px -1px rgba(15, 23, 42, 0.15);
  transition:
    background-color 0.2s,
    transform 0.2s,
    box-shadow 0.2s;
  cursor: pointer;
}

.btn-retour-catalogue:hover {
  background-color: #0284c7; /* Bascule sur le bleu de l'agence au survol */
  transform: translateY(-2px); /* Léger effet d'élévation */
  box-shadow: 0 10px 15px -3px rgba(2, 132, 199, 0.3);
  color: #ffffff;
}

.btn-retour-catalogue span {
  font-size: 1.2rem;
  transition: transform 0.2s;
}

.btn-retour-catalogue:hover span {
  transform: scale(1.2); /* Grossit légèrement l'icône au survol */
}

/* Ajustement Mobile */
@media (max-width: 576px) {
  .btn-retour-catalogue {
    width: 100%;
    justify-content: center; /* Prend toute la largeur sur petit écran */
  }
}

/* ==========================================================================
   LOADER & DEBOUNCE EFFECT (SEARCH AJAX-LIKE)
   ========================================================================== */

/* Conteneur de la grille en cours de chargement */
.biens-grid {
  position: relative; /* Indispensable pour centrer le loader à l'intérieur */
  transition: opacity 0.3s ease;
}

/* Effet de flou/opacité sur les anciennes cartes pendant le chargement */
.grid-loading {
  opacity: 0.4;
  pointer-events: none; /* Empêche les clics intempestifs pendant le rafraîchissement */
}

/* Structure du Loader CSS (Spin) */
.immo-loader {
  position: absolute;
  top: 100px;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 50px;
  height: 50px;
  border: 5px solid #cbd5e1;
  border-top-color: #0284c7; /* Couleur bleue principale de l'agence */
  border-radius: 50%;
  animation: immoSpin 0.8s linear infinite;
  z-index: 10;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Animation de rotation continue */
@keyframes immoSpin {
  to {
    transform: translate(-50%, -50%) rotate(360deg);
  }
}
