/* pages/main/products/css/products.css */
.popular-products {
  position: relative;
  overflow: hidden;
  border-radius: var(--border-radius-background);
  margin: var(--spacing-md);
}

.product-carousel-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--spacing-xl);
  padding: var(--spacing-xl) 0;
  margin: 0 auto;
}

.product-carousel {
  width: calc(100% - 140px);
  position: relative;
}

.swiper-wrapper {
  display: flex;
  width: 100%;
}

.swiper-slide {
  height: auto;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: var(--spacing-md) 0;
  flex-shrink: 0;
}

.product-card {
  width: 330px;
  height: 500px;
  background: var(--color-white);
  border-radius: var(--border-radius-background);
  overflow: hidden;
  box-shadow: var(--shadow-base);
  transition: all var(--transition-base);
  display: flex;
  flex-direction: column;
  margin: 0 auto;
  border: 1px solid var(--color-grey);
  position: relative;
}

.product-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
  border-color: var(--color-yellow);
}

.product-image-container {
  height: 300px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
  background: var(--color-grey);
}

.product-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform var(--transition-slow);
}

.product-card:hover .product-image {
  transform: scale(1.05);
}

.product-body {
    padding: var(--spacing-md);
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    height: auto;
    position: relative;
}

.product-title {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-bold);
  margin-bottom: var(--spacing-sm);
  font-size: var(--font-size-base);
  line-height: var(--line-height-tight);
  color: var(--color-black);
}

.product-description {
  color: var(--color-black);
  opacity: 0.7;
  font-size: var(--font-size-base);
  line-height: var(--line-height-normal);
  margin-bottom: var(--spacing-md);
  overflow: hidden;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  flex-grow: 1;
}

.product-footer {
  padding: var(--spacing-md) var(--spacing-lg);
  border-top: 1px solid var(--color-grey);
  background: var(--color-white);
  margin-top: auto;
}

.product-link {
  font-family: var(--font-family-primary);
  color: var(--color-yellow);
  font-weight: var(--font-weight-semibold);
  font-size: var(--font-size-base);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  transition: all var(--transition-fast);
  width: 100%;
  justify-content: space-between;
}

.product-link:hover {
  color: var(--color-black);
  text-decoration: none;
}

.product-link i {
  transition: transform var(--transition-fast);
}

.product-link:hover i {
  transform: translateX(4px);
}

/* Кастомная навигация по бокам */
.custom-prev,
.custom-next {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: var(--color-white);
  border: 2px solid var(--color-yellow);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all var(--transition-base);
  box-shadow: var(--shadow-base);
  flex-shrink: 0;
  position: relative;
  z-index: 20;
}

.custom-prev:hover,
.custom-next:hover {
  background: var(--color-yellow);
  transform: scale(1.1);
}

.custom-prev::before,
.custom-next::before {
  content: '';
  width: 15px;
  height: 15px;
  border-top: 3px solid var(--color-black);
  border-right: 3px solid var(--color-black);
  transition: all var(--transition-base);
}

.custom-prev::before {
  transform: rotate(-135deg);
  margin-right: -3px;
}

.custom-next::before {
  transform: rotate(45deg);
  margin-left: -3px;
}

.custom-prev:hover::before,
.custom-next:hover::before {
  border-color: var(--color-white);
}

/* Мобильная пагинация */
.mobile-pagination {
  display: none;
  justify-content: center;
  /* margin-top: var(--spacing-lg); */
  padding: var(--spacing-md) 0;
  gap: var(--spacing-xs);
}

.mobile-pagination-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-grey);
  transition: all var(--transition-base);
  cursor: pointer;
}

.mobile-pagination-dot.active {
  background: var(--color-yellow);
  transform: scale(1.3);
}

/* Стандартная пагинация Swiper (скрываем) */
.swiper-pagination {
  display: none;
}

.swiper-button-prev,
.swiper-button-next {
  display: none;
}

/* Убираем подчеркивание у всех ссылок внутри карточки */
.product-card a {
  text-decoration: none;
}

.product-card a:hover {
  text-decoration: none;
}

/* Адаптация */
@media (max-width: 1200px) {
  .product-card {
    width: 300px;
    height: 480px;
  }
  
  .product-image-container {
    height: 280px;
  }
  
  .custom-prev,
  .custom-next {
    width: 50px;
    height: 50px;
  }
  
  .product-carousel {
    width: calc(100% - 120px);
  }
}

@media (max-width: 992px) {
  .product-card {
    width: 280px;
    height: 460px;
  }
  
  .product-image-container {
    height: 260px;
  }
  
  .product-body {
    padding: var(--spacing-md);
  }
  
  .product-title {
    font-size: var(--font-size-sm);
  }
  
  .custom-prev,
  .custom-next {
    width: 45px;
    height: 45px;
  }
  
  .custom-prev::before,
  .custom-next::before {
    width: 12px;
    height: 12px;
  }
  
  .product-carousel {
    width: calc(100% - 100px);
  }
}

@media (max-width: 768px) {
  .popular-products {
    margin: var(--spacing-xs);
    border-radius: var(--border-radius-background);
  }
  
  .product-carousel-container {
    padding: 0;
    gap: var(--spacing-md);
  }
  
  .product-carousel {
    width: auto;
        padding: var(--spacing-md);
  }
  
  .product-card {
    width: 280px;
    height: 440px;
    margin: 0 var(--spacing-xs);
  }
  
  .product-image-container {
    height: 240px;
  }
  
  .product-body {
    padding: var(--spacing-md);
  }
  
  /* Скрываем кастомную навигацию по бокам на мобильных */
  .custom-prev,
  .custom-next {
    display: none;
  }
  
  /* Показываем мобильную пагинацию */
  .mobile-pagination {
    display: flex;
  }
}

@media (max-width: 576px) {
  .product-card {
    width: 300px;
    height: auto;
    min-height: 420px;
  }
  
  .product-image-container {
    height: 200px;
  }
  
  .product-body {
    padding: var(--spacing-md);
  }
  
  .product-title {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-xs);
  }
  
  .product-description {
    font-size: var(--font-size-sm);
    margin-bottom: var(--spacing-sm);
  }
  
  .product-footer {
    padding: var(--spacing-sm) var(--spacing-md);
  }
  
  .product-link {
    font-size: var(--font-size-sm);
  }
  
  .mobile-pagination-dot {
    width: 6px;
    height: 6px;
  }
}

@media (max-width: 480px) {
  .product-card {
    width: 280px;
    min-height: 400px;
  }
  
  .product-image-container {
    height: 180px;
  }
  
  .product-body {
    padding: var(--spacing-sm);
  }
  
  .product-title {
    font-size: var(--font-size-xs);
  }
  
  .product-description {
    font-size: var(--font-size-xs);
  }
  
  .mobile-pagination-dot {
    width: 5px;
    height: 5px;
  }
}

@media (max-width: 360px) {
  .product-card {
    width: 260px;
    min-height: auto;
  }
  
  .product-image-container {
    height: 160px;
  }
  
  .product-body {
    padding: var(--spacing-xs);
  }
  
  .product-title {
    font-size: 0.9rem;
  }
  
  .product-description {
    font-size: var(--font-size-xs);
  }
  
  .product-link {
    font-size: 0.8rem;
  }
  
  .mobile-pagination-dot {
    width: 4px;
    height: 4px;
  }
}