/* ========================================
   CSS PAGE RÉSULTATS DE RECHERCHE
   Mon Décor à Louer
   ========================================
*/

/* === NAVBAR SCROLL FIX === */
.navbar_component.is-scrolled {
  background-color: #ffffff !important;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08) !important;
  transition: background-color 0.2s ease, box-shadow 0.2s ease !important;
}

/* === HERO SECTION === */
.search-results-hero {
  background: transparent;
  padding: 10px 0;
  /* Margin réduit autour de la carte */
  border-bottom: none;
}

/* === CARD STYLE FOR HEADER === */
.search-header-card {
  background-color: #ffffff;
  border-radius: 24px;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.05);
  padding: 60px 40px;
  /* Padding original restauré */
  max-width: 900px;
  margin: 0 auto;
  text-align: center;
}

.search-results-title {
  font-size: 32px;
  font-weight: 700;
  color: #18383B;
  margin: 0 0 8px 0;
  text-align: center;
}

.search-results-query {
  font-size: 16px;
  color: #666;
  text-align: center;
  margin: 0 0 24px 0;
}

.search-results-query span {
  font-weight: 600;
  color: #4199A1;
}

/* === BARRE DE RECHERCHE INLINE === */
.inline-search-bar {
  max-width: 600px;
  margin: 0 auto;
}

.inline-search-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border: 2px solid transparent;
  border-radius: 12px;
  padding: 0 8px 0 16px;
  /* Ajusté pour laisser de la place aux boutons à droite */
  transition: all 0.25s ease;
  background:
    linear-gradient(#ffffff, #ffffff) padding-box,
    linear-gradient(135deg, #4199A1, #18383B) border-box;
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  /* Empêche tout débordement */
}

.inline-search-wrapper:focus-within {
  box-shadow: 0 4px 16px rgba(65, 153, 161, 0.15);
  transform: translateY(-1px);
}

.inline-search-icon {
  display: none;
  /* Masquer l'icône de loupe à gauche */
}

.inline-search-input {
  flex: 1;
  border: none;
  outline: none;
  padding: 14px 0;
  font-size: 15px;
  color: #18383B;
  background: transparent;
  font-family: inherit;
}

.inline-search-input::placeholder {
  color: #999;
}

.inline-search-clear {
  display: none;
  /* Par défaut masqué, géré par JS */
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 4px;
  margin: 0 2px;
  color: #666;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
  font-size: 20px;
  line-height: 1;
  width: 32px;
  height: 32px;
}

/* On garde le display: flex !important si l'utilisateur veut qu'il soit toujours là, 
   mais on va plutôt réactiver le JS pour qu'il soit intelligent */

.inline-search-clear:hover {
  background: #f5f5f5;
  color: #18383B;
}

.inline-search-submit {
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  margin-left: 8px;
  color: #4199A1;
  border-radius: 50%;
  transition: all 0.2s ease;
  flex-shrink: 0;
}

.inline-search-submit:hover {
  background: #f5f5f5;
}

/* === LAYOUT PRINCIPAL === */
.search-results-section {
  padding: 40px 0;
}

.search-results-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
  align-items: start;
}

/* === SIDEBAR FILTRES === */
.search-filters {
  position: sticky;
  top: 100px;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  padding: 24px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

/* Custom scrollbar pour les filtres */
.search-filters::-webkit-scrollbar {
  width: 6px;
}

.search-filters::-webkit-scrollbar-track {
  background: transparent;
}

.search-filters::-webkit-scrollbar-thumb {
  background: #E0E0E0;
  border-radius: 3px;
}

.search-filters::-webkit-scrollbar-thumb:hover {
  background: #CACACA;
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 2px solid #f0f0f0;
}

.filters-header h3 {
  font-size: 18px;
  font-weight: 700;
  color: #18383B;
  margin: 0;
}

.filters-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.filters-reset {
  background: transparent;
  border: none;
  color: #4199A1;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  padding: 4px 8px;
  border-radius: 4px;
  transition: all 0.2s ease;
}

.filters-reset:hover {
  background: rgba(65, 153, 161, 0.1);
}

/* === GROUPES DE FILTRES === */
.filter-group {
  margin-bottom: 24px;
}

.filter-group:last-child {
  margin-bottom: 0;
}

.filter-title {
  font-size: 14px;
  font-weight: 700;
  color: #18383B;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin: 0 0 12px 0;
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-checkbox {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  transition: background 0.2s ease;
}

.filter-checkbox:hover {
  background: #f8f9fa;
}

.filter-checkbox input[type="checkbox"] {
  width: 18px;
  height: 18px;
  cursor: pointer;
  accent-color: #4199A1;
}

.filter-checkbox span {
  flex: 1;
  font-size: 14px;
  color: #18383B;
}

.filter-checkbox .filter-count {
  flex: none;
  /* S'adapte au contenu */
  font-size: 12px;
  color: #000000;
  background: #f5f5f5;
  padding: 2px 8px;
  border-radius: 10px;
  font-weight: 600;
}

/* === BARRE D'OUTILS RÉSULTATS === */
.results-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding: 16px 20px;
  background: #f8f9fa;
  border-radius: 8px;
}

.results-info {
  font-size: 15px;
  font-weight: 600;
  color: #18383B;
}

.results-sort {
  display: flex;
  align-items: center;
  gap: 10px;
}

.results-sort label {
  font-size: 14px;
  color: #666;
  font-weight: 500;
}

.sort-select {
  padding: 8px 12px;
  font-size: 14px;
  color: #18383B;
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 6px;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s ease;
}

.sort-select:hover {
  border-color: #4199A1;
}

.sort-select:focus {
  outline: none;
  border-color: #4199A1;
  box-shadow: 0 0 0 3px rgba(65, 153, 161, 0.1);
}

/* === LOADING STATE === */
.results-loading {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
}

.loader-spinner-large {
  width: 48px;
  height: 48px;
  border: 4px solid #f3f3f3;
  border-top: 4px solid #4199A1;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.results-loading p {
  margin: 0;
  font-size: 16px;
  color: #666;
  font-weight: 500;
}

/* === EMPTY STATE === */
.results-empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 20px;
  gap: 16px;
  text-align: center;
}

.results-empty h3 {
  font-size: 20px;
  font-weight: 600;
  color: #18383B;
  margin: 0;
}

.results-empty p {
  font-size: 15px;
  color: #999;
  margin: 0;
  max-width: 400px;
}

/* === GRILLE DE RÉSULTATS === */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

/* === CARTE RÉSULTAT === */
.result-card {
  background: #ffffff;
  border: 1px solid #e0e0e0;
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}

.result-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  border-color: #4199A1;
}

.result-card-image {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #f5f5f5;
}

.result-card-content {
  padding: 16px;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.result-card-type {
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: #4199A1;
  margin: 0 0 8px 0;
}

.result-card-name {
  font-size: 16px;
  font-weight: 600;
  color: #18383B;
  margin: 0 0 8px 0;
  line-height: 1.4;
}

.result-card-meta {
  font-size: 13px;
  color: #999;
  margin: 0 0 12px 0;
  flex: 1;
}

.result-card-price {
  font-size: 18px;
  font-weight: 700;
  color: #4199A1;
  margin-top: auto;
  /* Pousse vers le bas */
  align-self: flex-end;
  /* Aligne à droite */
}




/* Highlight du texte recherché */
.search-highlight {
  background: linear-gradient(135deg, rgba(65, 153, 161, 0.2), rgba(24, 56, 59, 0.2));
  color: #18383B;
  font-weight: 700;
  padding: 0 2px;
  border-radius: 2px;
}

/* Cache l'overlay par défaut (Desktop) */
.filters-overlay {
  display: none;
}

/* === RESPONSIVE === */
@media (max-width: 991px) {
  .search-results-layout {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  /* Bouton toggle filtres (visible uniquement ici) */
  .mobile-filter-toggle {
    display: flex !important;
    align-items: center;
    justify-content: center;
    gap: 8px;
    width: 100%;
    padding: 12px;
    background: #ffffff;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-weight: 600;
    color: #18383B;
    cursor: pointer;
    margin-bottom: 16px;
    transition: all 0.2s ease;
  }

  .mobile-filter-toggle:hover {
    background: #f8f9fa;
    border-color: #4199A1;
    color: #4199A1;
  }

  /* Filtres en mode Drawer latéral */
  .search-filters {
    display: block !important;
    /* On annule le display toggle précédent */
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 85%;
    max-width: 360px;
    height: 100svh !important;
    min-height: 100svh !important;
    z-index: 1002;
    background: #ffffff;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.15);
    overflow-y: auto;
    padding: 24px;
    margin: 0;
    border-radius: 0;
    border: none;
    border-left: 1px solid #e0e0e0;
  }

  .search-filters.active {
    transform: translateX(0);
  }

  /* Overlay sombre */
  .filters-overlay {
    display: block;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
  }

  .filters-overlay.active {
    opacity: 1;
    pointer-events: auto;
  }

  .search-results-hero {
    padding: 0 !important;
  }

  .search-results-hero .padding-section-small {
    padding-top: 20px !important;
    padding-bottom: 10px !important;
  }

  .search-header-card {
    padding: 60px 40px;
    /* Retour au padding premium */
  }

  .search-results-section {
    padding-top: 0 !important;
  }

  .search-results-section .padding-section-small {
    padding-top: 10px !important;
  }

  .search-results-content {
    order: 2;
  }

  .results-grid {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .filters-close {
    display: inline-flex !important;
    background: transparent;
    border: none;
    padding: 4px;
    cursor: pointer;
    color: #666;
    transition: color 0.2s ease;
  }

  .filters-close:hover {
    color: #18383B;
  }
}

@media (max-width: 767px) {
  .search-results-title {
    font-size: 24px;
  }

  .search-results-hero .padding-section-small {
    padding-top: 10px !important;
    padding-bottom: 5px !important;
  }

  .search-header-card {
    padding: 40px 24px;
  }

  .results-toolbar {
    flex-direction: column;
    align-items: flex-start;
    gap: 12px;
  }

  .results-grid {
    grid-template-columns: 1fr;
  }

  .inline-search-input {
    font-size: 16px;
    /* Évite le zoom sur iOS */
  }
}