.search-hero {
  padding: 28px 10px 0;
  max-width: 1400px;
  margin: 0 auto;
}

.search-hero__title {
  font-size: 13px;
  font-weight: 400;
  color: var(--text-muted);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-bottom: 14px;
}

.search-hero__bar {
  display: flex;
  gap: 10px;
  align-items: center;
}

.search-hero__input-wrap {
  flex: 1;
  position: relative;
}

.search-hero__input-wrap svg {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  stroke: var(--text-muted);
  pointer-events: none;
  flex-shrink: 0;
}

.search-hero__input {
  width: 100%;
  background: #1c1c20;
  border: 1px solid var(--border);
  border-radius: 14px;
  color: var(--text);
  font-family: "Philosopher", sans-serif;
  font-size: 16px;
  padding: 13px 16px 13px 44px;
  outline: none;
  transition: border-color var(--transition);
}

.search-hero__input::placeholder {
  color: var(--text-muted);
}

.search-hero__input:focus {
  border-color: var(--accent);
}

.search-hero__submit {
  background: var(--accent);
  border: none;
  border-radius: 14px;
  color: var(--text);
  font-family: "Philosopher", sans-serif;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 13px 26px;
  cursor: pointer;
  white-space: nowrap;
  transition: opacity var(--transition);
}

.search-hero__submit:hover {
  opacity: 0.85;
}

/* ---------- Панель фільтрів ---------- */
.sf-panel {
  background: #121217;
  border: 1px solid var(--border);
  border-radius: 18px;
  padding: 22px 20px;
  max-width: 1400px;
  margin: 18px auto 0;
}

.sf-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

@media (max-width: 900px) {
  .sf-row {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 520px) {
  .sf-row {
    grid-template-columns: 1fr 1fr;
    gap: 8px;
  }
}

.sf-select {
  width: 100%;
  background: #1c1c20;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: "Philosopher", sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color var(--transition);
}

.sf-select:focus {
  border-color: var(--accent);
}

.sf-select option {
  background: #1c1c20;
}

/* ---------- Ціновий рядок ---------- */
.sf-price-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  flex-wrap: wrap;
}

.sf-price-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  letter-spacing: 1px;
  text-transform: uppercase;
}

.sf-price-input {
  width: 120px;
  background: #1c1c20;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: "Philosopher", sans-serif;
  font-size: 14px;
  padding: 10px 14px;
  outline: none;
  transition: border-color var(--transition);
}

.sf-price-input:focus {
  border-color: var(--accent);
}

.sf-price-input::placeholder {
  color: var(--text-muted);
}

.sf-sep {
  color: var(--text-muted);
  font-size: 18px;
  font-weight: 700;
}

/* ---------- Тогли ---------- */
.sf-toggles {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-top: 14px;
  flex-wrap: wrap;
}

.sf-toggle-label {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  font-size: 14px;
  color: #ccc;
  user-select: none;
}

.sf-toggle-label input[type="checkbox"] {
  display: none;
}

.sf-toggle-track {
  width: 40px;
  height: 22px;
  background: #2a2a2e;
  border-radius: 11px;
  position: relative;
  transition: background var(--transition);
  border: 1px solid var(--border);
  flex-shrink: 0;
}

.sf-toggle-track::after {
  content: "";
  position: absolute;
  width: 16px;
  height: 16px;
  background: #666;
  border-radius: 50%;
  top: 2px;
  left: 2px;
  transition:
    transform var(--transition),
    background var(--transition);
}

.sf-toggle-label input:checked + .sf-toggle-track {
  background: var(--accent);
  border-color: var(--accent);
}

.sf-toggle-label input:checked + .sf-toggle-track::after {
  transform: translateX(18px);
  background: #fff;
}

/* ---------- Нижній рядок ---------- */
.sf-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 16px;
  flex-wrap: wrap;
}

.sf-sort-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.sf-sort-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.sf-sort-select {
  background: #1c1c20;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text);
  font-family: "Philosopher", sans-serif;
  font-size: 14px;
  padding: 9px 36px 9px 14px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  cursor: pointer;
  transition: border-color var(--transition);
}

.sf-sort-select:focus {
  border-color: var(--accent);
}

.sf-sort-select option {
  background: #1c1c20;
}

.sf-apply-btn {
  background: var(--accent);
  border: none;
  border-radius: 12px;
  color: #fff;
  font-family: "Philosopher", sans-serif;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
  padding: 10px 24px;
  cursor: pointer;
  transition: opacity var(--transition);
}

.sf-apply-btn:hover {
  opacity: 0.85;
}

.sf-reset-btn {
  background: transparent;
  border: 1px solid var(--border);
  border-radius: 12px;
  color: var(--text-muted);
  font-family: "Philosopher", sans-serif;
  font-size: 14px;
  padding: 10px 18px;
  cursor: pointer;
  transition:
    border-color var(--transition),
    color var(--transition);
  text-decoration: none;
}

.sf-reset-btn:hover {
  border-color: #555;
  color: var(--text);
}

/* ---------- Результати ---------- */
.search-results-header {
  max-width: 1400px;
  margin: 28px auto 12px;
  padding: 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.search-results-count {
  font-size: 13px;
  color: var(--text-muted);
}

.search-results-count strong {
  color: var(--text);
  font-weight: 700;
}

/* ---------- Empty state ---------- */
.search-empty {
  text-align: center;
  padding: 80px 20px;
}

.search-empty__icon {
  font-size: 54px;
  margin-bottom: 16px;
}

.search-empty__title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 8px;
}

.search-empty__text {
  font-size: 14px;
  color: var(--text-muted);
}

/* ---------- Pagination active ---------- */
.pag-link.active {
  background: var(--accent);
  border-color: var(--accent);
}

.ac-dropdown {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  background: #1a1a22;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.7);
  z-index: 9999;
  overflow: hidden;
  display: none;
  max-height: 380px;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #333 transparent;
}

.ac-dropdown::-webkit-scrollbar {
  width: 4px;
}

.ac-dropdown::-webkit-scrollbar-track {
  background: transparent;
}

.ac-dropdown::-webkit-scrollbar-thumb {
  background: #333;
  border-radius: 4px;
}

.ac-dropdown.visible {
  display: block;
}

.ac-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 16px;
  cursor: pointer;
  text-decoration: none;
  color: var(--text);
  transition: background 0.15s;
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.ac-item:last-child {
  border-bottom: none;
}

.ac-item:hover,
.ac-item.ac-focused {
  background: rgba(177, 2, 86, 0.12);
}

.ac-item__photo {
  width: 46px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
  flex-shrink: 0;
  background: #2a2a30;
  display: block;
}

.ac-item__photo-placeholder {
  width: 46px;
  height: 56px;
  border-radius: 10px;
  background: linear-gradient(135deg, #2a2a30, #1c1c24);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #555;
  font-size: 18px;
}

.ac-item__info {
  flex: 1;
  min-width: 0;
}

.ac-item__name {
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ac-item__name mark {
  background: none;
  color: var(--accent);
  font-weight: 700;
}

.ac-item__meta {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
}

.ac-item__price {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  flex-shrink: 0;
  white-space: nowrap;
}

.ac-item__avail {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--green);
  flex-shrink: 0;
  box-shadow: 0 0 6px rgba(34, 197, 94, 0.6);
}

.ac-empty {
  padding: 20px 16px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.ac-header {
  padding: 10px 16px 6px;
  font-size: 11px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: #555;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
#back-to-top {
  position: fixed;
  bottom: 109px;
  right: 46px;
  z-index: 999;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: none;
  background: linear-gradient(135deg, #ba3e62, #8b2042);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 18px rgba(186, 62, 98, 0.45);
  opacity: 0;
  transform: translateY(16px) scale(0.85);
  pointer-events: none;
  transition:
    opacity 0.3s,
    transform 0.3s;
}
#back-to-top.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
  animation: btt-pulse 2.2s ease-in-out infinite;
}
@keyframes btt-pulse {
  0%,
  100% {
    box-shadow: 0 4px 18px rgba(186, 62, 98, 0.45);
  }
  50% {
    box-shadow:
      0 4px 28px rgba(186, 62, 98, 0.85),
      0 0 0 8px rgba(186, 62, 98, 0.12);
  }
}
