/* Category strip search — shared across catalog pages */

.filter-strip-bar {
  position: relative;
}

.category-search {
  position: relative;
  display: flex;
  align-items: center;
  flex-shrink: 0;
  z-index: 3;
}

.category-search-label {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.category-search-icon {
  position: absolute;
  left: 0.72rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 0.95rem;
  height: 0.95rem;
  color: rgba(255, 255, 255, 0.72);
  pointer-events: none;
}

.category-search-icon svg {
  width: 100%;
  height: 100%;
}

.category-search-input {
  width: clamp(10.5rem, 22vw, 16rem);
  height: 2rem;
  padding: 0 1.75rem 0 2rem;
  border: 1px solid rgba(255, 255, 255, 0.42);
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.92);
  font-family: var(--sans, Georgia, serif);
  font-size: 0.82rem;
  line-height: 1;
  letter-spacing: 0.02em;
  outline: none;
  transition:
    border-color 0.25s ease,
    box-shadow 0.25s ease;
  -webkit-appearance: none;
  appearance: none;
}

.category-search-input::placeholder {
  color: rgba(255, 255, 255, 0.52);
}

.category-search-input:focus {
  border-color: rgba(255, 255, 255, 0.78);
  background: transparent;
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.14);
}

.category-search-input::-webkit-search-cancel-button,
.category-search-input::-webkit-search-decoration {
  -webkit-appearance: none;
  appearance: none;
}

.category-search-clear {
  position: absolute;
  right: 0.35rem;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 1.35rem;
  height: 1.35rem;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: rgba(255, 255, 255, 0.58);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.category-search-clear:hover,
.category-search-clear:focus-visible {
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.1);
}

.category-search-empty {
  grid-column: 1 / -1;
  padding: 1.5rem 1.5rem 0.5rem;
  text-align: center;
  color: var(--text-muted, rgba(58, 50, 42, 0.62));
}

.material-card.is-search-hidden,
.mix-card.is-search-hidden {
  display: none !important;
}

.gallery-panel.is-search-active .material-card:not(.is-search-hidden),
.gallery-panel.is-search-active .mix-card:not(.is-search-hidden),
#mixGrid.is-search-active .mix-card:not(.is-search-hidden) {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

.mix-subgroup.is-search-empty {
  display: none;
}

@media (min-width: 769px) {
  .filter-strip-bar > .category-search {
    position: absolute;
    top: 50%;
    right: clamp(1rem, 2.4vw, 1.75rem);
    transform: translateY(-50%);
  }

  .filter-strip-bar:has(.category-search) > .category-strip,
  .filter-strip-bar:has(.category-search) > .type-strip,
  .filter-strip-bar:has(.category-search) > .brand-strip,
  .filter-strip-bar:has(.category-search) > .mix-brand-strip {
    padding-right: clamp(12rem, 20vw, 18rem);
  }
}

@media (max-width: 768px) {
  .material-gallery > .category-search {
    width: calc(100% - 2rem);
    margin: 0 auto 1rem;
  }

  .material-gallery > .category-search .category-search-icon {
    color: rgba(58, 50, 42, 0.55);
  }

  .material-gallery > .category-search .category-search-input {
    flex: 1 1 auto;
    width: 100%;
    min-width: 0;
    height: 2.6rem;
    padding: 0 2.1rem 0 2.35rem;
    border-color: rgba(26, 16, 18, 0.55);
    color: var(--text, #3a322a);
    font-size: 16px;
  }

  .material-gallery > .category-search .category-search-input::placeholder {
    color: rgba(58, 50, 42, 0.42);
  }

  .material-gallery > .category-search .category-search-input:focus {
    border-color: rgba(26, 16, 18, 0.82);
    box-shadow: 0 0 0 1px rgba(110, 36, 51, 0.12);
  }

  .material-gallery > .category-search .category-search-clear {
    color: rgba(58, 50, 42, 0.48);
  }

  .material-gallery > .category-search .category-search-clear:hover,
  .material-gallery > .category-search .category-search-clear:focus-visible {
    color: rgba(58, 50, 42, 0.82);
    background: rgba(110, 36, 51, 0.08);
  }
}
