.catalog-section {
  width: min(var(--container), calc(100% - 48px));
  margin: 0 auto;
  padding-bottom: 96px;
  color: var(--text-main);
}

.catalog-section__header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  margin-bottom: 32px;
}

.catalog-section__heading {
  display: flex;
  min-width: 0;
  align-items: baseline;
  gap: 30px;
}

.catalog-section__title {
  margin: 0;
  color: var(--green-main);
  font: 700 clamp(42px, 4vw, 62px)/.98 Georgia, "Times New Roman", serif;
  letter-spacing: -.055em;
}

.catalog-section__count {
  margin: 0;
  color: #526c80;
  font-size: 19px;
  white-space: nowrap;
}

.catalog-section__count strong { color: var(--green-main); font-weight: 600; }

.catalog-section__toolbar,
.catalog-sort-select,
.catalog-view-toggle {
  display: flex;
  align-items: center;
}

.catalog-section__toolbar { gap: 14px; }

.catalog-sort-select {
  position: relative;
  min-width: 224px;
}

.catalog-sort-select select {
  width: 100%;
  height: 48px;
  appearance: none;
  padding: 0 42px 0 16px;
  color: var(--green-main);
  font: inherit;
  font-weight: 600;
  border: 1px solid #e3e9e7;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.catalog-sort-select .icon {
  position: absolute;
  right: 14px;
  width: 18px;
  height: 18px;
  pointer-events: none;
}

.catalog-view-toggle {
  gap: 8px;
}

.catalog-view-toggle button {
  display: grid;
  width: 48px;
  height: 48px;
  padding: 0;
  place-items: center;
  color: var(--green-main);
  border: 1px solid #e3e9e7;
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
}

.catalog-view-toggle button.is-active {
  color: var(--pink-main);
  border-color: var(--pink-main);
  background: var(--pink-soft);
}

.catalog-view-toggle .icon { width: 22px; height: 22px; }

.catalog-selected-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 20px;
}

.catalog-selected-filter {
  display: inline-flex;
  min-height: 34px;
  align-items: center;
  gap: 8px;
  padding: 5px 10px 5px 13px;
  color: var(--green-main);
  font-size: 13px;
  line-height: 1.2;
  border: 1px solid #ffd5dc;
  border-radius: 999px;
  background: var(--pink-soft);
  cursor: pointer;
}

.catalog-selected-filter:hover {
  border-color: var(--pink-main);
}

.catalog-selected-filter b {
  display: grid;
  width: 18px;
  height: 18px;
  place-items: center;
  color: var(--pink-main);
  font-size: 17px;
  font-weight: 400;
  line-height: 1;
}

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

.catalog-filters {
  position: sticky;
  top: 16px;
  min-width: 0;
  padding: 20px 18px 18px;
  border: 1px solid #eef1ef;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 24px rgba(18, 54, 48, .045);
}

.catalog-filters__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.catalog-filters__head h3 {
  margin: 0;
  color: var(--green-main);
  font-size: 18px;
}

.catalog-filters__head > span {
  display: grid;
  min-width: 24px;
  height: 24px;
  padding: 0 6px;
  place-items: center;
  color: #fff;
  font-size: 12px;
  border-radius: 999px;
  background: var(--pink-main);
}

.catalog-filter {
  border-top: 1px solid #edf0ef;
}

.catalog-filter__toggle {
  display: flex;
  width: 100%;
  min-height: 48px;
  align-items: center;
  justify-content: space-between;
  padding: 0;
  color: var(--green-main);
  font-size: 15px;
  font-weight: 600;
  text-align: left;
  cursor: pointer;
}

.catalog-filter__toggle .icon {
  width: 16px;
  height: 16px;
  transition: transform .18s ease;
}

.catalog-filter__toggle[aria-expanded="false"] .icon { transform: rotate(-90deg); }
.catalog-filter__content { padding: 0 0 14px; }

.catalog-filter__option,
.catalog-filter__availability {
  display: grid;
  min-height: 30px;
  grid-template-columns: 18px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  color: #526c80;
  font-size: 13px;
  cursor: pointer;
}

.catalog-filter__option input,
.catalog-filter__availability input {
  width: 17px;
  height: 17px;
  margin: 0;
  accent-color: var(--pink-main);
}

.catalog-filter__option small {
  color: #8e9da3;
  font-size: 12px;
}

.catalog-filter__swatch {
  display: block;
  width: 18px;
  height: 18px;
  margin-left: -3px;
  border: 1px solid rgba(29, 56, 52, .08);
  border-radius: 50%;
  background: #eee;
}

.catalog-filter__option:has(.catalog-filter__swatch) { grid-template-columns: 18px 18px minmax(0, 1fr) auto; }
.catalog-filter__swatch--red { background: #d7193f; }
.catalog-filter__swatch--white { background: #f7ecd5; }
.catalog-filter__swatch--pink { background: #ee91a6; }
.catalog-filter__swatch--cream { background: #eed9aa; }
.catalog-filter__swatch--yellow { background: #edc94d; }
.catalog-filter__swatch--mix { background: conic-gradient(#df3152 0 25%, #f5d88e 0 50%, #ed91a6 0 75%, #9bca98 0); }
.catalog-filter__swatch--spray { background: radial-gradient(circle at 35% 35%, #ef9aae 0 22%, transparent 24%), #f5d5dc; }
.catalog-filter__swatch--peony { background: radial-gradient(circle at 55% 45%, #ee9aae 0 36%, #f8d8df 38% 100%); }

.catalog-price-range {
  position: relative;
  height: 22px;
  margin: 2px 2px 12px;
}

.catalog-price-range input {
  position: absolute;
  top: 5px;
  width: 100%;
  height: 14px;
  margin: 0;
  appearance: none;
  pointer-events: none;
  background: transparent;
}

.catalog-price-range::before {
  position: absolute;
  top: 11px;
  right: 5px;
  left: 5px;
  height: 3px;
  border-radius: 999px;
  background: #ffd9df;
  content: '';
}

.catalog-price-range input::-webkit-slider-thumb {
  width: 17px;
  height: 17px;
  appearance: none;
  border: 0;
  border-radius: 50%;
  background: var(--pink-main);
  pointer-events: auto;
  cursor: pointer;
}

.catalog-price-range input::-moz-range-thumb {
  width: 17px;
  height: 17px;
  border: 0;
  border-radius: 50%;
  background: var(--pink-main);
  pointer-events: auto;
  cursor: pointer;
}

.catalog-price-inputs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.catalog-price-inputs input {
  width: 100%;
  height: 36px;
  padding: 0 9px;
  color: #526c80;
  border: 1px solid #e1e8e6;
  border-radius: 9px;
  background: #fff;
}

.catalog-filter__availability {
  display: flex;
  padding-top: 15px;
  border-top: 1px solid #edf0ef;
}

.catalog-filters__submit,
.catalog-filters__reset {
  display: block;
  width: 100%;
  min-height: 44px;
  margin-top: 16px;
  padding: 0 14px;
  border-radius: 999px;
  cursor: pointer;
}

.catalog-filters__submit {
  color: #fff;
  background: var(--pink-main);
}

.catalog-filters__reset {
  margin-top: 8px;
  color: var(--pink-main);
  background: transparent;
}

.catalog-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.catalog-product {
  display: flex;
  width: 100%;
  min-width: 0;
  flex-direction: column;
}

.catalog-product__image-link {
  display: block;
  height: 100%;
}

.catalog-product__image-link img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.catalog-product__badges {
  position: absolute;
  z-index: 2;
  top: 11px;
  left: 11px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.catalog-product__badges .popular-product__tag {
  position: static;
  padding: 6px 9px;
  color: var(--pink-main);
  background: rgba(255, 255, 255, .94);
}

.catalog-product__status {
  top: auto;
  right: auto;
  bottom: 10px;
  left: 12px;
  transform: none;
  margin: 0;
  padding: 5px 9px;
  color: #28755c;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 3px 10px rgba(27, 74, 57, .08);
}

.catalog-product__badges .catalog-product__badge--available,
.catalog-product__badges .catalog-product__badge--new { color: #fff; background: #36ad6e; }
.catalog-product__badges .catalog-product__badge--premium { color: #3f3011; background: #f3c866; }
.catalog-product__badges .catalog-product__badge--discount { color: #fff; background: var(--pink-main); }
.catalog-product__badges .catalog-product__badge--popular { color: #fff; background: #d39a32; }

.catalog-product .popular-product__favorite {
  z-index: 3;
  color: var(--green-main);
}

.catalog-product .popular-product__favorite.is-active {
  color: var(--pink-main);
  background: #ffe6eb;
}

.catalog-product__body {
  height: auto;
  min-height: 144px;
  padding: 14px 15px 14px;
}

.catalog-product__title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 1.3em;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.catalog-product__meta {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
  color: #526c80;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
}

.catalog-product__meta span {
  display: inline-flex;
  min-width: 0;
  align-items: center;
  gap: 4px;
}

.catalog-product__meta .icon { width: 16px; height: 16px; }

.catalog-product__footer {
  padding-top: 14px;
}

.catalog-product__price {
  display: flex;
  flex-direction: row;
  min-width: 0;
  align-items: baseline;
  gap: 8px;
}

.catalog-product__price-row {
  order: 1;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.catalog-product__price .popular-product__current-price {
  color: var(--green-main);
  font-weight: 600;
}

.catalog-product__price .popular-product__current-price.is-discount { color: var(--pink-main); }

.catalog-product__price del {
  order: 2;
  width: auto;
  color: #87959b;
  font-size: 12px;
  white-space: nowrap;
}

.catalog-product__cart {
  color: var(--pink-main);
  background: var(--pink-soft);
  transition: transform .18s ease, background .18s ease;
}

.catalog-product__cart:hover,
.catalog-product__cart.is-added { background: #ffe0e5; transform: none; }

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

.catalog-grid--list .catalog-product {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
}

.catalog-grid--list .catalog-product__body { min-height: 220px; }

.catalog-empty {
  grid-column: 1 / -1;
  padding: 48px 24px;
  color: var(--green-main);
  text-align: center;
  border: 1px solid #eef1ef;
  border-radius: 20px;
  background: #fff;
}

.catalog-empty h3 { margin: 0 0 18px; font-size: 22px; font-weight: 500; }
.catalog-empty button { color: var(--pink-main); cursor: pointer; }

.catalog-drawer,
.catalog-sort-sheet,
.catalog-overlay,
.catalog-mobile-bar { display: none; }

.catalog-drawer[hidden],
.catalog-sort-sheet[hidden],
.catalog-overlay[hidden] { display: none !important; }

@media (max-width: 767px) {
  body.catalog-drawer-open { overflow: hidden; }
}

@media (max-width: 1430px) {
  .catalog-section__heading { gap: 20px; }
  .catalog-grid { gap: 12px; }
  .catalog-product__meta { gap: 6px; font-size: 11px; }
}

@media (max-width: 1179px) {
  .catalog-section { width: calc(100% - 32px); }
  .catalog-filters { display: none; }
  .catalog-layout { display: block; }
  .catalog-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .catalog-view-toggle { display: none; }
}

@media (max-width: 899px) {
  .catalog-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catalog-product__meta { gap: 5px; font-size: 11px; }
  .catalog-product__meta .icon { width: 14px; height: 14px; }
}

@media (max-width: 767px) {
  .catalog-section {
    width: 100%;
    padding: 24px 16px 104px;
  }

  .catalog-section__header {
    display: block;
    margin-bottom: 20px;
  }

  .catalog-section__heading {
    display: block;
  }

  .catalog-section__title {
    font-size: clamp(32px, 9vw, 38px);
    line-height: 1;
  }

  .catalog-section__count {
    margin-top: 8px;
    font-size: 15px;
  }

  .catalog-section__toolbar {
    margin-top: 16px;
  }

  .catalog-selected-filters { margin-bottom: 16px; }

  .catalog-sort-select { width: 100%; }
  .catalog-sort-select select { height: 44px; font-size: 14px; }
  .catalog-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
  }

  .catalog-product {
    width: 100%;
    flex: 0 0 auto;
    border-radius: 16px;
  }

  .catalog-product__badges { top: 4px; left: 4px; gap: 4px; }
  .catalog-product__badges .popular-product__tag { padding: 5px 10px; font-size: 11px; }
  .catalog-product__status { bottom: 7px; left: 7px; padding: 4px 7px; font-size: 10px; }
  .catalog-product .popular-product__favorite { top: 7px; right: 7px; width: 30px; height: 30px; }
  .catalog-product .popular-product__favorite .icon { width: 16px; height: 16px; }
  .catalog-product__body { min-height: 149px; padding: 10px 10px 10px; }
  .catalog-product__title { font-size: 16px; }
  .catalog-product__meta { flex-wrap: wrap; gap: 5px 7px; margin-top: 9px; font-size: 10px; }
  .catalog-product__footer { align-items: center; padding-top: 10px; }
  .catalog-product .popular-product__footer {
    width: 100%;
    height: 38px;
    min-height: 38px;
    margin-top: auto;
    padding: 0 10px;
    border-radius: 10px;
    background: var(--green-main);
    box-shadow: none;
  }

  .catalog-product__price {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    align-items: center;
    justify-content: center;
    gap: 6px;
  }

  .catalog-product__price-row {
    width: auto;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
  }

  .catalog-product .catalog-product__price .popular-product__current-price {
    color: #fff;
    font-size: 16px;
  }

  .catalog-product .popular-product__price del {
    position: static;
    width: auto;
    color: rgba(255, 255, 255, .58);
    font-size: 9px;
    line-height: 1.1;
    transform: none;
  }

  .catalog-product .popular-product__cart { display: none; }

  .catalog-grid--list {
    display: grid;
    overflow: visible;
    margin-right: 0;
    padding-right: 0;
  }

  .catalog-grid--list .catalog-product {
    width: 100%;
    flex-basis: auto;
  }

  .catalog-grid--list .catalog-product { grid-template-columns: 112px minmax(0, 1fr); }
  .catalog-grid--list .catalog-product__body { min-height: 112px; }

  .catalog-overlay {
    position: fixed;
    z-index: 30;
    inset: 0;
    display: block;
    background: rgba(17, 37, 34, .3);
  }

  .catalog-drawer,
  .catalog-sort-sheet {
    position: fixed;
    z-index: 31;
    right: 0;
    bottom: 0;
    left: 0;
    display: block;
    max-height: min(84dvh, 720px);
    overflow: auto;
    padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
    border-radius: 24px 24px 0 0;
    background: #fff;
    box-shadow: 0 -16px 40px rgba(18, 54, 48, .16);
  }

  .catalog-drawer__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 8px;
  }

  .catalog-drawer__head h2 { margin: 0; color: var(--green-main); font-size: 24px; }
  .catalog-drawer__head button { display: grid; width: 38px; height: 38px; place-items: center; border-radius: 50%; background: #f7f8f7; cursor: pointer; }
  .catalog-drawer__head .icon { width: 20px; height: 20px; }
  .catalog-drawer__actions { padding-top: 6px; }
  .catalog-drawer .catalog-filter__toggle { min-height: 54px; font-size: 17px; }
  .catalog-drawer .catalog-filter__content { padding-bottom: 18px; }
  .catalog-sort-sheet { padding-bottom: calc(26px + env(safe-area-inset-bottom)); }
  .catalog-sort-sheet__options { display: grid; gap: 3px; }
  .catalog-sort-sheet__options label { display: flex; min-height: 52px; align-items: center; gap: 12px; color: var(--green-main); font-size: 16px; border-bottom: 1px solid #edf0ef; }
  .catalog-sort-sheet__options input { accent-color: var(--pink-main); }

  .catalog-mobile-bar {
    position: fixed;
    z-index: 20;
    right: 12px;
    bottom: calc(10px + env(safe-area-inset-bottom));
    left: 12px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    padding: 8px;
    border: 1px solid #edf0ef;
    border-radius: 18px;
    background: rgba(255, 255, 255, .95);
    box-shadow: 0 8px 30px rgba(18, 54, 48, .14);
    backdrop-filter: blur(14px);
  }

  .catalog-mobile-bar button {
    display: flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    color: var(--green-main);
    font-size: 15px;
    font-weight: 600;
    border-radius: 12px;
    background: #f8faf9;
    cursor: pointer;
  }

  .catalog-mobile-bar button:first-child { background: var(--pink-soft); }
  .catalog-mobile-bar .icon { width: 20px; height: 20px; }
  .catalog-mobile-bar b { display: grid; min-width: 22px; height: 22px; place-items: center; color: #fff; font-size: 12px; border-radius: 50%; background: var(--pink-main); }
}

@media (max-width: 340px) {
  .catalog-section { padding-inline: 12px; }
  .catalog-grid { gap: 7px; }
  .catalog-product__body { padding-inline: 8px; }
  .catalog-product__title { font-size: 14px; }
  .catalog-product__meta { font-size: 9px; }
  .catalog-product .popular-product__current-price { font-size: 16px; }
  .catalog-product .popular-product__cart { width: 32px; height: 32px; flex-basis: 32px; }
}

@media (prefers-reduced-motion: reduce) {
  .catalog-product,
  .catalog-product__cart,
  .catalog-filter__toggle .icon { transition: none; }
}
