/* LOGEMENTS */
.logements-section {
  width: 100%;
  min-height: auto; /* Allow flexible height based on content */
  padding: 2rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
  box-sizing: border-box;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  color: inherit; /* Use inherited text color instead of forcing white */
  text-align: center;
}

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

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

.logement-card {
  background: var(--bg-white);
  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: 400px; /* Increased from 340px for better mobile display */
  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: 200px; /* Increased from 180px for better mobile display */
  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: var(
    --bg-white
  ); /* or var(--bg-white) for white if the background is dark */
}

.logement-icons-overlay .paw-disabled {
  opacity: 0.4;
}

.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;
  padding: 1rem;
  flex-grow: 1;
  display: flex;
  flex-direction: column;
}

.card-body:hover {
  background: var(--bg-warm);
  transform: scale(1.02);
}

.logement-title {
  font-size: 1.1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--text-primary);
  line-height: 1.3;
}

.price {
  font-size: 1rem;
  color: var(--primary-color, var(--primary-color)); /* Use gold tone */
  margin-bottom: 0.8rem;
  font-weight: 600;
}
.logement-details {
  font-size: 0.85rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  color: var(--text-muted);
  margin-bottom: 0.5rem;
  margin-top: auto; /* Push to bottom of card */
}

.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: var(--bg-warm);
  color: var(--text-secondary);
  border: 1px solid var(--border-medium);
}

.btn-view:hover {
  background-color: var(--bg-secondary);
  border-color: var(--text-light);
}

.btn-show-more {
  background: transparent;
  color: var(--primary-color);
  border: 2px solid var(--primary-color);
  padding: var(--spacing-sm) var(--spacing-xl);
  border-radius: var(--radius-full);
  font-weight: 600;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  text-decoration: none;
  display: inline-block;
  text-align: center;
  transition: all var(--transition-normal);
  cursor: pointer;
  min-width: 160px;
  margin-top: 0.7rem;
}

.btn-show-more:hover {
  background: var(--gradient-primary);
  color: var(--bg-white) !important;
  border-color: var(--primary-dark);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  text-decoration: none;
}

.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;
  margin-bottom: 0.5rem;
}

.logement-stars .ms-1 {
  margin-left: 0.5rem;
  font-size: 0.8rem;
}

/* Show more button styling */
.show-more-container {
  text-align: center;
  margin-top: 2rem;
  padding: 0 1rem;
  display: flex;
  justify-content: center;
  align-items: center;
}

.show-more-container .btn-outline-primary {
  min-width: 200px;
  min-height: 44px;
  padding: 0.75rem 1.5rem;
  font-size: 1rem;
  display: flex !important;
  align-items: center !important;
  justify-content: center !important;
  text-align: center !important;
  vertical-align: middle;
  line-height: 1.2 !important;
  transition: all 0.3s ease;
  white-space: nowrap;
}

.show-more-container .btn-outline-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

@media (max-width: 576px) {
  .logements-section {
    padding: 1rem 0.75rem 1.5rem 0.75rem;
    margin-top: 0.5rem;
    margin-bottom: 1rem;
  }
  
  .logements-section .section-title-luxury {
    font-size: 1.5rem;
    margin-bottom: 1rem;
  }
  
  .logements-section .luxury-divider {
    margin: 1rem auto;
  }
}

@media (max-width: 480px) {
  .logements-section {
    padding: 0.75rem 0.5rem 1rem 0.5rem;
    margin-top: 0.25rem;
  }
  
  .logements-section .section-title-luxury {
    font-size: 1.25rem;
    line-height: 1.3;
  }
}

@media (max-width: 360px) {
  .logements-section {
    padding: 0.5rem 0.25rem 0.75rem 0.25rem;
  }
}

@media (max-width: 576px) {
  .logements-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 0 0.5rem;
  }
  .logement-card {
    min-width: 0;
    max-width: 100%;
    margin: 0 auto 1.5rem auto;
    padding: 12px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
  }

  .logement-img-wrapper {
    height: 200px; /* Better proportion on mobile */
  }

  .logement-title {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
  }

  .price {
    font-size: 1.05rem;
    margin-bottom: 0.8rem;
  }

  .logement-details {
    font-size: 0.9rem;
    gap: 1rem;
    margin-bottom: 0.8rem;
  }

  .card-body {
    padding: 1rem;
  }

  .show-more-container {
    margin-top: 2rem;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .show-more-container .btn-outline-primary {
    width: 100%;
    max-width: none;
    padding: 1rem 2rem;
    font-size: 1rem;
    min-height: 50px;
    border-radius: 12px;
    text-transform: none;
    letter-spacing: normal;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }
}

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

  .logements-section {
    padding: 1.5rem 1rem;
    padding-top: 2rem; /* Adjust padding for smaller screens */
    margin-top: 1.5rem;
    margin-bottom: 1.5rem;
    min-height: auto;
  }

  .show-more-container {
    margin-top: 1.5rem;
    padding: 0 1rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .show-more-container .btn-outline-primary {
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    font-size: 0.95rem;
    padding: 0.8rem 1.5rem;
    letter-spacing: 0.3px;
    min-width: 200px;
    min-height: 48px;
    line-height: 1.2 !important;
    text-align: center !important;
  }

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

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

  .show-more-container .btn-outline-primary {
    width: calc(100% - 1rem);
    max-width: none;
    padding: 0.9rem 1.5rem;
    font-size: 0.95rem;
    min-height: 48px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }
}

@media (max-width: 480px) {
  .logements-grid {
    grid-template-columns: 1fr;
    gap: 1rem;
    padding: 0 0.25rem;
  }
  .logement-card {
    padding: 8px;
    font-size: 1em;
    margin: 0 auto 1rem auto;
  }
  .logement-img-wrapper {
    height: 180px;
  }

  .logement-title {
    font-size: 1rem;
  }

  .price {
    font-size: 1rem;
  }

  .logement-details {
    font-size: 0.85rem;
  }

  .show-more-container {
    padding: 0 0.5rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .show-more-container .btn-outline-primary {
    width: 100%;
    padding: 1rem;
    font-size: 0.9rem;
    min-height: 48px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }
}

/* Touch-friendly improvements for mobile */
@media (max-width: 768px) {
  .logement-card a {
    display: block;
    text-decoration: none;
    -webkit-tap-highlight-color: transparent;
  }

  .logement-card:active {
    transform: scale(0.98);
  }

  /* Improve touch targets */
  .logement-details span {
    padding: 0.2rem 0;
    display: inline-block;
  }

  /* Better spacing on mobile */
  .logements-section {
    padding: 1rem 0.5rem 2rem 0.5rem;
    margin-top: 1rem;
    margin-bottom: 1rem;
    min-height: auto;
  }

  /* Ensure proper scroll on mobile */
  .logements-grid {
    overflow-x: visible;
    -webkit-overflow-scrolling: touch;
  }
}

/* Very small screens optimization */
@media (max-width: 360px) {
  .logements-grid {
    padding: 0 0.125rem;
  }

  .logement-card {
    margin: 0 auto 0.8rem auto;
    border-radius: 8px;
  }

  .show-more-container {
    padding: 0 0.25rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .show-more-container .btn-outline-primary {
    padding: 0.8rem 1rem;
    font-size: 0.85rem;
    border-radius: 8px;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1.2 !important;
    text-align: center !important;
  }
}
