.catalog-main {
  padding: 8px 0 72px;
}

.catalog-main > .container {
  position: relative;
}

.catalog-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  min-height: 30px;
  /* Smooth pagination scrolling stops below the sticky site header. */
  scroll-margin-top: 120px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  color: #9aa9bd;
  font-size: 16px;
}

.breadcrumbs span {
  margin-inline: 2px;
}

.breadcrumbs strong {
  color: var(--color-navy);
  font-weight: 400;
}

.catalog-promos {
  display: flex;
  align-items: center;
  gap: 19px;
  color: #98a7bb;
  white-space: nowrap;
}

.catalog-promos > button:not(.catalog-filter) {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0;
  color: inherit;
  background: transparent;
  font-size: 16px;
}

.catalog-promos > button:not(.catalog-filter) span {
  width: 17px;
  height: 17px;
  border: 1px solid #a9b7c7;
  border-radius: 50%;
}

.catalog-promos > button.is-active:not(.catalog-filter) span {
  border-color: transparent;
  background: url("../../assets/icons/filter_check_icon.svg") center / 16px 16px no-repeat;
}

.catalog-promos > button.is-active:not(.catalog-filter) span::after {
  content: none;
}

.catalog-filter {
  width: 32px;
  height: 32px;
  margin-left: 22px;
  padding: 3px;
  color: var(--color-navy);
  background: transparent;
}

.catalog-filter img {
  width: 24px;
  height: 24px;
}

.catalog-view-switch {
  display: flex;
  gap: 8px;
  margin-top: 8px;
}

.catalog-view-switch button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 8px;
  color: #dce6f0;
  border: 1px solid #dce6f0;
  border-radius: 3px;
  background: #fff;
}

.catalog-view-switch button.is-active {
  color: #5a7098;
  border-color: #5a7098;
}

.view-icon {
  position: relative;
  width: 22px;
  height: 22px;
  color: currentColor;
}

.view-icon--grid {
  border: 2px solid currentColor;
}

.view-icon--list {
  border: 2px solid currentColor;
}

.view-icon--list::after {
  position: absolute;
  top: 5px;
  right: 2px;
  left: 2px;
  height: 2px;
  content: "";
  background: currentColor;
  box-shadow: 0 6px currentColor;
}

.catalog-filter-panel {
  position: absolute;
  z-index: 15;
  top: 45px;
  right: 0;
  display: block;
  width: 300px;
  max-height: min(997px, calc(100vh - 170px));
  overflow-y: auto;
  background: #fff;
  box-shadow: 0 12px 36px rgba(0, 38, 79, .2);
  scrollbar-color: #9ba9c0 transparent;
  scrollbar-width: thin;
}

.catalog-filter-panel[hidden] {
  display: none;
}

.catalog-filter-panel__head {
  position: relative;
  display: grid;
  place-items: center;
  height: 70px;
  color: #fff;
  background: var(--color-navy-dark);
}

.catalog-filter-panel__head h2 {
  font-size: 20px;
  font-weight: 400;
  text-transform: uppercase;
}

.catalog-filter-panel__head button {
  position: absolute;
  top: 18px;
  left: 20px;
  padding: 0;
  color: #fff;
  background: transparent;
  font-size: 25px;
  font-weight: 200;
}

.filter-group__toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 50px;
  padding: 0 20px;
  color: var(--color-navy);
  background: var(--color-ice);
  text-align: left;
  text-transform: uppercase;
}

.filter-group__toggle span {
  width: 0;
  height: 0;
  border-top: 5px solid #c2ccda;
  border-right: 4px solid transparent;
  border-left: 4px solid transparent;
  transition: transform var(--transition);
}

.filter-group:not(.is-open) .filter-group__toggle span {
  transform: rotate(90deg);
}

.filter-group__options {
  display: grid;
  gap: 10px;
  padding: 8px 20px 10px;
}

.filter-group:not(.is-open) .filter-group__options {
  display: none;
}

.filter-group__options label {
  display: flex;
  align-items: center;
  gap: 8px;
  color: #98a4bc;
  cursor: pointer;
  font-size: 16px;
}

.filter-group__options input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.filter-group__options label > span {
  position: relative;
  flex: 0 0 17px;
  width: 17px;
  height: 17px;
  border: 1px solid #b5bfd0;
  border-radius: 50%;
}

.filter-group__options input:checked + span {
  border-color: transparent;
  background: url("../../assets/icons/filter_check_icon.svg") center / 16px 16px no-repeat;
}

.catalog-filter-panel__actions {
  position: sticky;
  bottom: 0;
  display: grid;
  grid-template-columns: 42px 1fr;
  gap: 10px;
  padding: 18px 30px 20px;
  border-top: 1px solid #e5eaf0;
  background: #fff;
}

.filter-reset {
  width: 42px;
  height: 42px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
}

.filter-reset img {
  width: 42px;
  height: 42px;
}

.filter-apply {
  min-height: 42px;
  padding-inline: 18px;
}

.catalog-products {
  margin-top: 20px;
}

.catalog-empty {
  display: grid;
  place-items: center;
  align-content: center;
  grid-column: 1 / -1;
  min-height: 520px;
  padding: 56px 24px;
  color: var(--color-text);
  border: 1px dashed #c5d1df;
  background: linear-gradient(180deg, #f8fbfd 0%, #edf4f8 100%);
  text-align: center;
}

.catalog-empty h2 {
  margin: 0 0 12px;
  color: var(--color-navy);
  font-size: 32px;
  font-weight: 400;
  line-height: 1.15;
  text-transform: uppercase;
}

.catalog-empty p {
  max-width: 520px;
  margin: 0;
  color: #7e8ca1;
  font-size: 18px;
  line-height: 1.4;
}

.catalog-empty .button {
  min-width: 240px;
  margin-top: 28px;
}

.catalog-products--grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 48px 39px;
}

.catalog-products--grid .product-card {
  width: 100%;
}

.catalog-products--grid .product-card__image {
  position: absolute;
  top: 20%;
  left: 0;
  width: 100%;
  height: 52%;
  background-position: center calc(50% - 10px);
  background-size: 100% auto;
}

.catalog-products--grid .product-card__quantity {
  display: none;
}

.catalog-products--list {
  display: grid;
  gap: 24px;
  margin-top: 24px;
}

.catalog-products--list .product-card {
  width: 100%;
  height: 234px;
  aspect-ratio: auto;
  overflow: visible;
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 38, 79, .1);
}

.catalog-products--list .product-card::after {
  position: absolute;
  right: 0;
  bottom: 90px;
  left: 220px;
  height: 1px;
  content: "";
  background: #dce5ee;
}

.catalog-products--list .product-card__head {
  position: absolute;
  top: 27px;
  left: 220px;
  min-height: 0;
  padding: 0;
  text-align: left;
}

.catalog-products--list .product-card__head h3 {
  font-size: 24px;
}

.catalog-products--list .product-card__head p {
  margin-top: 3px;
  font-size: 16px;
}

.catalog-products--list .product-card__discount,
.catalog-products--list [data-product-action="cart"] {
  display: none;
}

.catalog-products--list .product-card__actions {
  top: 27px;
  right: 20px;
  gap: 14px;
}

.catalog-products--list .product-card__actions button {
  width: 44px;
  height: 44px;
  padding: 9px;
  background: var(--color-ice);
}

.catalog-products--list .product-card__actions button.is-active {
  background: var(--color-ice);
}

.catalog-products--list .product-card__actions img {
  width: 26px;
  max-height: 26px;
}

.catalog-products--list .product-card__image {
  position: absolute;
  top: 30px;
  left: 36px;
  width: 142px;
  height: 174px;
  background-color: var(--color-ice);
  background-position: center;
  background-size: 100% auto;
}

.catalog-products--list .product-card__colors {
  position: absolute;
  top: 91px;
  left: 220px;
  justify-content: flex-start;
  width: auto;
  margin: 0;
}

.catalog-products--list .product-card__colors button {
  width: 28px;
  height: 28px;
}

.catalog-products--list .product-card__price {
  position: absolute;
  top: auto;
  bottom: 27px;
  left: 220px;
  width: auto;
  padding: 0;
  font-size: 32px;
  line-height: 1;
}

.catalog-products--list .product-card__quantity {
  position: absolute;
  bottom: 27px;
  left: 370px;
  display: grid;
  grid-template-columns: 22px 100px 22px;
  align-items: center;
  text-align: center;
}

.product-card__quantity button {
  color: #aebbd0;
  background: transparent;
  font-size: 19px;
}

.product-card__quantity output {
  display: grid;
  place-items: center;
  height: 44px;
  border-radius: var(--radius-pill);
  background: var(--color-ice);
  font-size: 18px;
}

.catalog-products--list .product-card__buy {
  right: auto;
  bottom: 27px;
  left: 588px;
  width: 212px;
  height: 48px;
  min-height: 48px;
  border-radius: var(--radius-pill);
}

.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  margin-top: 78px;
  color: #b4bfd0;
}

.pagination > button,
.pagination div {
  display: flex;
  align-items: center;
  gap: 7px;
}

.pagination button {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  padding: 0;
  color: inherit;
  border: 1px solid transparent;
  border-radius: 50%;
  background: transparent;
  font-size: 14px;
}

.pagination button.is-active {
  color: var(--color-navy);
  border-color: var(--color-navy);
}

.catalog-products--list + .pagination {
  margin-top: 78px;
}

@media (max-width: 900px) {
  .catalog-toolbar { align-items: flex-start; flex-direction: column; }
  .catalog-promos { flex-wrap: wrap; }
  .catalog-products--grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
  .catalog-products--list .product-card__buy { left: 520px; }
}

@media (max-width: 767px) {
  /* Keep the footer at the bottom when the catalog has too little content
     to fill the viewport. The fixed header and bottom navigation are body
     padding, so flex sizing accounts for both of them. */
  body.catalog-page {
    display: flex;
    flex-direction: column;
    min-height: 100dvh;
  }

  .catalog-page .search {
    min-width: 0;
  }

  .catalog-main {
    flex: 1 0 auto;
    padding: 9px 0 51px;
  }

  .catalog-page .site-footer {
    flex: 0 0 auto;
  }

  .catalog-empty {
    min-height: 360px;
    padding: 36px 18px;
  }

  .catalog-empty h2 {
    font-size: 22px;
  }

  .catalog-empty p {
    font-size: 14px;
  }

  .catalog-empty .button {
    min-width: 0;
    width: min(100%, 240px);
    margin-top: 22px;
    font-size: 13px;
  }

  .catalog-toolbar {
    gap: 8px;
    min-height: 0;
  }

  .breadcrumbs {
    width: 100%;
    flex-wrap: nowrap;
    overflow: hidden;
    font-size: 10px;
    white-space: nowrap;
  }

  .breadcrumbs a,
  .breadcrumbs strong {
    flex: 0 0 auto;
  }

  .catalog-promos {
    width: 100%;
    flex-wrap: nowrap;
    gap: 12px;
  }

  .catalog-promos > button:not(.catalog-filter) {
    gap: 5px;
    font-size: 11px;
  }

  .catalog-promos > button:not(.catalog-filter) span {
    width: 13px;
    height: 13px;
  }

  .catalog-promos > button.is-active:not(.catalog-filter) span {
    background-size: 13px 13px;
  }

  .catalog-filter {
    flex: 0 0 24px;
    width: 24px;
    height: 24px;
    margin-left: auto;
    padding: 1px;
  }

  .catalog-filter img {
    width: 21px;
    height: 21px;
  }

  .catalog-view-switch {
    gap: 8px;
    margin-top: 10px;
  }

  .catalog-view-switch button {
    width: 40px;
    height: 40px;
  }

  .catalog-filter-panel {
    position: fixed;
    z-index: 100;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    width: 100%;
    max-height: 100dvh;
    padding-bottom: 77px;
    box-shadow: none;
    overscroll-behavior: contain;
  }

  .catalog-filter-panel__head {
    position: sticky;
    z-index: 2;
    top: 0;
    height: 70px;
  }

  .catalog-filter-panel__head h2 {
    font-size: 19px;
  }

  .catalog-filter-panel__head button {
    top: 21px;
    left: 20px;
    color: #9cabc0;
    font-size: 22px;
  }

  .filter-group__toggle {
    height: 50px;
    padding-inline: 20px;
    font-size: 16px;
  }

  .filter-group__options {
    gap: 10px;
    padding: 7px 20px 10px;
  }

  .filter-group__options label {
    font-size: 16px;
  }

  .catalog-filter-panel__actions {
    position: fixed;
    z-index: 3;
    right: 0;
    bottom: 0;
    left: 0;
    grid-template-columns: 43px minmax(0, 275px);
    justify-content: center;
    gap: 10px;
    padding: 11px 18px 14px;
  }

  .catalog-products {
    margin-top: 18px;
  }

  .catalog-products--grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .catalog-products--grid .product-card {
    position: relative;
    height: 411px;
  }

  .catalog-products--grid .product-card__head {
    min-height: 72px;
    padding: 14px 40px 8px;
  }

  .catalog-products--grid .product-card__head h3 {
    display: -webkit-box;
    overflow: hidden;
    font-size: 18px;
    line-height: 1.15;
    overflow-wrap: anywhere;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
  }

  .catalog-products--grid .product-card__head p {
    font-size: 12px;
  }

  .catalog-products--grid .product-card__actions {
    top: 64px;
    right: 8px;
  }

  .catalog-products--grid .product-card__discount {
    top: 65px;
    left: 12px;
    padding: 6px 8px;
    font-size: 13px;
  }

  .catalog-products--grid .product-card__image {
    top: 83px;
    height: 221px;
    background-position: center;
    background-size: 100% auto;
  }

  .catalog-products--grid .product-card__colors {
    position: absolute;
    top: 296px;
    left: 0;
    width: 100%;
    margin: 0;
  }

  .catalog-products--grid .product-card__colors button {
    width: 25px;
    height: 25px;
  }

  .catalog-products--grid .product-card__price {
    position: absolute;
    top: 329px;
    left: 0;
    width: 100%;
    padding: 0;
    font-size: 18px;
  }

  .catalog-products--grid .product-card__buy {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    height: 40px;
    min-height: 40px;
    font-size: 12px;
  }

  .catalog-products--list {
    gap: 10px;
    margin: 23px calc(var(--page-padding) * -1) 0;
  }

  .catalog-products--list .product-card {
    height: 104px;
    min-height: 104px;
    box-shadow: 0 2px 8px rgba(0, 38, 79, .12);
  }

  .catalog-products--list .product-card::after {
    right: 52px;
    bottom: 35px;
    left: 72px;
  }

  .catalog-products--list .product-card__head {
    top: 8px;
    right: 56px;
    left: 72px;
    width: auto;
    min-width: 0;
  }

  .catalog-products--list .product-card__head h3 {
    overflow: hidden;
    font-size: 16px;
    line-height: 1.15;
  }

  .catalog-products--list .product-card__head h3 a {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .catalog-products--list .product-card__head p {
    margin-top: 0;
    font-size: 12px;
  }

  .catalog-products--list .product-card__discount,
  .catalog-products--list .product-card__buy {
    display: none;
  }

  .catalog-products--list .product-card__actions {
    top: 0;
    right: 0;
    display: block;
    width: 52px;
    height: 100%;
  }

  .catalog-products--list .product-card__actions button {
    position: absolute;
    right: 20px;
    display: block;
    width: 22px;
    height: 22px;
    padding: 3px;
    background: var(--color-ice);
  }

  .catalog-products--list .product-card__actions button[data-product-action="favorite"] { top: 8px; }
  .catalog-products--list .product-card__actions button[data-product-action="compare"] { top: 38px; }
  .catalog-products--list .product-card__actions button[data-product-action="cart"] {
    right: 20px;
    bottom: 8px;
    width: 24px;
    height: 24px;
    padding: 4px;
    background: var(--color-navy);
  }

  .catalog-products--list .product-card__actions img {
    width: 17px;
    max-height: 17px;
  }

  .catalog-products--list .product-card__actions button[data-product-action="cart"] img {
    filter: brightness(0) invert(1);
  }

  .catalog-products--list .product-card__image {
    top: 32px;
    left: 23px;
    width: 42px;
    height: 38px;
    background-color: transparent;
  }

  .catalog-products--list .product-card__colors {
    top: 45px;
    left: 72px;
    gap: 5px;
  }

  .catalog-products--list .product-card__colors button {
    width: 16px;
    height: 16px;
    border-width: 1px;
  }

  .catalog-products--list .product-card__price {
    bottom: 9px;
    left: 72px;
    font-size: 16px;
  }

  .catalog-products--list .product-card__quantity {
    bottom: 7px;
    left: 143px;
    grid-template-columns: 16px 43px 16px;
  }

  .catalog-products--list .product-card__quantity button {
    font-size: 14px;
  }

  .catalog-products--list .product-card__quantity output {
    height: 20px;
    font-size: 12px;
  }

  .pagination,
  .catalog-products--list + .pagination {
    gap: 7px;
    margin-top: 28px;
  }

  .pagination > button,
  .pagination div {
    gap: 7px;
  }

  .pagination button {
    width: 30px;
    height: 30px;
    font-size: 14px;
  }

  .catalog-page .site-footer {
    margin-top: 0;
  }
}
