/* ── Breadcrumbs ── */
.breadcrumbs {
  max-width: 1600px;
  margin: 0 auto;
  padding: 12px 24px 0;
  font-size: 13px;
  color: #999999;
}

.breadcrumbs a {
  color: #999999;
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: #f5a623;
}

.breadcrumbs span {
  margin: 0 6px;
}

/* ── Page title ── */
.page-title-section {
  max-width: 1600px;
  margin: 0 auto;
  padding: 16px 24px 0;
  margin-left: 24px;
  margin-right: 24px;
}

.page-title {
  font-size: 1.75rem;
  font-weight: 700;
  color: #333333;
  margin: 0 0 8px 0;
}

.page-title-underline {
  width: 80px;
  height: 4px;
  background: #f5a623;
  border-radius: 2px;
}

/* ── Filter block ── */
.filter-block {
  max-width: 1600px;
  margin: 20px auto 0;
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  overflow: hidden;
}

.top-filter-bar {
  padding: 16px 24px;
  background: transparent;
}

.filter-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-bottom: 10px;
  align-items: center;
}

.filter-row:last-child {
  margin-bottom: 0;
}

.top-filter-bar select,
.top-filter-bar input {
  height: 38px;
  padding: 6px 12px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  background: #ffffff;
  color: #333333;
  font-size: 13px;
  min-width: 130px;
  flex: 0 1 auto;
}

.top-filter-bar select option {
  background: #ffffff;
  color: #333333;
}

.top-filter-bar input::placeholder {
  color: #999999;
}

.top-filter-bar input[type="number"] {
  min-width: 90px;
}

.year-range-inputs,
.price-range-inputs {
  display: flex;
  gap: 6px;
  align-items: center;
}

.year-range-inputs input,
.price-range-inputs input {
  min-width: 80px;
  flex: 1;
}

.range-separator {
  color: #666666;
  font-weight: bold;
}

.filter-actions {
  display: flex;
  gap: 8px;
  margin-top: 4px;
}

.btn-filter {
  height: 38px;
  padding: 0 24px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 4px;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
}

.btn-filter:hover {
  background: #43a047;
}

/* ── Mobile filter toggle ── */
.mobile-filter-toggle {
  display: none;
  width: 100%;
  padding: 10px 16px;
  background: #f5f5f5;
  color: #333333;
  border: 1px solid #cccccc;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  text-align: left;
  margin-bottom: 0;
}

/* ── Selected filters ── */
.selected-filters-section {
  padding: 12px 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  min-height: 52px;
  border-top: 1px solid #e0e0e0;
}

.selected-filters-left {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  flex: 1;
}

.selected-filters-label {
  font-size: 13px;
  color: #999999;
  font-weight: 400;
  margin-right: 4px;
  white-space: nowrap;
}

.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: #4a4a4a;
  border: none;
  border-radius: 4px;
  padding: 5px 12px;
  font-size: 13px;
  color: white;
  transition: background 0.2s ease;
  white-space: nowrap;
}

.filter-chip:hover {
  background: #5a5a5a;
}

.chip-label {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 400;
}

.chip-value {
  font-weight: 500;
  color: white;
}

.chip-remove {
  color: white;
  text-decoration: none;
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  margin-left: 4px;
  transition: color 0.2s ease;
  padding: 0 2px;
  opacity: 0.9;
}

.chip-remove:hover {
  color: #ff6b6b;
  opacity: 1;
}

.no-filters-text {
  color: #999999;
  font-size: 13px;
}

.filter-actions-row {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-shrink: 0;
}

.btn-action {
  height: 30px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn-action .btn-icon {
  flex-shrink: 0;
}

.btn-action:hover {
  opacity: 0.9;
  transform: translateY(-1px);
}

.btn-save-search {
  background: #4caf50;
  color: white;
  border: none;
}

.btn-save-search:hover {
  background: #43a047;
}

.btn-save-search:disabled {
  background: #7a7f87;
  cursor: not-allowed;
  opacity: 0.5;
}

.btn-clear {
  background: #f44336;
  color: white;
  border: none;
}

.btn-clear:hover {
  background: #e53935;
}

.btn-toggle-sidebar {
  background: #4a4a4a;
  color: white;
  border: none;
}

.btn-toggle-sidebar:hover {
  background: #5a5a5a;
}

.btn-filter-hits {
  background: #4a4a4a;
  color: white;
  border: none;
  padding: 0 16px;
  height: 38px;
  font-size: 14px;
  font-weight: 500;
  border-radius: 4px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: background 0.2s ease;
}

.btn-filter-hits:hover {
  background: #5a5a5a;
}

.btn-filter-hits .btn-icon {
  flex-shrink: 0;
}

/* ── Page body / layout ── */
.page-body {
  max-width: 1600px;
  margin: 20px auto 40px;
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 20px;
  padding: 0 0 40px;
  transition: grid-template-columns 0.3s ease;
}

.page-body.sidebar-collapsed {
  grid-template-columns: 1fr;
}

/* ── Sidebar ── */
.filter-sidebar {
  background: white;
  border-radius: 8px;
  padding: 20px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  position: sticky;
  top: 100px;
  align-self: start;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  transition: transform 0.3s ease;
}

.filter-sidebar.sidebar-hidden {
  display: none;
}

.filter-sidebar h3 {
  font-size: 1.1rem;
  margin-bottom: 16px;
  color: #333333;
  border-bottom: 2px solid #f5a623;
  padding-bottom: 8px;
}

.filter-group {
  margin-bottom: 18px;
}

.filter-group label {
  display: block;
  font-size: 0.875rem;
  font-weight: 500;
  color: #555;
  margin-bottom: 6px;
}

.filter-group select,
.filter-group input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 13px;
  background: white;
}

.filter-group .range-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.sidebar-submit {
  width: 100%;
  padding: 10px;
  background: #4caf50;
  color: white;
  border: none;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.2s ease;
  margin-top: 10px;
}

.sidebar-submit:hover {
  background: #43a047;
}

/* ── Main content ── */
.listing-main {
  min-width: 0;
}

.results-header {
  background: #ffffff;
  padding: 20px;
  border-radius: 4px;
  margin-bottom: 20px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.results-header-left h2 {
  font-size: 1.25rem;
  color: #333333;
  margin: 0 0 4px 0;
}

.results-header-left p {
  color: #999999;
  font-size: 0.9rem;
  margin: 0;
}

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

.results-header-right label {
  font-size: 13px;
  color: #666666;
}

.sort-dropdown {
  padding: 8px 12px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  background: #ffffff;
  color: #333333;
  font-size: 13px;
  cursor: pointer;
}

/* ── Watch cards ── */
.watches-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
  margin-bottom: 40px;
}

.watch-card {
  background: #ffffff;
  border-radius: 4px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08);
  border: 1px solid #e0e0e0;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  text-decoration: none;
  color: inherit;
  display: block;
}

.watch-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.watch-image {
  width: 100%;
  height: 200px;
  background: #f0f0f0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #999;
  font-size: 14px;
  overflow: hidden;
}

.watch-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.watch-content {
  padding: 16px;
}

.watch-brand {
  font-size: 1.1rem;
  font-weight: 600;
  color: #333333;
  margin-bottom: 4px;
}

.watch-model {
  font-size: 0.95rem;
  color: #555555;
  margin-bottom: 8px;
}

.watch-reference {
  font-size: 0.85rem;
  color: #999999;
  margin-bottom: 10px;
}

.watch-price {
  font-size: 1.3rem;
  font-weight: 700;
  color: #4caf50;
  margin-bottom: 8px;
}

.watch-details {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.detail-badge {
  background: #f5f5f5;
  color: #333333;
  padding: 3px 8px;
  border-radius: 4px;
  font-size: 0.75rem;
  font-weight: 500;
}

.watch-condition {
  background: #e8f5e9;
  color: #4caf50;
}

.watch-movement {
  background: #e3f2fd;
  color: #1976d2;
}

.watch-year {
  background: #fff3e0;
  color: #f5a623;
}

.watch-description {
  color: #666666;
  font-size: 0.85rem;
  line-height: 1.4;
  margin-bottom: 10px;
}

.watch-meta {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.75rem;
  color: #999999;
}

/* ── Pagination ── */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 30px;
  padding: 20px;
}

.pagination a,
.pagination span {
  padding: 8px 14px;
  border: 1px solid #cccccc;
  border-radius: 4px;
  text-decoration: none;
  color: #333333;
  background: #ffffff;
  font-size: 13px;
}

.pagination a:hover {
  background: #4a4a4a;
  color: white;
  border-color: #4a4a4a;
}

.pagination .current {
  background: #4a4a4a;
  color: white;
  border-color: #4a4a4a;
}

/* ── Empty state ── */
.no-watches {
  text-align: center;
  padding: 60px 20px;
  color: #999999;
  background: #ffffff;
  border-radius: 4px;
  border: 1px solid #e0e0e0;
}

.no-watches h2 {
  font-size: 1.5rem;
  margin-bottom: 10px;
}

/* ── Sidebar overlay (mobile) ── */
.sidebar-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 250;
  display: none;
}

.sidebar-overlay.visible {
  display: block;
}

/* ── Responsive ── */
@media (min-width: 769px) {
  .filter-actions {
    display: none;
  }

  .sidebar-submit {
    display: none;
  }
}

@media (max-width: 1200px) {
  .page-body {
    grid-template-columns: 260px 1fr;
    gap: 16px;
    padding: 16px 0;
  }

  .watches-grid {
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 1024px) {
  .filter-sidebar {
    position: fixed;
    left: 0;
    top: 0;
    bottom: 0;
    width: 320px;
    max-width: 85vw;
    z-index: 300;
    background: white;
    box-shadow: 2px 0 12px rgba(0, 0, 0, 0.3);
    transform: translateX(0);
    transition: transform 0.3s ease;
    max-height: 100vh;
    border-radius: 0;
  }

  .filter-sidebar.sidebar-hidden {
    transform: translateX(-100%);
    display: block;
  }

  .page-body {
    grid-template-columns: 1fr !important;
  }
}

@media (max-width: 768px) {
  .mobile-filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
  }

  .filter-rows-wrapper {
    display: none;
  }

  .filter-rows-wrapper.expanded {
    display: block;
    margin-top: 10px;
  }

  .top-filter-bar {
    padding: 12px;
  }

  .filter-row {
    gap: 8px;
  }

  .top-filter-bar select,
  .top-filter-bar input {
    min-width: 100%;
    flex: 1 1 100%;
  }

  .selected-filters-section {
    flex-direction: column;
    align-items: flex-start;
  }

  .filter-actions-row {
    width: 100%;
    justify-content: flex-start;
  }

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