/* Детальная страница товара — уменьшаем штатный верхний отступ Tilda */

#allrecords[data-product-page="y"] .t-catalog__prod-snippet__container {
    padding-top: 30px !important;
}

@media screen and (max-width: 560px) {
    #allrecords[data-product-page="y"] .t-catalog__prod-snippet__container {
        padding-top: 15px !important;
    }

    #allrecords[data-product-page="y"] .t-catalog__prod-popup__breadcrumbs {
        padding-top: 0 !important;
    }
}

/* Grail Peptide — жирное начертание цены во всех карточках каталога */

#allrecords .js-product-price,
#allrecords .t-catalog__card__price-currency,
#allrecords .t-catalog__prod-popup__price-currency,
#allrecords .t-store__card__price-currency,
#allrecords .t-store__prod-popup__price-currency {
    font-weight: 600 !important;
}

/* =========================================================
   "Также рекомендуем"
   Повторяем логику штатного каталога Tilda:
   контент идёт естественно, кнопки выравниваются по низу
   ========================================================= */


/* Короткая подпись под названием */

#allrecords[data-product-page="y"]
.t-catalog__relevants__container
.gp-relevant-subtitle {
    display: block;

    margin: 3px 0 0;

    line-height: 1.35;
    font-weight: 400;
    text-align: center;

    opacity: 0.72;

    white-space: nowrap;
}


/* Небольшой промежуток между подписью и ценой */

#allrecords[data-product-page="y"]
.t-catalog__relevants__container
.gp-relevant-subtitle + .js-catalog-price-wrapper {
    margin-top: 6px !important;
}


/*
   Desktop.
   Карточки одинаковой высоты, как в полном каталоге.
*/

@media screen and (min-width: 961px) {

    /* Карточки ряда растягиваются на одинаковую высоту */

    #allrecords[data-product-page="y"]
    .t-catalog__relevants__container
    .t-catalog__card-list__vertical-align-buttons {
        align-items: stretch !important;
    }


    /* Карточка становится вертикальной колонкой */

    #allrecords[data-product-page="y"]
    .t-catalog__relevants__container
    .js-product-relevant {
        display: flex !important;
        flex-direction: column !important;
    }


    /*
       Весь блок под изображением занимает оставшуюся высоту карточки.
    */

    #allrecords[data-product-page="y"]
    .t-catalog__relevants__container
    .js-product-relevant
    .t-catalog__card__wrap_txt-and-btns {
        display: flex !important;
        flex-direction: column !important;
        flex: 1 1 auto !important;
    }


    /*
       Название, подпись, цена, наличие и "Содержание"
       остаются в естественном потоке.
       Ничего внутри искусственно не выравниваем.
    */

    #allrecords[data-product-page="y"]
    .t-catalog__relevants__container
    .js-product-relevant
    .t-catalog__card__wrap_txt-and-opts {
        flex: 0 0 auto !important;
    }


    /*
       Убираем наш прежний искусственный margin-top:auto
       у текстового блока, если он остался в inline-стиле.
    */

    #allrecords[data-product-page="y"]
    .t-catalog__relevants__container
    .js-product-relevant
    .t-catalog__card__textwrapper {
        margin-top: 0 !important;
    }


    /*
       КЛЮЧЕВАЯ логика полного каталога:
       свободное пространство остаётся перед кнопками,
       поэтому нижняя часть всех карточек совпадает.
    */

    #allrecords[data-product-page="y"]
    .t-catalog__relevants__container
    .js-product-relevant
    .t-catalog__card__btns-wrapper {
        margin-top: auto !important;
        padding-top: 14px;
    }
}