/*
 * Santrade home new products
 * v1.9 — touch-safe mobile scroll with firm mobile card snapping
 * Scope: only .home-new-products block. Does not touch legacy .sales, .ms2_product, header menu or Swiper styles.
 */

.home-new-products {
  --hnp-bordo: #66281d;
  --hnp-text: #333333;
  --hnp-muted: #777777;
  --hnp-line: #e7e1df;
  --hnp-soft: #fafafa;
  --hnp-card: #ffffff;
  --hnp-shadow: 0 14px 34px rgba(54, 43, 40, 0.08);
  --hnp-shadow-hover: 0 18px 42px rgba(54, 43, 40, 0.14);
  --hnp-radius: 4px;
  --hnp-gap: 20px;
  --hnp-mobile-side: 20px;
  --hnp-mobile-card: min(76vw, 292px);
  --hnp-mobile-snap-side: max(20px, calc((100vw - var(--hnp-mobile-card)) / 2));

  background: var(--hnp-soft);
  color: var(--hnp-text);
  padding: 0 20px 76px;
}

.home-new-products__inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "head actions"
    "viewport viewport";
  column-gap: 28px;
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
}

.home-new-products__head {
  grid-area: head;
  padding: 60px 0 34px;
}

.home-new-products__title {
  position: relative;
  display: inline-flex;
  color: var(--hnp-bordo);
  font-size: 2rem;
  font-weight: 400;
  line-height: 1.15;
  text-transform: uppercase;
}

.home-new-products__title::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -12px;
  height: 1px;
  background: currentColor;
}

.home-new-products__lead {
  display: none;
}

.home-new-products__actions {
  grid-area: actions;
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  align-self: end;
  padding: 60px 0 34px;
}

.home-new-products__controls {
  display: flex;
  align-items: center;
  gap: 10px;
}

.home-new-products__nav-button,
.home-new-products__link {
  min-height: 46px;
  border: 1px solid var(--hnp-text);
  border-radius: var(--hnp-radius);
  background: transparent;
  color: var(--hnp-text);
  transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.home-new-products__nav-button {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 46px;
  padding: 0;
  cursor: pointer;
}

.home-new-products__nav-button::before {
  content: "";
  display: block;
  width: 11px;
  height: 11px;
  border-right: 1.6px solid currentColor;
  border-bottom: 1.6px solid currentColor;
}

.home-new-products__nav-button--prev::before {
  transform: rotate(135deg);
  margin-left: 4px;
}

.home-new-products__nav-button--next::before {
  transform: rotate(-45deg);
  margin-right: 4px;
}

.home-new-products__nav-icon,
.home-new-products__link-icon,
.home-new-products__more-icon {
  display: none;
}

.home-new-products__nav-button:active,
.home-new-products__link:active {
  transform: translateY(1px);
}

.home-new-products__nav-button:disabled {
  cursor: default;
  opacity: 0.35;
}

.home-new-products__link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 170px;
  padding: 0 22px;
  color: var(--hnp-text);
  font-size: 1rem;
  font-weight: 300;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
}

.home-new-products__viewport {
  grid-area: viewport;
  position: relative;
  margin: 0 -2px;
  overflow: hidden;
}

.home-new-products__track {
  display: flex;
  gap: var(--hnp-gap);
  overflow-x: auto;
  overflow-y: hidden;
  padding: 4px 2px 22px;
  scroll-snap-type: x mandatory;
  scroll-padding-inline: 2px;
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-inline: contain;
  touch-action: auto;
}

.home-new-products__track::-webkit-scrollbar {
  display: none;
}

.home-new-products__item {
  flex: 0 0 calc((100% - (var(--hnp-gap) * 3)) / 4);
  min-width: 0;
  scroll-snap-align: start;
}

.home-new-products__card {
  display: flex;
  height: 100%;
  min-height: 100%;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid rgba(102, 40, 29, 0.06);
  border-radius: var(--hnp-radius);
  background: var(--hnp-card);
  color: var(--hnp-text);
  text-decoration: none;
  box-shadow: var(--hnp-shadow);
  transform: translateY(0);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
  -webkit-tap-highlight-color: rgba(102, 40, 29, 0.08);
}

.home-new-products__image-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #ffffff;
}

.home-new-products__picture {
  display: block;
  width: 100%;
  height: 100%;
}

.home-new-products__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.home-new-products__body {
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  padding: 20px 22px 24px;
}

.home-new-products__section {
  display: block;
  margin-bottom: 10px;
  color: var(--hnp-bordo);
  font-size: 0.78rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.home-new-products__product-title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 2.5em;
  color: var(--hnp-text);
  font-size: 1.02rem;
  font-weight: 500;
  line-height: 1.25;
  text-transform: uppercase;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-new-products__text {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 10px;
  color: var(--hnp-muted);
  font-size: 0.95rem;
  font-weight: 300;
  line-height: 1.45;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.home-new-products__more {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  width: fit-content;
  margin-top: auto;
  padding-top: 18px;
  color: var(--hnp-bordo);
  font-size: 0.9rem;
  font-weight: 400;
}

.home-new-products__more::after {
  content: "";
  display: block;
  width: 8px;
  height: 8px;
  border-right: 1.4px solid currentColor;
  border-bottom: 1.4px solid currentColor;
  transform: rotate(-45deg);
  transition: transform 0.2s ease;
}

.home-new-products--is-static .home-new-products__nav-button {
  display: none;
}

.home-new-products__sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (hover: hover) and (pointer: fine) {
  .home-new-products__nav-button:not(:disabled):hover,
  .home-new-products__link:hover {
    background: var(--hnp-bordo);
    border-color: var(--hnp-bordo);
    color: #ffffff;
  }

  .home-new-products__nav-button:disabled:hover {
    background: transparent;
    border-color: var(--hnp-text);
    color: var(--hnp-text);
  }

  .home-new-products__card:hover {
    border-color: rgba(102, 40, 29, 0.2);
    box-shadow: var(--hnp-shadow-hover);
    transform: translateY(-3px);
  }

  .home-new-products__card:hover .home-new-products__image {
    transform: scale(1.01);
  }

  .home-new-products__card:hover .home-new-products__more::after {
    transform: translateX(3px) rotate(-45deg);
  }
}

@media (hover: none), (pointer: coarse) {
  .home-new-products__nav-button,
  .home-new-products__link,
  .home-new-products__card,
  .home-new-products__image,
  .home-new-products__more::after {
    transition: none;
  }

  .home-new-products__card:hover,
  .home-new-products__card:hover .home-new-products__image {
    transform: none;
  }

  .home-new-products__card:hover .home-new-products__more::after {
    transform: rotate(-45deg);
  }

  .home-new-products__card:hover {
    border-color: rgba(102, 40, 29, 0.06);
    box-shadow: var(--hnp-shadow);
  }

  .home-new-products__nav-button:hover,
  .home-new-products__link:hover {
    background: transparent;
    border-color: var(--hnp-text);
    color: var(--hnp-text);
  }
}

@media (max-width: 1180px) {
  .home-new-products__item {
    flex-basis: calc((100% - (var(--hnp-gap) * 2)) / 3);
  }
}

@media (max-width: 820px) {
  .home-new-products {
    padding-bottom: 56px;
  }

  .home-new-products__inner {
    grid-template-columns: 1fr;
    grid-template-areas:
      "head"
      "viewport"
      "actions";
    column-gap: 0;
  }

  .home-new-products__head {
    padding: 38px 0 24px;
  }

  .home-new-products__actions {
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 14px 0 0;
  }

  .home-new-products__link {
    order: 1;
    flex: 1 1 auto;
    min-width: 0;
    justify-content: center;
  }

  .home-new-products__controls {
    order: 2;
    flex: 0 0 auto;
  }

  .home-new-products__track {
    scroll-snap-type: x mandatory;
  }

  .home-new-products__item {
    flex-basis: calc((100% - var(--hnp-gap)) / 2.15);
  }
}

@media (max-width: 520px) {
  .home-new-products {
    padding-right: 0;
    padding-left: 0;
  }

  .home-new-products__head {
    padding-right: var(--hnp-mobile-side);
    padding-left: var(--hnp-mobile-side);
  }

  .home-new-products__title {
    font-size: 1.72rem;
  }

  .home-new-products__viewport {
    width: 100%;
    margin-right: 0;
    margin-left: 0;
  }

  .home-new-products__track {
    gap: 16px;
    padding: 4px var(--hnp-mobile-snap-side) 22px var(--hnp-mobile-side);
    scroll-padding-inline: var(--hnp-mobile-snap-side);
  }

  .home-new-products__item {
    flex-basis: var(--hnp-mobile-card);
    scroll-snap-align: center;
  }

  .home-new-products__body {
    padding: 18px 18px 22px;
  }

  .home-new-products__actions {
    padding: 14px var(--hnp-mobile-side) 0;
  }

  .home-new-products__link {
    padding: 0 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-new-products__nav-button,
  .home-new-products__link,
  .home-new-products__more::after,
  .home-new-products__card,
  .home-new-products__image {
    transition: none;
  }

  .home-new-products__card:hover,
  .home-new-products__card:hover .home-new-products__image {
    transform: none;
  }

  .home-new-products__card:hover .home-new-products__more::after {
    transform: rotate(-45deg);
  }
}
