.homefeed { position: relative; }
.homefeed__title { margin-bottom: 12px; }
.homefeed__more { display: flex; justify-content: center; padding: 24px 0; }
.homefeed__more[hidden] { display: none; }
.homefeed__spinner {
    width: 28px; height: 28px; border-radius: 50%;
    border: 3px solid rgba(0,0,0,.12); border-top-color: rgba(0,0,0,.5);
    animation: homefeed-spin .8s linear infinite;
}
@keyframes homefeed-spin { to { transform: rotate(360deg); } }
.homefeed__end { text-align: center; color: #888; padding: 16px 0; font-size: 14px; }

/* Блок в карточке товара: встроенные карточки как в instock («В наличии сейчас») */
.homefeed_product { margin: 40px 0 20px; }
.homefeed_product .homefeed__title { font-size: 22px; font-weight: 700; line-height: 1.2; margin-bottom: 20px; }
.homefeed-cards {
    display: grid;
    grid-template-columns: repeat(var(--homefeed-cols, 6), minmax(0, 1fr));
    gap: 28px 24px;
}
.homefeed__list .homefeed-cards + .homefeed-cards { margin-top: 28px; }
.homefeed-card { min-width: 0; }
.homefeed-card__link { display: block; color: inherit; text-decoration: none; }
.homefeed-card__link:hover .homefeed-card__name { color: var(--cheme-color, #e30016); }
.homefeed-card__img { display: block; height: 140px; margin-bottom: 8px; overflow: hidden; }
.homefeed-card__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.homefeed-card__badge {
    display: inline-block; margin-bottom: 8px; background: #12a44a; color: #fff; font-size: 13px; font-weight: 700;
    padding: 3px 8px; border-radius: 4px; line-height: 1.2;
}
.homefeed-card__row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; margin-bottom: 4px; }
.homefeed-card__price { font-size: 17px; font-weight: 700; line-height: 1.2; }
.homefeed-card__name {
    display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
    font-size: 13px; line-height: 1.4; color: #222; min-height: 4.2em; transition: color .3s ease-out;
}
.homefeed-card__rating { display: inline-flex; align-items: center; gap: 3px; font-size: 13px; color: #222; flex: none; }
.homefeed-card__rating .star { flex: none; }
.homefeed-card__rating b { font-weight: 600; }
.homefeed-card__rating span { color: #888; }
@media (max-width: 760px) {
    .homefeed_product .homefeed__title { font-size: 18px; }
    .homefeed-cards { gap: 20px 12px; }
}

/* Баннеры между строками товаров.
   Отдельный блок между сетками карточек: сетка ленты у темы — flex с
   отрицательными полями, поэтому баннер занимает свою строку сам */
.homefeed-banners { position: relative; margin: 20px 0; border-radius: 8px; overflow: hidden; }
.homefeed__list .products + .homefeed-banners { margin-top: 24px; }
.homefeed__list > .homefeed-banners:first-child { margin-top: 0; }
.homefeed-banners__item,
.homefeed-banners__item picture { display: block; width: 100%; text-decoration: none; }
/* Картинка вписывается по ширине ленты и не режется: пропорции берутся
   из width/height самого файла, высота считается от них */
.homefeed-banners__img { display: block; width: 100%; height: auto; border-radius: 8px; }

/* Карусель: слайды в ряд, переключение — сдвигом дорожки.
   flex-start — чтобы слайд с другими пропорциями не растягивался под
   самый высокий и не обрезался */
/* overflow на дорожке ставить нельзя: она сама сдвигается transform'ом,
   и соседние слайды обрезались бы её же рамкой. Лишнее по высоте и
   ширине обрезает родитель .homefeed-banners */
.homefeed-banners_slider .homefeed-banners__track {
    display: flex; align-items: flex-start;
    transition: transform .4s ease-out, height .3s ease-out;
}
.homefeed-banners_slider .homefeed-banners__item { flex: 0 0 100%; max-width: 100%; }
.homefeed-banners__dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; }
.homefeed-banners__dot {
    width: 8px; height: 8px; padding: 0; border: none; border-radius: 50%; cursor: pointer;
    background: rgba(255,255,255,.55); box-shadow: 0 0 3px rgba(0,0,0,.25); transition: background .2s ease-out, width .2s ease-out;
}
.homefeed-banners__dot.is-active { background: #fff; width: 20px; border-radius: 4px; }
.homefeed-banners__arrow {
    position: absolute; top: 50%; transform: translateY(-50%); width: 36px; height: 36px; padding: 0;
    border: none; border-radius: 50%; cursor: pointer; background: rgba(255,255,255,.8);
    opacity: 0; transition: opacity .2s ease-out;
}
.homefeed-banners__arrow::before {
    content: ""; position: absolute; top: 12px; left: 12px; width: 10px; height: 10px;
    border-top: 2px solid #333; border-right: 2px solid #333;
}
.homefeed-banners__arrow_prev { left: 12px; }
.homefeed-banners__arrow_prev::before { transform: rotate(-135deg); left: 15px; }
.homefeed-banners__arrow_next { right: 12px; }
.homefeed-banners__arrow_next::before { transform: rotate(45deg); left: 10px; }
.homefeed-banners_slider:hover .homefeed-banners__arrow { opacity: 1; }
@media (max-width: 760px) {
    .homefeed-banners { margin: 14px 0; border-radius: 8px; }
    .homefeed-banners__img { border-radius: 8px; }
    .homefeed-banners__arrow { display: none; }
    .homefeed-banners__dots { bottom: 6px; gap: 6px; }
    .homefeed-banners__dot { width: 6px; height: 6px; }
    .homefeed-banners__dot.is-active { width: 14px; border-radius: 3px; }
}

/* Встроенная плитка (когда в теме нет шаблона списка товаров) */
.homefeed-grid { display: grid; grid-template-columns: repeat(var(--homefeed-cols, auto-fill), minmax(min(180px, 100%), 1fr)); gap: 16px; }
.homefeed-grid__item { border: 1px solid #eee; border-radius: 8px; overflow: hidden; background: #fff; }
.homefeed-grid__link { display: block; color: inherit; text-decoration: none; }
.homefeed-grid__img { display: block; aspect-ratio: 1 / 1; background: #f6f6f6; }
.homefeed-grid__img img { width: 100%; height: 100%; object-fit: contain; display: block; }
.homefeed-grid__name { display: block; padding: 8px 10px 0; font-size: 14px; line-height: 1.3; min-height: 2.6em; }
.homefeed-grid__price { display: block; padding: 6px 10px 10px; font-weight: 600; }
.homefeed-grid__old { color: #999; font-weight: 400; margin-left: 6px; }
