/* ===========================================================================
 * Catalog filter styles (#69)
 * Migrated from css/global.css.
 * Includes: noUiSlider library + filter-panel/group/price/bar/categories
 *   + catalog-filter-form + mobile-apply-filter.
 * Attach on catalog/search-result pages only.
 * =========================================================================== */

.filters-bar__radius {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--grey-scale-700);
  font-size: 1rem;
  font-style: normal;
  font-weight: 700;
  line-height: 125%;
}

.filters-bar__btn {
  position: relative;
  color: var(--main-700, #075ba2);
  font-size: 1rem;
  font-weight: 700;
  line-height: 125%;
}

.filters-bar__btn::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  width: 100%;
  height: 0.0625rem;
  background-color: var(--main-700, #075ba2);
  transform: translateX(-50%) scaleX(0);
  transition: transform 0.3s ease;
}

.filters-bar__list {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.filters-bar__sort-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--grey-scale-700);
  font-size: 0.875rem;
  font-weight: 500;
  line-height: 125%;
  transition: color 0.3s ease;
}

.filters-bar__sort-btn::before {
  font-size: 1.25rem;
  color: var(--grey-scale-500);
  transition: color 0.3s ease;
}

.filters-bar__sort-btn.is-active::before {
  color: var(--main-700);
}

.noUi-target,
.noUi-target * {
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0);
  -webkit-user-select: none;
  -ms-touch-action: none;
  touch-action: none;
  -ms-user-select: none;
  -moz-user-select: none;
  user-select: none;
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.noUi-target {
  position: relative;
}

.noUi-base,
.noUi-connects {
  width: 100%;
  height: 100%;
  position: relative;
  z-index: 1;
}

.noUi-connects {
  overflow: hidden;
  z-index: 0;
}

.noUi-connect,
.noUi-origin {
  will-change: transform;
  position: absolute;
  z-index: 1;
  top: 0;
  right: 0;
  height: 100%;
  width: 100%;
  -ms-transform-origin: 0 0;
  -webkit-transform-origin: 0 0;
  -webkit-transform-style: preserve-3d;
  transform-origin: 0 0;
  transform-style: flat;
}

.noUi-txt-dir-rtl.noUi-horizontal .noUi-origin {
  left: 0;
  right: auto;
}

.noUi-vertical .noUi-origin {
  top: -100%;
  width: 0;
}

.noUi-horizontal .noUi-origin {
  height: 0;
}

.noUi-handle {
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  position: absolute;
}

.noUi-touch-area {
  height: 100%;
  width: 100%;
}

.noUi-state-tap .noUi-connect,
.noUi-state-tap .noUi-origin {
  -webkit-transition: transform 0.3s;
  transition: transform 0.3s;
}

.noUi-state-drag * {
  cursor: inherit !important;
}

.noUi-horizontal {
  height: 1.125rem;
}

.noUi-horizontal .noUi-handle {
  width: 2.125rem;
  height: 1.75rem;
  right: -1.0625rem;
  top: -0.375rem;
}

.noUi-vertical {
  width: 1.125rem;
}

.noUi-vertical .noUi-handle {
  width: 1.75rem;
  height: 2.125rem;
  right: -0.375rem;
  bottom: -1.0625rem;
}

.noUi-txt-dir-rtl.noUi-horizontal .noUi-handle {
  left: -1.0625rem;
  right: auto;
}

.noUi-target {
  background: #FAFAFA;
  border-radius: 0.25rem;
  border: 0.0625rem solid #D3D3D3;
  box-shadow: inset 0 0.0625rem 0.0625rem #F0F0F0, 0 0.1875rem 0.375rem -0.3125rem #BBB;
}

.noUi-connects {
  border-radius: 0.1875rem;
}

.noUi-connect {
  background: #3FB8AF;
}

.noUi-draggable {
  cursor: ew-resize;
}

.noUi-vertical .noUi-draggable {
  cursor: ns-resize;
}

.noUi-handle {
  border: 0.0625rem solid #D9D9D9;
  border-radius: 0.1875rem;
  background: #FFF;
  cursor: default;
  box-shadow: inset 0 0 0.0625rem #FFF, inset 0 0.0625rem 0.4375rem #EBEBEB, 0 0.1875rem 0.375rem -0.1875rem #BBB;
}

.noUi-active {
  box-shadow: inset 0 0 0.0625rem #FFF, inset 0 0.0625rem 0.4375rem #DDD, 0 0.1875rem 0.375rem -0.1875rem #BBB;
}

.noUi-handle:before,
.noUi-handle:after {
  content: "";
  display: block;
  position: absolute;
  height: 0.875rem;
  width: 0.0625rem;
  background: #E8E7E6;
  left: 0.875rem;
  top: 0.375rem;
}

.noUi-handle:after {
  left: 1.0625rem;
}

.noUi-vertical .noUi-handle:before,
.noUi-vertical .noUi-handle:after {
  width: 0.875rem;
  height: 0.0625rem;
  left: 0.375rem;
  top: 0.875rem;
}

.noUi-vertical .noUi-handle:after {
  top: 1.0625rem;
}

[disabled] .noUi-connect {
  background: #B8B8B8;
}

[disabled].noUi-target,
[disabled].noUi-handle,
[disabled] .noUi-handle {
  cursor: not-allowed;
}

.noUi-pips,
.noUi-pips * {
  -moz-box-sizing: border-box;
  box-sizing: border-box;
}

.noUi-pips {
  position: absolute;
  color: #999;
}

.noUi-value {
  position: absolute;
  white-space: nowrap;
  text-align: center;
}

.noUi-value-sub {
  color: #ccc;
  font-size: 0.625rem;
}

.noUi-marker {
  position: absolute;
  background: #CCC;
}

.noUi-marker-sub {
  background: #AAA;
}

.noUi-marker-large {
  background: #AAA;
}

.noUi-pips-horizontal {
  padding: 0.625rem 0;
  height: 5rem;
  top: 100%;
  left: 0;
  width: 100%;
}

.noUi-value-horizontal {
  -webkit-transform: translate(-50%, 50%);
  transform: translate(-50%, 50%);
}

.noUi-rtl .noUi-value-horizontal {
  -webkit-transform: translate(50%, 50%);
  transform: translate(50%, 50%);
}

.noUi-marker-horizontal.noUi-marker {
  margin-left: -0.0625rem;
  width: 0.125rem;
  height: 0.3125rem;
}

.noUi-marker-horizontal.noUi-marker-sub {
  height: 0.625rem;
}

.noUi-marker-horizontal.noUi-marker-large {
  height: 0.9375rem;
}

.noUi-pips-vertical {
  padding: 0 0.625rem;
  height: 100%;
  top: 0;
  left: 100%;
}

.noUi-value-vertical {
  -webkit-transform: translate(0, -50%);
  transform: translate(0, -50%);
  padding-left: 1.5625rem;
}

.noUi-rtl .noUi-value-vertical {
  -webkit-transform: translate(0, 50%);
  transform: translate(0, 50%);
}

.noUi-marker-vertical.noUi-marker {
  width: 0.3125rem;
  height: 0.125rem;
  margin-top: -0.0625rem;
}

.noUi-marker-vertical.noUi-marker-sub {
  width: 0.625rem;
}

.noUi-marker-vertical.noUi-marker-large {
  width: 0.9375rem;
}

.noUi-tooltip {
  display: block;
  position: absolute;
  border: 0.0625rem solid #D9D9D9;
  border-radius: 0.1875rem;
  background: #fff;
  color: #000;
  padding: 0.3125rem;
  text-align: center;
  white-space: nowrap;
}

.noUi-horizontal .noUi-tooltip {
  -webkit-transform: translate(-50%, 0);
  transform: translate(-50%, 0);
  left: 50%;
  bottom: 120%;
}

.noUi-vertical .noUi-tooltip {
  -webkit-transform: translate(0, -50%);
  transform: translate(0, -50%);
  top: 50%;
  right: 120%;
}

.noUi-horizontal .noUi-origin > .noUi-tooltip {
  -webkit-transform: translate(50%, 0);
  transform: translate(50%, 0);
  left: auto;
  bottom: 0.625rem;
}

.noUi-vertical .noUi-origin > .noUi-tooltip {
  -webkit-transform: translate(0, -1.125rem);
  transform: translate(0, -1.125rem);
  top: auto;
  right: 1.75rem;
}

.filter-panel .filter-panel__top {
  display: flex;
  padding: 1rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  align-self: stretch;
  background: var(--main-700);
}

.filter-group {
  padding: 1.5rem;
  background: var(--white);
  display: flex;
  flex-direction: column;
}

.filter-group__search {
  position: relative;
  display: block;
}

.filter-group__search:not(:last-child) {
  margin-bottom: 0.75rem;
}

.filter-group__search::before {
  position: absolute;
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
  width: 1.5rem;
  height: 1.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.25rem;
  line-height: 1;
  color: var(--grey-scale-400);
}

.filter-group__search input {
  width: 100%;
  height: 3.125rem;
  padding: 0.625rem 0.75rem 0.625rem 2.75rem;
  border-radius: 0.375rem;
  background: var(--grey-scale-100);
  border: 0.0625rem solid var(--grey-scale-200);
  font-size: 1.125rem;
  font-weight: 300;
  line-height: 125%;
  color: var(--grey-scale-700);
}

.filter-group__search input::placeholder {
  color: var(--grey-scale-400);
}

.filter-group__search input:focus {
  border-color: var(--main-700);
  outline: none;
}

.filter-group__title {
  display: flex;
  align-items: center;
  flex-direction: row-reverse;
  justify-content: space-between;
  gap: 0.75rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 125%;
  min-height: 1.5rem;
  transition: color 0.3s;
}

.filter-group__title::before {
  width: 1.5rem;
  height: 1.5rem;
  flex-shrink: 0;
  font-size: 1.5rem;
  font-weight: 400;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--main-700);
  transition: transform 0.3s;
}

.filter-group__title.is-active::before {
  transform: rotate(-180deg);
}

.filter-group__body {
  max-height: 0;
  overflow: hidden;
  opacity: 0;
  transition: max-height 0.4s ease, opacity 0.4s ease;
}

.filter-group__body.is-open {
  opacity: 1;
}

.filter-group__content {
  padding-top: 0.75rem;
}

.filter-group__list {
  display: flex;
  flex-direction: column;
  row-gap: 0.75rem;
}

.filter-price {
  width: 100%;
  max-width: calc(100% - 5rem);
  margin-left: auto;
  margin-right: auto;
  padding-top: 1.5625rem;
  padding-bottom: 3.75rem;
}

.filter-price .filter-price__inputs {
  display: none;
}

.filter-price .noUi-target {
  border: none;
  box-shadow: none;
  height: 0.4375rem;
  cursor: pointer;
  border-radius: 0.4375rem;
  background: rgba(178, 204, 225, 0.4);
}

.filter-price .noUi-connect {
  border-radius: 0.125rem;
  background: var(--main-700);
}

.filter-price .noUi-horizontal .noUi-handle {
  width: 1.25rem;
  height: 1.25rem;
  right: -0.625rem;
  top: -0.4375rem;
  background: var(--main-700);
  border: 0.1875rem solid var(--white);
  border-radius: 50%;
  box-shadow: 0 0.125rem 0.375rem rgba(142, 148, 152, 0.2);
  cursor: grab;
}

.filter-price .noUi-horizontal .noUi-handle::before, .filter-price .noUi-horizontal .noUi-handle::after {
  display: none;
}

.filter-price .noUi-horizontal .noUi-handle:active {
  cursor: grabbing;
}

.filter-price .noUi-tooltip {
  display: block;
  position: absolute;
  border: none;
  border-radius: 0.25rem;
  padding: 0.625rem;
  color: var(--grey-scale-700);
  width: 5rem;
  height: 2.625rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 400;
  line-height: 1.25;
  top: calc(100% + 0.75rem);
  background: var(--grey-scale-100);
  border: 0.0625rem solid var(--grey-scale-200);
}

.filter-price .noUi-tooltip::before {
  content: "";
  position: absolute;
  top: -0.25rem;
  left: calc(50% - 0.1875rem);
  transform: translateX(-50%);
  width: 0.375rem;
  height: 0.375rem;
  background: var(--grey-scale-100);
  border-left: 0.0625rem solid var(--grey-scale-200);
  border-top: 0.0625rem solid var(--grey-scale-200);
  transform: rotate(45deg);
}

@media (max-width: 85.37375em) {
  .filter-panel {
    position: fixed;
    z-index: 10001;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--white);
    max-width: 38.6875rem;
    transform: translateX(-100%);
    transition: transform 0.3s;
  }
  .filter-open .filter-panel {
    transform: translateX(0);
  }
  .filter-panel .filter-panel__items {
    overflow: auto;
    max-height: calc(100% - 10rem);
  }
}

@media (max-width: 61.99875em) {
  .filters-bar__sort-btn::before {
    font-size: 1rem;
  }
  .filters-bar__sort-btn {
    font-size: 0.75rem;
  }
  .filter-panel .filter-panel__top {
    padding: 0.75rem 1rem;
  }
  .filter-group {
    padding: 1.25rem 1rem;
  }
}

@media (min-width: 85.37375em) {
  .filter-panel {
    position: sticky;
    top: 8.75rem;
    height: fit-content;
    overflow: auto;
    max-height: calc(100vh - 9rem);
  }
  .filter-panel .filter-panel__top {
    display: none;
  }
  .filter-panel .filter-panel__selected {
    display: none;
  }
}

@media (any-hover: hover) {
  .filters-bar__btn:hover::before {
    transform: translateX(-50%) scaleX(1);
  }
  .filters-bar__sort-btn:hover {
    color: var(--main-700);
  }
  .filters-bar__sort-btn:hover::before {
    color: var(--main-700);
  }
  .filter-group__search input:hover {
    border-color: var(--main-700);
  }
  .filter-group__title:hover {
    color: var(--main-700);
  }
}
