/* ---------------------------------------------------
 🎨 Thème principal - Variables de couleur
--------------------------------------------------- */
:root {
  --lavaux-blue: #0b284a;
  --lavaux-gray: #202225;
  --lavaux-orange: #f58220;
  --lavaux-light: #f4f4f4;
  --text-color: #333;
  --border-color: #ddd;
}


/* ---------------------------------------------------
 🔍 Conteneur principal
--------------------------------------------------- */
main.recherche {
  padding: 10px;
}

.search-container {
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
  padding: 25px 20px;
  width: 100%;
}


/* ---------------------------------------------------
 🔎 Barre de recherche
--------------------------------------------------- */
.input-group .btn-primary {
  background-color: var(--lavaux-gray);
  border: none;
  transition: 0.2s ease;
}
.input-group .btn-primary:hover {
  background-color: var(--lavaux-orange);
}


/* ---------------------------------------------------
 🧩 Zone des filtres
--------------------------------------------------- */

/* Ligne compacte (inactive mais conservée) */
.filters-checkbox-row {}

/* Label pour groupe inline */
.filter-group-inline label {
  font-weight: 600;
  color: var(--lavaux-gray);
  margin-right: 10px;
  font-size: 0.95rem;
}

/* Groupes de cases à cocher */
.checkbox-group {}

.form-check-input:checked {}

/* Séparateur entre les types de filtres */
.filters-separator {
  border: none;
  border-top: 1px solid #ccc;
  margin: 10px 0 20px 0;
  opacity: 0.4;
}

/* Grille fluide des filtres select */
.filters-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 15px 20px;
  margin: 15px 0 25px;
}

/* Label commun */
.filter-group label {
  font-weight: 600;
  color: var(--lavaux-gray);
  margin-bottom: 6px;
  display: block;
  font-size: 0.95rem;
}

/* Inputs / selects */
.form-select,
.form-control {
  border-radius: 6px;
  border: 1px solid var(--border-color);
  transition: all 0.2s ease;
  font-size: 0.95rem;
}
.form-select:focus,
.form-control:focus {
  border-color: var(--lavaux-orange);
  box-shadow: 0 0 0 0.2rem rgba(245, 130, 32, 0.25);
}


/* ---------------------------------------------------
 🧰 Bouton de réinitialisation
--------------------------------------------------- */
#resetFilters {
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
#resetFilters:hover {
  color: var(--lavaux-orange);
  text-decoration: underline;
}

/* ---------------------------------------------------
 🧰 Bouton pour enregistrer la recherche
--------------------------------------------------- */
#saveSearchBtn {
  cursor: pointer;
  font-size: 0.9rem;
  transition: color 0.2s ease;
}
#saveSearchBtn:hover {
  color: var(--lavaux-orange);
  text-decoration: underline;
}


/* ---------------------------------------------------
 📦 Résumé des résultats
--------------------------------------------------- */
.results-summary {
  background: #fdfdfd;
  border-left: 4px solid var(--lavaux-gray);
  padding: 15px 20px;
  border-radius: 8px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
  margin: 20px 0;
  font-size: 0.95rem;
}
.results-summary p {
  margin: 0;
  font-style: italic;
  color: #555;
}
.results-summary p:first-letter {
  text-transform: uppercase;
}


/* ---------------------------------------------------
 🛒 Liste des produits
--------------------------------------------------- */
.results-liste {
  margin-top: 25px;
}
.results-liste ul {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 20px;
}
.results-liste li {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.05);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  display: flex;
  flex-direction: column;
}
.results-liste li:hover {
  transform: translateY(-4px);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

/* Image produit */
.product-img {
  background: #f9f9f9;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 160px;
  overflow: hidden;
}
.product-img img {
  max-height: 140px;
  max-width: 100%;
  object-fit: contain;
  transition: transform 0.2s ease;
}
.results-liste li:hover .product-img img {
  transform: scale(1.05);
}

/* Infos produit */
.product-info {
  padding: 12px 15px;
  display: flex;
  flex-direction: column;
  gap: 5px;
}
.product-info h3 {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--lavaux-gray);
  margin: 0;
}
.product-meta {
  font-size: 0.85rem;
  color: #555;
}
.product-meta strong {
  color: var(--lavaux-gray);
}
.price {
  margin-top: 5px;
  font-size: 1rem;
  font-weight: 600;
  color: var(--lavaux-orange);
}
.price strike {
  color: #999;
  margin-right: 6px;
}
.category-logo {
  margin-top: auto;
  text-align: right;
}
.category-logo img {
  max-height: 30px;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}
.results-liste li:hover .category-logo img {
  opacity: 1;
}


/* ---------------------------------------------------
 📄 Pagination
--------------------------------------------------- */
.pagination-nav .page-link {
  color: var(--lavaux-gray);
  border-radius: 6px;
}
.pagination-nav .page-item.active .page-link {
  background-color: var(--lavaux-orange);
  border-color: var(--lavaux-orange);
  color: #fff;
}
@media (max-width: 768px) {
  /* .pagination-nav.top { display: none; } */
}


/* ---------------------------------------------------
 💰 Curseur de prix
--------------------------------------------------- */
.price-slider-container {
  position: relative;
  height: 35px;
}
.filter-group input[type="range"] {
  width: 100%;
  appearance: none;
  height: 6px;
  border-radius: 5px;
  background: var(--border-color);
  outline: none;
  cursor: pointer;
  position: absolute;
  top: 15px;
}
.filter-group input[type="range"]::-webkit-slider-thumb {
  appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--lavaux-orange);
  border: 2px solid #fff;
  box-shadow: 0 0 2px rgba(0,0,0,0.3);
  cursor: pointer;
  position: relative;
  z-index: 3;
}
.price-display {
  text-align: center;
  margin-top: 8px;
  font-weight: 600;
  color: var(--lavaux-gray);
}


/* ---------------------------------------------------
 ✅ Choices.js (sélecteurs)
--------------------------------------------------- */
.choices__list--multiple .choices__item {
  background-color: var(--lavaux-gray) !important;
  color: #fff !important;
  border: none !important;
  border-radius: 4px;
  font-size: 0.85rem;
  font-weight: 500;
  padding: 4px 8px !important;
}
.choices__list--multiple .choices__item[data-deletable]::after {
  color: #fff !important;
  opacity: 0.8;
}
.choices__inner {
  background-color: #fff !important;
  color: #000 !important;
  border: 1px solid #ccc !important;
}
.choices__placeholder {
  color: #888 !important;
}
.choices__list--dropdown .choices__item--selectable.is-highlighted {
  background-color: var(--lavaux-orange) !important;
  color: #fff !important;
}
.choices__list--dropdown,
.choices__list[role=listbox] {
  touch-action: auto !important;
  -webkit-overflow-scrolling: touch;
  overflow-y: auto !important;
  max-height: 240px;
}


/* ---------------------------------------------------
 📱 Optimisation mobile / compacte
--------------------------------------------------- */

/* ✅ Conteneur général */
.filters-container {
  margin-bottom: 15px;
}

/* Bouton d’ouverture mobile */
.filters-toggle {
  background-color: var(--lavaux-gray);
  color: #fff;
  border: none;
  width: 100%;
  padding: 5px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
}

/* Contenu repliable — LOGIQUE D’ORIGINE MAINTENUE */
.filters-content {
  transition: max-height 0.3s ease, opacity 0.2s ease;
  overflow: hidden;
  max-height: 0;
  opacity: 0;
  padding:3px ;
  /* border:1px solid #000000 ; */
}
.filters-content.active {
  max-height: 1200px; /* assez grand pour tout montrer */
  opacity: 1;
}

/* Compactage des groupes */
.filter-group,
.filters-radio-row,
.filters-checkbox-row {
  /* margin-bottom: 10px; */
}

.filter-group label,
.filters-radio-row > div:first-child,
.filters-checkbox-row > div:first-child {
  font-weight: 600;
  color: var(--lavaux-gray);
  font-size: 0.9rem;
  margin-bottom: 4px;
}

.form-check,
.checkbox-group {
  margin-bottom: 4px;
}

/* Réduction des espacements */
.filters-grid {
  gap: 10px;
  margin: 10px 0;
}

/* 📱 Spécifique mobile */
@media (max-width: 768px) {
  .filters-toggle {
    display: block;
  }
  .filters-radio-row,
  .filters-checkbox-row {
    display: block;
  }
  .form-check-inline {
    display: inline-block;
    margin-right: 10px;
  }
  .filters-container label,
  .filter-group label,
  .form-check-label {
    font-size: 0.85rem;
  }
  .choices__inner {
    min-height: 36px;
    font-size: 0.85rem;
  }
}

/* 📱 Grille produits plus compacte */
@media (max-width: 480px) {
  .results-liste ul {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 10px;
  }
  .product-img { height: 100px; }
  .product-info { padding: 8px 10px; }
  .price { font-size: 0.9rem; }
}


/* ---------------------------------------------------
 🧍 Responsive global
--------------------------------------------------- */
@media (max-width: 992px) {
  .search-container { padding: 20px 15px; }
}
@media (max-width: 768px) {
  .input-group { flex-direction: column; }
  .input-group .form-control {
    width: 100%;
    margin-bottom: 10px;
  }
  .input-group .btn { width: 100%; }
  .filters-grid { grid-template-columns: 1fr; }
  .results-liste ul {
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  }
  .product-img { height: 130px; }
}
@media (max-width: 480px) {
  .search-container { padding: 15px; }
  .filters-grid { gap: 10px; }
  .results-summary { font-size: 0.9rem; }
}


/* ---------------------------------------------------
 🧩 Initialisation JS multiselect
--------------------------------------------------- */
.js-multiselect {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease;
}
.js-multiselect.is-ready {
  opacity: 1;
  visibility: visible;
}




.saved-searches {
  background: #fff;
  border-radius: 8px;
  padding: 15px;
  margin: 20px 0;
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

.saved-searches h4 {
  color: var(--lavaux-gray);
  margin-bottom: 10px;
}

.saved-searches ul {
  list-style: none;
  padding: 0;
}

.saved-searches li {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  border-bottom: 1px solid #eee;
}

.saved-searches a {
  color: var(--lavaux-gray);
  text-decoration: none;
}

.saved-searches button {
  border: none;
  background: none;
  color: var(--lavaux-orange);
  cursor: pointer;
  font-size: 1rem;
}




.save-search-container .btn {
  background-color: var(--lavaux-gray);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 6px 12px;
  font-size: 0.9rem;
  transition: background-color 0.2s ease;
}

.save-search-container .btn:hover {
  background-color: var(--lavaux-orange);
}


/* ========LISTE DES RECHERCHES FAVORITES==========  */
/* Conteneur de chaque favori */
.favorite-item {
  display: inline-flex;
  align-items: center;
}

/* Bouton principal (le lien .btn) */
.favorite-item .btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  padding-right: 2rem; /* espace pour la croix */
}

/* Croix rouge de suppression */
.favorite-item .deleteFav {
  position: absolute;
  right: 0.6rem;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  line-height: 1;
}

.favorite-item .deleteFav svg {
  width: 16px;
  height: 16px;
  fill: #dc3545; /* rouge Bootstrap */
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.favorite-item .deleteFav:hover svg {
  transform: scale(1.15);
  opacity: 0.85;
}
