.modal {
  display: none;
  position: fixed;
  z-index: 1000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: rgba(0, 0, 0, 0.5);
}

.modal-content {
  background-color: #fff;
  margin: 5% auto;
  padding: 0;
  border-radius: 10px;
  width: 70%;
  max-width: 1200px;
  box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  max-height: 85vh;
  overflow: hidden;
}

/* Header */
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-bottom: 1px solid #eee;
}

.modal-title {
  margin: 0;
  font-size: 24px;
  color: #333;
  font-weight: 600;
}

.close-modal {
  background: none;
  border: none;
  font-size: 28px;
  color: #999;
  cursor: pointer;
  transition: color 0.2s;
}

.close-modal:hover {
  color: #333;
}

/* Corps du modal */
.modal-body {
  padding: 30px;
  overflow-y: auto;
  flex: 1;
}

/* Grille pour 2 colonnes */
.modal-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 30px;
  margin-bottom: 30px;
}

.modal-column {
  min-width: 0;
}

/* Sections de filtres */
.filter-section {
  margin-bottom: 25px;
}

.filter-section.full-width {
  grid-column: 1 / -1;
}

.filter-section h4 {
  margin: 0 0 15px 0;
  font-size: 20px;
  color: #333;
  font-weight: 600;
}

.filter-content {
  background-color: #f9f9f9;
  border-radius: 8px;
  overflow: hidden;
}

.filter-content.amenities-content {
  padding: 0;
}

/* Nouveau style simplifié pour les menus déroulants */
.simple-dropdown-container {
  position: relative;
  width: 100%;
  margin-bottom: 15px;
}

.dropdown-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 12px 15px;
  background-color: #fff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  text-align: left;
  transition: all 0.2s;
}

.dropdown-toggle:hover {
  border-color: #ccc;
}

.dropdown-toggle.active {
  border-color: #ba967e;
  border-bottom-left-radius: 0;
  border-bottom-right-radius: 0;
}

.dropdown-label {
  font-size: 14px;
  color: #666;
  text-align: left;
  margin-right: auto;
}

.dropdown-count {
  display: inline-block;
  padding: 0 6px;
  background-color: #ba967e;
  color: white;
  font-size: 12px;
  border-radius: 10px;
  margin-right: 8px;
  opacity: 0;
  transition: opacity 0.2s;
}

.dropdown-count.show {
  opacity: 1;
}

.dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 100%;
  background-color: #fff;
  border: 1px solid #ba967e;
  border-top: none;
  border-radius: 0 0 6px 6px;
  box-shadow: 0 5px 15px rgba(0,0,0,0.1);
  z-index: 100;
  display: none;
  margin-top: -1px;
}

.dropdown-menu.show {
  display: block;
}

.dropdown-search-bar {
  position: relative;
  padding: 10px 15px;
  border-bottom: 1px solid #eee;
}

.dropdown-search-bar .search-icon {
  position: absolute;
  left: 25px;
  top: 50%;
  transform: translateY(-50%);
  color: #aaa;
}

.dropdown-search-input {
  width: 100%;
  padding: 10px 10px 10px 35px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  font-size: 14px;
}

.dropdown-search-input:focus {
  border-color: #ba967e;
  outline: none;
  box-shadow: 0 0 0 2px rgba(186, 150, 126, 0.15);
}

.dropdown-options {
  max-height: 250px;
  overflow-y: auto;
  padding: 10px 0;
}

.dropdown-option {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: left;
}

.dropdown-option:hover {
  background-color: #f5f5f5;
}

.dropdown-option.selected {
  background-color: rgba(186, 150, 126, 0.1);
}

.checkbox-wrapper {
  display: flex;
  align-items: center;
  width: 100%;
}

.checkbox-wrapper input[type="checkbox"] {
  margin-right: 10px;
  min-width: 16px;
  height: 16px;
}

.option-wrapper {
  width: 100%;
  text-align: left;
}

.option-label {
  font-size: 14px;
  color: #444;
}

/* Style pour la scrollbar des options */
.dropdown-options::-webkit-scrollbar {
  width: 6px;
}

.dropdown-options::-webkit-scrollbar-track {
  background: #f8f8f8;
  border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb {
  background: #ddd;
  border-radius: 3px;
}

.dropdown-options::-webkit-scrollbar-thumb:hover {
  background: #ba967e;
}

/* Style spécifique pour les options des quartiers */
#locationOptions .dropdown-option {
  display: flex;
  align-items: center;
  padding: 8px 15px;
  cursor: pointer;
  transition: background-color 0.2s;
  text-align: left;
}

#locationOptions .checkbox-wrapper {
  flex-direction: row;
  justify-content: flex-start;
}

#locationOptions .checkbox-wrapper input[type="checkbox"] {
  margin-right: 10px;
  float: left;
  position: relative;
  top: 2px;
}

#locationOptions .option-label {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: calc(100% - 30px);
}

#locationOptions .dropdown-option {
  justify-content: space-between;
}

#locationOptions .dropdown-option .option-text {
  flex: 1;
  text-align: right;
  padding-right: 15px;
}

/* Grille pour les équipements */
.amenities-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 10px;
  padding: 15px;
  max-height: none;
  overflow-y: visible;
}

/* Style pour les équipements */
.amenities-grid .option-item {
  background-color: #f9f9f9;
  border-radius: 6px;
  padding: 10px 15px;
  margin-bottom: 5px;
  border: 1px solid transparent;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.amenities-grid .option-item:hover {
  background-color: #f0f0f0;
  border-color: #e0e0e0;
}

.amenities-grid .option-item.selected {
  background-color: rgba(186, 150, 126, 0.1);
  border-color: rgba(186, 150, 126, 0.3);
}

.amenities-grid .option-item .option-label {
  margin-right: auto;
}

.amenities-grid .option-item .form-checkbox {
  margin-left: 10px;
}

/* Footer de la modal */
.modal-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 30px;
  border-top: 1px solid #eee;
  background-color: #f9f9f9;
}

.counter-section {
  font-size: 14px;
  color: #666;
  display: flex;
  align-items: center;
}

.filter-counter {
  font-weight: 600;
  color: #ba967e;
  margin-right: 5px;
}

.action-buttons {
  display: flex;
  gap: 15px;
}

.btn {
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 15px;
  cursor: pointer;
  transition: all 0.2s;
  border: none;
  font-weight: 500;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid #ba967e;
  color: #ba967e;
}

.btn-outline:hover {
  background-color: rgba(186, 150, 126, 0.1);
}

.btn-primary {
  background-color: #ba967e;
  color: white;
  border: 1px solid #ba967e;
}

.btn-primary:hover {
  background-color: #a68069;
}

/* Scrollbar personnalisée */
.options-container::-webkit-scrollbar,
.amenities-grid::-webkit-scrollbar {
  width: 8px;
}

.options-container::-webkit-scrollbar-track,
.amenities-grid::-webkit-scrollbar-track {
  background: #f1f1f1;
  border-radius: 4px;
}

.options-container::-webkit-scrollbar-thumb,
.amenities-grid::-webkit-scrollbar-thumb {
  background: #ccc;
  border-radius: 4px;
}

.options-container::-webkit-scrollbar-thumb:hover,
.amenities-grid::-webkit-scrollbar-thumb:hover {
  background: #ba967e;
}

/* Responsive */
@media (max-width: 991px) {
  .modal-content {
    width: 90%;
    margin: 4% auto;
    max-height: 85vh;
  }
  
  .simple-dropdown-container {
    margin-bottom: 12px;
  }
  
  .dropdown-toggle {
    padding: 10px 12px;
  }
  
  .dropdown-options {
    max-height: 200px;
  }
}

@media (max-width: 767px) {
  .modal-content {
    width: 95%;
    margin: 2% auto;
    max-height: 95vh;
  }
  
  .modal-grid {
    grid-template-columns: 1fr;
    gap: 15px;
    margin-bottom: 20px;
  }
  
  .modal-header, 
  .modal-body, 
  .modal-footer {
    padding: 15px;
  }
  
  .modal-header {
    flex-wrap: wrap;
    gap: 10px;
  }
  
  .amenities-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 8px;
  }
  
  .modal-title {
    font-size: 18px;
  }
  
  .filter-section {
    margin-bottom: 15px;
  }
  
  .filter-section h4 {
    font-size: 18px;
    margin-bottom: 10px;
  }
  
  .dropdown-options {
    max-height: 180px;
  }
  
  .modal-footer {
    flex-direction: column;
    gap: 15px;
    align-items: center;
  }
  
  .action-buttons {
    width: 100%;
    display: flex;
    justify-content: space-between;
  }
  
  .btn {
    padding: 8px 16px;
    font-size: 14px;
  }
  
  .dropdown-option {
    padding: 8px 10px;
  }
  
  .option-label {
    font-size: 13px;
  }
  
  .dropdown-menu {
    max-height: 250px;
    overflow-y: auto;
    box-shadow: 0 5px 15px rgba(0,0,0,0.15);
    border-radius: 0 0 6px 6px;
  }
  
  .dropdown-search-bar {
    position: sticky;
    top: 0;
    background-color: white;
    z-index: 10;
    padding: 10px;
  }
  
  .dropdown-search-input {
    height: 36px;
    font-size: 14px;
  }
  
  .checkbox-wrapper {
    padding: 2px 0;
  }
  
  .checkbox-wrapper input[type="checkbox"] {
    min-width: 18px;
    height: 18px;
    margin-right: 8px;
  }
  
  .amenities-grid .option-item {
    padding: 10px;
    min-height: auto;
  }
  
  .modal-body {
    -webkit-overflow-scrolling: touch;
  }
  
  .dropdown-options {
    -webkit-overflow-scrolling: touch;
  }
  
  .dropdown-option,
  .amenities-grid .option-item,
  .btn,
  .dropdown-toggle,
  .close-modal {
    touch-action: manipulation;
  }
  
  .dropdown-toggle,
  .dropdown-option,
  .btn,
  .close-modal {
    min-height: 44px;
  }
  
  .dropdown-search-input {
    font-size: 16px;
  }
  
  .dropdown-option:active,
  .amenities-grid .option-item:active,
  .btn:active {
    opacity: 0.7;
  }
}

/* Pour les très petits écrans comme iPhone SE */
@media (max-width: 375px) {
  .modal-content {
    width: 98%;
    margin: 1% auto;
  }
  
  .modal-header, 
  .modal-body, 
  .modal-footer {
    padding: 12px 10px;
  }
  
  .amenities-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 6px;
  }
  
  .dropdown-toggle {
    padding: 8px 10px;
    font-size: 13px;
  }
  
  .modal-title {
    font-size: 16px;
  }
  
  .btn {
    padding: 8px 12px;
    font-size: 13px;
  }
  
  .counter-section {
    font-size: 13px;
  }
  
  .dropdown-menu {
    max-height: 200px;
  }
  
  .filter-section h4 {
    font-size: 17px;
  }
}

/* Style spécifique pour les cases à cocher des quartiers */
#locationOptions input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
  width: 18px;
  height: 18px;
  border: 1px solid #ccc;
  border-radius: 2px;
  margin-right: 12px;
  position: relative;
  top: 1px;
  background-color: #fff;
  cursor: pointer;
}

#locationOptions input[type="checkbox"]:checked {
  background-color: #ba967e;
  border-color: #ba967e;
}

#locationOptions input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  width: 4px;
  height: 8px;
  border: solid white;
  border-width: 0 2px 2px 0;
  top: 3px;
  left: 6px;
  transform: rotate(45deg);
}

#locationOptions .checkbox-wrapper {
  display: flex;
  align-items: center;
}

#locationOptions .option-label {
  color: #333;
  font-size: 14px;
  line-height: 1.4;
  cursor: pointer;
}

/* Aligner le texte à droite */
#locationOptions .dropdown-option {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

#locationOptions .dropdown-option .checkbox-wrapper {
  flex: 1;
  flex-direction: row;
  justify-content: flex-start;
}

/* Styles pour le menu dropdown */
.dropdown-search-bar {
  border-bottom: 1px solid #eee;
  padding: 8px 12px;
}

.dropdown-search-input {
  border: 1px solid #ddd;
  border-radius: 4px;
  padding: 8px 8px 8px 35px;
  font-size: 14px;
  width: 100%;
}

/* Style pour les checkboxes des équipements */
.amenities-grid .form-checkbox__mark {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  border: 1px solid #ccc;
  border-radius: 2px;
  background-color: white;
}

.amenities-grid .form-checkbox__mark.checked,
.amenities-grid input[type="checkbox"]:checked + .form-checkbox__mark {
  background-color: #ba967e;
  border-color: #ba967e;
}

.amenities-grid .form-checkbox__icon {
  display: none;
}

.amenities-grid .form-checkbox__mark.checked .form-checkbox__icon,
.amenities-grid input[type="checkbox"]:checked + .form-checkbox__mark .form-checkbox__icon {
  display: block;
  position: absolute;
  width: 10px;
  height: 10px;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  color: white;
}

.amenities-grid .form-checkbox input[type="checkbox"] {
  position: absolute;
  opacity: 0;
  cursor: pointer;
  height: 0;
  width: 0;
}

