/* Catalog filters extracted from styles.css to isolate search and filter UI. */

.filters {
  position: sticky;
  top: 0;
  z-index: 10;
  margin-bottom: 12px;
}

/* Catalog filters restored to the previous visible layout reference. */

.filters {
  position: relative;
  z-index: 10;
  margin: 6px auto 18px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
}

.filters-inner {
  order: 2;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  justify-content: center;
  align-items: center;
}

.filters-actions {
  display: flex;
  align-items: center;
  gap: 14px;
}

.filters-panel,
.filters-panel[hidden] {
  order: 1;
  display: flex !important;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  justify-content: center;
}

.btn.btn-filter,
.btn-clear {
  display: none !important;
}

.btn.btn-filter {
  border: 1px solid rgba(85, 120, 184, .18);
  background: #fff;
  color: var(--primary);
  box-shadow: 0 8px 18px rgba(85, 120, 184, .12);
}

.filter-group {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, rgba(135, 125, 211, 0.74) 0%, rgba(85, 120, 184, 0.74) 100%);
  border-radius: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(85, 120, 184, .18);
  box-shadow: 0 8px 18px rgba(85, 120, 184, .22);
}

.filter-label {
  font-weight: 800;
  color: #fff;
  margin-right: 0;
  font-size: 1.02rem;
  line-height: 1;
}

.chip-row {
  display: inline-flex;
  flex-wrap: nowrap;
  overflow-x: auto;
  overflow-y: hidden;
  gap: 8px;
  padding: 0;
  background: transparent;
  border: 0;
  box-shadow: none;
  scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
  display: none;
}

.chip {
  flex: 0 0 auto;
  border: 1px solid #d8d8d8;
  border-radius: 999px;
  padding: 7px 14px;
  background: #fff;
  color: #333;
  cursor: pointer;
  font-weight: 500;
  font-size: 0.88rem;
  line-height: 1;
  box-shadow: 0 1px 2px rgba(0, 0, 0, .05);
  transition: background .15s ease, color .15s ease, border-color .15s ease, transform .15s ease;
}

.chip:hover {
  transform: translateY(-1px);
}

.chip[aria-selected="true"],
.chip.active {
  background: #fff;
  color: var(--brand);
  border-color: var(--brand);
}

.chip:disabled,
.chip[aria-disabled="true"] {
  opacity: .45;
  cursor: not-allowed;
}

.search-input {
  width: 220px;
  max-width: 220px;
  padding: 10px 16px;
  border: 1px solid rgba(85, 120, 184, .18);
  border-radius: 999px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--text);
  background: #fff;
  box-shadow: 0 4px 12px rgba(85, 120, 184, .10);
  transition: box-shadow .2s ease, border-color .2s ease;
}

.search-input:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(85, 120, 184, .15);
}

.btn.btn-offers {
  border: 1px solid var(--primary);
  background: #fff;
  color: var(--primary);
  font-weight: 800;
  font-size: 1.1rem;
  padding: 10px 18px;
  transition: transform .15s ease, filter .15s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease, border-color .2s ease;
  box-shadow:
    0 0 0 1px rgba(135, 125, 211, 0.35),
    0 0 10px rgba(135, 125, 211, 0.45),
    0 6px 14px rgba(0, 0, 0, 0.10);
  will-change: box-shadow, filter, transform;
  text-shadow: none;
  position: relative;
  z-index: 0;
  -webkit-tap-highlight-color: transparent;
  white-space: nowrap;
  animation: offersShakeCycle 3s ease-in-out infinite;
}

.btn.btn-offers::before {
  content: "";
  position: absolute;
  inset: -3px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--primary) 0%, var(--brand) 100%);
  filter: blur(10px);
  opacity: 0;
  transition: opacity .12s ease, transform .12s ease;
  z-index: -1;
  pointer-events: none;
}

.btn.btn-offers:hover {
  filter: none;
  transform: translateY(-1px);
  box-shadow:
    0 0 0 1px rgba(135, 125, 211, 0.45),
    0 0 12px rgba(135, 125, 211, 0.55),
    0 10px 18px rgba(0, 0, 0, 0.12);
}

.btn.btn-offers:focus {
  outline: none;
}

.btn.btn-offers:focus-visible {
  outline: none;
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.6), 0 0 0 6px rgba(85, 120, 184, 0.55);
}

.btn.btn-offers:active {
  outline: none;
  transform: translateY(2px) scale(0.985);
  box-shadow: 0 6px 14px rgba(135, 125, 211, .32), 0 12px 24px rgba(85, 120, 184, .28);
}

.btn.btn-offers:active::before {
  opacity: 1;
  transform: scale(1.03);
}

.btn.btn-offers.active,
.btn.btn-offers[aria-pressed="true"] {
  background: #00e676 !important;
  background-color: #00e676 !important;
  color: #fff !important;
  border-color: #00e676 !important;
  border-width: 2px !important;
  filter: none !important;
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.25);
  box-shadow:
    0 0 0 1px rgba(0, 230, 118, 0.35),
    0 0 10px rgba(0, 230, 118, 0.60),
    0 0 20px rgba(0, 230, 118, 0.42),
    0 6px 14px rgba(0, 0, 0, 0.12);
  animation: none !important;
}

.btn.btn-offers.active:hover,
.btn.btn-offers[aria-pressed="true"]:hover {
  background: #00e676 !important;
  filter: brightness(1.03) !important;
  transform: translateY(-1px) !important;
  box-shadow:
    0 0 0 1px rgba(0, 230, 118, 0.45),
    0 0 12px rgba(0, 230, 118, 0.70),
    0 10px 18px rgba(0, 0, 0, 0.12) !important;
}

.btn.btn-offers.active::before,
.btn.btn-offers[aria-pressed="true"]::before {
  opacity: 0;
  animation: none;
  transform: none;
}

.btn.btn-offers:hover,
.btn.btn-offers:focus,
.btn.btn-offers:active,
.btn.btn-offers[aria-pressed="true"],
.btn.btn-offers.active {
  animation: none !important;
}

@keyframes offersShakeCycle {
  0% {
    transform: translateX(0) rotate(0);
  }

  2% {
    transform: translateX(-1.5px) rotate(-0.4deg);
  }

  4% {
    transform: translateX(1.5px) rotate(0.4deg);
  }

  6% {
    transform: translateX(-1.5px) rotate(-0.4deg);
  }

  8% {
    transform: translateX(0) rotate(0);
  }

  9%,
  100% {
    transform: translateX(0) rotate(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .btn.btn-offers {
    animation: none !important;
  }
}

@media (max-width: 767px) {
  .filters {
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    margin-bottom: 14px;
  }

  .filters-inner {
    order: 1;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    justify-content: stretch;
    gap: 10px;
  }

  .filters-actions {
    width: 100%;
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 10px;
  }

  .filters-panel,
  .filters-panel[hidden] {
    order: 2;
    width: 100%;
    display: flex !important;
    flex-direction: column;
    align-items: stretch;
    gap: 10px;
    overflow: hidden;
    transform-origin: top center;
    transition:
      max-height var(--motion-duration-ui) var(--motion-ease-ui),
      opacity var(--motion-duration-ui-fast) var(--motion-ease-ui),
      transform var(--motion-duration-ui-fast) var(--motion-ease-ui),
      padding-top var(--motion-duration-ui-fast) var(--motion-ease-ui),
      margin-top var(--motion-duration-ui-fast) var(--motion-ease-ui);
  }

  .filters-panel {
    max-height: 420px;
    opacity: 1;
    transform: translateY(0);
    margin-top: 0;
  }

  .filters-panel[hidden] {
    max-height: 0;
    opacity: 0;
    transform: translateY(-10px);
    pointer-events: none;
    margin-top: -2px;
  }

  .btn.btn-filter {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    width: 100%;
    gap: 8px;
    padding: 10px 16px;
    font-weight: 800;
  }

  .btn.btn-filter::after {
    content: "";
    width: 9px;
    height: 9px;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: translateY(-1px) rotate(45deg);
    transition: transform var(--motion-duration-ui-fast) var(--motion-ease-ui), opacity var(--motion-duration-ui-fast) var(--motion-ease-ui);
    opacity: .8;
    flex: 0 0 auto;
  }

  .btn.btn-filter[aria-expanded="true"] {
    color: #fff;
    background: linear-gradient(135deg, rgba(135, 125, 211, 0.92) 0%, rgba(85, 120, 184, 0.92) 100%);
    border-color: transparent;
    box-shadow: 0 10px 20px rgba(85, 120, 184, .22);
  }

  .btn.btn-filter[aria-expanded="true"]::after {
    transform: translateY(1px) rotate(-135deg);
    opacity: 1;
  }

  .filter-group {
    width: 100%;
    min-width: 0;
    gap: 10px;
    padding: 10px 12px;
  }

  .filter-label {
    font-size: 0.96rem;
  }

  .chip-row {
    flex: 1 1 auto;
    min-width: 0;
  }

  .chip {
    padding: 6px 12px;
    font-size: 0.78rem;
  }

  .search-input {
    flex: 1 1 auto;
    max-width: none;
    width: 100%;
  }

  .btn.btn-offers {
    width: 100%;
    min-height: 46px;
    justify-content: center;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .filters-inner,
  .filters-actions {
    width: 100%;
  }

  .filters-actions {
    justify-content: stretch;
  }

  .btn.btn-offers {
    width: 100%;
    text-align: center;
    justify-content: center;
  }
}

@media (max-width: 767px) and (prefers-reduced-motion: reduce) {
  .filters-panel,
  .filters-panel[hidden] {
    transition: none;
  }
}