.popular-products {
  padding: 80px 20px;
}

.container {
  max-width: 1440px;
  margin: 0 auto;
}

.header-row {
  width: 100%;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  margin-bottom: 30px;
  align-items: center;
}

.header-row>* {
  max-width: 30%;
}

.header-row h2 {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
}

.header-row p {
  max-width: 500px;
  font-size: 14px;
  margin-top: 10px;
}

.to-products {
  border: 1px solid #7d5a4f;
  color: #7d5a4f;
  padding: 10px 24px;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 500;
}

.carousel-wrapper {
  position: relative;
  overflow: hidden;
  padding: 0 60px;
  width: 100%;
}

.carousel-track {
  display: flex;
  justify-content: flex-start; /* ВАЖНО! */
  align-items: center;
  gap: 20px;
  overflow: visible;
  width: 100%;
  transition: transform 0.4s ease, opacity 0.4s ease;
  position: relative;
  will-change: transform;
}

.carousel-footer {
  display: flex;
  justify-content: space-around;
  width: 50%;
  margin: 20px auto;
}

.product-card {
  flex: 0 0 520px;
  margin: 0 10px;
  padding: 24px;
  opacity: 0.3;
  filter: blur(3px);
  transform: scale(0.92);
  transition: all 0.5s ease;
  background: #F1EEE6;
  border-radius: 16px;
}

.product-card.side {
  opacity: 0.5;
  filter: blur(2px);
  transform: scale(0.95);
  z-index: 1;
}

.product-card.cloned {
  opacity: 0.3;
  filter: blur(3px);
  pointer-events: none;
}

.product-card.active {
  opacity: 1;
  filter: none;
  transform: scale(1);
  z-index: 2;
}

.product-inner {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  width: 100%;
}

.carousel-track,
.product-inner {
  height: 100%;
}

.card-info {
  flex: 1;
}
.product-img img {
  width: 160px;
  border-radius: 16px;
}
.card-info h3 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
}

.card-info p {
  font-size: 14px;
  color: #333;
  margin-bottom: 16px;
  line-height: 1.4;
}

.icons {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}
.icons span img {
  width: 24px;
  height: 24px;
}
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.price strong {
  font-size: 20px;
  font-weight: 700;
}

.price span {
  font-size: 14px;
  margin-left: 4px;
}

.buttons {
  display: flex;
  gap: 8px;
}
.btn-icon {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: transparent;
  border: 1px solid #ccc;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  cursor: pointer;
  transition: 0.3s ease;
}

.btn-icon img {
  width: 20px;
  height: 20px;
}

.btn-icon.filled {
  background-color: #9c826b;
  border-color: #9c826b;
}

.product-img img {
  width: 180px;
  height: auto;
  border-radius: 16px;
}
.arrow {
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: #7d5a4f;
  padding: 10px;
}
.pagination {
  text-align: center;
  margin-top: 20px;
  color: #7d5a4f;
  font-weight: 600;
  font-size: 18px;
}

/*@media (max-width: 800px) {
  .product-img img {
    display: none;
  }

  
}*/

@media (max-width: 768px) {
  .popular-products {
    padding: 40px 16px;
  }

  .header-row>* {
    max-width: 100%;
  }

  .header-row {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    flex-wrap: wrap;
    gap: 20px;
  }

  .header-row h2 {
    font-size: 28px;
  }

  .header-row p {
    font-size: 14px;
    max-width: 100%;
  }

  .to-products {
    padding: 10px 20px;
    font-size: 14px;
  }

  .carousel-wrapper {
    padding: 0;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
  }

  .carousel-track {
    gap: 16px;
    width: max-content;
    padding-bottom: 10px;
  }

  .product-card {
    flex: 0 0 80vw;
    margin: 0;
    scroll-snap-align: center;
    opacity: 1 !important;
    filter: none !important;
    transform: scale(1) !important;
  }

  .product-inner {
    flex-direction: column;
    gap: 16px;
  }

  .card-info h3 {
    font-size: 18px;
  }

  .card-info p {
    font-size: 13px;
    line-height: 1.4;
  }

  .carousel-footer {
    width: 100%;
    justify-content: center;
    gap: 30px;
    margin-top: 20px;
  }

  .product-img img {
    display: block;
    width: 100%;
    max-width: 220px;
    margin: auto;
  }

  .icons span img {
    width: 20px;
    height: 20px;
  }

  .btn-icon {
    width: 32px;
    height: 32px;
  }

  .btn-icon img {
    width: 18px;
    height: 18px;
  }
}
