/**
 * Les Jardins de Courances — panneau de filtres boutique
 *
 * Autorité unique chargée après WooCommerce. L'état sticky ne change jamais
 * l'apparence du composant : seules position, coordonnées et z-index varient.
 */

.jdc-filter-sticky-panel,
.jdc-filter-sticky-panel.is-sticky-filters {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  padding: 10px 12px;
  overflow: hidden;
  border: 1px solid rgba(127, 160, 95, .34);
  border-radius: 4px;
  background: rgba(250, 246, 236, .98);
  box-shadow: none;
  color: #2e3b26;
}

.jdc-filter-sticky-panel.is-sticky-filters {
  position: fixed;
  top: 0;
  left: var(--jdc-sticky-left);
  z-index: 80;
  width: var(--jdc-sticky-width);
}

.jdc-filter-sticky-panel .jdc-shop-filters,
.jdc-filter-sticky-panel.is-sticky-filters .jdc-shop-filters {
  display: block;
  box-sizing: border-box;
  width: 100%;
  max-width: none;
  margin: 0;
}

.jdc-filter-sticky-panel .wc-block-product-filters__open-overlay,
.jdc-filter-sticky-panel .wc-block-product-filters__overlay > header {
  display: none;
}

.jdc-filter-sticky-panel .wc-block-product-filters__overlay-content {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-rows: auto auto;
  align-items: center;
  gap: 8px 14px;
  box-sizing: border-box;
  width: 100%;
  margin: 0;
  padding: 0;
}

.jdc-filter-sticky-panel .jdc-group-filter {
  position: static;
  display: grid;
  grid-column: 1 / -1;
  grid-row: 1;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: stretch;
  gap: 8px 10px;
  width: 100%;
  min-width: 0;
  margin: 0;
}

.jdc-filter-sticky-panel .jdc-group-filter > .wp-block-group,
.jdc-filter-sticky-panel .jdc-color-filter > .wp-block-group {
  display: none;
}

.jdc-filter-sticky-panel .jdc-group-filter .wc-block-product-filter-chips,
.jdc-filter-sticky-panel .jdc-group-filter .wc-block-product-filter-chips__fieldset,
.jdc-filter-sticky-panel .jdc-group-filter .wc-block-product-filter-chips__items {
  display: contents;
  min-width: 0;
  margin: 0;
  padding: 0;
  border: 0;
}

.jdc-filter-sticky-panel .jdc-shop-all-groups,
.jdc-filter-sticky-panel .jdc-group-filter .wc-block-product-filter-chips__item {
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  max-width: none;
  height: 36px;
  min-height: 36px;
  padding: 5px 10px 5px 6px;
  overflow: hidden;
  border: 1.5px solid rgba(46, 59, 38, .16);
  border-radius: 4px !important;
  background: #fbf6ea;
  box-shadow: none;
  color: #7c7563;
  font: 600 11px/1 "DM Sans", sans-serif;
  text-decoration: none;
}

.jdc-filter-sticky-panel .jdc-shop-all-groups > span:last-child,
.jdc-filter-sticky-panel .jdc-group-filter .wc-block-product-filter-chips__item > span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.jdc-filter-sticky-panel .jdc-shop-all-groups:hover,
.jdc-filter-sticky-panel .jdc-group-filter .wc-block-product-filter-chips__item:hover {
  border-color: var(--jdc-filter-code, #7fa05f);
  background: color-mix(in srgb, var(--jdc-filter-code, #7fa05f) 9%, #fbf6ea);
  color: #2e3b26;
}

.jdc-filter-sticky-panel .jdc-shop-all-groups.is-active,
.jdc-filter-sticky-panel .jdc-group-filter .wc-block-product-filter-chips__item.is-selected,
.jdc-filter-sticky-panel .jdc-group-filter .wc-block-product-filter-chips__item[aria-checked="true"] {
  border-color: var(--jdc-filter-code, #7fa05f);
  background: color-mix(in srgb, var(--jdc-filter-code, #7fa05f) 22%, #fbf6ea);
  color: #2e3b26;
  font-weight: 700;
}

.jdc-filter-sticky-panel .jdc-exotique-filter {
  position: static;
  display: block;
  grid-column: 1;
  grid-row: 2;
  align-self: center;
  justify-self: start;
  margin: 0;
}

.jdc-filter-sticky-panel .jdc-exotique-filter .wc-block-product-filter-chips,
.jdc-filter-sticky-panel .jdc-exotique-filter .wc-block-product-filter-chips__fieldset {
  display: contents;
  margin: 0;
  padding: 0;
  border: 0;
}

.jdc-filter-sticky-panel .jdc-exotique-filter .wc-block-product-filter-chips__items {
  display: flex;
  align-items: center;
  height: 30px;
  margin: 0;
}

.jdc-filter-sticky-panel .jdc-color-filter {
  position: static;
  display: block;
  grid-column: 2;
  grid-row: 2;
  align-self: center;
  min-width: 0;
  margin: 0;
}

.jdc-filter-sticky-panel .jdc-color-filter .wc-block-product-filter-checkbox-list__items {
  display: flex;
  align-items: center;
  flex-wrap: nowrap;
  gap: 12px;
  height: 30px;
  margin: 0;
}

.jdc-filter-sticky-panel .jdc-color-filter .wc-block-product-filter-checkbox-list__item,
.jdc-filter-sticky-panel .jdc-color-filter .wc-block-product-filter-checkbox-list__item label {
  min-height: 0;
  margin: 0;
}

.jdc-filter-sticky-panel .jdc-sort-pills {
  position: static;
  display: flex;
  grid-column: 3;
  grid-row: 2;
  align-self: center;
  justify-self: end;
  width: auto;
  max-width: none;
  margin: 0;
  white-space: nowrap;
}

@media (max-width: 980px) {
  .jdc-filter-sticky-panel,
  .jdc-filter-sticky-panel.is-sticky-filters {
    position: relative;
    top: auto;
    left: auto;
    z-index: auto;
    width: 100%;
    padding: 10px 12px;
  }

  .jdc-filter-sticky-panel .wc-block-product-filters__overlay-content {
    grid-template-columns: 1fr;
  }

  .jdc-filter-sticky-panel .jdc-group-filter,
  .jdc-filter-sticky-panel .jdc-exotique-filter,
  .jdc-filter-sticky-panel .jdc-color-filter,
  .jdc-filter-sticky-panel .jdc-sort-pills {
    grid-column: 1;
    grid-row: auto;
  }

  .jdc-filter-sticky-panel .jdc-group-filter {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .jdc-filter-sticky-panel .jdc-color-filter .wc-block-product-filter-checkbox-list__items {
    flex-wrap: wrap;
    height: auto;
  }

  .jdc-filter-sticky-panel .jdc-sort-pills {
    justify-self: start;
  }
}

@media (max-width: 620px) {
  .jdc-filter-sticky-panel .jdc-group-filter {
    grid-template-columns: 1fr;
  }
}
