/* Search/Browse Page Styles */

.search-page {
  background: var(--bg-cream);
  padding: 32px 0 80px;
  min-height: calc(100vh - 300px);
}

/* Search Header */
.search-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 32px;
  gap: 24px;
}

.search-header h1 {
  font-size: 38px;
  font-weight: 600;
  margin-bottom: 8px;
  letter-spacing: -0.02em;
}

.results-count {
  font-size: 15px;
  color: var(--text-secondary);
  margin: 0;
}

.search-controls {
  display: flex;
  gap: 12px;
  align-items: center;
}

.filter-toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 18px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-toggle:hover {
  border-color: var(--primary-color);
  background: var(--bg-light);
}

.filter-toggle svg {
  width: 18px;
  height: 18px;
}

.sort-select {
  padding: 10px 16px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 0.2s;
}

.sort-select:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Search Layout */
.search-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 32px;
}

/* Filters Panel */
.filters-panel {
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 24px;
  height: fit-content;
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 140px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: var(--border-color) transparent;
}

.filters-panel::-webkit-scrollbar {
  width: 8px;
}

.filters-panel::-webkit-scrollbar-track {
  background: transparent;
  border-radius: 10px;
}

.filters-panel::-webkit-scrollbar-thumb {
  background: var(--border-color);
  border-radius: 10px;
  transition: background 0.2s;
}

.filters-panel::-webkit-scrollbar-thumb:hover {
  background: var(--secondary-color);
}

.filters-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border-color);
}

.filters-header h2 {
  font-size: 18px;
  font-weight: 600;
  margin: 0;
}

.clear-filters {
  font-size: 13px;
  color: var(--accent-color);
  background: none;
  border: none;
  cursor: pointer;
  font-weight: 500;
  transition: opacity 0.2s;
}

.clear-filters:hover {
  opacity: 0.7;
}

/* Filter Section */
.filter-section {
  margin-bottom: 28px;
  padding-bottom: 28px;
  border-bottom: 1px solid var(--border-color);
}

.filter-section:last-of-type {
  border-bottom: none;
  padding-bottom: 0;
}

.filter-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 14px;
}

.filter-search {
  margin-bottom: 12px;
}

.filter-search-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  background: var(--bg-light);
}

.filter-search-input:focus {
  outline: none;
  border-color: var(--primary-color);
  background: var(--bg-white);
}

.filter-options {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.filter-option {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 0;
  transition: color 0.2s;
}

.filter-option:hover {
  color: var(--primary-color);
}

.filter-option input[type="checkbox"] {
  flex-shrink: 0;
  cursor: pointer;
}

.filter-option span:first-of-type {
  flex: 1;
  font-size: 14px;
  word-wrap: break-word;
  overflow-wrap: break-word;
  min-width: 0;
}

.filter-count {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-secondary);
  margin-left: auto;
}

/* Price Inputs */
.price-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.price-input {
  flex: 1;
  min-width: 0;
  padding: 10px 8px;
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 14px;
  box-sizing: border-box;
}

.price-inputs span {
  flex-shrink: 0;
  color: var(--text-secondary);
}

.price-input:focus {
  outline: none;
  border-color: var(--primary-color);
}

/* Size Grid */
.size-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.size-button {
  padding: 10px;
  background: var(--bg-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.size-button:hover {
  border-color: var(--primary-color);
  background: var(--bg-white);
}

.size-button.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.apply-filters {
  width: 100%;
  margin-top: 20px;
}

/* Results Section */
.results-section {
  display: flex;
  flex-direction: column;
  gap: 32px;
}

.results-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* Listing Cards (same as home.css) */
.listing-card {
  display: block;
  background: var(--bg-white);
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border-color);
  transition: transform 0.2s, box-shadow 0.2s, border-color 0.2s;
  cursor: pointer;
}

.listing-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 16px 36px rgba(20, 17, 15, 0.12);
  border-color: rgba(20, 17, 15, 0.12);
}

.listing-image-wrapper {
  position: relative;
  width: 100%;
  padding-bottom: 128%;
  background: var(--bg-light);
  overflow: hidden;
}

.listing-image {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.favorite-button {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg-white);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 8px 16px rgba(20, 17, 15, 0.12);
  transition: transform 0.2s;
  z-index: 10;
  border: none;
}

.favorite-button:hover {
  transform: scale(1.1);
}

.favorite-button.is-favorite {
  animation: heartBeat 0.3s ease-in-out;
}

@keyframes heartBeat {
  0%, 100% { transform: scale(1); }
  25% { transform: scale(1.2); }
  50% { transform: scale(1.1); }
}

.discount-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--discount-color);
  color: white;
  padding: 6px 12px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 600;
}

.listing-content {
  padding: 14px;
}

.listing-brand {
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 4px;
  letter-spacing: 0.08em;
}

.listing-title {
  font-size: 15px;
  color: var(--text-primary);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.listing-size {
  font-size: 12px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  letter-spacing: 0.02em;
}

.listing-price-wrapper {
  display: flex;
  align-items: center;
  gap: 8px;
}

.listing-price {
  font-size: 18px;
  font-weight: 600;
  color: var(--text-primary);
}

.listing-old-price {
  font-size: 14px;
  color: var(--text-secondary);
  text-decoration: line-through;
}

/* Pagination */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  padding: 32px 0;
}

.pagination-button {
  padding: 10px 18px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-button:hover:not(:disabled) {
  border-color: var(--primary-color);
  background: var(--bg-light);
}

.pagination-button:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-pages {
  display: flex;
  gap: 4px;
  align-items: center;
}

.pagination-page {
  min-width: 40px;
  height: 40px;
  padding: 0 12px;
  background: var(--bg-white);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.pagination-page:hover {
  border-color: var(--primary-color);
  background: var(--bg-light);
}

.pagination-page.active {
  background: var(--primary-color);
  color: white;
  border-color: var(--primary-color);
}

.pagination-dots {
  padding: 0 8px;
  color: var(--text-secondary);
}

/* Responsive */
@media (max-width: 1024px) {
  .search-layout {
    grid-template-columns: 1fr;
  }

  .filters-panel {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 1000;
    max-height: 100vh;
    border-radius: 0;
    overflow-y: auto;
  }

  .filters-panel.mobile-show {
    display: block;
  }

  .filter-toggle {
    display: flex;
  }

  .results-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .search-page {
    padding: 24px 0 60px;
  }

  .search-header {
    flex-direction: column;
    gap: 16px;
  }

  .search-header h1 {
    font-size: 28px;
  }

  .search-controls {
    width: 100%;
    justify-content: space-between;
  }

  .filter-toggle,
  .sort-select {
    flex: 1;
  }

  .results-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .pagination {
    flex-wrap: wrap;
    gap: 8px;
  }

  .pagination-button {
    padding: 8px 14px;
    font-size: 13px;
  }

  .pagination-page {
    min-width: 36px;
    height: 36px;
    font-size: 13px;
  }
}

@media (min-width: 1025px) {
  .filter-toggle {
    display: none;
  }
}
