/* LOGEMENTS */
.logements-section {
  width: 100%;
  min-height: 600px; /* Ensures space is reserved immediately */
  padding: 0 2rem;
  padding-top: 4rem; /* or whatever you want */
  margin-top: 2rem;
  box-sizing: border-box;
  margin-bottom: 20px;
  color: white; /* Optional if you want text contrast */
  position: relative;
  align-items: center;
  justify-content: center;
  color: white;
  text-align: center;
  max-height: 70vh;
}

.logements-section > * {
  position: relative;
  z-index: 1;
}

/* --- Responsive logements grid --- */
.logements-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  justify-content: center;
  margin: 2rem auto;
  padding: 0 1rem;
  width: 100%;
  box-sizing: border-box;
}

.logement-card {
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  justify-content: flex-start;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
  transition: transform 0.3s ease;
  display: flex;
  flex-direction: column;
  max-width: 340px; /* 👈 LIMIT THE CARD WIDTH */
  width: 100%; /* let it be responsive */
  margin: 0 auto; /* optional: center card in grid cell */
  padding: 8px 8px;
}

.logement-card:hover {
  transform: translateY(-4px);
}

.logement-img-wrapper {
  position: relative;
  height: 180px;
  overflow: hidden;
}

.logement-img-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.logement-badge {
  position: absolute;
  top: 0;
  left: 0;
  color: white;
  font-size: 0.75rem;
  padding: 0.4rem 0.6rem;
  border-bottom-right-radius: 8px;
  z-index: 2;
}

.logement-badge span {
    display: flex;
    line-height: 1.2;
    justify-content: left;
}

.logement-icons-overlay {
  position: absolute;
  bottom: 0;
  right: 0;
  padding: 0.4rem 0.6rem;
  border-top-left-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
  font-size: 1rem;
  z-index: 2;
}

.logement-icons-overlay i,
.logement-badge i {
  color: #fff; /* or #fff for white if the background is dark */
}

.logement-location {
  position: absolute;
  bottom: 0;
  left: 0;
  background: rgba(0, 0, 0, 0.6);
  color: white;
  padding: 0.3rem 0.7rem;
  font-size: 0.85rem;
  width: 100%;
  text-align: left;
  z-index: 1;
}

.card-body {
  transition: background 0.3s, transform 0.3s;
}

.card-body:hover {
  background: #fdf7f0;
  transform: scale(1.02);
}

.logement-title {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.2rem;
  color: #111;
}

.price {
  font-size: 0.95rem;
  color: var(--primary-color, #bfa66b); /* Use gold tone */
  margin-bottom: 0.5rem;
  font-weight: 600;
}
.logement-details {
  font-size: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
  color: #555;
  margin-bottom: 0.4rem;
}

.fade-in-up {
  opacity: 0;
  transform: translateY(30px);
  animation: fadeInUp 0.6s ease-out forwards;
}

@keyframes fadeInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.card-actions {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  margin-top: 1rem;
}

.btn-card {
  flex: 1;
  padding: 0.6rem 0;
  text-align: center;
  font-size: 0.95rem;
  font-weight: 500;
  border: 1px solid transparent;
  border-radius: 8px;
  text-decoration: none;
  transition: all 0.3s ease;
  display: inline-block;
}

.btn-view {
  background-color: #f9f9f9;
  color: #444;
  border: 1px solid #ccc;
}

.btn-view:hover {
  background-color: #f0f0f0;
  border-color: #aaa;
}

.btn-show-more {
  background: linear-gradient(90deg, #d4af7f 0%, #ffecd2 100%);
  color: #222 !important;
  font-weight: 700;
  border: none;
  border-radius: 999px;
  padding: 0.85rem 2.2rem;
  font-size: 1.1rem;
  margin-top: 0.7rem;
  box-shadow: 0 2px 8px rgba(191, 166, 107, 0.13);
  transition: background 0.2s, color 0.2s, box-shadow 0.2s;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}

.btn-show-more:hover {
  background: linear-gradient(90deg, #bfa66b 0%, #ffe6b7 100%);
  color: #fff !important;
  box-shadow: 0 4px 16px rgba(191, 166, 107, 0.18);
}

.logement-stars i {
  font-size: 1.1em;
  vertical-align: middle;
  margin-right: 1px;
}
.logement-stars {
  display: flex;
  align-items: center;
  gap: 2px;
  justify-content: center;
}

@media (max-width: 576px) {
  .logements-grid {
    flex-direction: column;
    align-items: center;
  }
  .logement-card {
    min-width: 0;
    margin-bottom: 1.5rem;
    padding: 0.5rem;
  }
}

@media (max-width: 991.98px) {
  .logements-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.2rem;
    padding: 0 0.5rem;
  }
  .logement-card {
    padding: 6px 6px;
  }

  .logements-section {
    padding: 0 1rem;
    padding-top: 2rem; /* Adjust padding for smaller screens */
    aspect-ratio: unset;
    min-height: 400px;
  }

  .btn-show-more {
    max-width: 340px;
    margin: 0 auto 1.5rem auto;
    display: block;
    font-size: 1rem;
    padding: 0.7rem 1.5rem;
  }

  .btn-card {
    padding: 0.3rem 0;
  }
}

@media (max-width: 767.98px) {
  .logements-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0;
  }
  .logement-card {
    margin-bottom: 1.2rem;
    padding: 4px 4px;
  }
}

@media (max-width: 480px) {
  .logements-grid {
    grid-template-columns: 1fr;
    gap: 0.7rem;
    padding: 0;
  }
  .logement-card {
    padding: 2px 2px;
    font-size: 0.97em;
  }
  .logement-img-wrapper {
    height: 130px;
  }
}
