/* ============================================================
   CCC FILTRES STYLE — version SAFE
   - Style visuel
   - Sticky CSS natif sur le bloc filtre, avec overflow:visible
     ciblé UNIQUEMENT sur la chaîne directe d'ancêtres (3 sélecteurs).
   ============================================================ */

/* === STICKY (approche n°4 : JS-driven via classe .ccc-sticky-on) ===
   Pas de position:sticky CSS (trop fragile avec h-100 / flex-column ancestors).
   Le JS toggle .ccc-sticky-on et calcule left/width dynamiquement. */

/* max-height EN PERMANENCE (pas seulement quand sticky) — limite la sidebar
   à la hauteur du viewport, avec scroll interne si plus haute. */
.PM_ASBlockOutputVertical{
  max-height: calc(100vh - 40px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #d1d5db transparent;
}
.PM_ASBlockOutputVertical::-webkit-scrollbar{ width: 5px; }
.PM_ASBlockOutputVertical::-webkit-scrollbar-track{ background: transparent; }
.PM_ASBlockOutputVertical::-webkit-scrollbar-thumb{ background: #d1d5db; border-radius: 3px; }

.PM_ASBlockOutputVertical.ccc-sticky-on{
  position: fixed !important;
  top: 20px !important;
  z-index: 50;
}
/* Etat "stopped" : on a atteint le bas de la grille produits, sidebar ancrée en absolute */
.PM_ASBlockOutputVertical.ccc-sticky-stopped{
  z-index: 50;
}

/* === BARRE TRI/COMPTEUR (#js-product-list-top) — style assorti au filtre === */
#js-product-list-top{
  background: #fff !important;
  border: 1px solid rgba(0,0,0,.04) !important;
  border-radius: 6px !important;
  padding: 10px 16px !important;
  box-shadow: none !important;
  margin-bottom: 14px !important;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  color: #6b7e95 !important;
  display: flex !important;
  align-items: center !important;
  flex-wrap: nowrap !important;
  gap: 12px !important;
}

/* Compteur "Il y a X produits" : couleur subtile, pas en cyan */
#js-product-list-top .total-products,
#js-product-list-top .total-products p{
  font-family: inherit !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #8a99ab !important;
  background: transparent !important;
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  flex: 1 1 auto !important;
}

/* "Trier par :" label */
#js-product-list-top .sort-by{
  font-family: inherit !important;
  font-size: 12.5px !important;
  font-weight: 400 !important;
  color: #8a99ab !important;
  margin: 0 8px 0 0 !important;
  padding: 0 !important;
  border: none !important;
  white-space: nowrap !important;
}

/* Icônes grille/liste — style minimaliste */
#js-product-list-top .grid-or-list{
  display: flex !important;
  align-items: center !important;
  gap: 4px !important;
  margin: 0 4px 0 0 !important;
  padding: 0 !important;
  background: transparent !important;
}
#js-product-list-top .grid-or-list a,
#js-product-list-top .grid-or-list .grid,
#js-product-list-top .grid-or-list .list{
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  width: 28px !important;
  height: 28px !important;
  background: transparent !important;
  border-radius: 4px !important;
  cursor: pointer !important;
  transition: background .15s ease, color .15s ease !important;
  color: #b3bfca !important;
  padding: 0 !important;
}
#js-product-list-top .grid-or-list a i,
#js-product-list-top .grid-or-list .grid i,
#js-product-list-top .grid-or-list .list i,
#js-product-list-top .grid-or-list a .material-icons,
#js-product-list-top .grid-or-list .grid .material-icons,
#js-product-list-top .grid-or-list .list .material-icons{
  font-size: 18px !important;
  color: inherit !important;
}
#js-product-list-top .grid-or-list a:hover,
#js-product-list-top .grid-or-list .grid:hover,
#js-product-list-top .grid-or-list .list:hover{
  background: #f3faff !important;
  color: #2fadce !important;
}
#js-product-list-top .grid-or-list .selected,
#js-product-list-top .grid-or-list .active,
#js-product-list-top .grid-or-list a.active,
#js-product-list-top .grid-or-list a.selected{
  background: #eaf5fb !important;
  color: #2fadce !important;
}

/* Selecteur "Trier par" */
#js-product-list-top .products-sort-order,
#js-product-list-top .products-sort-order .select-title,
#js-product-list-top .products-sort-order > a{
  font-family: inherit !important;
  font-size: 12.5px !important;
  color: #6b7e95 !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  border-radius: 4px !important;
  padding: 6px 28px 6px 12px !important;
  background: #fff !important;
  text-decoration: none !important;
  display: inline-flex !important;
  align-items: center !important;
  cursor: pointer !important;
  transition: border-color .15s ease, background .15s ease !important;
  position: relative !important;
}
#js-product-list-top .products-sort-order:hover,
#js-product-list-top .products-sort-order .select-title:hover,
#js-product-list-top .products-sort-order > a:hover{
  border-color: rgba(47, 173, 206, 0.3) !important;
  background: #f3faff !important;
}
#js-product-list-top .products-sort-order .select-title i,
#js-product-list-top .products-sort-order > a i{
  margin-left: 6px !important;
  color: #b3bfca !important;
  font-size: 16px !important;
}
#js-product-list-top .products-sort-order .dropdown-menu{
  border: 1px solid rgba(0,0,0,.06) !important;
  border-radius: 4px !important;
  box-shadow: 0 4px 14px rgba(0,0,0,0.06) !important;
  margin-top: 4px !important;
  padding: 4px !important;
  font-family: inherit !important;
}
#js-product-list-top .products-sort-order .dropdown-menu a,
#js-product-list-top .products-sort-order .dropdown-menu .select-list{
  font-size: 12.5px !important;
  color: #6b7e95 !important;
  padding: 6px 12px !important;
  border-radius: 3px !important;
  display: block !important;
}
#js-product-list-top .products-sort-order .dropdown-menu a:hover,
#js-product-list-top .products-sort-order .dropdown-menu .select-list:hover{
  background: #f3faff !important;
  color: #2fadce !important;
  text-decoration: none !important;
}
#js-product-list-top .products-sort-order .dropdown-menu .selected{
  color: #2fadce !important;
  font-weight: 500 !important;
}

/* Si la barre utilise un <select> natif au lieu du dropdown custom */
#js-product-list-top select,
#js-product-list-top .form-control{
  font-family: inherit !important;
  font-size: 12.5px !important;
  color: #6b7e95 !important;
  border: 1px solid rgba(0,0,0,.06) !important;
  border-radius: 4px !important;
  padding: 5px 28px 5px 12px !important;
  background-color: #fff !important;
  height: auto !important;
  cursor: pointer !important;
  outline: none !important;
  box-shadow: none !important;
  transition: border-color .15s ease, background .15s ease !important;
  appearance: none !important;
  -webkit-appearance: none !important;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b3bfca' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>") !important;
  background-repeat: no-repeat !important;
  background-position: right 8px center !important;
  background-size: 12px !important;
}
#js-product-list-top select:hover,
#js-product-list-top .form-control:hover{
  border-color: rgba(47, 173, 206, 0.3) !important;
  background-color: #f3faff !important;
}
#js-product-list-top select:focus,
#js-product-list-top .form-control:focus{
  border-color: #2fadce !important;
  background-color: #fff !important;
}

/* Sticky JS-driven */
#js-product-list-top.ccc-bar-sticky-on{
  position: fixed !important;
  top: 20px !important;
  z-index: 49;
  margin-bottom: 0 !important;
  box-shadow: 0 2px 12px rgba(0,0,0,0.05) !important;
}
#js-product-list-top.ccc-bar-sticky-stopped{
  z-index: 49;
}

/* === CARD CONTAINER (même contour que les blocs produits du thème) === */
.PM_ASBlockOutput .card{
  border: 1px solid rgba(0,0,0,.04);
  border-radius: 6px;
  box-shadow: none;
  overflow: hidden;
  background: #fff;
}
.PM_ASBlockOutput .card-header{
  background: #f6fafd;
  border-bottom: 1px solid rgba(0,0,0,.04);
  padding: 12px 14px;
}
.PM_ASBlockOutput .PM_ASBlockTitle{
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #8a99ab;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: 0;
  text-transform: none;
}
.PM_ASBlockOutput .PM_ASBlockTitle::before{
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232fadce' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polygon points='22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
  flex-shrink: 0;
}
.PM_ASBlockOutput .PM_ASBlockNbProductValue{
  display: inline-block;
  margin-left: auto;
  background: transparent;
  padding: 0;
  color: #a8b4c2;
  font-size: 11px;
  font-weight: 400;
  border: none;
}
.PM_ASBlockOutput .card-block{
  padding: 4px 8px 10px !important;
}

/* === RESET BUTTON (caché par défaut, visible uniquement quand des filtres sont actifs) === */
.PM_ASResetSearch{
  display: none !important;
  text-align: center;
  margin: 8px 4px !important;
  padding: 6px 12px;
  background: transparent;
  color: #a3b1c0 !important;
  font-size: 11px;
  font-weight: 400;
  text-decoration: none !important;
  border: 1px solid #e6eef5;
  border-radius: 4px;
  letter-spacing: 0;
  text-transform: none;
  transition: all .15s ease;
}
.PM_ASResetSearch.ccc-show{
  display: block !important;
}
.PM_ASResetSearch:hover{
  background: #f4faff;
  color: #2fadce !important;
  border-color: #2fadce;
}

/* === ACCORDION HEADERS === */
/* Annule tous les borders parasites du module pm_advancedsearch4 */
.PM_ASCriterionsGroup,
.PM_ASCriterionsOutput,
.PM_ASCriterions,
.PM_ASCriterionsGroupTitle,
.PM_ASCriterionsGroupOuter{
  border-top: none !important;
  border-left: none !important;
  border-right: none !important;
  border-bottom: none !important;
}
/* Notre seule séparation : très clair, bleu CCC à 8% d'opacité */
.PM_ASCriterionsGroup{
  border-bottom: 1px solid rgba(47, 173, 206, 0.08) !important;
  margin: 0 !important;
}
.PM_ASCriterionsGroup:last-child{ border-bottom: none !important; }

.PM_ASCriterionsGroupTitle{
  margin: 0 !important;
  padding: 11px 8px 11px 8px !important;
  display: flex;
  align-items: center;
  cursor: pointer;
  user-select: none;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 13px !important;
  font-weight: 400 !important;
  color: #a8b6c4;
  transition: color .15s ease, background .18s ease;
  border-radius: 4px;
}
.PM_ASCriterionsGroupTitle:hover{
  color: #2fadce;
  background: #f3faff;
}
.PM_ASCriterionsGroupTitle:hover .ccc-filter-icon{ stroke: #2fadce; }
.PM_ASCriterionsGroupName{
  display: flex !important;
  align-items: center;
  gap: 9px;
  flex: 1;
  font-size: 13px;
}

/* SVG icon container (injecté par JS) — bleu CCC */
.ccc-filter-icon{
  width: 15px;
  height: 15px;
  flex-shrink: 0;
  stroke: #2fadce;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: stroke .15s ease;
  opacity: .85;
}
.PM_ASCriterionsGroupTitle:hover .ccc-filter-icon,
.PM_ASCriterionsGroup.is-active .ccc-filter-icon{ opacity: 1; }

/* Caret accordéon */
.PM_ASCriterionsGroupTitle::after{
  content: "";
  width: 10px;
  height: 10px;
  margin-left: 8px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23b8c5d1' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-size: contain;
  transition: transform .25s cubic-bezier(0.4, 0, 0.2, 1);
}
/* État replié : flèche pointe à droite */
.PM_ASCriterionsGroup.is-collapsed .PM_ASCriterionsGroupTitle::after{ transform: rotate(-90deg); }
/* Hover quand replié : décalage vers la droite (translateY car repère pivoté) */
.PM_ASCriterionsGroup.is-collapsed .PM_ASCriterionsGroupTitle:hover::after{
  transform: rotate(-90deg) translateY(3px);
}
/* Hover quand déplié : flèche descend légèrement */
.PM_ASCriterionsGroupTitle:hover::after{
  transform: translateY(2px);
}
/* Hover sur un groupe ACTIF : flèche bleu CCC aussi */
.PM_ASCriterionsGroupTitle:hover::after{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%232fadce' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
}
.PM_ASCriterionsGroup.is-active .PM_ASCriterionsGroupTitle{ color: #2fadce; }
.PM_ASCriterionsGroup.is-active .ccc-filter-icon{ stroke: #2fadce; }

/* Compteur nb actifs sur titre */
.ccc-filter-count{
  margin-left: 6px;
  background: #2fadce;
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  padding: 0 6px;
  border-radius: 9px;
  line-height: 16px;
  height: 16px;
  display: inline-flex;
  align-items: center;
}

/* === GROUPE OUTER (collapse) === */
.PM_ASCriterionsGroupOuter{
  padding: 0 4px 8px;
  max-height: 1000px;
  opacity: 1;
  overflow: hidden;
  transition: max-height .25s ease, opacity .15s ease, padding .25s ease;
}
.PM_ASCriterionsGroup.is-collapsed .PM_ASCriterionsGroupOuter{
  max-height: 0 !important;
  opacity: 0;
  padding-top: 0;
  padding-bottom: 0;
}

/* === SELECT NATIF CACHÉ === */
.ccc-filters-enhanced .PM_ASCriterionStepEnable .PM_ASCriterionGroupSelect{
  display: none !important;
}

/* === LISTE CHECKBOX CUSTOM === */
.ccc-filter-list{
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.ccc-filter-item{ margin: 0; }
.ccc-filter-checkbox{
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.ccc-filter-label{
  display: flex !important;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 5px 6px;
  cursor: pointer;
  border-radius: 3px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif !important;
  font-size: 12.5px;
  color: #b3bfca;
  transition: background .12s ease, color .12s ease;
  margin: 0;
  font-weight: 400 !important;
  line-height: 1.4;
}
.ccc-filter-label:hover{ background: #f4faff; color: #6b7e95; }
.ccc-filter-label::before{
  content: "";
  width: 14px;
  height: 14px;
  border: 1.5px solid #dde7f0;
  border-radius: 3px;
  flex-shrink: 0;
  background: #fff;
  transition: all .12s ease;
}
.ccc-filter-checkbox:checked + .ccc-filter-label{
  color: #2fadce;
  font-weight: 500;
}
.ccc-filter-checkbox:checked + .ccc-filter-label::before{
  background: #2fadce;
  border-color: #2fadce;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='10' viewBox='0 0 10 10' fill='%23fff'%3E%3Cpath d='M3.7 7.3L1.6 5.2 2.6 4.2l1.1 1.1L7.4 1.6l1 1z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: center;
}
.ccc-filter-name{
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-weight: inherit;
}
.ccc-filter-count-badge{
  background: transparent;
  color: #9ca3af;
  font-size: 11px;
  font-weight: 400;
  padding: 0;
  border-radius: 0;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.ccc-filter-checkbox:checked + .ccc-filter-label .ccc-filter-count-badge{
  color: #2fadce;
}

/* === CHIPS FILTRES ACTIFS === */
.ccc-active-filters{
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin: 0 0 18px;
  padding: 0;
  background: transparent;
  border: none;
}
.ccc-active-filters:empty{ display: none; }
.ccc-active-filters-label{
  font-size: 12px;
  font-weight: 400;
  color: #6b7280;
  margin-right: 2px;
  letter-spacing: 0;
  text-transform: none;
  font-style: normal;
}
.ccc-active-chip{
  display: inline-flex;
  align-items: center;
  gap: 0;
  padding: 4px 4px 4px 12px;
  background: #fff;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  font-size: 12.5px;
  color: #1a202c;
  font-weight: 400;
  transition: all .15s ease;
  line-height: 1.4;
}
.ccc-active-chip:hover{
  border-color: #2fadce;
  color: #2fadce;
  background: #f0fdff;
}
.ccc-active-chip-x{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 18px;
  height: 18px;
  margin-left: 6px;
  background: transparent;
  color: inherit;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  padding: 0;
  font-weight: 400;
  opacity: .55;
  transition: all .12s ease;
}
.ccc-active-chip:hover .ccc-active-chip-x{ opacity: 1; }
.ccc-active-chip-x:hover{ background: #2fadce; color: #fff !important; opacity: 1 !important; }
.ccc-active-clear-all{
  margin-left: 4px;
  padding: 4px 8px;
  background: transparent;
  border: none;
  color: #6b7280;
  font-size: 12px;
  font-weight: 400;
  cursor: pointer;
  letter-spacing: 0;
  text-transform: none;
  transition: color .15s ease;
  text-decoration: underline;
  text-decoration-color: transparent;
}
.ccc-active-clear-all:hover{
  color: #dc2626;
  text-decoration-color: currentColor;
  background: transparent;
}

/* === HIDE le bloc "Filtres actifs" NATIF de pm_advancedsearch4 (doublon de notre version épurée) === */
#js-active-search-filters,
.PM_ASSelectionsBlock.active_filters,
.PM_ASSelections.active_filters{
  display: none !important;
}

/* === SLIDER PRIX / RANGE (jQuery UI) === */
.PM_ASCriterionStepEnable{
  padding: 14px 8px 8px;
}
.PM_ASCritRange,
.PM_ASCritRange .ui-slider{
  position: relative;
  height: 4px;
  background: #e4eef6;
  border: none !important;
  border-radius: 2px;
  margin: 4px 8px 14px;
  box-shadow: none !important;
}
.PM_ASCritRange .ui-slider-range{
  position: absolute;
  background: #2fadce !important;
  height: 100%;
  border: none !important;
  border-radius: 2px;
}
.PM_ASCritRange .ui-slider-handle{
  position: absolute;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #fff !important;
  border: 2px solid #2fadce !important;
  top: -6px !important;
  margin-left: -7px;
  cursor: grab;
  outline: none !important;
  box-shadow: 0 1px 3px rgba(0,0,0,0.15);
  transition: box-shadow .15s ease, transform .1s ease;
}
.PM_ASCritRange .ui-slider-handle:hover{
  transform: scale(1.1);
}
.PM_ASCritRange .ui-slider-handle:focus,
.PM_ASCritRange .ui-slider-handle:active{
  box-shadow: 0 0 0 4px rgba(47, 173, 206, 0.18);
  cursor: grabbing;
}
.PM_ASCritRangeValue{
  display: block;
  text-align: center;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif !important;
  font-size: 12px;
  color: #6b7e95;
  font-weight: 400;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}
