/* Catalog — блок фильтров
   Figma: 360 (6645:14866) / 1440 (6628:12416)
   Mobile first; desktop layout с 768
*/

.bz-catalog-filters {
  background-color: var(--bz-bg-prim, #f7f6f1);
  /* Figma 360: help → фильтры ≈ 60px; боковые 16 */
  padding: 60px 16px 0;
  margin: 0;
  box-sizing: border-box;
  /* Locomotive / data-scroll-section ставит overflow-y:auto — из-за этого
     у выпадающего списка сортировки появляется лишний скролл */
  overflow: visible !important;
}

.bz-catalog-filters__textures-wrap {
  display: none;
}

.bz-catalog-filters__controls {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "filter check"
    "sort sort"
    "amount amount";
  align-items: center;
  column-gap: 20px;
  row-gap: 16px;
}

.bz-catalog-filters__filter-btn {
  grid-area: filter;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 25px;
  background-color: #edeae7;
  color: var(--bz-b-100, #2d2c2c);
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.02em;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.bz-catalog-filters__filter-icon {
  display: block;
  width: 24px;
  height: 24px;
}

.bz-catalog-filters__filter-dot {
  position: absolute;
  top: 8px;
  right: 12px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: var(--bz-prim, #f27e00);
}

.bz-catalog-filters__check {
  grid-area: check;
  display: inline-flex;
  align-items: center;
  justify-self: end;
  gap: 10px;
  margin: 0;
  cursor: pointer;
  -webkit-user-select: none;
  user-select: none;
}

.bz-catalog-filters__check-input {
  position: absolute;
  opacity: 0;
  width: 1px;
  height: 1px;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

.bz-catalog-filters__check-box {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  border-radius: 4px;
  border: 1.5px solid #cecece;
  background-color: transparent;
  box-sizing: border-box;
}

.bz-catalog-filters__check-box img {
  display: none;
  width: 16px;
  height: 16px;
}

.bz-catalog-filters__check-input:checked + .bz-catalog-filters__check-box {
  border-color: var(--bz-prim, #f27e00);
  background-color: var(--bz-prim, #f27e00);
}

.bz-catalog-filters__check-input:checked + .bz-catalog-filters__check-box img {
  display: block;
}

.bz-catalog-filters__check-label {
  color: var(--bz-b-100, #2d2c2c);
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

.bz-catalog-filters__check-label--desktop {
  display: none;
}

.bz-catalog-filters__sort {
  grid-area: sort;
  position: relative;
  width: 100%;
  overflow: visible;
}

.bz-catalog-filters__sort-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 44px;
  padding: 10px 20px;
  border: 0;
  border-radius: 25px;
  background-color: #edeae7;
  color: var(--bz-b-100, #2d2c2c);
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.02em;
  text-align: left;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
}

.bz-catalog-filters__sort-btn::after {
  display: none;
}

.bz-catalog-filters__sort-caret {
  display: block;
  flex-shrink: 0;
  width: 24px;
  height: 24px;
}

.bz-catalog-filters__sort-menu {
  width: 100%;
  margin-top: 4px;
  padding: 8px 0;
  border: 0;
  border-radius: 16px;
  background-color: #ffffff;
  box-shadow: 0 8px 24px rgba(45, 44, 44, 0.12);
  overflow: visible;
  max-height: none;
}

.bz-catalog-filters__sort-menu .dropdown-item {
  padding: 10px 20px;
  color: var(--bz-b-100, #2d2c2c);
  font-family: Inter, sans-serif;
  font-size: 14px;
  line-height: 1.4;
}

.bz-catalog-filters__sort-menu .dropdown-item.active,
.bz-catalog-filters__sort-menu .dropdown-item:active {
  background-color: #edeae7;
  color: var(--bz-b-100, #2d2c2c);
}

.bz-catalog-filters__amount {
  grid-area: amount;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 44px;
  padding: 10px 20px;
  border-radius: 25px;
  background-color: #edeae7;
  box-sizing: border-box;
}

.bz-catalog-filters__amount-input {
  flex: 1 1 auto;
  min-width: 0;
  width: 100%;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--bz-b-100, #2d2c2c);
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.02em;
  outline: none;
}

.bz-catalog-filters__amount-input::placeholder {
  color: #a6a5a2;
}

.bz-catalog-filters__amount-input:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.bz-catalog-filters__amount-input.is-invalid {
  color: #ce0000;
}

.bz-catalog-filters__amount-unit {
  flex-shrink: 0;
  margin-left: 12px;
  color: var(--bz-b-100, #2d2c2c);
  font-family: Inter, sans-serif;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.4;
  letter-spacing: -0.02em;
  white-space: nowrap;
}

/* ——— Desktop с 768 ——— */
@media (min-width: 768px) {
  .bz-catalog-filters {
    /* Figma 1440: табы/help → фактуры ≈ 40px (170+24 → 252) */
    padding: 40px 30px 0;
  }

  .bz-catalog-filters__textures-wrap {
    display: block;
    margin-bottom: 40px;
  }

  .bz-catalog-filters__textures {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px 20px;
  }

  .bz-catalog-filters__texture {
    color: rgba(45, 44, 44, 0.6);
    font-family: Inter, sans-serif;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    letter-spacing: -0.02em;
    text-decoration: none;
    white-space: nowrap;
  }

  .bz-catalog-filters__texture:hover,
  .bz-catalog-filters__texture:focus {
    color: var(--bz-b-100, #2d2c2c);
    text-decoration: none;
  }

  .bz-catalog-filters__texture.is-active {
    color: var(--bz-b-100, #2d2c2c);
    text-decoration: underline;
    text-underline-offset: 3px;
    cursor: default;
  }

  .bz-catalog-filters__controls {
    display: grid;
    grid-template-columns: auto 1fr auto auto;
    grid-template-areas: "check . amount sort";
    align-items: center;
    column-gap: 16px;
    row-gap: 0;
    min-height: 44px;
  }

  .bz-catalog-filters__filter-btn {
    display: none;
  }

  .bz-catalog-filters__check {
    justify-self: start;
  }

  .bz-catalog-filters__check-label--mobile {
    display: none;
  }

  .bz-catalog-filters__check-label--desktop {
    display: inline;
  }

  .bz-catalog-filters__amount {
    width: 263px;
  }

  .bz-catalog-filters__sort {
    width: 263px;
  }
}

@media (min-width: 1440px) {
  .bz-catalog-filters {
    max-width: 1440px;
    margin-left: auto;
    margin-right: auto;
  }
}
