/* Полная замена assets/featured-collection.css. */
.featured-collection {
  overflow: hidden;
}

.featured-collection .featured-collection__inner,
.featured-collection .products.product-list.row {
  min-width: 0;
}

.featured-collection .products.row {
  padding: 0;
}

.featured-collection .text-center .button {
  margin-top: 10px;
}

/* Мобильные экраны: одна целая карточка по ширине блока. */
@media only screen and (max-width: 767px) {
  .featured-collection {
    --mobile-swipe-width: 100%;
  }

  .featured-collection > .row {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 16px !important;
  }

  .featured-collection > .row > .columns {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    padding: 0 !important;
  }

  .featured-collection .products.product-list.row {
    box-sizing: border-box;
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* Обычная сетка: карточки идут друг под другом. */
  .featured-collection .featured-collection__inner.display-type--grid .products.product-list.row {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 20px !important;
    align-items: stretch;
  }

  /* Ширина работает и до, и после инициализации карусели Flickity. */
  .featured-collection .products.product-list.row > .columns,
  .featured-collection .products.product-list.row .carousel__slide {
    box-sizing: border-box;
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0;
    margin: 0 !important;
    padding: 0 !important;
  }

  /* При включённом свайпе листаем целые карточки по одной. */
  .featured-collection.swipe-on-mobile .featured-collection__inner.display-type--grid .products.product-list.row {
    grid-template-columns: none !important;
    grid-auto-flow: column;
    grid-auto-columns: 100%;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }

  .featured-collection.swipe-on-mobile .featured-collection__inner.display-type--grid .products.product-list.row::-webkit-scrollbar {
    display: none;
  }

  .featured-collection.swipe-on-mobile .featured-collection__inner.display-type--grid .products.product-list.row > .columns {
    scroll-snap-align: start;
    scroll-snap-stop: always;
  }

  .featured-collection .product-card,
  .featured-collection .product-card-info,
  .featured-collection .product-card--info,
  .featured-collection .product-card__info {
    box-sizing: border-box;
    min-width: 0;
    max-width: 100%;
  }

  .featured-collection .product-card {
    width: 100%;
  }

  /* Отменяем перенос по буквам, который наследуется от body темы. */
  .featured-collection,
  .featured-collection * {
    word-break: normal !important;
    overflow-wrap: normal !important;
    word-wrap: normal !important;
    -webkit-hyphens: none !important;
    hyphens: none !important;
  }

  /* Название показывается целиком, без обрезки после второй строки. */
  .featured-collection .product-card .product-card-title,
  .featured-collection .product-card .product-card--title,
  .featured-collection .product-card .product-card__title {
    display: block !important;
    -webkit-line-clamp: unset !important;
    -webkit-box-orient: initial !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    white-space: normal !important;
    text-overflow: clip !important;
    font-size: 16px !important;
    line-height: 1.4 !important;
  }

  .featured-collection .product-card-subtitle,
  .featured-collection .section-header--title,
  .featured-collection .section-header--description {
    white-space: normal !important;
  }
}

/* Десктоп: пять карточек в сетке. Карусель управляется Flickity. */
@media only screen and (min-width: 1068px) {
  .featured-collection .featured-collection__inner.display-type--grid .products.product-list.row {
    display: grid !important;
    grid-template-columns: repeat(5, minmax(0, 1fr)) !important;
    gap: 16px !important;
    margin: 0 !important;
  }

  .featured-collection .featured-collection__inner.display-type--grid .products.product-list.row > .columns {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }

  .featured-collection .product-card-info,
  .featured-collection .product-card--info,
  .featured-collection .product-card__info {
    padding-top: 10px !important;
  }

  .featured-collection .product-card-title,
  .featured-collection .product-card--title,
  .featured-collection .product-card__title {
    font-size: 14px !important;
    line-height: 1.3 !important;
  }

  .featured-collection .price {
    font-size: 14px !important;
  }
}

/* Планшеты и небольшие ноутбуки: четыре карточки в сетке. */
@media only screen and (min-width: 768px) and (max-width: 1067px) {
  .featured-collection .featured-collection__inner.display-type--grid .products.product-list.row {
    display: grid !important;
    grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    gap: 14px !important;
    margin: 0 !important;
  }

  .featured-collection .featured-collection__inner.display-type--grid .products.product-list.row > .columns {
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}

/* Широкая секция: отступы только у внешней строки. */
@media only screen and (min-width: 768px) {
  .featured-collection > .row {
    box-sizing: border-box;
    max-width: 100% !important;
    width: 100% !important;
    padding-left: 40px !important;
    padding-right: 40px !important;
  }
}
