/* ===========================
   SEARCH / LISTING PAGE CSS
   =========================== */

/* ===========================
   BREADCRUMB
   =========================== */
.breadcrumb-bar {
  background: #f7f7f7;
  border-bottom: 1px solid #eee;
  padding: 0 20px;
}

.breadcrumb-inner {
  max-width: 1500px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  font-size: 12px;
  color: #888;
  font-family: var(--font-main);
}

.breadcrumb-inner a {
  color: #666;
  transition: color 0.15s;
}

.breadcrumb-inner a:hover { color: var(--red); }

.breadcrumb-inner i {
  font-size: 10px;
  color: #ccc;
}

.breadcrumb-inner span {
  color: #333;
  font-weight: 600;
}

/* ===========================
   SEARCH PAGE LAYOUT
   =========================== */
.search-page-wrap {
  min-height: 70vh;
}

.search-layout {
  display: flex;
  max-width: 1500px;
  margin: 0 auto;
  padding: 0 20px;
  gap: 0;
  align-items: flex-start;
}

/* ===========================
   SIDEBAR
   =========================== */
.filter-sidebar {
  width: 240px;
  flex-shrink: 0;
  padding: 20px 0;
  border-right: 1px solid #eee;
  position: sticky;
  top: 64px;
  max-height: calc(100vh - 64px);
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: #ddd transparent;
}

.filter-sidebar::-webkit-scrollbar { width: 4px; }
.filter-sidebar::-webkit-scrollbar-thumb { background: #ddd; border-radius: 4px; }

.filter-sidebar-inner { padding-right: 20px; }

.filter-mobile-header {
  display: none;
  align-items: center;
  justify-content: space-between;
  padding: 16px 16px 12px;
  border-bottom: 1px solid #eee;
  font-family: var(--font-heading);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 1px;
}

.close-filter-btn {
  background: none;
  border: none;
  font-size: 22px;
  color: #555;
  cursor: pointer;
  line-height: 1;
}

/* Filter Group */
.filter-group {
  border-bottom: 1px solid #f0f0f0;
  padding: 14px 0;
}

.filter-group:last-child { border-bottom: none; }

.filter-group-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: pointer;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.8px;
  color: var(--black);
  padding: 2px 0;
  user-select: none;
}

.toggle-icon {
  transition: transform 0.2s;
  font-size: 13px;
  color: #888;
}

.filter-group-header.collapsed .toggle-icon { transform: rotate(-90deg); }

.filter-group-body {
  margin-top: 10px;
  overflow: hidden;
  transition: max-height 0.25s ease;
}

.filter-group-body.hidden { display: none; }

/* Check filter */
.filter-check {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 5px 0;
  cursor: pointer;
  font-size: 13px;
  color: #444;
  transition: color 0.15s;
  text-decoration: none;
}

.filter-check:hover { color: var(--black); }
.filter-check.checked { color: var(--black); font-weight: 600; }

.check-box {
  width: 16px;
  height: 16px;
  border: 1.5px solid #ccc;
  border-radius: 2px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  font-size: 9px;
  transition: all 0.15s;
}

.filter-check.checked .check-box {
  background: var(--black);
  border-color: var(--black);
  color: var(--white);
}

.check-label { font-family: var(--font-main); font-size: 13px; }

/* Price range */
.price-range-wrap { padding: 4px 0; }

.price-display {
  display: flex;
  justify-content: space-between;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--black);
}

.price-slider {
  width: 100%;
  -webkit-appearance: none;
  height: 3px;
  background: #ddd;
  outline: none;
  border-radius: 3px;
  margin: 6px 0;
  cursor: pointer;
}

.price-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--black);
  cursor: pointer;
  border: 2px solid var(--white);
  box-shadow: 0 1px 4px rgba(0,0,0,0.25);
}

.price-apply-btn {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 8px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  text-align: center;
  transition: background 0.2s;
}

.price-apply-btn:hover { background: var(--red); }

.price-shortcuts {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 10px;
}

.price-tag {
  font-size: 11px;
  font-family: var(--font-heading);
  font-weight: 600;
  border: 1px solid #ddd;
  padding: 4px 8px;
  border-radius: 20px;
  color: #555;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
  white-space: nowrap;
}

.price-tag:hover,
.price-tag.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* Size grid */
.size-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.size-chip {
  width: 42px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ddd;
  font-family: var(--font-heading);
  font-size: 11px;
  font-weight: 700;
  color: #555;
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.15s;
  text-decoration: none;
}

.size-chip:hover { border-color: var(--black); color: var(--black); }

.size-chip.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* Color filter */
.color-filter-grid {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.color-filter-item {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  text-decoration: none;
  padding: 2px 0;
  transition: opacity 0.15s;
}

.color-filter-item:hover { opacity: 0.8; }

.color-swatch {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  transition: transform 0.15s;
}

.color-filter-item.active .color-swatch { transform: scale(1.1); }

.color-name {
  font-size: 12px;
  font-family: var(--font-main);
  color: #444;
}

.color-filter-item.active .color-name {
  font-weight: 700;
  color: var(--black);
}

/* Active filter chips in sidebar */
.active-filters-group { padding: 8px 0 14px; }

.active-filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: #f0f0f0;
  border: 1px solid #ddd;
  border-radius: 20px;
  font-size: 11px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: #444;
  text-decoration: none;
  transition: all 0.15s;
}

.filter-chip:hover { background: #e0e0e0; }

.filter-chip.clear-all {
  background: var(--red);
  color: var(--white);
  border-color: var(--red);
}

/* ===========================
   MAIN RESULTS AREA
   =========================== */
.search-main {
  flex: 1;
  padding: 20px 0 40px 24px;
  min-width: 0;
}

/* Results Header */
.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 14px;
  padding-bottom: 14px;
  border-bottom: 1px solid #eee;
}

.results-info { display: flex; flex-direction: column; gap: 4px; }

.results-heading {
  font-family: var(--font-heading);
  font-size: 18px;
  font-weight: 700;
  color: var(--black);
  text-transform: capitalize;
}

.results-heading em { font-style: italic; font-weight: 600; color: #555; }

.results-count {
  font-size: 13px;
  color: #888;
  font-family: var(--font-main);
}

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

/* Mobile filter button */
.mobile-filter-btn {
  display: none;
  align-items: center;
  gap: 6px;
  padding: 9px 14px;
  border: 1.5px solid var(--black);
  background: var(--white);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--black);
  position: relative;
  cursor: pointer;
}

.filter-count-badge {
  background: var(--red);
  color: var(--white);
  font-size: 10px;
  font-weight: 700;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

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

.sort-label {
  font-size: 12px;
  font-family: var(--font-heading);
  font-weight: 600;
  color: #666;
  white-space: nowrap;
}

.sort-select-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.sort-select {
  appearance: none;
  -webkit-appearance: none;
  padding: 8px 30px 8px 12px;
  border: 1.5px solid #ddd;
  background: var(--white);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 600;
  color: var(--black);
  cursor: pointer;
  outline: none;
  border-radius: 2px;
  transition: border-color 0.15s;
}

.sort-select:hover { border-color: var(--black); }

.sort-select-wrap > i {
  position: absolute;
  right: 9px;
  pointer-events: none;
  font-size: 11px;
  color: #888;
}

/* Active chips bar */
.active-chips-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 14px;
}

.active-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  background: var(--black);
  color: var(--white);
  font-size: 11px;
  font-family: var(--font-heading);
  font-weight: 600;
  border-radius: 2px;
  text-decoration: none;
  transition: background 0.15s;
}

.active-chip:hover { background: #333; }

.active-chip.clear-chip {
  background: var(--white);
  color: var(--red);
  border: 1.5px solid var(--red);
}

.active-chip.clear-chip:hover { background: var(--red); color: var(--white); }

/* ===========================
   PRODUCT GRID (SEARCH)
   =========================== */
.search-product-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 16px;
}

.product-card-link {
  display: block;
  text-decoration: none;
  color: inherit;
}

/* ===========================
   NO RESULTS
   =========================== */
.no-results {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 80px 24px;
  text-align: center;
  gap: 12px;
}

.no-results-icon { font-size: 60px; margin-bottom: 8px; }

.no-results h2 {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 700;
}

.no-results p { font-size: 14px; color: #666; }

.no-results-btn {
  display: inline-block;
  margin-top: 16px;
  padding: 12px 32px;
  background: var(--black);
  color: var(--white);
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: background 0.2s;
}

.no-results-btn:hover { background: var(--red); }

/* ===========================
   PAGINATION
   =========================== */
.pagination-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin-top: 40px;
  flex-wrap: wrap;
}

.page-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 9px 16px;
  border: 1.5px solid #ddd;
  font-family: var(--font-heading);
  font-size: 12px;
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  transition: all 0.15s;
  border-radius: 2px;
}

.page-btn:hover {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.page-numbers {
  display: flex;
  align-items: center;
  gap: 4px;
}

.page-num {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1.5px solid #ddd;
  font-family: var(--font-heading);
  font-size: 13px;
  font-weight: 700;
  color: var(--black);
  text-decoration: none;
  border-radius: 2px;
  transition: all 0.15s;
}

.page-num:hover { border-color: var(--black); }

.page-num.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

.page-ellipsis {
  padding: 0 4px;
  color: #aaa;
  font-size: 14px;
}

/* ===========================
   FILTER OVERLAY (mobile)
   =========================== */
.filter-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  z-index: 1099;
}

/* ===========================
   RESPONSIVE — TABLET 1024px
   =========================== */
@media (max-width: 1024px) {
  .search-product-grid { grid-template-columns: repeat(2, 1fr); gap: 14px; }
  .filter-sidebar { width: 210px; }
}

/* ===========================
   RESPONSIVE — TABLET 768px
   (Hide sidebar, show as drawer)
   =========================== */
@media (max-width: 768px) {
  .search-layout { padding: 0 14px; }

  /* Sidebar becomes a slide-in drawer */
  .filter-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    width: 85%;
    max-width: 300px;
    height: 100%;
    background: var(--white);
    z-index: 1100;
    border-right: none;
    box-shadow: 4px 0 20px rgba(0,0,0,0.18);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
    padding: 0;
    max-height: 100%;
    overflow-y: auto;
  }

  .filter-sidebar.open { transform: translateX(0); }

  .filter-sidebar-inner { padding: 0 16px 24px; }

  .filter-mobile-header { display: flex; }

  .filter-overlay.active { display: block; }

  .mobile-filter-btn { display: flex; }

  /* Main takes full width */
  .search-main { padding: 16px 0 32px; }

  .search-product-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }

  .results-heading { font-size: 15px; }
  .results-count { font-size: 12px; }
}

/* ===========================
   RESPONSIVE — MOBILE 480px
   =========================== */
@media (max-width: 480px) {
  .search-layout { padding: 0 10px; }
  .search-main { padding: 12px 0 24px; }

  .results-header { gap: 8px; margin-bottom: 10px; padding-bottom: 10px; }
  .results-heading { font-size: 14px; }

  .sort-label { display: none; }
  .sort-select { font-size: 11px; padding: 7px 26px 7px 10px; }

  .search-product-grid { grid-template-columns: repeat(2, 1fr); gap: 8px; }

  .pagination-wrap { gap: 4px; margin-top: 28px; }
  .page-num { width: 32px; height: 32px; font-size: 12px; }
  .page-btn { padding: 7px 12px; font-size: 11px; }
}
