.catalog-layout {
  display: flex;
  gap: var(--space-xl);
  align-items: flex-start;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}


.catalog-sidebar {
  width: 300px;
  flex-shrink: 0;
  position: sticky;
  top: calc(var(--header-height) + var(--space-lg));
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  max-height: calc(100vh - var(--header-height) - var(--space-xl));
  overflow-y: auto;
}

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

.reset-filters-btn {
  background: none;
  border: none;
  color: var(--color-primary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition-base);
}

.reset-filters-btn:hover {
  color: var(--color-white);
}

.filter-group {
  margin-bottom: var(--space-lg);
}

.filter-title-btn {
  width: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: none;
  border: none;
  color: var(--color-white);
  font-family: inherit;
  font-weight: 600;
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  padding: var(--space-sm) 0;
  cursor: pointer;
  text-align: left;
}

.filter-title-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
  transition: transform 0.3s;
}

.filter-title-btn.collapsed svg {
  transform: rotate(-90deg);
}

.filter-content {
  margin-top: var(--space-sm);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  max-height: 400px;
  overflow: hidden;
  transition: max-height 0.3s ease;
}

.filter-title-btn.collapsed + .filter-content {
  max-height: 0;
}


.filter-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
  font-size: 0.9rem;
  color: var(--color-text);
  user-select: none;
}

.filter-option input[type="checkbox"],
.filter-option input[type="radio"] {
  accent-color: var(--color-primary);
  width: 16px;
  height: 16px;
  cursor: pointer;
}


.slider-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.slider-values {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.range-slider {
  width: 100%;
  accent-color: var(--color-primary);
  height: 6px;
  background: var(--color-surface-2);
  border-radius: var(--radius-full);
  outline: none;
  cursor: pointer;
  border: none;
}


.star-rating-selector {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.star-option {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  cursor: pointer;
}

.star-option input {
  accent-color: var(--color-primary);
}


.catalog-content {
  flex-grow: 1;
}

.catalog-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-lg);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  padding: var(--space-md) var(--space-lg);
  border-radius: var(--radius-lg);
}

.results-count {
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--color-text-muted);
}

.results-count span {
  color: var(--color-white);
  font-weight: 600;
}

.toolbar-actions {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.toggle-group {
  display: flex;
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  padding: 3px;
  border-radius: var(--radius-md);
}

.toggle-btn {
  background: none;
  border: none;
  color: var(--color-text-muted);
  padding: var(--space-sm) var(--space-md);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: var(--radius-sm);
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: var(--space-xs);
  transition: var(--transition-base);
}

.toggle-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor;
}

.toggle-btn.active {
  background: var(--color-primary);
  color: var(--color-white);
}

.sort-select {
  background: var(--color-surface-2);
  border: 1px solid var(--color-border);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-lg);
  border-radius: var(--radius-md);
  font-family: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  outline: none;
  cursor: pointer;
}

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


.catalog-cards-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-lg);
}

.catalog-map-container {
  display: none;
  height: 600px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-card);
}

.catalog-map-container.active {
  display: block;
}

.catalog-cards-grid.hidden {
  display: none;
}




.mobile-filters-trigger {
  display: none;
  width: 100%;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  color: var(--color-white);
  padding: 12px;
  border-radius: var(--radius-md);
  font-weight: 600;
  cursor: pointer;
  margin-bottom: var(--space-md);
}

.mobile-filters-trigger svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

@media (max-width: 1024px) {
  .catalog-layout {
    flex-direction: column;
  }
  .catalog-sidebar {
    display: none; 
  }
  .catalog-sidebar.mobile-open {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    max-height: 100vh;
    z-index: 1002;
    border-radius: 0;
    border: none;
  }
  .mobile-filters-trigger {
    display: flex;
  }
  .catalog-sidebar-close {
    display: flex;
    justify-content: flex-end;
    margin-bottom: var(--space-md);
  }
}

@media (max-width: 768px) {
  .catalog-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-md);
  }
  .toolbar-actions {
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
  }
  .toggle-group, .sort-select {
    width: 100%;
    justify-content: center;
  }
  .catalog-cards-grid {
    grid-template-columns: 1fr;
  }
}
