.nd-home-products {
  color: rgb(var(--color-text));
  background: rgb(var(--color-background));
}

.nd-home-products__inner {
  padding-block: clamp(68px, 7vw, 112px);
}

.nd-home-products__header {
  display: flex;
  gap: 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: 28px;
  border-bottom: 1px solid rgb(var(--color-text) / 18%);
}

.nd-home-products__header p {
  margin: 0 0 10px;
  color: rgb(var(--color-light-text));
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
}

.nd-home-products__header h2 {
  margin: 0;
  font-family: var(--sort-title-font);
  font-size: clamp(38px, 5vw, 72px);
  font-weight: 500;
  line-height: 1;
  letter-spacing: -0.025em;
}

.nd-home-products__header > a,
.nd-home-products__mobile-link {
  color: inherit;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-decoration: none;
  text-transform: uppercase;
}

.nd-home-products__header > a,
.nd-home-products__mobile-link,
.nd-home-products__link-icon {
  align-items: center;
}

.nd-home-products__header > a,
.nd-home-products__mobile-link {
  display: inline-flex;
  gap: 8px;
  min-height: 44px;
}

.nd-home-products__link-icon {
  display: inline-flex;
}

.nd-home-products__link-icon svg {
  width: 18px;
  height: 18px;
}

.nd-home-products__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(36px, 4vw, 64px) clamp(14px, 2vw, 28px);
  padding: 34px 0 0;
  margin: 0;
  list-style: none;
}

.nd-home-product__media {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #f3f1ed;
}

.nd-home-product__media img,
.nd-home-product__media svg {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.nd-home-product__badge {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 12px;
  min-height: 28px;
  padding: 6px 10px;
  color: #fff;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: #111;
}

.nd-home-product__details {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  justify-content: space-between;
  padding-top: 14px;
}

.nd-home-product__title {
  max-width: 72%;
  color: inherit;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
}

.nd-home-product__price {
  flex: none;
  font-size: 13px;
  line-height: 1.4;
  text-align: right;
}

.nd-home-product__price s {
  display: block;
  color: rgb(var(--color-light-text));
}

.nd-home-products__empty {
  grid-column: 1 / -1;
  min-height: 180px;
  padding: 60px;
  color: rgb(var(--color-light-text));
  text-align: center;
  border: 1px dashed rgb(var(--color-text) / 25%);
}

.nd-home-products__mobile-footer {
  display: none;
}

@media (max-width: 959px) {
  .nd-home-products__inner {
    padding-block: 64px;
  }

  .nd-home-products__header {
    align-items: flex-start;
  }

  .nd-home-products__header > a {
    display: none;
  }

  .nd-home-products__grid {
    display: flex;
    gap: 14px;
    width: 100%;
    margin-inline: 0;
    padding-inline: 0;
    padding-top: 24px;
    overflow-x: auto;
    overscroll-behavior-inline: contain;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .nd-home-products__grid::-webkit-scrollbar {
    display: none;
  }

  .nd-home-product {
    flex: 0 0 min(78vw, 350px);
    min-width: 0;
  }

  .nd-home-product__details {
    display: block;
    padding-top: 10px;
  }

  .nd-home-product__title {
    display: block;
    max-width: none;
    min-height: 40px;
    font-size: 13px;
  }

  .nd-home-product__price {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 5px;
    text-align: left;
  }

  .nd-home-product__price s {
    display: inline;
  }

  .nd-home-products__mobile-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-top: 36px;
  }

  .nd-home-products__controls {
    display: grid;
    grid-template-columns: 44px auto 44px;
    gap: 8px;
    align-items: center;
  }

  .nd-home-products__controls button {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    color: inherit;
    background: transparent;
    border: 1px solid rgb(var(--color-text));
  }

  .nd-home-products__controls button:disabled {
    color: rgb(var(--color-light-text));
    border-color: rgb(var(--color-text) / 24%);
  }

  .nd-home-products__controls svg {
    width: 20px;
    height: 20px;
  }

  .nd-home-products__position {
    display: flex;
    gap: 6px;
    align-items: baseline;
    justify-content: center;
    min-width: 56px;
    font-size: 12px;
    letter-spacing: 0.08em;
  }

  .nd-home-products__position strong {
    font-size: 15px;
  }

  .nd-home-products__mobile-link {
    display: inline-flex;
    flex: 1;
    justify-content: center;
    min-height: 44px;
    padding: 0 14px;
    border-bottom: 1px solid rgb(var(--color-text));
  }
}

@media (min-width: 700px) and (max-width: 959px) {
  .nd-home-product {
    flex-basis: min(43vw, 360px);
  }
}
