*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: 'Inter', sans-serif;
  color: #1b1b1b;
  background: #ffffff;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

a {
  text-decoration: none;
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
}

.products-hero {
  width: 100%;
  height: 320px;
  overflow: hidden;
  background: #f4f1ec;
}

.products-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.products-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 48px;
  padding: 48px 60px 80px;
  align-items: start;
}

.products-filters {
  position: sticky;
  top: 108px;
}

.filter-block {
  border-bottom: 1px solid #ececec;
  padding: 8px 0 16px;
}

.filter-block__toggle,
.filter-accordion__toggle {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border: none;
  background: none;
  cursor: pointer;
  font-family: inherit;
  font-size: 16px;
  font-weight: 600;
  color: #1b1b1b;
  text-align: left;
}

.filter-accordion__toggle {
  font-size: 14px;
  font-weight: 500;
  color: #4a4a4a;
  padding: 8px 0;
}

.filter-block__toggle svg,
.filter-accordion__toggle svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  transition: transform 0.2s ease;
}

.filter-block.is-open > .filter-block__toggle svg,
.filter-accordion.is-open > .filter-accordion__toggle svg {
  transform: rotate(180deg);
}

.filter-block__body,
.filter-accordion__items {
  display: none;
}

.filter-block.is-open > .filter-block__body,
.filter-accordion.is-open > .filter-accordion__items {
  display: block;
}

.filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 14px;
  color: #4a4a4a;
  cursor: pointer;
}

.filter-check input {
  appearance: none;
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  background: #ffffff;
  display: grid;
  place-content: center;
  flex-shrink: 0;
  cursor: pointer;
}

.filter-check input::after {
  content: '';
  width: 9px;
  height: 6px;
  border-left: 2px solid #ffffff;
  border-bottom: 2px solid #ffffff;
  transform: rotate(-45deg) translateY(-1px);
  opacity: 0;
}

.filter-check input:checked {
  background: #2f9e44;
  border-color: #2f9e44;
}

.filter-check input:checked::after {
  opacity: 1;
}

.filter-check--nested {
  padding-left: 22px;
}

.filter-swatch {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(27, 27, 27, 0.12);
  flex-shrink: 0;
}

.filter-swatch.is-light {
  border-color: #d4d4d4;
}

.filter-clear {
  display: inline-block;
  margin: 4px 0 12px;
  font-size: 13px;
  font-weight: 600;
  color: #8a8a8a;
  text-decoration: underline;
}

.products-filter-btn,
.products-filters__mobile-bar,
.products-filters__apply,
.products-filters-overlay {
  display: none;
}

body.is-filters-open {
  overflow: hidden;
}

.products-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.products-per-page {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  font-size: 13px;
  color: #8a8a8a;
}

.products-per-page select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  color: #1b1b1b;
}

.products-toolbar span {
  font-size: 14px;
  color: #8a8a8a;
}

.view-toggle {
  display: flex;
  gap: 6px;
}

.view-toggle button {
  width: 36px;
  height: 36px;
  border: 1px solid #e5e5e5;
  border-radius: 8px;
  background: #ffffff;
  color: #8a8a8a;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

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

.view-toggle button.is-active {
  background: #1b1b1b;
  border-color: #1b1b1b;
  color: #ffffff;
}

.products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 28px 18px;
}

.products-grid.is-list {
  grid-template-columns: 1fr;
  gap: 16px;
}

.catalog-card {
  position: relative;
  min-width: 0;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.catalog-card.is-hidden,
.catalog-card.is-page-hidden {
  display: none;
}

.catalog-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  color: inherit;
  text-decoration: none;
}

.catalog-card__body {
  display: flex;
  flex-direction: column;
  flex: 1;
}

.catalog-card__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: calc(1.35em * 2);
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
  margin-bottom: 4px;
}

.catalog-card__image {
  display: block;
  position: relative;
  aspect-ratio: 1;
  background: #f6f5f3;
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 14px;
}

.catalog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 18px;
  transition: transform 0.4s ease;
}

.catalog-card__link:hover .catalog-card__image img {
  transform: scale(1.04);
}

.catalog-card__meta {
  display: none;
  font-size: 13px;
  color: #8a8a8a;
  margin-bottom: 8px;
}

.catalog-card__swatches {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.catalog-card__swatches i {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  display: inline-block;
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.swatch-beige {
  background: #d8cdbe;
}

.swatch-gray {
  background: #8a8a8a;
}

.catalog-card__heart {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #1b1b1b;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.catalog-card__heart svg {
  width: 16px;
  height: 16px;
}

.catalog-card__heart.is-active {
  color: #c45c4a;
}

.catalog-card__heart.is-active svg path {
  fill: currentColor;
}

.catalog-card__add {
  margin-top: 12px;
  width: 100%;
  height: 40px;
  border: 1px solid #1b1b1b;
  border-radius: 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}

.products-filter-btn,
.products-filters__mobile-bar,
.products-filters__apply {
  display: none;
}

.products-filters-overlay[hidden] {
  display: none;
}

.products-grid.is-list .catalog-card__add {
  max-width: 180px;
}

.products-grid.is-list .catalog-card__link {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  align-items: center;
}

.products-grid.is-list .catalog-card__image {
  aspect-ratio: 1;
  margin-bottom: 0;
}

.products-grid.is-list .catalog-card__title {
  min-height: 0;
}

.products-grid.is-list .catalog-card__meta {
  display: block;
}

.products-grid.is-list .catalog-card__heart {
  right: auto;
  left: 138px;
}

.products-empty {
  padding: 48px 0;
  text-align: center;
  color: #8a8a8a;
}

.products-pagination {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 48px;
}

.products-pagination.is-hidden {
  display: none;
}

.products-pagination__btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid #e5e5e5;
  border-radius: 10px;
  background: #ffffff;
  font-family: inherit;
  font-size: 14px;
  cursor: pointer;
}

.products-pagination__btn:disabled {
  opacity: 0.45;
  cursor: default;
}

.products-pagination__btn svg {
  width: 16px;
  height: 16px;
}

.products-pagination__pages {
  display: flex;
  align-items: center;
  gap: 8px;
}

.products-pagination__pages button,
.products-pagination__pages a {
  min-width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: none;
  font-family: inherit;
  font-size: 14px;
  color: #1b1b1b;
  cursor: pointer;
}

.products-pagination__pages button.is-active,
.products-pagination__pages a.is-active {
  background: #ececec;
  border-radius: 999px;
  font-weight: 600;
}

.products-pagination__pages button.is-hidden {
  display: none;
}

.products-pagination__ellipsis {
  min-width: 24px;
  color: #8a8a8a;
  text-align: center;
}

.products-pagination__status {
  display: none;
  font-size: 14px;
  color: #8a8a8a;
}

@media (max-width: 1024px) {
  .products-layout {
    grid-template-columns: 1fr;
    padding: 28px 24px 64px;
    gap: 20px;
  }

  .products-hero {
    height: 180px;
  }

  .products-toolbar {
    flex-wrap: wrap;
    gap: 12px;
  }

  .products-filter-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    height: 40px;
    padding: 0 14px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    color: #1b1b1b;
    cursor: pointer;
  }

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

  .products-filter-btn__count {
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #1b1b1b;
    color: #ffffff;
    font-size: 11px;
    line-height: 18px;
    text-align: center;
  }

  .products-filter-btn__count[hidden] {
    display: none;
  }

  .products-filters {
    position: fixed;
    top: 0;
    left: 0;
    width: min(360px, 88vw);
    height: 100%;
    z-index: 300;
    background: #ffffff;
    padding: 16px 20px 96px;
    overflow-y: auto;
    transform: translateX(-105%);
    transition: transform 0.28s ease;
  }

  .products-filters.is-open-mobile {
    transform: translateX(0);
    box-shadow: 16px 0 40px rgba(0, 0, 0, 0.12);
  }

  .products-filters__mobile-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    position: sticky;
    top: -16px;
    z-index: 2;
    margin: -16px -20px 12px;
    padding: 16px 20px;
    background: #ffffff;
    border-bottom: 1px solid #ececec;
  }

  .products-filters__close {
    width: 36px;
    height: 36px;
    border: 1px solid #e5e5e5;
    border-radius: 10px;
    background: #ffffff;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
  }

  .products-filters__close svg {
    width: 16px;
    height: 16px;
  }

  .products-filters__apply {
    display: block;
    position: sticky;
    bottom: 16px;
    width: 100%;
    height: 48px;
    margin-top: 20px;
    border: none;
    border-radius: 12px;
    background: #1b1b1b;
    color: #ffffff;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
  }

  .products-filters-overlay {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 290;
    background: rgba(27, 27, 27, 0.28);
  }

  .products-filters-overlay[hidden] {
    display: none;
  }
}

@media (max-width: 768px) {
  .products-layout {
    padding: 28px 20px 56px;
  }

  .products-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 20px 12px;
  }

  .products-grid.is-list {
    grid-template-columns: 1fr;
  }

  .products-grid.is-list .catalog-card__link {
    grid-template-columns: 120px minmax(0, 1fr);
  }

  .products-grid.is-list .catalog-card__heart {
    left: 86px;
  }

  .products-pagination {
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  .products-pagination__pages {
    display: none;
  }

  .products-pagination__status {
    display: inline-flex;
  }

  .catalog-card__add {
    height: 36px;
    font-size: 12px;
  }

  .catalog-card__title {
    font-size: 14px;
  }
}

.filter-link {
  display: block;
  padding: 8px 0;
  color: #8a8a8a;
  font-size: 14px;
}

.filter-link.is-active {
  color: #1b1b1b;
  font-weight: 600;
}

.products-pagination a,
.products-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.products-pagination .is-disabled {
  opacity: 0.4;
  pointer-events: none;
}

.products-main .product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
}
