#ventisette-filters {
  --vf-border: #d9dde3;
  --vf-soft: #f5f6f8;
  --vf-text: #252a31;
  --vf-muted: #69717d;
  --vf-accent: #232a32;

  margin: 0 0 1.5rem;
  color: var(--vf-text);
  font-size: 14px;
}

.vf__toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 15px 16px;
  border: 1px solid var(--vf-border);
  border-radius: 6px 6px 0 0;
  background: #fff;
}

.vf__title {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 180px;
  font-size: 16px;
}

.vf__subtitle {
  color: var(--vf-muted);
  font-size: 12px;
  font-weight: 400;
}

.vf__toolbar-actions {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 18px;
  flex: 1;
}

.vf__feature-search-wrap,
.vf__value-search-wrap {
  position: relative;
}

.vf__feature-search-wrap {
  width: min(420px, 100%);
}

.vf__search-icon {
  position: absolute;
  top: 50%;
  left: 11px;
  z-index: 1;
  color: #777f89;
  font-size: 17px;
  transform: translateY(-50%);
  pointer-events: none;
}

.vf__feature-search,
.vf__value-search {
  width: 100%;
  height: 36px;
  padding: 6px 10px 6px 34px;
  border: 1px solid var(--vf-border);
  border-radius: 4px;
  outline: none;
  background: #fff;
  color: var(--vf-text);
}

.vf__feature-search:focus,
.vf__value-search:focus {
  border-color: #929aa5;
}

.vf__inactive-toggle {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0;
  white-space: nowrap;
  cursor: pointer;
}

.vf__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(220px, 1fr));
  border-left: 1px solid var(--vf-border);
  background: #fff;
}

.vf__facet {
  min-width: 0;
  border-right: 1px solid var(--vf-border);
  border-bottom: 1px solid var(--vf-border);
  background: #fff;
}

.vf__facet-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 45px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--vf-border);
  background: var(--vf-soft);
  font-weight: 700;
}

.vf__facet-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.vf__facet-total,
.vf__count {
  margin-left: 7px;
  color: var(--vf-muted);
  font-size: 12px;
  font-weight: 400;
}

.vf__value-search-wrap {
  margin: 10px 10px 7px;
}

.vf__values {
  height: 180px;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 2px 10px 7px;
  scrollbar-width: thin;
}

.vf__value {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 31px;
  margin: 0;
  padding: 4px 2px;
  cursor: pointer;
  user-select: none;
}

.vf__checkbox {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}

.vf__checkmark {
  position: relative;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  margin-right: 8px;
  border: 1px solid #aeb5be;
  border-radius: 2px;
  background: #fff;
}

.vf__checkbox:checked + .vf__checkmark {
  border-color: var(--vf-accent);
  background: var(--vf-accent);
}

.vf__checkbox:checked + .vf__checkmark::after {
  position: absolute;
  top: 1px;
  left: 5px;
  width: 5px;
  height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  content: "";
  transform: rotate(45deg);
}

.vf__value-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.vf__count {
  margin-left: auto;
  padding-left: 6px;
}

.vf__select-all {
  width: 100%;
  min-height: 36px;
  padding: 7px 10px;
  border: 0;
  border-top: 1px solid var(--vf-border);
  background: #fff;
  color: #363d46;
  font-size: 11px;
  font-weight: 700;
  text-align: left;
  cursor: pointer;
}

.vf__select-all:hover {
  background: var(--vf-soft);
}

.vf__facet--hidden,
.vf__value--hidden {
  display: none !important;
}

@media (max-width: 1199px) {
  .vf__grid {
    grid-template-columns: repeat(3, minmax(210px, 1fr));
  }
}

@media (max-width: 991px) {
  .vf__toolbar,
  .vf__toolbar-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .vf__feature-search-wrap {
    width: 100%;
  }

  .vf__grid {
    grid-template-columns: repeat(2, minmax(200px, 1fr));
  }
}

@media (max-width: 575px) {
  .vf__grid {
    grid-template-columns: 1fr;
  }

  .vf__values {
    height: auto;
    max-height: 190px;
  }
}

/* ==========================================================
   VENTISETTE FILTERS - LAYOUT ORIZZONTALE TIPO TME
   ========================================================== */

#ventisette-filters .vf__grid {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;

  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;

  border-left: 1px solid var(--vf-border);
  border-bottom: 1px solid var(--vf-border);

  background: #fff;

  scrollbar-width: thin;
  scroll-behavior: smooth;
}

#ventisette-filters .vf__facet {
  flex: 0 0 285px;
  width: 285px;
  min-width: 285px;
  max-width: 285px;

  border-right: 1px solid var(--vf-border);
  border-bottom: 0;

  background: #fff;
}

#ventisette-filters .vf__facet-header {
  height: 46px;
  min-height: 46px;
}

#ventisette-filters .vf__values {
  height: 175px;
  min-height: 175px;
  max-height: 175px;

  overflow-x: hidden;
  overflow-y: auto;
}

#ventisette-filters .vf__select-all {
  height: 36px;
  min-height: 36px;
}

/*
 * Impedisce alle vecchie media query della griglia
 * di trasformare nuovamente i filtri in più righe.
 */
@media (max-width: 1199px) {
  #ventisette-filters .vf__grid {
    display: flex;
    grid-template-columns: none;
  }

  #ventisette-filters .vf__facet {
    flex: 0 0 270px;
    width: 270px;
    min-width: 270px;
    max-width: 270px;
  }
}

@media (max-width: 575px) {
  #ventisette-filters .vf__grid {
    display: flex;
    grid-template-columns: none;
  }

  #ventisette-filters .vf__facet {
    flex: 0 0 260px;
    width: 260px;
    min-width: 260px;
    max-width: 260px;
  }

  #ventisette-filters .vf__values {
    height: 175px;
    max-height: 175px;
  }
}


/* ==========================================================
   VENTISETTE FILTERS
   FORZA TUTTI I FILTRI SU UNA SOLA RIGA ORIZZONTALE
   ========================================================== */

#ventisette-filters .vf__grid {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;

    overflow-x: auto !important;
    overflow-y: hidden !important;

    white-space: nowrap !important;

    border-left: 1px solid var(--vf-border);
    border-bottom: 1px solid var(--vf-border);

    font-size: 0;

    scrollbar-width: thin;
    scroll-behavior: smooth;
}

#ventisette-filters .vf__facet {
    display: inline-block !important;

    width: 285px !important;
    min-width: 285px !important;
    max-width: 285px !important;

    margin: 0 !important;
    padding: 0 !important;

    vertical-align: top !important;

    white-space: normal !important;

    border-right: 1px solid var(--vf-border);
    border-bottom: 0 !important;

    font-size: 14px;
}

#ventisette-filters .vf__facet-header {
    box-sizing: border-box;
    height: 46px !important;
    min-height: 46px !important;
}

#ventisette-filters .vf__value-search-wrap {
    box-sizing: border-box;
}

#ventisette-filters .vf__values {
    box-sizing: border-box;

    height: 175px !important;
    min-height: 175px !important;
    max-height: 175px !important;

    overflow-x: hidden !important;
    overflow-y: auto !important;
}

#ventisette-filters .vf__select-all {
    box-sizing: border-box;

    height: 36px !important;
    min-height: 36px !important;
}

/* Nessuna media query deve mandare i pannelli a capo */
@media (max-width: 1199px) {
    #ventisette-filters .vf__grid {
        display: block !important;
        white-space: nowrap !important;
    }

    #ventisette-filters .vf__facet {
        display: inline-block !important;
        width: 270px !important;
        min-width: 270px !important;
        max-width: 270px !important;
    }
}

@media (max-width: 575px) {
    #ventisette-filters .vf__grid {
        display: block !important;
        white-space: nowrap !important;
    }

    #ventisette-filters .vf__facet {
        display: inline-block !important;
        width: 260px !important;
        min-width: 260px !important;
        max-width: 260px !important;
    }

    #ventisette-filters .vf__values {
        height: 175px !important;
        min-height: 175px !important;
        max-height: 175px !important;
    }
}


/* ==========================================================
   VENTISETTE FILTERS - CONTENITORE PIU' LARGO
   ========================================================== */

#ventisette-filters {
    width: min(1250px, calc(100vw - 40px)) !important;
    max-width: 1250px !important;

    position: relative;
    left: 50%;
    transform: translateX(-50%);

    margin-left: 0 !important;
    margin-right: 0 !important;
}

@media (max-width: 767px) {
    #ventisette-filters {
        width: 100% !important;
        max-width: 100% !important;

        left: auto;
        transform: none;
    }
}


/* ==========================================================
   VENTISETTE FILTERS - VALORI INATTIVI / NON COMPATIBILI
   ========================================================== */

#ventisette-filters .vf__value--disabled {
    opacity: 0.42;
    cursor: not-allowed !important;
    background: #f4f5f6;
}

#ventisette-filters .vf__value--disabled .vf__value-label {
    text-decoration: line-through;
}

#ventisette-filters .vf__value--disabled .vf__count {
    font-weight: 600;
}

#ventisette-filters .vf__value--disabled .vf__checkmark {
    background: #eceff1;
    border-color: #cfd4da;
}

#ventisette-filters.vf--hide-inactive
.vf__value--disabled {
    display: none !important;
}


/* ==========================================================
   VENTISETTE FILTERS - AZZERA FILTRI
   ========================================================== */

#ventisette-filters .vf__reset-filters {
    height: 36px;
    padding: 0 15px;

    border: 1px solid #c8cdd3;
    border-radius: 4px;

    background: #ffffff;
    color: #343a40;

    font-size: 12px;
    font-weight: 700;

    white-space: nowrap;
    cursor: pointer;

    transition:
        background-color .15s ease,
        border-color .15s ease;
}

#ventisette-filters .vf__reset-filters:hover {
    background: #f1f3f5;
    border-color: #9da5ae;
}

#ventisette-filters .vf__reset-filters:active {
    background: #e6e9ec;
}

