/* =========================================================================
   Блок рекомендуемых товаров в статьях блога
   =========================================================================*/

/* Основной контейнер блока */
.blog-recommended-products {
  padding-top: 60px;
  padding-bottom: 60px;
  background-color: #fff;
}

/* Заголовок блока */
.blog-recommended-products__title {
  font-size: 32px;
  font-weight: 500;
  text-align: center;
  margin-bottom: 40px;
  color: #333;
  line-height: normal;
}

/* Сетка товаров - flexbox для адаптивности */
.blog-recommended-products__grid {
  display: flex;
  flex-wrap: wrap;
  gap: 20px;
  justify-content: flex-start;
  width: 100%;
  margin: 0;
  padding: 0;
}

/* Слайдер для десктопа - горизонтальное отображение */
.blog-recommended-products__slider {
  position: relative;
  padding: 0 50px;
}

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

.blog-recommended-products__slider .swiper-slide {
  height: auto;
  width: auto;
  display: flex;
  align-items: stretch;
}

/* Элемент сетки - карточка товара */
.blog-recommended-products__item {
  width: 100%;
  max-width: none;
  min-width: auto;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Кнопки навигации слайдера для десктопа */
.blog-recommended-products__prev-desktop,
.blog-recommended-products__next-desktop {
  width: 45px;
  height: 45px;
  background: #fff;
  border: 1px solid #ececec;
  border-radius: 50%;
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  cursor: pointer;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.blog-recommended-products__prev-desktop:hover,
.blog-recommended-products__next-desktop:hover {
  background: #0749ca;
  border-color: #0749ca;
}

.blog-recommended-products__prev-desktop:hover::after,
.blog-recommended-products__next-desktop:hover::after {
  background: #fff;
}

.blog-recommended-products__prev-desktop::after,
.blog-recommended-products__next-desktop::after {
  content: '';
  display: block;
  width: 12px;
  height: 12px;
  border-top: 2px solid #333;
  border-right: 2px solid #333;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

.blog-recommended-products__prev-desktop {
  left: 0;
}

.blog-recommended-products__prev-desktop::after {
  -webkit-transform: rotate(-135deg);
  -ms-transform: rotate(-135deg);
  transform: rotate(-135deg);
  margin-left: 3px;
}

.blog-recommended-products__next-desktop {
  right: 0;
}

.blog-recommended-products__next-desktop::after {
  -webkit-transform: rotate(45deg);
  -ms-transform: rotate(45deg);
  transform: rotate(45deg);
  margin-right: 3px;
}

.blog-recommended-products__prev-desktop.swiper-button-disabled,
.blog-recommended-products__next-desktop.swiper-button-disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Стили для интеграции с существующими .card классами */
.blog-recommended-products .card {
  border: 2px solid transparent;
  border-radius: 5px;
  overflow: hidden;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;
}

.blog-recommended-products .card:hover {
  border: 2px solid #ececec;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

/* Внутренний контейнер карточки */
.blog-recommended-products .card__inner {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
}

/* Изображение товара */
.blog-recommended-products .card__img {
  width: 100%;
  height: 275px;
  background-position: center;
  background-repeat: no-repeat;
  background-size: contain;
  background-color: #f5f5f5;
  transition: transform 0.3s ease;
}

.blog-recommended-products .card:hover .card__img {
  transform: scale(1.02);
}

/* Ссылка на карточку товара */
.blog-recommended-products .card__product {
  background: #f5f5f5;
  display: block;
  flex-shrink: 0;
}

/* Контент карточки */
.blog-recommended-products .card__content {
  padding: 20px 25px 30px;
  display: flex;
  flex-direction: column;
  gap: 15px;
  flex: 1;
}

/* Название товара */
.blog-recommended-products .card__title {
  color: #333;
  text-align: center;
  font-size: 20px;
  font-weight: 300;
  line-height: normal;
  min-height: 48px;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
}

/* Цена товара */
.blog-recommended-products .card__coast {
  text-align: center;
  white-space: nowrap;
  font-size: 24px;
  font-weight: 500;
  color: #333;
}

/* Контейнер цены */
.blog-recommended-products .product-item-price-container {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

/* Текущая цена */
.blog-recommended-products .product-item-price-current {
  font-size: 24px;
  font-weight: 500;
  color: #333;
}

/* Кнопка "В корзину" - всегда видима */
.blog-recommended-products .card__btn {
  opacity: 1;
  visibility: visible;
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  margin-top: auto;
  cursor: pointer;
}

/* Кнопка в корзину - стили из .btn-border */
.blog-recommended-products .btn {
  display: -webkit-box;
  display: -ms-flexbox;
  display: flex;
  width: -webkit-fit-content;
  width: -moz-fit-content;
  width: fit-content;
  padding: 14px 30px;
  -webkit-box-pack: center;
  -ms-flex-pack: center;
  justify-content: center;
  -webkit-box-align: center;
  -ms-flex-align: center;
  align-items: center;
  border-radius: 5px;
  overflow: hidden;
  text-align: center;
  font-size: 16px;
  font-style: normal;
  font-weight: 500;
  line-height: normal;
  text-transform: uppercase;
  margin: 0 auto;
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
  border: 1.5px solid #0749ca;
  color: #0749ca;
  background: transparent;
  white-space: nowrap;
}

.blog-recommended-products .btn:hover {
  color: #fff;
  background: #0749ca;
}

.blog-recommended-products .btn:active {
  color: #fff;
  background: #005fe5;
  border: 1.5px solid #005fe5;
}

/* Контейнер кнопки */
.blog-recommended-products .product-item-button-container {
  display: flex;
  justify-content: center;
  margin-top: auto;
}

/* Ссылки на товар */
.blog-recommended-products .card__product,
.blog-recommended-products .card__content a {
  text-decoration: none;
  color: inherit;
  -webkit-transition: color 0.3s ease;
  -o-transition: color 0.3s ease;
  transition: color 0.3s ease;
}

.blog-recommended-products .card__content a:hover {
  color: #0749ca;
}

/* =========================================================================
   Адаптивность
   =========================================================================*/

/* Планшет (до 1280px) */
@media (max-width: 1280px) {
  .blog-recommended-products__title {
    font-size: 28px;
    margin-bottom: 35px;
  }

  .blog-recommended-products__slider {
    padding: 0 40px;
  }
}

/* Планшет (до 992px) */
@media (max-width: 992px) {
  .blog-recommended-products {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .blog-recommended-products__title {
    font-size: 24px;
    margin-bottom: 30px;
  }

  .blog-recommended-products__slider {
    padding: 0 35px;
  }

  .blog-recommended-products .card__img {
    height: 240px;
  }

  .blog-recommended-products .card__title {
    font-size: 18px;
    min-height: 42px;
  }

  .blog-recommended-products .card__coast {
    font-size: 20px;
  }
}

/* Мобильные устройства (до 768px) */
@media (max-width: 768px) {
  .blog-recommended-products {
    padding-top: 30px;
    padding-bottom: 30px;
  }

  .blog-recommended-products__title {
    font-size: 20px;
    margin-bottom: 25px;
  }

  .blog-recommended-products .card__img {
    height: 200px;
  }

  .blog-recommended-products .card__content {
    padding: 15px 20px 25px;
    gap: 12px;
  }

  .blog-recommended-products .card__title {
    font-size: 16px;
    min-height: 38px;
    line-height: 19px;
  }

  .blog-recommended-products .card__coast {
    font-size: 18px;
  }

  .blog-recommended-products .btn {
    padding: 12px 25px;
    font-size: 14px;
  }

  /* На мобильных кнопка всегда видна */
  .blog-recommended-products .card__btn {
    opacity: 1;
    visibility: visible;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    margin-top: 10px;
  }

  /* Скрываем десктоп версию на мобильных */
  .blog-recommended-products__grid--desktop {
    display: none !important;
  }

  /* Показываем мобильный слайдер */
  .blog-recommended-products__grid--mobile {
    display: block !important;
  }

  /* Стили для слайдера на мобильных */
  .blog-recommended-products__grid--mobile {
    position: relative;
    padding: 0 50px; /* Место для кнопок навигации */
  }

  .blog-recommended-products__grid--mobile .swiper-slide {
    height: auto;
  }

  .blog-recommended-products__grid--mobile .blog-recommended-products__item {
    width: 100%;
    max-width: none;
    min-width: auto;
  }

  /* Кнопки навигации слайдера */
  .blog-recommended-products__prev,
  .blog-recommended-products__next {
    width: 40px;
    height: 40px;
    background: #fff;
    border: 1px solid #ececec;
    border-radius: 50%;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    cursor: pointer;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
  }

  .blog-recommended-products__prev:hover,
  .blog-recommended-products__next:hover {
    background: #0749ca;
    border-color: #0749ca;
  }

  .blog-recommended-products__prev:hover::after,
  .blog-recommended-products__next:hover::after {
    background: #fff;
  }

  .blog-recommended-products__prev::after,
  .blog-recommended-products__next::after {
    content: '';
    display: block;
    width: 10px;
    height: 10px;
    border-top: 2px solid #333;
    border-right: 2px solid #333;
    -webkit-transition: all 0.3s ease;
    -o-transition: all 0.3s ease;
    transition: all 0.3s ease;
  }

  .blog-recommended-products__prev {
    left: 0;
  }

  .blog-recommended-products__prev::after {
    -webkit-transform: rotate(-135deg);
    -ms-transform: rotate(-135deg);
    transform: rotate(-135deg);
    margin-left: 3px;
  }

  .blog-recommended-products__next {
    right: 0;
  }

  .blog-recommended-products__next::after {
    -webkit-transform: rotate(45deg);
    -ms-transform: rotate(45deg);
    transform: rotate(45deg);
    margin-right: 3px;
  }

  .blog-recommended-products__prev.swiper-button-disabled,
  .blog-recommended-products__next.swiper-button-disabled {
    opacity: 0.3;
    cursor: not-allowed;
  }
}

/* Маленьшие мобильные устройства (до 550px) */
@media (max-width: 550px) {
  .blog-recommended-products {
    padding-top: 20px;
    padding-bottom: 20px;
  }

  .blog-recommended-products__title {
    font-size: 18px;
    margin-bottom: 20px;
  }


  .blog-recommended-products .card__img {
    height: 220px;
  }

  .blog-recommended-products .card__content {
    padding: 15px 20px 20px;
    gap: 10px;
  }

  .blog-recommended-products .card__title {
    font-size: 16px;
    min-height: auto;
    -webkit-box-orient: vertical;
    -webkit-box-direction: normal;
    -ms-flex-direction: column;
    flex-direction: column;
    -webkit-box-pack: start;
    -ms-flex-pack: start;
    justify-content: flex-start;
    text-align: left;
  }

  .blog-recommended-products .card__coast {
    font-size: 18px;
    text-align: left;
  }

  .blog-recommended-products .product-item-button-container {
    justify-content: flex-start;
  }

  .blog-recommended-products .btn {
    width: 100%;
    padding: 12px 20px;
    font-size: 14px;
  }
}

/* Дополнительные hover эффекты для ссылок */
.blog-recommended-products .card__product:hover {
  opacity: 0.9;
}

/* Улучшение доступности */
.blog-recommended-products .card__product:focus,
.blog-recommended-products .btn:focus {
  outline: 2px solid #0749ca;
  outline-offset: 2px;
}

/* Плавные переходы для всех интерактивных элементов */
.blog-recommended-products a,
.blog-recommended-products .btn {
  -webkit-transition: all 0.3s ease;
  -o-transition: all 0.3s ease;
  transition: all 0.3s ease;
}

/* =========================================================================
   Управление видимостью версий для десктопа (>=768px)
   =========================================================================*/

@media (min-width: 769px) {
  /* Показываем десктоп версию (слайдер) */
  .blog-recommended-products__grid--desktop {
    display: block !important;
  }

  /* Скрываем мобильный слайдер */
  .blog-recommended-products__grid--mobile {
    display: none !important;
  }
}
