/* Styles pour la page des destinations */

body {
  display: flex;
  flex-direction: row;
  min-height: 100vh;
}

.page-wrapper {
  display: flex;
  flex: 1;
  flex-direction: column;
  margin-left: 300px; /* Largeur de la sidebar */
  width: calc(100% - 300px);
  transition: margin-left 0.3s, width 0.3s;
}

/* Pour le mobile */
body.sidebar-collapsed .page-wrapper {
  margin-left: 0;
  width: 100%;
}

/* Sidebar principale */
.filters-sidebar {
  position: fixed;
  top: 0;
  left: 0;
  width: 300px;
  height: 100vh;
  background: white;
  box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
  padding: 1.5rem;
  overflow-y: auto;
  z-index: 1030;
  transition: left 0.3s ease;
}

/* Pour le mobile - cacher la sidebar */
body.sidebar-collapsed .filters-sidebar {
  left: -300px;
}

/* Style pour le logo dans la sidebar */
.sidebar-logo {
  padding: 0 0 1.5rem;
  margin-bottom: 1.5rem;
  border-bottom: 1px solid #e5e8f5;
  text-align: center;
}

.sidebar-logo .app-logo-header {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Style pour le header de la sidebar */
.sidebar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.5rem;
}

.sidebar-header h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 0;
}

/* Bouton pour fermer la sidebar en mobile */
.close-sidebar-btn {
  display: none;
  color: #666;
  font-size: 1.5rem;
  cursor: pointer;
  transition: color 0.2s;
}

.close-sidebar-btn:hover {
  color: #4e54c8;
}

/* Bouton pour ouvrir la sidebar en mobile */
.open-sidebar-btn {
  display: none;
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: #4e54c8;
  color: white;
  text-align: center;
  line-height: 50px;
  box-shadow: 0 2px 10px rgba(78, 84, 200, 0.3);
  z-index: 1029;
  cursor: pointer;
  transition: transform 0.2s, background 0.2s;
}

.open-sidebar-btn:hover {
  transform: scale(1.05);
  background: #3a40a0;
}

/* Groupes de filtres dans la sidebar */
.sidebar-filter-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e8f5;
}

.sidebar-filter-group:last-child {
  border-bottom: none;
}

.sidebar-filter-group h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  color: #333;
  background: linear-gradient(90deg, #4e54c8, #6a6fc1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Adaptation des filtres pour la sidebar */
.sidebar-filter-buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.sidebar-filter-btn {
  background-color: white;
  border: 1px solid #e3e8f0;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  font-size: 0.9rem;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  display: flex;
  align-items: center;
  justify-content: flex-start;
}

.sidebar-filter-btn i {
  margin-right: 8px;
  font-size: 0.9rem;
  width: 20px;
  text-align: center;
}

.sidebar-filter-btn:hover {
  transform: translateX(2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  border-color: #d0d5e9;
}

.btn-check:checked + .sidebar-filter-btn {
  background: linear-gradient(145deg, #4e54c8, #5c62d6);
  color: white !important;
  border-color: transparent;
  box-shadow: 0 5px 10px rgba(78, 84, 200, 0.25);
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: white !important;
}

/* Styles pour la page des destinations */

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh; /* Utiliser toute la hauteur de la vue */
  color: var(--text-color);
  background: linear-gradient(135deg, #f5f7fa, #e4e8f0);
}


/* Header */
.destinations-header {
  padding: 0rem 0;
  text-align: center;
}

.destinations-header h1 {
  font-size: 2rem;
  font-weight: 700;
}

.destinations-header .subtitle {
  font-size: 1.25rem;
  opacity: 0.9;
}

/* Section des filtres */
.filters-section {
  padding: 1.5rem 0;
  top: 0;
  background: linear-gradient(135deg, #f5f7fa, #e4e8f0);
}

.filters-container {
  background: linear-gradient(135deg, #f5f7fa, #e4e8f0);
  border-radius: 12px;
  padding: 1.25rem;
  box-shadow: 0 8px 25px rgba(108, 114, 147, 0.15);
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.6);
  position: relative;
  overflow: hidden;
}

.filters-container::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  height: 4px;
  width: 100%;
  background: linear-gradient(90deg, #4e54c8, #8f94fb);
}

.filter-group {
  position: relative;
}

.filter-group label {
  display: inline-block;
  margin-bottom: 0.75rem;
  font-weight: 600;
  color: #333;
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  background: linear-gradient(90deg, #4e54c8, #6a6fc1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  position: relative;
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 3px;
}

.filter-btn {
  background-color: white;
  border: 1px solid #e3e8f0;
  padding: 0.25rem 0.25rem;
  border-radius: 8px;
  font-size: 0.5rem;
  transition: all 0.2s;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
}

.filter-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.08);
  border-color: #d0d5e9;
}

.btn-check:checked + .filter-btn {
  background: linear-gradient(145deg, #4e54c8, #5c62d6);
  color: white !important;
  border-color: transparent;
  box-shadow: 0 5px 10px rgba(78, 84, 200, 0.25);
  /* Désactiver tout effet de dégradé de texte */
  background-clip: initial !important;
  -webkit-background-clip: initial !important;
  -webkit-text-fill-color: white !important;
}

/* Assurer que les icônes sont également blanches */
.btn-check:checked + .filter-btn i {
  color: white !important;
  -webkit-text-fill-color: white !important;
}
/* Ajustement spécifique pour les boutons de filtre d'activité */
.col-md-6.col-lg-4 .filter-buttons {
  display: flex;
  flex-wrap: nowrap;
  width: 100%;
  justify-content: space-between;
}

.col-md-6.col-lg-4 .filter-btn {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  white-space: nowrap;
  flex: 1;
  text-align: center;
  margin: 0 2px;
}

.col-md-6.col-lg-4 .filter-btn i {
  margin-right: 4px;
}

/* Slider de prix */
.price-range {
  padding: 0rem 0;
}

.range-slider {
  width: 100%;
}

.price-slider {
  width: 100%;
  -webkit-appearance: none;
  appearance: none;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(to right, #e0e4f5, #d0d5e9);
  outline: none;
  box-shadow: inset 0 1px 3px rgba(0, 0, 0, 0.1);
}

.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #4e54c8, #5c62d6);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s, box-shadow 0.2s;
}

.price-slider::-webkit-slider-thumb:hover {
  transform: scale(1.1);
  box-shadow: 0 3px 8px rgba(78, 84, 200, 0.4);
}

.price-slider::-moz-range-thumb {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: linear-gradient(145deg, #4e54c8, #5c62d6);
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
}

.price-display {
  display: flex;
  justify-content: space-between;
  margin-top: 0.5rem;
  font-size: 0.85rem;
  color: #666;
  font-weight: 500;
}

#price-value {
  color: #4e54c8;
  font-weight: 700;
}

/* Style pour le menu déroulant de tri */
.form-select {
  border: 1px solid #e3e8f0;
  border-radius: 8px;
  padding: 0.6rem 1rem;
  font-size: 0.95rem;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.03);
  transition: all 0.2s;
  background-color: white;
  background-image: linear-gradient(45deg, transparent 50%, #4e54c8 50%), 
                    linear-gradient(135deg, #4e54c8 50%, transparent 50%);
  background-position: calc(100% - 20px) calc(1em + 2px), 
                      calc(100% - 15px) calc(1em + 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  cursor: pointer;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

.form-select:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(78, 84, 200, 0.15);
  border-color: #4e54c8;
}

/* Filtres actifs */
.active-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.active-filter {
  background: linear-gradient(145deg, #f0f3ff, #eaedfa);
  border-radius: 30px;
  padding: 6px 14px;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 3px 6px rgba(0, 0, 0, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.8);
  transition: all 0.2s;
}

.active-filter:hover {
  background: linear-gradient(145deg, #eaedfa, #e5e8f5);
  transform: translateY(-1px);
}

.active-filter i.remove-filter {
  cursor: pointer;
  color: #777;
  transition: all 0.2s;
}

.active-filter i.remove-filter:hover {
  color: #dc3545;
  transform: rotate(90deg);
}

/* Animation d'apparition pour les filtres */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.filter-group {
  animation: fadeInUp 0.5s ease forwards;
}

.filter-group:nth-child(2) {
  animation-delay: 0.1s;
}

.filter-group:nth-child(3) {
  animation-delay: 0.2s;
}

.filter-group:nth-child(4) {
  animation-delay: 0.3s;
}

/* Section des résultats */
.destinations-results {
  padding: 1rem 0;
}

.results-stat {
  margin-bottom: 1.5rem;
  color: #555;
  font-weight: 500;
}

/* SUPPRESSION DES STYLES CONFLICTUELS POUR LES CARDS */
/* Les styles suivants ont été supprimés:
   - .destination-card
   - .destination-card.visible
   - .destination-card:hover
   - .destination-image
   - .budget-info, .budget-amount, .budget-details
   - .destination-content
   - .destination-name
   - .destination-description
   - .destination-meta, .destination-meta span, .destination-meta i
*/

/* Messages d'erreur et pas de résultats */
.no-results, .error-message {
  grid-column: 1 / -1;
  text-align: center;
  padding: 3rem;
  border-radius: 10px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.error-message i {
  font-size: 3rem;
  color: #dc3545;
  margin-bottom: 1rem;
}

/* Loader */
.loader-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(255, 255, 255, 0.9);
  z-index: 9999;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
}

.loader {
  border: 5px solid #f3f3f3;
  border-top: 5px solid #4e54c8;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  animation: spin 1s linear infinite;
  margin-bottom: 15px;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}

/* Style pour le bouton "Afficher plus" */
.load-more-container {
  grid-column: 1 / -1;
  display: flex;
  justify-content: center;
  margin: 2rem 0;
}

.load-more-button {
  padding: 0.75rem 2rem;
  border-radius: 30px;
  font-size: 1rem;
  transition: all 0.3s;
  background: white;
  border: 1px solid #4e54c8;
  color: #4e54c8;
}

.load-more-button:hover {
  background: #4e54c8;
  color: white;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(78, 84, 200, 0.2);
}

.load-more-button i {
  margin-right: 8px;
}

.remaining-count {
  font-size: 0.9rem;
  opacity: 0.8;
}

/* Barre de recherche moderne */
.search-container {
  position: relative;
  margin-bottom: 10px;
  border-radius: 50px;
  background: white;
  box-shadow: 0 6px 20px rgba(78, 84, 200, 0.1);
  transition: all 0.3s;
  border: 1px solid rgba(230, 235, 245, 0.9);
  z-index: 1000; /* S'assurer que le conteneur est au-dessus des autres éléments */
}

.search-container:focus-within {
  box-shadow: 0 8px 25px rgba(78, 84, 200, 0.18);
  transform: translateY(-2px);
  border-color: rgba(78, 84, 200, 0.2);
}

.search-icon {
  position: absolute;
  left: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #4e54c8;
  font-size: 1.2rem;
  z-index: 2;
}

.search-input {
  width: 100%;
  padding: 18px 60px 18px 55px;
  border: none;
  background: transparent;
  font-size: 1.1rem;
  color: #333;
  outline: none;
  border-radius: 50px;
}

.search-clear {
  position: absolute;
  right: 20px;
  top: 50%;
  transform: translateY(-50%);
  color: #999;
  cursor: pointer;
  padding: 5px;
  border-radius: 50%;
  background: #f0f3ff;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.search-clear.visible {
  opacity: 1;
}

/* Styles simplifiés pour les suggestions de recherche */
.search-container {
  position: relative;
  z-index: 1000;
}

.search-suggestions {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 1001;
  background: white;
  border-radius: 15px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
  margin-top: 5px;
  display: none; /* Par défaut caché */
}

.search-suggestions.visible {
  display: block; /* Simplement affiché quand visible */
}

/* Empêcher le confinement des suggestions */
.filters-container, .filters-section, .container, .row, .col-12 {
  overflow: visible !important;
}

/* Styles pour les items de suggestion */
.suggestion-item {
  display: flex;
  align-items: center;
  padding: 12px 20px;
  border-bottom: 1px solid #f0f3ff;
  cursor: pointer;
  transition: background-color 0.2s;
}

.suggestion-item:last-child {
  border-bottom: none;
}

.suggestion-item:hover {
  background-color: #f7f9ff;
}

.suggestion-icon {
  margin-right: 15px;
  width: 35px;
  height: 35px;
  border-radius: 50%;
  background: #f0f3ff;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #4e54c8;
}

.suggestion-content {
  flex-grow: 1;
}

.suggestion-name {
  font-weight: 600;
  color: #333;
  margin-bottom: 2px;
}

.suggestion-type {
  font-size: 0.8rem;
  color: #888;
}

.highlight {
  color: #4e54c8;
  font-weight: 700;
}

/* Animation lors de l'apparition des suggestions */
@keyframes fadeInDown {
  from {
    opacity: 0;
    transform: translateY(-10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.suggestion-item {
  animation: fadeInDown 0.3s forwards;
}

.suggestion-item:nth-child(2) {
  animation-delay: 0.05s;
}

.suggestion-item:nth-child(3) {
  animation-delay: 0.1s;
}

.suggestion-item:nth-child(4) {
  animation-delay: 0.15s;
}

.suggestion-item:nth-child(5) {
  animation-delay: 0.2s;
}

/* Media queries */
@media (max-width: 768px) {
  .destinations-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  }
  
  .filters-container {
    padding: 1rem;
  }
  
  .filter-controls {
    gap: 15px;
  }
}

@media (max-width: 576px) {
  .destinations-grid {
    grid-template-columns: 1fr;
  }
  
  .destinations-header h1 {
    font-size: 1.8rem;
  }
}

@media (max-width: 1199px) {
  .col-md-6.col-lg-4 .filter-btn {
    padding: 0.5rem 0.5rem;
    font-size: 0.8rem;
  }
}

@media (max-width: 991px) {
  .col-md-6.col-lg-4 .filter-buttons {
    flex-wrap: wrap;
  }
  
  .col-md-6.col-lg-4 .filter-btn {
    margin-bottom: 5px;
  }
}

/* Ajouter à votre fichier CSS */
.filter-group button.btn-primary {
  margin-top: 8px;
  transition: all 0.2s ease;
}

.filter-group button.btn-primary:hover {
  background-color: #0056b3;
  transform: translateY(-2px);
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.filter-group button.btn-primary i {
  margin-right: 5px;
}

.btn-price{
  background-color: #4e54c8;
  color: white;
}

/* Ajoutez ces règles pour adapter les suggestions de recherche à la sidebar */

.filters-sidebar .search-container {
  margin-bottom: 0;
  width: 100%;
}

.filters-sidebar .search-suggestions {
  width: 100%;
  max-height: 300px;
  overflow-y: auto;
}

@media (max-width: 991px) {
  .filters-sidebar .search-suggestions {
    max-width: 85vw; /* Pour éviter qu'elle dépasse sur mobile */
  }
}

/* Ajustements pour déplacer le logo au centre et les filtres actifs en haut */

/* Logo au centre de la page */
.page-logo {
  text-align: center;
  padding: 1rem 0 0.5rem;  /* Réduit de 1.5rem à 0.5rem en bas */
  margin-bottom: 0;  /* Supprime la marge sous le logo */
}

.page-logo .app-logo-header {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.page-logo .logo-icon {
  font-size: 1.8rem;
  margin-right: 0.5rem;
  color: #4e54c8;
}

.page-logo .logo-text {
  font-size: 1.8rem;
  font-weight: 700;
  background: linear-gradient(90deg, #4e54c8, #8f94fb);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Réorganisation des filtres actifs */
.active-filters-container {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e8f5;
  order: -1; /* Forcer à apparaître en premier */
}

/* Container flex pour la sidebar */
.sidebar-content {
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Ajustement de marges pour les filtres actifs */
.active-filters {
  margin-top: 0;
}

.active-filter-title {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 1rem;
  color: #333;
  background: linear-gradient(90deg, #4e54c8, #6a6fc1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Ajustement de la page-wrapper pour compenser le logo */
.page-wrapper {
  margin-top: 0;
}

/* Ajustement pour le mobile */
@media (max-width: 991px) {
  .page-wrapper {
    margin-left: 0;
    width: 100%;
  }
  
  /* Pour le bouton de sidebar en position fixe */
  .open-sidebar-btn {
    display: block;
  }
  
  /* Pour le panneau d'overlay */
  body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
  }
}

/* Styles pour les sections repliables dans la sidebar */
.sidebar-filter-group {
  margin-bottom: 1.5rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid #e5e8f5;
}

.sidebar-filter-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  cursor: pointer;
  user-select: none;
  margin-bottom: 1rem;
}

.sidebar-filter-header h4 {
  font-size: 0.85rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 0; /* Supprimé la marge bottom pour l'intégrer dans le header */
  color: #333;
  background: linear-gradient(90deg, #4e54c8, #6a6fc1);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.sidebar-filter-header .toggle-icon {
  color: #4e54c8;
  font-size: 0.85rem;
  transition: transform 0.3s ease;
}

.sidebar-filter-content {
  max-height: 300px;
  overflow: hidden;
  transition: max-height 0.3s ease, opacity 0.3s ease, transform 0.3s ease;
  transform-origin: top;
  opacity: 1;
  transform: scaleY(1);
}

.sidebar-filter-group.collapsed .sidebar-filter-content {
  max-height: 0;
  opacity: 0;
  transform: scaleY(0);
  margin-top: 0;
}

.sidebar-filter-group.collapsed .toggle-icon {
  transform: rotate(-90deg);
}

/* Animation pour les transitions */
@keyframes slideDown {
  from {
    max-height: 0;
    opacity: 0;
    transform: scaleY(0);
  }
  to {
    max-height: 300px;
    opacity: 1;
    transform: scaleY(1);
  }
}

@keyframes slideUp {
  from {
    max-height: 300px;
    opacity: 1;
    transform: scaleY(1);
  }
  to {
    max-height: 0;
    opacity: 0;
    transform: scaleY(0);
  }
}

.sidebar-filter-group:not(.collapsed) .sidebar-filter-content {
  animation: slideDown 0.3s forwards;
}

.sidebar-filter-group.collapsed .sidebar-filter-content {
  animation: slideUp 0.3s forwards;
}

/* Améliorations du responsive design */

/* Ajustement de base pour la sidebar et le contenu */
.filters-sidebar {
  width: 280px;  /* Légèrement plus étroite */
  height: 100vh;
  overflow-y: auto;
  scrollbar-width: thin;
}

.page-wrapper {
  margin-left: 280px;
  width: calc(100% - 280px);
}

/* Optimisation de l'affichage des cards */
.destinations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  max-width: 1600px; /* Limite la largeur maximale de la grille */
  margin: 0 auto; /* Centre la grille */
}

/* Gestion responsive améliorée */
@media (max-width: 1200px) {
  .destinations-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 1.25rem;
  }
  
  .sidebar-filter-btn {
    padding: 0.4rem 0.75rem;
    font-size: 0.85rem;
  }
}

@media (max-width: 992px) {
  /* Ajustements pour tablettes */
  .filters-sidebar {
    left: -280px;
    z-index: 1050;
    box-shadow: none;
  }
  
  body.sidebar-open .filters-sidebar {
    left: 0;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.2);
  }
  
  .page-wrapper {
    margin-left: 0;
    width: 100%;
  }
  
  .destinations-grid {
    grid-template-columns: repeat(2, 1fr); /* Toujours 2 colonnes sur tablette */
    gap: 1rem;
  }
  
  .close-sidebar-btn, 
  .open-sidebar-btn {
    display: block;
  }
  
  .sidebar-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1040;
    opacity: 0;
    transition: opacity 0.3s;
    backdrop-filter: blur(2px);
  }
  
  body.sidebar-open .sidebar-overlay {
    display: block;
    opacity: 1;
  }
  
  /* Amélioration de la navigation mobile */
  .open-sidebar-btn {
    bottom: 20px;
    left: 20px;
  }
}

@media (max-width: 768px) {
  /* Optimisations pour mobiles */
  .destinations-grid {
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    padding: 0.75rem;
  }
  
  .filters-sidebar {
    width: 85%;
    max-width: 300px;
    left: -85%;
    padding: 1.25rem;
  }
  
  .sidebar-filter-buttons {
    gap: 6px;
  }
  
  .sidebar-filter-btn {
    padding: 0.35rem 0.7rem;
    font-size: 0.8rem;
  }
  
  .page-logo .logo-icon {
    font-size: 1.5rem;
  }
  
  .page-logo .logo-text {
    font-size: 1.5rem;
  }
  
  .destinations-header h1 {
    font-size: 1.6rem;
  }
  
  .destinations-header .subtitle {
    font-size: 1rem;
  }
  
  /* Améliorer la recherche sur mobile */
  .search-input {
    padding: 14px 50px 14px 45px;
    font-size: 1rem;
  }
  
  .search-icon {
    left: 15px;
  }
  
  .search-clear {
    right: 15px;
  }
}

@media (max-width: 576px) {
  /* Petits smartphones */
  .destinations-grid {
    grid-template-columns: 1fr; /* Une seule colonne */
    gap: 1rem;
  }
  
  .sidebar-filter-group {
    margin-bottom: 1.25rem;
    padding-bottom: 1.25rem;
  }
  
  /* Rendre le menu plus compact */
  .sidebar-filter-header h4 {
    font-size: 0.8rem;
  }
  
  .sidebar-header h3 {
    font-size: 1.1rem;
  }
  
  .sidebar-filter-btn i {
    width: 16px;
    margin-right: 6px;
  }
}

@media (max-width: 480px) {
  /* Très petits écrans */
  .filters-sidebar {
    width: 90%;
    left: -90%;
    padding: 1rem;
  }
  
  .sidebar-filter-btn {
    padding: 0.35rem 0.6rem;
    font-size: 0.75rem;
  }
  
  .form-select {
    padding: 0.5rem 0.75rem;
    font-size: 0.9rem;
  }
}

/* Optimisations performances pour mobile */
@media (max-width: 992px) {
  .sidebar-filter-content {
    transition: max-height 0.25s ease, opacity 0.25s ease, transform 0.25s ease;
  }
  
  /* Réduire les animations sur mobile pour de meilleures performances */
  @keyframes slideDown {
    from {
      max-height: 0;
      opacity: 0;
    }
    to {
      max-height: 300px;
      opacity: 1;
    }
  }
  
  @keyframes slideUp {
    from {
      max-height: 300px;
      opacity: 1;
    }
    to {
      max-height: 0;
      opacity: 0;
    }
  }
}

/* Fix pour les scrollbars de la sidebar */
.filters-sidebar::-webkit-scrollbar {
  width: 5px;
}

.filters-sidebar::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 5px;
}

.filters-sidebar::-webkit-scrollbar-thumb {
  background: #c1c3d7;
  border-radius: 5px;
}

.filters-sidebar::-webkit-scrollbar-thumb:hover {
  background: #8f94fb;
}

/* Ajout d'un style pour les inputs sur mobile */
@media (max-width: 768px) {
  input, select, button {
    font-size: 16px !important; /* Empêche le zoom sur iPhone */
  }
  
  .search-input {
    font-size: 16px !important;
  }
}

/* Correction des cards pour une taille plus cohérente */
.destination-card {
  height: 100%;
  display: flex;
  flex-direction: column;
}

.destination-content {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.destination-description {
  flex: 1;
}

/* Éviter les problèmes de débordement */
* {
  box-sizing: border-box;
  max-width: 100%;
}

img {
  max-width: 100%;
  height: auto;
}

/* Ajustement de la taille des cartes en responsive */

/* Mise à jour de la grille principale pour limiter la taille maximale */
.destinations-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  padding: 1rem;
  max-width: 1600px; /* Limite la largeur maximale de la grille */
  margin: 0 auto; /* Centre la grille */
}

/* Ajustements pour grand écran */
@media (min-width: 1400px) {
  .destinations-grid {
    grid-template-columns: repeat(3, minmax(200px, 420px)); /* Limite la taille max des cartes */
    justify-content: center;
  }
}


@media (max-width: 1400px) {  
  .destinations-grid {
    grid-template-columns: repeat(2, minmax(80px, 370px)); /* Limite la taille maximale en mode 2 colonnes */
    justify-content: center;
    gap: 1.25rem;
  }
}
/* Ajustements pour tablettes */
@media (max-width: 992px) {  
  .destinations-grid {
    grid-template-columns: repeat(2, minmax(80px, 300px)); /* Limite la taille maximale en mode 2 colonnes */
    justify-content: center;
    gap: 1.25rem;
  }
  
  /* Limiter la taille des images pour garder des proportions cohérentes */
  .destination-card .destination-image {
    height: 200px; /* Hauteur fixe pour les images */
  }
}

/* Ajustements pour mobiles */
@media (max-width: 768px) {
  .destinations-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 180px));
    gap: 1rem;
    padding: 0.75rem;
    max-width: 550px; /* Limiter la largeur max sur mobile */
  }
}

/* Ajustements pour petits écrans */
@media (max-width: 576px) {
  .destinations-grid {
    grid-template-columns: minmax(120px, 300px); /* Une seule colonne, mais avec taille minimale */
    max-width: 400px; /* Limiter encore plus sur petit écran */
  }
  
  /* Réduire un peu la hauteur des images sur mobile */
  .destination-card .destination-image {
    height: 180px;
  }
}

/* Amélioration des cartes pour avoir des proportions cohérentes */
.destination-card {
  height: 100%;
  display: flex;
  flex-direction: column;
  max-width: 450px; /* Limite absolue par carte */
  margin: 0 auto; /* Centre chaque carte */
}

.destination-image {
  width: 100%;
  height: 220px; /* Hauteur fixe pour les images */
  object-fit: cover;
  border-radius: 12px 12px 0 0;
  overflow: hidden;
}

/* S'assurer que les images s'affichent correctement */
.destination-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

/* Correction des marges et alignements */

/* Réduire la marge sous le logo */
.page-logo {
  text-align: center;
  padding: 1rem 0 0.5rem;  /* Réduit de 1.5rem à 0.5rem en bas */
  margin-bottom: 0;  /* Supprime la marge sous le logo */
}

/* Ajuster le header des destinations */
.destinations-header {
  padding: 0;  /* Supprime le padding */
  text-align: center;
  margin-bottom: 1rem;  /* Ajoute une petite marge en bas */
}

.destinations-header .subtitle {
  font-size: 1.1rem;
  margin-top: 0;
  margin-bottom: 0.5rem;
}

/* Correction de l'alignement du compteur de résultats */
.results-stat {
  text-align: left;
  padding-left: 1.5rem;  /* Aligner avec la grille */
  margin: 0 auto 1rem;  /* Centrer et ajouter marge sous le compteur */
  font-size: 0.95rem;
  padding: 0.5rem 1.5rem;
  color: #555;
  text-align: center;
}

/* Ajuster le padding de la grille */
.destinations-results {
  padding: 0;  /* Supprime le padding */
}

.destinations-grid {
  padding: 0 1.5rem;  /* Ajoute un padding horizontal uniforme */
}

/* Correction pour l'alignement sur mobile */
@media (max-width: 768px) {
  .results-stat {
    padding-left: 1rem;
  }
  
  .destinations-grid {
    padding: 0 1rem;
  }
}

/* Pour très petits écrans */
@media (max-width: 576px) {
  .results-stat {
    padding-left: 0.75rem;
    text-align: center;  /* Centrer sur très petits écrans */
  }
  
  .destinations-grid {
    padding: 0 0.75rem;
  }
}

/* Assurer que la structure des sections est cohérente */
.destinations-results .container {
  padding: 0;  /* Supprime le padding du conteneur */
  width: 100%;
  max-width: none;  /* Permet d'utiliser toute la largeur disponible */
}

/* Ajustements pour éviter que la sidebar soit coupée par le bandeau d'URL mobile */

/* Ajouter ces styles pour corriger le problème sur les appareils mobiles */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .filters-sidebar {
    height: 101vh;
    /* Utiliser les variables d'environnement safe-area */
    height: -webkit-fill-available + 20px;
    padding-bottom: calc(env(safe-area-inset-bottom));
    /* S'assurer que le contenu est accessible */
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  
  .sidebar-content {
    padding-bottom: calc(env(safe-area-inset-bottom));
  }
  
  /* Ajustement pour le bouton d'ouverture de la sidebar */
  .open-sidebar-btn {
    bottom: calc(env(safe-area-inset-bottom));
  }
}

/* Pour Safari iOS */
@supports (-webkit-touch-callout: none) {
  .filters-sidebar {
    /* Hauteur fixe pour iOS */
    height: -webkit-fill-available + 5px;
    padding-bottom: calc( 15px + env(safe-area-inset-bottom));
  }

  .open-sidebar-btn {
    bottom: calc(1rem + env(safe-area-inset-bottom));
  }

  .last-filter{
    height: 150px;
  }
}

/* S'assurer que le contenu n'est pas coupé au bas de la sidebar */
.sidebar-filter-group:last-child {
  margin-bottom: calc(env(safe-area-inset-bottom, 0px));
}

/* Empêcher les problèmes de défilement */
html, body {
  height: 100%;
}

body {
  /* Important pour iOS */
  position: fixed;
  overflow-y: auto;
  width: 100%;
  -webkit-overflow-scrolling: touch;
}