.catalog-page {
  max-width: 1200px;
  margin: 0 auto;
  padding: 24px;
  color: var(--text-primary);
  overflow-x: hidden;
}

.catalog-header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  margin-bottom: 24px;
}

.catalog-saved-searches {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.catalog-saved-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full, 999px);
  background: var(--bg-primary);
  padding: 4px 8px;
}

.catalog-saved-chip button {
  border: 0;
  background: transparent;
  color: var(--text-primary);
  font-weight: var(--font-weight-semibold, 600);
  cursor: pointer;
}

.catalog-saved-chip-remove {
  color: var(--text-secondary);
  line-height: 1;
}

.catalog-root-link {
  width: fit-content;
  color: var(--text-primary);
  font-size: var(--font-size-4xl, 2rem);
  font-weight: 900;
  text-decoration: none;
}

.catalog-root-link-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.catalog-section {
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.catalog-products-section {
  display: grid;
  grid-template-columns: minmax(220px, 280px) minmax(0, 1fr);
  align-items: start;
  gap: 24px;
}

@media (max-width: 1024px) {
  .catalog-products-section {
    grid-template-columns: minmax(0, 1fr);
    gap: 16px;
  }
}

.catalog-left-panel {
  position: sticky;
  top: 16px;
}

.catalog-results-panel {
  display: grid;
  gap: 16px;
  min-width: 0;
}

.catalog-tools-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: space-between;
}

.catalog-mobile-toolbar {
  position: sticky;
  bottom: 12px;
  z-index: 5;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  padding: 12px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: color-mix(in srgb, var(--bg-primary) 92%, white);
  backdrop-filter: blur(8px);
}

.catalog-mobile-toolbar-btn,
.catalog-open-filters-btn {
  min-height: 42px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0 12px;
  font-weight: var(--font-weight-bold, 700);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.catalog-mobile-toolbar-btn:hover,
.catalog-open-filters-btn:hover {
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 8%, white);
  transform: translateY(-1px);
}

.catalog-open-filters-btn {
  width: fit-content;
}

.catalog-sort-reset-group {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.catalog-reset-btn {
  min-height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: transparent;
  color: var(--text-secondary);
  padding: 0 12px;
  font-weight: var(--font-weight-bold, 700);
  cursor: pointer;
  transition: border-color 0.2s ease, color 0.2s ease, background-color 0.2s ease;
}

.catalog-reset-btn:hover {
  border-color: var(--primary-color);
  color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 7%, white);
}

.catalog-save-search-btn {
  min-height: 40px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0 12px;
  font-weight: var(--font-weight-bold, 700);
  cursor: pointer;
  transition: transform 0.2s ease, border-color 0.2s ease, background-color 0.2s ease;
}

.catalog-reset-btn:focus-visible,
.catalog-save-search-btn:focus-visible,
.catalog-mobile-toolbar-btn:focus-visible,
.catalog-open-filters-btn:focus-visible,
.catalog-sort-option:focus-visible,
.catalog-icon-btn:focus-visible,
.catalog-apply-btn:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--primary-color) 28%, white);
  outline-offset: 2px;
}

.catalog-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.45);
  z-index: 25;
}

.catalog-filter-drawer {
  position: fixed;
  right: 0;
  top: 0;
  bottom: 0;
  width: min(420px, 100vw);
  background: var(--bg-primary);
  z-index: 26;
  display: grid;
  grid-template-rows: auto 1fr auto;
  border-left: 1px solid var(--border-color);
  box-shadow: -12px 0 28px rgba(15, 23, 42, 0.14);
  animation: catalog-drawer-in 0.2s ease-out;
}

.catalog-filter-drawer-head,
.catalog-sort-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-color);
}

.catalog-filter-drawer-head h2,
.catalog-sort-sheet-head h2 {
  margin: 0;
  color: var(--text-primary);
  font-size: var(--font-size-lg, 1rem);
}

.catalog-icon-btn {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--bg-primary);
  color: var(--text-primary);
  font-size: var(--font-size-xl, 1.125rem);
  line-height: 1;
  cursor: pointer;
}

.catalog-filter-drawer-body {
  overflow: auto;
  padding: 16px;
  padding-bottom: 84px;
}

.catalog-filter-drawer-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px;
  border-top: 1px solid var(--border-color);
  position: sticky;
  bottom: 0;
  background: var(--bg-primary);
}

.catalog-apply-btn {
  min-height: 42px;
  border: 0;
  border-radius: var(--radius-sm);
  background: var(--primary-color);
  color: #fff;
  font-weight: var(--font-weight-bold, 700);
  cursor: pointer;
}

.catalog-sort-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-primary);
  border-top-left-radius: 16px;
  border-top-right-radius: 16px;
  border: 1px solid var(--border-color);
  border-bottom: 0;
  z-index: 26;
  box-shadow: 0 -10px 24px rgba(15, 23, 42, 0.16);
  max-height: 80vh;
  overflow: auto;
  animation: catalog-sheet-in 0.2s ease-out;
}

.catalog-sort-sheet-options {
  display: grid;
  gap: 8px;
  padding: 16px;
}

.catalog-sort-option {
  min-height: 44px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm);
  background: var(--bg-primary);
  color: var(--text-primary);
  text-align: left;
  padding: 0 12px;
  font-weight: var(--font-weight-semibold, 600);
  cursor: pointer;
  transition: border-color 0.18s ease, background-color 0.18s ease, transform 0.18s ease;
}

.catalog-sort-option.active {
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 10%, white);
  font-weight: var(--font-weight-bold, 700);

  &::after {
    content: '✓';
    float: right;
    color: var(--primary-color);
  }
}

.catalog-sort-option:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.catalog-grid-sheet .catalog-sort-sheet-options {
  grid-template-columns: 1fr;
}

.catalog-save-search-btn:hover {
  transform: translateY(-1px);
  border-color: var(--primary-color);
  background: color-mix(in srgb, var(--primary-color) 8%, white);
}

.catalog-category-banner {
  padding: 16px;
  background: linear-gradient(120deg, color-mix(in srgb, var(--primary-color) 14%, white), #f8fbfb);
}

.catalog-category-banner h3,
.catalog-category-banner p {
  margin: 0;
}

.catalog-category-banner p {
  margin-top: 6px;
  color: var(--text-secondary);
}

.subcategory-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.subcategory-chip {
  min-height: 36px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-full, 999px);
  background: var(--bg-primary);
  color: var(--text-primary);
  padding: 0 10px;
  cursor: pointer;
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.subcategory-chip:hover {
  border-color: var(--primary-color);
  transform: translateY(-1px);
}

.catalog-navigation-placeholder {
  padding: 14px;
  display: grid;
  gap: 6px;
}

.catalog-navigation-placeholder strong,
.catalog-navigation-placeholder p {
  margin: 0;
}

.catalog-navigation-placeholder p {
  color: var(--text-secondary);
}

.catalog-section-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;

  h1 {
    margin: 0;
    color: var(--text-primary);
    font-size: var(--font-size-4xl, 2rem);
    font-weight: 900;
  }

  p {
    margin: 0;
    color: var(--text-secondary);
    font-size: var(--font-size-lg, 1rem);
  }
}

.catalog-loading {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 16px;
}

.catalog-skeleton-card {
  min-height: 340px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg, 13px);
  padding: 16px;
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.catalog-skeleton-image {
  aspect-ratio: 1 / 1;
}

.catalog-inline-loading,
.catalog-message {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  color: var(--text-secondary);
}

.catalog-message-error {
  ::ng-deep .app-empty-state__title {
    color: var(--error-color);
  }
}

.catalog-message-error__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--error-color) 14%, transparent);
  color: var(--error-color);
  font-weight: 800;
  font-size: var(--font-size-xl, 1.125rem);
}

@keyframes catalog-sheet-in {
  from {
    transform: translateY(10px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@keyframes catalog-drawer-in {
  from {
    transform: translateX(12px);
    opacity: 0;
  }
  to {
    transform: translateX(0);
    opacity: 1;
  }
}

@media (max-width: 640px) {
  .catalog-page {
    padding: 16px;
  }

  .catalog-header {
    gap: 12px;
    margin-bottom: 18px;
  }

  .catalog-products-section {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .catalog-left-panel {
    position: static;
  }

  .catalog-tools-row {
    align-items: stretch;
  }

  .catalog-sort-reset-group,
  .catalog-save-search-btn,
  .catalog-layout-switcher {
    width: 100%;
  }

  .catalog-sort-reset-group {
    display: grid;
    grid-template-columns: 1fr;
  }

  .catalog-reset-btn,
  .catalog-save-search-btn {
    min-height: 40px;
  }

  .catalog-open-filters-btn {
    width: 100%;
  }

  .catalog-root-link {
    font-size: var(--font-size-3xl, 1.5rem);
  }

  .catalog-mobile-toolbar {
    bottom: 8px;
    gap: 8px;
    padding: 8px;
  }

  .catalog-mobile-toolbar-btn {
    min-height: 40px;
  }

  .catalog-section-heading h1 {
    font-size: var(--font-size-3xl, 1.5rem);
  }

  .catalog-loading {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }
}
