/* 03 / Новинки — Figma */

body:has(.sp-products) .page,
body:has(.sp-products) .content {
  overflow: visible;
}

.sp-products {
  box-sizing: border-box;
  width: 100vw;
  max-width: 100vw;
  position: relative;
  left: 50%;
  right: 50%;
  margin-left: -50vw;
  margin-right: -50vw;
  padding: 80px 240px;
  background: #fff;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
}

.sp-products *,
.sp-products *::before,
.sp-products *::after {
  box-sizing: border-box;
}

.sp-products__inner {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 40px;
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
}

.sp-products__head {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
}

.sp-products__title {
  margin: 0;
  font-weight: 500;
  font-size: 48px;
  line-height: 52px;
  color: #000;
}

.sp-products__swiper {
  width: 100%;
  overflow: hidden;
  cursor: grab;
  touch-action: pan-y;
}

.sp-products__swiper:active {
  cursor: grabbing;
}

.sp-products__swiper .swiper-slide {
  height: auto;
  display: flex;
}

.sp-products__swiper .swiper-wrapper {
  align-items: stretch;
}

/* Product card */
.sp-product-card {
  display: flex;
  width: 100%;
  height: 100%;
}

/* Сброс глобальных .selectform button */
.sp-products form.selectform button.sp-product-card__cart,
.sp-products form.selectform button.sp-product-card__compare,
.sp-products form.selectform button.sp-product-card__qty-minus,
.sp-products form.selectform button.sp-product-card__qty-plus {
  color: inherit !important;
  background-image: none !important;
  border-radius: 10px !important;
  display: inline-flex !important;
  font-size: inherit !important;
  line-height: inherit !important;
  padding: 14px !important;
  margin: 0 !important;
  width: auto !important;
  height: 52px !important;
  box-shadow: none !important;
  text-transform: none !important;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif !important;
  border: 0 !important;
}

.sp-product-card__form {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 24px;
  width: 100%;
  height: 100%;
  min-height: 572px;
  padding: 16px 16px 20px;
  background: #fff;
  border: 2px solid #ebedf0;
  border-radius: 20px;
  overflow: hidden;
}

.sp-product-card__form > input[type="hidden"] {
  display: none !important;
}

.sp-product-card__media {
  position: relative;
  width: 100%;
  height: 280px;
  flex: none;
  align-self: stretch;
  border-radius: 12px;
  overflow: hidden;
}

.sp-product-card__photo {
  display: block;
  width: 100%;
  height: 100%;
  user-select: none;
  -webkit-user-drag: none;
}

.sp-product-card__photo img {
  display: block;
  width: 100% !important;
  height: 100% !important;
  max-width: none !important;
  max-height: none !important;
  object-fit: contain;
  object-position: center;
  pointer-events: none;
  -webkit-user-drag: none;
}

.sp-product-card__badges {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  pointer-events: none;
}

.sp-product-card__badge {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 6px 10px;
  border-radius: 8px;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #fff;
}

.sp-product-card__badge--new {
  background: #006ab5;
}

.sp-product-card__badge--only {
  background: #43b75d;
}

.sp-product-card__body {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 32px;
  width: 100%;
  flex: 1 1 auto;
  padding: 0 12px 8px;
  min-height: 0;
}

.sp-product-card__info {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 20px;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
}

.sp-product-card__copy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
}

.sp-product-card__name {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  min-height: 44px;
  font-weight: 400;
  font-size: 15px;
  line-height: 22px;
  color: #4d5461 !important;
  text-decoration: none !important;
}

.sp-product-card__price {
  font-weight: 500;
  font-size: 24px;
  line-height: 32px;
  color: #131927;
}

.sp-product-card__chips {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 6px;
  width: 100%;
  height: 32px;
  min-height: 0;
  overflow: hidden;
}

.sp-product-card__chip {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  padding: 6px 10px;
  background: #f5f6f8;
  border-radius: 4px;
  font-weight: 400;
  font-size: 14px;
  line-height: 20px;
  color: #4d5461;
  white-space: nowrap;
}

.sp-product-card__actions {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  width: 100%;
  margin-top: auto;
  flex: none;
  height: 52px;
  min-height: 52px;
}

.sp-product-card__qty {
  display: none;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
}

.sp-products form.selectform.is-in-basket .sp-product-card__qty {
  display: flex;
}

.sp-products form.selectform.is-in-basket button.sp-product-card__cart {
  display: none !important;
}

.sp-products form.selectform button.sp-product-card__qty-minus,
.sp-products form.selectform button.sp-product-card__qty-plus {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  flex: 0 0 52px !important;
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 52px !important;
  padding: 14px !important;
  margin: 0 !important;
  border: 0 !important;
  border-radius: 10px !important;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  box-shadow: none !important;
}

.sp-products form.selectform button.sp-product-card__qty-minus {
  background: #f5f6f8 !important;
  background-color: #f5f6f8 !important;
  color: #131927 !important;
}

.sp-products form.selectform button.sp-product-card__qty-minus:hover {
  background: #e8eaee !important;
  background-color: #e8eaee !important;
}

.sp-products form.selectform button.sp-product-card__qty-plus {
  background: #006ab5 !important;
  background-color: #006ab5 !important;
  color: #fff !important;
}

.sp-products form.selectform button.sp-product-card__qty-plus:hover {
  background: #005a9a !important;
  background-color: #005a9a !important;
}

.sp-products form.selectform button.sp-product-card__qty-minus svg,
.sp-products form.selectform button.sp-product-card__qty-plus svg {
  display: block;
  width: 24px;
  height: 24px;
}

.sp-product-card__qty-value {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  min-width: 0;
  height: 52px;
  margin: 0;
  padding: 14px 12px;
  border-radius: 10px;
  background: #f5f6f8;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif;
  font-weight: 500;
  font-size: 18px;
  line-height: 24px;
  color: #131927;
  text-align: center;
  font-variant-numeric: tabular-nums;
  user-select: none;
}

.sp-products form.selectform button.sp-product-card__cart {
  display: inline-flex !important;
  flex-direction: row;
  justify-content: center;
  align-items: center;
  gap: 12px;
  flex: 1 1 auto;
  width: auto !important;
  max-width: none;
  height: 52px !important;
  padding: 14px 24px !important;
  border: 0 !important;
  background: #e6f4ff !important;
  background-color: #e6f4ff !important;
  border-radius: 10px !important;
  font-family: Inter, "Helvetica Neue", Arial, sans-serif !important;
  font-weight: 500;
  font-size: 18px !important;
  line-height: 24px !important;
  color: #006ab5 !important;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.sp-products form.selectform button.sp-product-card__cart::before {
  content: "";
  flex: none;
  width: 24px;
  height: 24px;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg%20width%3D%2224%22%20height%3D%2224%22%20viewBox%3D%220%200%2024%2024%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M2%202H5.63636L8.07273%2014.1727C8.15586%2014.5913%208.38355%2014.9672%208.71595%2015.2348C9.04835%2015.5024%209.46427%2015.6445%209.89091%2015.6364H18.7273C19.1539%2015.6445%2019.5698%2015.5024%2019.9022%2015.2348C20.2346%2014.9672%2020.4623%2014.5913%2020.5455%2014.1727L22%206.54545H6.54545M20.1815%2020.1818C20.1815%2020.6839%2019.7744%2021.0909%2019.2724%2021.0909C18.7703%2021.0909%2018.3633%2020.6839%2018.3633%2020.1818C18.3633%2019.6798%2018.7703%2019.2727%2019.2724%2019.2727C19.7744%2019.2727%2020.1815%2019.6798%2020.1815%2020.1818ZM10.1815%2020.1818C10.1815%2020.6839%209.77445%2021.0909%209.27237%2021.0909C8.7703%2021.0909%208.36328%2020.6839%208.36328%2020.1818C8.36328%2019.6798%208.7703%2019.2727%209.27237%2019.2727C9.77445%2019.2727%2010.1815%2019.6798%2010.1815%2020.1818Z%22%20stroke%3D%22%23006AB5%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
}

.sp-products form.selectform button.sp-product-card__cart:hover {
  background: #d6ecff !important;
  background-color: #d6ecff !important;
  color: #006ab5 !important;
}

.sp-products form.selectform button.sp-product-card__compare {
  position: static !important;
  inset: auto !important;
  top: auto !important;
  left: auto !important;
  right: auto !important;
  bottom: auto !important;
  display: inline-flex !important;
  justify-content: center;
  align-items: center;
  flex: 0 0 52px !important;
  width: 52px !important;
  min-width: 52px !important;
  max-width: 52px !important;
  height: 52px !important;
  padding: 14px !important;
  border: 0 !important;
  background: #f5f6f8 !important;
  background-color: #f5f6f8 !important;
  border-radius: 10px !important;
  cursor: pointer;
  transition: background 0.15s ease;
  pointer-events: auto;
}

.sp-products form.selectform button.sp-product-card__compare:hover {
  background: #e8eaee !important;
  background-color: #e8eaee !important;
}

.sp-products form.selectform button.sp-product-card__compare:hover::before {
  background-image: url("data:image/svg+xml,%3Csvg width='19' height='14' viewBox='0 0 19 14' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1H17M1 7H10M1 13H9M15.5 8V10.5M15.5 10.5V13M15.5 10.5H18M15.5 10.5H13' stroke='%23131927' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

.sp-products form.selectform button.sp-product-card__compare._compare_added {
  background: #e6f4ff !important;
  background-color: #e6f4ff !important;
}

.sp-products form.selectform button.sp-product-card__compare img,
.sp-products form.selectform button.sp-product-card__compare svg {
  display: none !important;
}

.sp-products form.selectform button.sp-product-card__compare::before {
  content: "";
  width: 19px;
  height: 14px;
  background: center / contain no-repeat
    url("data:image/svg+xml,%3Csvg%20width%3D%2219%22%20height%3D%2214%22%20viewBox%3D%220%200%2019%2014%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1%201H17M1%207H10M1%2013H9M15.5%208V10.5M15.5%2010.5V13M15.5%2010.5H18M15.5%2010.5H13%22%20stroke%3D%22%236D717F%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
}

.sp-products form.selectform button.sp-product-card__compare._compare_added::before {
  background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2219%22%20height%3D%2214%22%20viewBox%3D%220%200%2019%2014%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M1%201H17M1%207H10M1%2013H9M15.5%208V10.5M15.5%2010.5V13M15.5%2010.5H18M15.5%2010.5H13%22%20stroke%3D%22%23006AB5%22%20stroke-width%3D%222%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
}

/* Footer */
.sp-products__footer {
  display: flex;
  flex-direction: row;
  justify-content: space-between;
  align-items: center;
  gap: 32px;
  width: 100%;
}

.sp-products__all {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  height: 52px;
  padding: 14px 24px;
  background: #006ab5;
  border-radius: 10px;
  font-weight: 500;
  font-size: 18px;
  line-height: 24px;
  color: #fff !important;
  text-decoration: none !important;
  transition: background 0.15s ease;
}

.sp-products__all:hover {
  background: #005a9a;
}

.sp-products__nav {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
}

.sp-products__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  padding: 14px;
  border: 2px solid #d2d5db;
  border-radius: 150px;
  background: #fff;
  opacity: 0.7;
  cursor: pointer;
  transition: opacity 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.sp-products__arrow:hover:not(:disabled) {
  opacity: 1;
  background: #ffffffe5;
}

.sp-products__arrow:disabled {
  opacity: 0.4;
  cursor: default;
}

.sp-products__arrow svg {
  display: block;
  width: 24px;
  height: 24px;
}

/* Progress — только мобилка */
.sp-products__scrollbar {
  display: none;
}

.sp-products__scrollbar.swiper-scrollbar {
  position: relative;
  left: auto;
  right: auto;
  bottom: auto;
  top: auto;
  width: 79px;
  height: 6px;
  margin: 0;
  background: #ebedf0;
  border-radius: 12px;
  overflow: hidden;
}

.sp-products__scrollbar .swiper-scrollbar-drag {
  background: #6d717f;
  border-radius: 12px;
  height: 100%;
  left: 0;
  top: 0;
}

@media (max-width: 1599px) {
  .sp-products {
    padding: 64px 48px;
  }
}

@media (max-width: 1199px) {
  .sp-products {
    padding: 48px 24px;
  }

  .sp-products__title {
    font-size: 36px;
    line-height: 40px;
  }

  .sp-product-card__form {
    min-height: 0;
  }
}

/* Mobile — Figma Frame 2043683990 / 2043684005 */
@media (max-width: 776px) {
  .sp-products,
  .sp-products.sp-popular {
    padding: 40px 16px;
    overflow: visible;
  }

  .sp-products__inner {
    gap: 24px;
    overflow: visible;
  }

  .sp-products__title {
    font-size: 32px;
    line-height: 40px;
  }

  .sp-products__swiper {
    width: calc(100% + 16px);
    margin-right: -16px;
  }

  .sp-products__swiper .swiper-slide {
    width: 165px;
  }

  .sp-product-card__form {
    gap: 12px;
    min-height: 329px;
    height: 100%;
    padding: 4px;
    border: 1.5px solid #ebedf0;
    border-radius: 10px;
  }

  .sp-product-card__media {
    height: 165px;
    border-radius: 8px;
  }

  .sp-product-card__badges {
    left: 6px;
    top: 6px;
    gap: 4px;
  }

  .sp-product-card__badge {
    padding: 2px 8px;
    border-radius: 4px;
    font-size: 13px;
    line-height: 18px;
  }

  .sp-product-card__body {
    gap: 20px;
    padding: 0 6px 8px;
  }

  .sp-product-card__info {
    gap: 8px;
  }

  .sp-product-card__copy {
    gap: 8px;
  }

  .sp-product-card__price {
    min-height: 24px;
    font-size: 16px;
    line-height: 24px;
  }

  .sp-product-card__name {
    min-height: 48px;
    font-size: 12px;
    line-height: 16px;
  }

  .sp-product-card__chips {
    display: none;
  }

  .sp-product-card__actions {
    align-items: flex-start;
    gap: 6px;
    min-height: 36px;
    height: 36px;
  }

  .sp-products form.selectform button.sp-product-card__cart,
  .sp-products form.selectform button.sp-product-card__compare,
  .sp-products form.selectform button.sp-product-card__qty-minus,
  .sp-products form.selectform button.sp-product-card__qty-plus {
    height: 36px !important;
    padding: 8px !important;
    border-radius: 6px !important;
  }

  .sp-products form.selectform button.sp-product-card__cart {
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    gap: 0;
    font-size: 0 !important;
    line-height: 0 !important;
    color: transparent !important;
  }

  .sp-products form.selectform button.sp-product-card__cart::before {
    width: 20px;
    height: 20px;
  }

  /* В корзине: галочка вместо qty */
  .sp-products form.selectform.is-in-basket .sp-product-card__qty {
    display: none !important;
  }

  .sp-products form.selectform.is-in-basket button.sp-product-card__cart {
    display: inline-flex !important;
    background: #006ab5 !important;
    background-color: #006ab5 !important;
  }

  .sp-products form.selectform.is-in-basket button.sp-product-card__cart::before {
    width: 20px;
    height: 20px;
    background-image: url("data:image/svg+xml,%3Csvg%20width%3D%2214%22%20height%3D%2210%22%20viewBox%3D%220%200%2014%2010%22%20fill%3D%22none%22%20xmlns%3D%22http%3A%2F%2Fwww.w3.org%2F2000%2Fsvg%22%3E%3Cpath%20d%3D%22M0.75%205.75L4.08333%209.08333L12.4167%200.75%22%20stroke%3D%22white%22%20stroke-width%3D%221.5%22%20stroke-linecap%3D%22round%22%20stroke-linejoin%3D%22round%22%2F%3E%3C%2Fsvg%3E");
  }

  .sp-products form.selectform button.sp-product-card__compare {
    display: inline-flex !important;
    flex: 1 1 0 !important;
    width: auto !important;
    min-width: 0 !important;
    max-width: none !important;
  }

  .sp-products form.selectform button.sp-product-card__compare::before {
    width: 20px;
    height: 20px;
  }

  .sp-product-card__qty {
    height: 36px;
    gap: 6px;
    flex: 1 1 0;
    min-width: 0;
  }

  .sp-products form.selectform button.sp-product-card__qty-minus,
  .sp-products form.selectform button.sp-product-card__qty-plus {
    flex: 0 0 36px !important;
    width: 36px !important;
    min-width: 36px !important;
    max-width: 36px !important;
    padding: 8px !important;
    border-radius: 6px !important;
  }

  .sp-products form.selectform button.sp-product-card__qty-minus svg,
  .sp-products form.selectform button.sp-product-card__qty-plus svg {
    width: 16px;
    height: 16px;
  }

  .sp-product-card__qty-value {
    height: 36px;
    padding: 8px;
    border-radius: 6px;
    font-size: 14px;
    line-height: 20px;
  }

  .sp-products__footer {
    flex-wrap: nowrap;
    justify-content: space-between;
    align-items: center;
    gap: 24px;
  }

  .sp-products__all {
    flex: 0 0 auto;
    width: auto;
    height: 40px;
    padding: 10px 20px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 20px;
  }

  .sp-products__nav {
    display: none;
  }

  .sp-products__scrollbar,
  .sp-products__scrollbar.swiper-scrollbar {
    display: block !important;
    position: relative !important;
    left: auto !important;
    right: auto !important;
    bottom: auto !important;
    top: auto !important;
    width: 79px !important;
    height: 6px !important;
    flex: none;
  }
}

/* 06 / Популярные товары — отступ снизу по макету (только ≥777) */
@media (min-width: 777px) {
  .sp-products.sp-popular {
    padding: 80px 240px 160px;
  }
}

@media (min-width: 777px) and (max-width: 1599px) {
  .sp-products.sp-popular {
    padding: 64px 48px 96px;
  }
}

@media (min-width: 777px) and (max-width: 1199px) {
  .sp-products.sp-popular {
    padding: 48px 24px 72px;
  }
}
