/*** ADVANCED-SEARCH ***/

:root{
  /* ff = filter fields */
  --ff-x-padding: 10px;
  --ff-y-padding:  5px;
  --ff-border-radius: 5px;
  
  /* af = active filters */
  --af-x-padding: 10px;
  --af-y-padding:  5px;
  --af-border-radius: 999px;
}

#filter-fields .autocomplete-component{
  position: relative;
  display: flex;
  justify-content: stretch;
  align-items: stretch;
  width: 100%;
  background-color: transparent;
}
#filter-fields .autocomplete-component:hover,
#filter-fields .autocomplete-component.open{
  z-index: 2;
}

#filter-fields .autocomplete-component:before{
  content: "";

  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  right: var(--ff-x-padding);

  display: inline-flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  width: auto;
  height: 100%;

  pointer-events: none;
  z-index: 1;
}
#filter-fields .autocomplete-component.load-all:before{
  font-family: "icons";
  content: "\E80D";
}
#filter-fields .autocomplete-component.load-all.open:before{
  content: "\E810";
}

#filter-fields .autocomplete-component.loading:before{
  width:  24px;
  height: 24px;
  background-image: url('../img/spin-dark.svg');
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
}

#filter-fields .autocomplete-component input{
  box-sizing: border-box;
  width: 100%;
  outline: none;

  padding: var(--ff-y-padding) var(--ff-x-padding);

  border-width: 1px;
  border-style: solid;
  border-color: black;
  border-radius: var(--ff-border-radius);

  background-color: white;
  
  z-index: 0;
}

#filter-fields input[readonly]{
  cursor: pointer;
}

#filter-fields .autocomplete-component-results{
  display: none;
  position: absolute;
  top: 100%;
  left: 0px;
  right: 0px;

  padding-top: var(--ff-y-padding);

  background-color: white;

  z-index: -1;
}

#filter-fields .autocomplete-component.open .autocomplete-component-results{
  display: block;
}

#filter-fields .autocomplete-component-results:before,
#filter-fields .autocomplete-component-results:after{
  content: "";
  display: block;
  position: absolute;
  bottom: 100%;
  width: 24px;
  height: 12px;
  background-color: inherit;
}

#filter-fields .autocomplete-component-results:before{ left: 0; }
#filter-fields .autocomplete-component-results:after{ right: 0; }

#filter-fields .i-autocomplete-item{
  position: relative;

  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: flex-start;
  flex-wrap: nowrap;

  padding: var(--ff-y-padding) var(--ff-x-padding);

  font-size: 90%;
  line-height: 130%;
  background-color: inherit;

  cursor: pointer;
}
#filter-fields .i-autocomplete-item:last-child{
  border-bottom: none;
}

#filter-fields .autocomplete-component-results,
#filter-fields .i-autocomplete-item:last-child{
  border-bottom-left-radius:  4px;
  border-bottom-right-radius: 4px;
}

#filter-fields .i-autocomplete-item.selected,
#filter-fields .i-autocomplete-item:hover{
  background-color: rgba(0, 0, 0, 0.2);
}

#filter-fields .i-autocomplete-item > *{
  max-width: 100%;
  text-overflow: ellipsis;
  white-space: nowrap;
  overflow: hidden;
}

#filter-fields .i-autocomplete-item .item-section{
  order: -1;
  font-size: 0.8em;
}

#active-filters #active-filters .col-auto{
  max-width: 100%;
}

#active-filters .active-filter{
  display: inline-flex;
  justify-content: flex-start;
  align-items: center;
  max-width: 100%;

  padding: var(--af-y-padding) var(--af-x-padding);

  border-width: 1px;
  border-style: solid;
  border-color: black;
  border-radius: var(--af-border-radius);

  font-size: 0.8em;
  font-weight: 600;
}

#active-filters .active-filter .item-label{
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

#active-filters .active-filter .item-section{
  font-size: 0.6em;
  letter-spacing: 0.3px;
  font-weight: 700;
  text-transform: uppercase;
  margin: 0.2em 10px 0 10px;
}

#active-filters .active-filter .delete-bttn{
  display: block;
  width: 12px;
  height: 12px;
  margin-left: 10px;
  background-repeat: no-repeat;
  background-color: transparent;
  background-position: center center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 352 512' fill='black'%3E%3Cpath d='M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z'%3E%3C/path%3E%3C/svg%3E");
  cursor: pointer;
}

#active-filters .active-filter[data-key*="ame"]{
  border-color: white;
  background-color: black;
  color: white;
}

#active-filters .active-filter[data-key*="ame"] .delete-bttn{
  background-image: url("data:image/svg+xml,%3Csvg role='img' xmlns='http://www.w3.org/2000/svg' viewBox='0 0 352 512' fill='white'%3E%3Cpath d='M242.72 256l100.07-100.07c12.28-12.28 12.28-32.19 0-44.48l-22.24-22.24c-12.28-12.28-32.19-12.28-44.48 0L176 189.28 75.93 89.21c-12.28-12.28-32.19-12.28-44.48 0L9.21 111.45c-12.28 12.28-12.28 32.19 0 44.48L109.28 256 9.21 356.07c-12.28 12.28-12.28 32.19 0 44.48l22.24 22.24c12.28 12.28 32.2 12.28 44.48 0L176 322.72l100.07 100.07c12.28 12.28 32.2 12.28 44.48 0l22.24-22.24c12.28-12.28 12.28-32.19 0-44.48L242.72 256z'%3E%3C/path%3E%3C/svg%3E");
}