/* Reusable catalog controls: search, select, view switcher and filter inputs. */
.catalog-search,
.catalog-sort,
.catalog-view-switcher {
  height: 54px;
  border: 1px solid rgba(67, 52, 35, 0.11);
  border-radius: 12px;
  background: rgba(255, 253, 249, 0.72);
  box-shadow: 0 5px 15px rgba(83, 66, 44, 0.025);
}
.catalog-search {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 18px;
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease;
}
.catalog-search.is-invalid {
  border-color: #de706a;
  box-shadow: 0 0 0 1px rgba(222, 112, 106, 0.12);
}
.catalog-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  font: 600 13px/1 var(--font-sans);
}
.catalog-search input::placeholder {
  color: #87908b;
  opacity: 1;
}
.catalog-search svg {
  flex: 0 0 auto;
  width: 20px;
  height: 20px;
  fill: none;
  stroke: #75817b;
  stroke-width: 1.8;
  stroke-linecap: round;
}
.catalog-sort {
  position: relative;
  display: flex;
  align-items: center;
  padding: 0 15px;
}
.catalog-sort::after {
  position: absolute;
  top: 50%;
  right: 17px;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--color-text);
  border-bottom: 1.5px solid var(--color-text);
  content: "";
  pointer-events: none;
  transform: translateY(-68%) rotate(45deg);
}
.catalog-sort select {
  width: 100%;
  appearance: none;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--color-text);
  cursor: pointer;
  font: 700 12px/1 var(--font-sans);
}
.catalog-view-switcher {
  display: grid;
  grid-template-columns: 1fr 1fr;
  position: relative;
  padding: 4px;
}
.catalog-view-switcher::before {
  position: absolute;
  top: 4px;
  bottom: 4px;
  left: 4px;
  width: calc(50% - 4px);
  border-radius: 8px;
  background: var(--color-brand);
  box-shadow: 0 4px 10px rgba(20, 83, 63, 0.2);
  content: "";
  transform: translateX(0);
  transition: transform 220ms cubic-bezier(0.2, 0.8, 0.2, 1);
}
.catalog-view-switcher[data-active-view="list"]::before {
  transform: translateX(100%);
}
.catalog-view-switcher__button {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #748078;
  cursor: pointer;
}
.catalog-view-switcher__button.is-active {
  background: transparent;
  color: #fff;
  box-shadow: none;
}
.catalog-view-switcher svg {
  width: 19px;
  height: 19px;
  fill: currentColor;
  stroke: currentColor;
  stroke-width: 1.7;
}
.catalog-view-switcher__button:last-child svg {
  fill: none;
}
.ui-checkbox {
  display: grid;
  grid-template-columns: 16px minmax(0, 1fr) auto;
  gap: 9px;
  align-items: center;
  margin-top: 12px;
  color: var(--color-text-muted);
  cursor: pointer;
  font-size: 11px;
  line-height: 1.2;
}
.ui-checkbox input {
  display: grid;
  place-content: center;
  width: 15px;
  height: 15px;
  margin: 0;
  appearance: none;
  border: 1px solid rgba(67, 52, 35, 0.25);
  border-radius: 4px;
  background: #fffdf9;
  cursor: pointer;
  transition:
    background-color 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}
.ui-checkbox input::before {
  width: 7px;
  height: 4px;
  border-bottom: 1.5px solid #fff;
  border-left: 1.5px solid #fff;
  content: "";
  opacity: 0;
  transform: rotate(-45deg) translate(1px, -1px);
  transition: opacity 150ms ease;
}
.ui-checkbox input:checked {
  border-color: var(--color-brand);
  background: var(--color-brand);
}
.ui-checkbox input:checked::before {
  opacity: 1;
}
.ui-checkbox input:focus {
  outline: 0;
}
.ui-checkbox input:focus-visible {
  outline: 2px solid rgba(20, 83, 63, 0.58);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px rgba(20, 83, 63, 0.12);
}
.ui-checkbox b {
  overflow: hidden;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ui-checkbox em {
  color: #6e7e76;
  font-size: 11px;
  font-style: normal;
}
.ui-range {
  position: relative;
  height: 20px;
  margin: 7px 0 16px;
}
.ui-range__track,
.ui-range__fill {
  position: absolute;
  top: 8px;
  height: 3px;
  border-radius: 999px;
}
.ui-range__track {
  right: 2px;
  left: 2px;
  background: #e6ded2;
}
.ui-range__fill {
  right: 24%;
  left: 12%;
  background: var(--color-brand);
}
.ui-range__input {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  appearance: none;
  -webkit-appearance: none;
  pointer-events: none;
  background: transparent;
}
.ui-range__input::-webkit-slider-runnable-track {
  height: 3px;
  background: transparent;
}
.ui-range__input::-moz-range-track {
  height: 3px;
  background: transparent;
}
.ui-range__input::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  margin-top: -7px;
  appearance: none;
  -webkit-appearance: none;
  border: 3px solid #fffdf9;
  border-radius: 50%;
  background: var(--color-brand);
  box-shadow: 0 1px 4px rgba(18, 54, 44, 0.28);
  cursor: grab;
  pointer-events: auto;
}
.ui-range__input::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 3px solid #fffdf9;
  border-radius: 50%;
  background: var(--color-brand);
  box-shadow: 0 1px 4px rgba(18, 54, 44, 0.28);
  cursor: grab;
  pointer-events: auto;
}
.ui-range__input:active::-webkit-slider-thumb {
  cursor: grabbing;
}
.ui-range__input--start {
  z-index: 3;
}
.ui-range__input--end {
  z-index: 4;
}
.ui-range__handle {
  position: absolute;
  top: 3px;
  width: 13px;
  height: 13px;
  border: 2px solid #fffdf9;
  border-radius: 50%;
  background: var(--color-brand);
  box-shadow: 0 1px 3px rgba(18, 54, 44, 0.25);
}
.ui-range__handle--start {
  left: calc(12% - 6px);
}
.ui-range__handle--end {
  left: calc(76% - 6px);
}
.ui-range-values {
  display: grid;
  grid-template-columns: 1fr 14px 1fr;
  gap: 7px;
  align-items: center;
  color: #718078;
  font-size: 12px;
  text-align: center;
}
.ui-range-values label {
  position: relative;
}
.ui-range-values input {
  width: 100%;
  height: 37px;
  border: 1px solid rgba(67, 52, 35, 0.12);
  border-radius: 8px;
  outline: 0;
  background: rgba(255, 255, 255, 0.54);
  color: var(--color-text);
  font: 700 12px/1 var(--font-sans);
  text-align: center;
}
.ui-range-values label span {
  position: absolute;
  top: 50%;
  left: 7px;
  color: #8b9690;
  font-size: 9px;
  transform: translateY(-50%);
}
.ui-segmented {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}
.ui-segmented button {
  min-height: 32px;
  padding: 0 10px;
  border: 1px solid rgba(67, 52, 35, 0.11);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.42);
  color: #5c7067;
  cursor: pointer;
  font: 700 10px/1 var(--font-sans);
  transition:
    background-color 190ms ease,
    border-color 190ms ease,
    color 190ms ease,
    box-shadow 190ms ease,
    transform 190ms ease;
}
.ui-segmented button.is-active {
  border-color: var(--color-brand);
  background: var(--color-brand);
  color: #fff !important;
  -webkit-text-fill-color: #fff;
  opacity: 1;
  box-shadow: 0 4px 10px rgba(20, 83, 63, 0.16);
}
.ui-segmented button:active {
  transform: scale(0.96);
}
.ui-select {
  display: grid;
  gap: 12px;
  padding-top: 19px;
}
.ui-select select {
  height: 42px;
  padding: 0 12px;
  border: 1px solid rgba(67, 52, 35, 0.12);
  border-radius: 8px;
  outline: 0;
  appearance: none;
  -webkit-appearance: none;
  background: rgba(255, 255, 255, 0.54);
  color: var(--color-text);
  font: 600 11px/1 var(--font-sans);
}
.ui-select {
  position: relative;
}
.ui-select::after {
  position: absolute;
  right: 15px;
  bottom: 17px;
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--color-text);
  border-bottom: 2px solid var(--color-text);
  content: "";
  pointer-events: none;
  transform: rotate(45deg);
}

/* Use one consistent, touch-friendly clear control instead of each browser's
   tiny native search glyph. */
.catalog-search input::-webkit-search-cancel-button {
  display: none;
  appearance: none;
}
.catalog-search input {
  padding-right: 10px;
}
.catalog-search__clear {
  position: relative;
  display: grid;
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-right: 8px;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: #edf2ee;
  color: var(--color-brand);
  cursor: pointer;
}
.catalog-search__clear[hidden] {
  display: none;
}
.catalog-search__clear::before,
.catalog-search__clear::after {
  position: absolute;
  width: 13px;
  height: 2px;
  border-radius: 999px;
  background: currentColor;
  content: "";
}
.catalog-search__clear::before {
  transform: rotate(45deg);
}
.catalog-search__clear::after {
  transform: rotate(-45deg);
}
.catalog-search__clear:hover,
.catalog-search__clear:focus-visible {
  background: var(--color-brand);
  color: #fff;
  outline: 0;
}
