/**
 * Правки по замечаниям дизайнера (десктоп 1440, 33 пункта).
 * Подключается ПОСЛЕДНИМ (header.php), чтобы переопределять *-layout.css.
 * Номера «№» — пункты PDF «СпортГрупп — замечания по десктопной версии».
 *
 * Базовая причина многих «лишних» отступов: глобальные стили Origami задают
 * h1–h6 { padding-bottom: 21px } и p { padding-bottom: 9.8px } — здесь они сбрасываются
 * точечно в тех блоках, где в замечаниях речь об отступах.
 */

/* ---------- Шрифт по дизайн-системе (Inter) — №5, №31 ---------- */
/* Тема Origami (theme/custom/style.css) жёстко задаёт Open Sans через !important на body и a —
   перебиваем специфичностью (ID внутри :not) и тоже с !important. */
body.sg-redesign:not(#bx-panel),
body.sg-redesign:not(#bx-panel) a {
    font-family: 'Inter', Arial, sans-serif !important;
}

body.sg-redesign :is(button, input, select, textarea) {
    font-family: inherit;
}

/* ---------- ГЛАВНАЯ ---------- */

/* №1 Категории: подпись в одну строку, без обрезания */
.sg-categories__card {
    container-type: inline-size;
}

.sg-categories__desc {
    font-size: min(18px, calc((100cqw - 48px) / 13.6));
}

/* №2 Видео/атмосфера: во всю ширину без кадрирования + отступ снизу под подписью */
.sg-atmosphere__video {
    display: none;
}

@media (min-width: 992px) {
    body.sg-redesign--home .sg-atmosphere {
        display: block;
        height: auto;
        min-height: 0;
        padding: 160px 0 0;
        background: #0a0a0a;
    }

    body.sg-redesign--home .sg-atmosphere__media {
        position: relative;
        inset: auto;
        width: 100%;
        /* по высоте не больше экрана: кадр кадрируется (cover), а не вылезает за viewport */
        height: min(56.25vw, max(520px, calc(100vh - 65px)));
        background: transparent;
    }

    body.sg-redesign--home .sg-atmosphere__media picture,
    body.sg-redesign--home .sg-atmosphere__art {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 50% 30%;
    }

    /* видео поверх картинки; появляется после начала воспроизведения */
    body.sg-redesign--home .sg-atmosphere__video {
        display: block;
        position: absolute;
        inset: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        object-position: 50% 30%;
        opacity: 0;
        transition: opacity 0.6s ease;
    }

    body.sg-redesign--home .sg-atmosphere__video.is-playing {
        opacity: 1;
    }

    /* текст поверх видео (Figma 319:233): слева по сетке 80px, низ текста — 80px от нижнего края кадра */
    body.sg-redesign--home .sg-atmosphere__copy {
        position: absolute;
        left: 0;
        right: 0;
        bottom: 80px;
        z-index: 2;
        pointer-events: none;
    }

    body.sg-redesign--home .sg-atmosphere__copy-inner {
        box-sizing: border-box;
        max-width: 1440px;
        margin: 0 auto;
        padding: 0 var(--sg-container-desktop, 80px);
    }

    body.sg-redesign--home .sg-atmosphere__eyebrow {
        margin: 0 0 48px;
        padding: 0;
        font-size: 20px;
        font-weight: 500;
        line-height: 1.1;
        letter-spacing: 5px;
        text-transform: uppercase;
        color: rgba(251, 250, 250, 0.5);
    }

    body.sg-redesign--home .sg-atmosphere__title {
        max-width: 640px;
        margin: 0 0 24px;
        padding: 0;
        font-size: 42px;
        font-weight: 600;
        line-height: 1.1;
        color: #fbfafa;
    }

    body.sg-redesign--home .sg-atmosphere__text {
        max-width: 610px;
        margin: 0;
        padding: 0;
        font-size: 20px;
        font-weight: 400;
        line-height: 1.15;
        color: rgba(251, 250, 250, 0.9);
    }
}

/* на <992px текст «запечён» в картинках — HTML-версию оставляем только для читалок/SEO */
@media (max-width: 991px) {
    .sg-atmosphere__copy {
        position: absolute;
        width: 1px;
        height: 1px;
        margin: -1px;
        overflow: hidden;
        clip: rect(0, 0, 0, 0);
        white-space: nowrap;
    }
}
/* №3 Бренды: логотипы без подложки, 5 плиток в ряд */
.sg-brands__logo {
    width: 68%;
    height: 56%;
    padding: 0;
    background: transparent;
    border-radius: 0;
    object-fit: contain;
    filter: brightness(0) invert(1);
    opacity: 0.88;
    transition: filter 0.3s ease-out, transform 0.3s ease, opacity 0.3s ease;
}

/* светлые логотипы (определяются в review.js) — страница /brands/ */
.sg-brands__logo--light {
    filter: none;
}

.sg-brands__logo--invert {
    filter: invert(1);
}

@media (min-width: 992px) {
    .sg-brands__grid {
        grid-template-columns: repeat(5, minmax(0, 1fr));
    }

    .sg-brands__item {
        aspect-ratio: auto;
        height: 143px;
        max-height: none;
    }

    .sg-brands__item:hover .sg-brands__logo,
    .sg-brands__item:focus-visible .sg-brands__logo {
        opacity: 1;
        transform: scale(1.04);
    }
}

/* Главная: grayscale → цвет при hover, как у .sg-product-mini */
@media (min-width: 1200px) {
    body.sg-redesign--home .sg-brands__logo,
    body.sg-redesign--home .sg-brands__logo--light,
    body.sg-redesign--home .sg-brands__logo--invert {
        filter: grayscale(1);
        opacity: 1;
    }

    body.sg-redesign--home .sg-brands__item:hover .sg-brands__logo,
    body.sg-redesign--home .sg-brands__item:focus-visible .sg-brands__logo,
    body.sg-redesign--home .sg-brands__item:hover .sg-brands__logo--light,
    body.sg-redesign--home .sg-brands__item:focus-visible .sg-brands__logo--light,
    body.sg-redesign--home .sg-brands__item:hover .sg-brands__logo--invert,
    body.sg-redesign--home .sg-brands__item:focus-visible .sg-brands__logo--invert {
        filter: none;
        opacity: 1;
    }
}

@media (max-width: 1199px) {
    body.sg-redesign--home .sg-brands__logo,
    body.sg-redesign--home .sg-brands__logo--light,
    body.sg-redesign--home .sg-brands__logo--invert {
        filter: none;
        opacity: 1;
        transition: filter 0.6s ease-in-out, transform 0.3s ease, opacity 0.3s ease;
    }

    body.sg-redesign--home .sg-brands__item--muted .sg-brands__logo,
    body.sg-redesign--home .sg-brands__item--muted .sg-brands__logo--light,
    body.sg-redesign--home .sg-brands__item--muted .sg-brands__logo--invert {
        filter: grayscale(1);
    }
}

/* №4 Бейджи: единый размер иконок, текст без висячих предлогов */
.sg-trust__icon svg {
    width: 50px;
    height: 50px;
}

.sg-trust__text,
.sg-trust__title {
    text-wrap: balance;
}

/* №5 Новости: изображения одной высоты, шрифт мельче и легче */
.sg-news__media {
    flex: 0 0 180px;
    height: 180px;
    overflow: hidden;
}

.sg-news__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.sg-news__date {
    font-size: 12px;
    font-weight: 400;
}

.sg-news__name {
    margin: 0;
    padding: 0;
    font-size: 15px;
    font-weight: 400;
    line-height: 1.3;
}

/* №6 Блог: внутренние отступы как в макете (одинаковые у крупной и малых карточек) */
.sg-blog__tag,
.sg-blog__name,
.sg-blog__excerpt {
    margin: 0;
    padding: 0;
}

.sg-blog__large-info,
.sg-blog__small {
    padding: 32px;
}

.sg-blog__large-info,
.sg-blog__small-body {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.sg-blog__small {
    display: flex;
    flex-direction: column;
    gap: 12px;
    height: auto;
    min-height: 0;
}

/* крупная карточка: картинка занимает всю свободную высоту (нет пустоты под текстом) */
.sg-blog__large-media {
    flex: 1 1 340px;
    min-height: 340px;
    height: auto;
}

/* №7 Футер: пункты колонок строго под заголовком */
.sg-footer__links,
body.sg-redesign .sg-footer__links li {
    margin-left: 0;
    padding-left: 0;
    list-style: none;
}

/* ---------- О НАС ---------- */

/* №9 Body: размер и межстрочный интервал по токенам (в «Как всё начиналось» был 14/1.2) */
.sg-about__history-col,
.sg-about__history-col p,
.sg-about__section-lead,
.sg-about__fact-label,
.sg-about__manufacturers-text,
.sg-about__cta-text {
    font-size: var(--sg-fs-body);
    line-height: var(--sg-lh-body);
}

.sg-about__work-title {
    line-height: var(--sg-lh-body);
}

.sg-about__work-text,
.sg-about__brand,
.sg-about__req-row {
    line-height: var(--sg-lh-body);
}

/* №8 Текст в плашках без висячих предлогов (+ типограф в review.js) */
.sg-about__fact-label,
.sg-about__work-text,
.sg-about__manufacturers-text,
.sg-about__brand {
    text-wrap: pretty;
}

/* №10 Свидетельства: изображения в натуральном формате (без обрезки), одна высота */
body.sg-redesign .sg-about__certs-track .sg-about__cert {
    width: auto;
    height: 433px;
    background: transparent;
    border-radius: 8px;
}

body.sg-redesign .sg-about__certs-track .sg-about__cert-link {
    display: block;
    width: auto;
    height: 100%;
}

body.sg-redesign .sg-about__certs-track .sg-about__cert img {
    width: auto;
    height: 100%;
    max-width: none;
    object-fit: contain;
    border-radius: 8px;
}

/* ---------- ЭНЦИКЛОПЕДИЯ ---------- */

/* №11 Алфавит: буквы в квадратных элементах */
@media (min-width: 1200px) {
    .sg-ingredients-list__alphabet {
        gap: 8px;
    }

    .sg-ingredients-list__alphabet-btn {
        display: inline-flex;
        align-items: center;
        justify-content: center;
        box-sizing: border-box;
        width: 44px;
        height: 44px;
        padding: 0;
        border: 1px solid rgba(251, 250, 250, 0.24);
        border-radius: 8px;
        background: transparent;
        font-size: 16px;
        font-weight: 500;
        line-height: 1;
    }

    .sg-ingredients-list__alphabet-btn--all {
        width: auto;
        min-width: 44px;
        padding: 0 16px;
    }

    .sg-ingredients-list__alphabet-btn:not(.is-active):not(.is-disabled):hover {
        border-color: #fbfafa;
        opacity: 1;
    }

    .sg-ingredients-list__alphabet-btn.is-active {
        border-color: #fbfafa;
        background: #fbfafa;
        color: #0a0a0a;
    }

    .sg-ingredients-list__alphabet-btn.is-disabled,
    .sg-ingredients-list__alphabet-btn:disabled {
        border-color: rgba(251, 250, 250, 0.08);
        color: #5f5d5d;
    }
}

/* №12 Полный список: без большой буквы на карточках («Часто ищут» не трогаем) */
.sg-ingredients-list__groups .sg-ingredients-list__card-letter,
.sg-ingredients-list__flat .sg-ingredients-list__card-letter {
    display: none;
}

.sg-ingredients-list__groups .sg-ingredients-list__card-head,
.sg-ingredients-list__flat .sg-ingredients-list__card-head {
    min-height: 0;
}

/* №13 Форма «Не нашли ингредиент?» */
.sg-ingredients-request {
    max-width: var(--sg-content-max, 1440px);
    margin: 0 auto;
    padding: 0 var(--sg-container-desktop, 80px) 96px;
    box-sizing: border-box;
}

.sg-ingredients-request__card {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 594px;
    gap: 20px;
    align-items: start;
    padding: 64px 36px;
    border-radius: 16px;
    background: #131313;
}

.sg-ingredients-request__copy {
    display: flex;
    flex-direction: column;
    gap: 16px;
    max-width: 560px;
}

.sg-ingredients-request__title {
    margin: 0;
    padding: 0;
    font-size: 24px;
    font-weight: 600;
    line-height: 1.1;
}

.sg-ingredients-request__text {
    margin: 0;
    padding: 0;
    font-size: var(--sg-fs-body);
    line-height: var(--sg-lh-body);
}

@media (max-width: 1199px) {
    .sg-ingredients-request {
        padding: 0 var(--sg-container-tablet, 24px) 80px;
    }

    .sg-ingredients-request__card {
        grid-template-columns: 1fr;
        padding: 40px 28px;
    }
}

@media (max-width: 767px) {
    .sg-ingredients-request {
        padding: 0 var(--sg-container-mobile, 20px) 64px;
    }

    .sg-ingredients-request__card {
        padding: 28px 20px;
    }
}

/* ---------- АКЦИИ / НОВОСТИ / БЛОГ / КАТАЛОГ ---------- */

/* №14 Единые отступы заголовок → вводный текст (16px — меньше расстояния «крошки → фильтры») */
.sg-blog-list__title,
.sg-blog-list__lead,
.sg-page-header__title,
.sg-page-header__desc {
    padding-bottom: 0;
}

.sg-blog-list__intro {
    gap: 16px;
}

.sg-page-header__desc {
    margin-top: 16px;
}

/* №15, №16 Карточки акций / новостей / блога: плотнее заголовок–текст, одинаковые уровни */
.sg-blog-card__body {
    gap: 8px;
}

.sg-blog-list__meta,
.sg-blog-card__title,
.sg-blog-card__text {
    margin: 0;
    padding: 0;
}

.sg-blog-card__title {
    min-height: 2.4em;
}

.sg-blog-card__title,
.sg-blog-card__text {
    text-wrap: pretty;
}

/* №17 «Загрузить ещё» вместо пагинации */
.sg-load-more {
    display: flex;
    justify-content: center;
    margin-top: 40px;
}

.sg-load-more__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 240px;
    height: 56px;
    padding: 0 32px;
    border: 1px solid rgba(251, 250, 250, 0.3);
    border-radius: 10px;
    background: transparent;
    color: #fbfafa;
    font-size: 16px;
    font-weight: 500;
    letter-spacing: 0.02em;
    text-decoration: none;
    cursor: pointer;
    transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

body.sg-redesign .sg-load-more__btn:hover,
body.sg-redesign .sg-load-more__btn:focus-visible {
    border-color: #fbfafa;
    background: #fbfafa;
    color: #0a0a0a;
    text-decoration: none;
}

.sg-load-more__btn.is-loading {
    opacity: 0.6;
    pointer-events: none;
}

/* ---------- КАРТОЧКА ТОВАРА (десктоп ≥1200) ---------- */
@media (min-width: 1200px) {
    /* №24 Верхний блок вместе с крошками — в один экран */
    .sg-pdp__inner {
        padding-top: 32px;
    }

    .sg-pdp__crumbs {
        margin-bottom: 32px;
    }

    .sg-pdp__buy {
        gap: 24px;
    }

    .sg-pdp__rating {
        margin-top: 12px;
    }

    .sg-pdp__tags {
        margin-top: 16px;
    }

    .sg-pdp__short {
        margin-top: 14px;
        padding-bottom: 0;
    }

    .sg-pdp__brand,
    .sg-pdp__title {
        padding-bottom: 0;
    }

    /* №23 Нижняя граница фото = нижняя граница блока с бейджами */
    .sg-pdp__above {
        align-items: stretch;
    }

    .sg-pdp__gallery {
        align-items: stretch;
    }

    .sg-pdp__main-image {
        position: relative;
        aspect-ratio: auto;
        min-height: 560px;
    }

    .sg-pdp__main-image img {
        position: absolute;
        inset: 0;
    }

    /* №20 Вес/Вкус: расстояние подпись → варианты меньше расстояния между блоками */
    .sg-pdp__variants {
        display: flex;
        flex-direction: column;
        gap: 24px;
    }

    .sg-pdp__variant-label {
        margin: 0 0 10px;
        padding: 0;
    }

    .sg-pdp__weights {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(76px, 1fr));
        gap: 8px;
    }

    .sg-pdp__weight {
        min-width: 0;
        padding: 0 6px;
    }

    /* №21 Шрифт цены по макету (Figma: 44) */
    .sg-pdp__prices {
        margin-bottom: 20px;
    }

    .sg-pdp__price {
        font-size: 44px;
        line-height: 1.1;
    }

    /* №26 Вкладки переключаются: виден один раздел */
    .sg-pdp__panel {
        display: none;
    }

    .sg-pdp__panel.is-active {
        display: block;
    }
}

/* №18 Бренд кликабелен */
.sg-pdp__brand-link {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

body.sg-redesign .sg-pdp__brand-link:hover,
body.sg-redesign .sg-pdp__brand-link:focus-visible {
    color: #fbfafa;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* №19 Рейтинг звёздами: заливка пропорциональна оценке */
.sg-pdp__stars {
    font-size: 18px;
    line-height: 1;
    letter-spacing: 3px;
    background: linear-gradient(
        90deg,
        #fbfafa 0,
        #fbfafa var(--sg-rating, 100%),
        rgba(251, 250, 250, 0.22) var(--sg-rating, 100%)
    );
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.sg-pdp__rating-value,
.sg-pdp__rating-count {
    font-size: 16px;
}

/* №22 Бейджи доставки / оригинальности под «Добавить в корзину» (Figma 566:4756) */
.sg-pdp__delivery {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px 16px;
    margin-top: 20px;
    padding: 18px 20px;
    border-radius: 12px;
    background: #131313;
}

.sg-pdp__delivery-item {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.sg-pdp__delivery-icon {
    flex-shrink: 0;
    color: #fbfafa;
}

.sg-pdp__delivery-item p {
    margin: 0;
    padding: 0;
    font-size: 14px;
    line-height: 1.3;
}

.sg-pdp__delivery-item strong {
    font-weight: 500;
}

.sg-pdp__delivery-item span {
    opacity: 0.5;
}

/* №25 Бренд в хлебных крошках — обычная ссылка (ничего дополнительно) */

/* №27 Плашки справа в описании: серый текст на одной вертикали */
.sg-pdp__stats li {
    display: grid;
    grid-template-columns: 96px minmax(0, 1fr);
    column-gap: 16px;
    align-items: center;
}

.sg-pdp__stats strong {
    min-width: 0;
    white-space: nowrap;
}

/* №28 Ключевые эффекты: заголовок → текст заметно ближе, чем цифра → заголовок */
.sg-pdp__benefit-num {
    margin-bottom: 20px;
}

.sg-pdp__benefit h3 {
    margin: 0 0 6px;
    padding: 0;
}

.sg-pdp__benefit p {
    padding: 0;
}

/* №29 Пищевая ценность: «Показатели для вкуса» по центру вертикали, числа по правому краю */
.sg-pdp__nutrition-head-label,
.sg-pdp__nutrition-card p {
    margin: 0;
    padding: 0;
}

.sg-pdp__nutrition-calories p:nth-child(2),
.sg-pdp__nutrition-card-top p:last-child {
    text-align: right;
}

/* если ни у одной строки нет процента — колонка % не занимает место, значения прижаты к правому краю */
.sg-pdp__nutrition-card:not(:has(.sg-pdp__nutrition-row p:nth-child(3):not(:empty))) :is(.sg-pdp__nutrition-calories, .sg-pdp__nutrition-row) {
    grid-template-columns: minmax(0, 1fr) auto 0;
}

/* №30 Применение: структура макета (Figma 585:4870) */
.sg-pdp__application h3 {
    margin: 0 0 12px;
    padding: 0;
}

.sg-pdp__application-how p {
    margin: 0 0 12px;
    padding: 0;
    font-size: 16px;
    line-height: var(--sg-lh-body);
}

.sg-pdp__application-metrics strong {
    font-size: 20px;
    white-space: nowrap;
}

.sg-pdp__application-metrics span {
    padding: 0;
}

.sg-pdp__application-recommendations ul {
    margin: 0;
    padding: 0;
}

/* №31 Характеристики: насыщенность шрифтов (подпись легче значения) */
.sg-pdp__specs dt {
    font-weight: 400;
    color: rgba(251, 250, 250, 0.5);
}

.sg-pdp__specs dd {
    font-weight: 500;
}

/* №32 «С этим товаром покупают»: заголовок + стрелки при >4 товарах */
.sg-pdp__related-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 32px;
}

.sg-pdp__related-head h2 {
    margin: 0;
}

.sg-pdp__related-nav {
    display: flex;
    gap: 8px;
}

.sg-pdp__related-nav[hidden] {
    display: none;
}

.sg-pdp__related-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    padding: 0;
    border: 1px solid rgba(251, 250, 250, 0.3);
    border-radius: 8px;
    background: transparent;
    color: #fbfafa;
    cursor: pointer;
    transition: border-color 0.2s ease, opacity 0.2s ease;
}

.sg-pdp__related-arrow:hover:not(:disabled) {
    border-color: #fbfafa;
}

.sg-pdp__related-arrow:disabled {
    opacity: 0.35;
    cursor: default;
}

/* ---------- СТРАНИЦА /brands/: карточки как на главной + 3D-переворот ---------- */
.sg-brands-page__body {
    padding-bottom: 80px;
}

.sg-brands-page__inner {
    max-width: 1440px;
    margin: 0 auto;
    padding: 0 var(--sg-container-desktop, 80px);
}

.sg-brands-page__grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sg-brands-page__cell {
    margin: 0;
    padding: 0;
}

body.sg-redesign .sg-brands-flip {
    display: block;
    height: 200px;
    perspective: 1000px;
    color: #fbfafa !important;
    text-decoration: none !important;
}

.sg-brands-flip__inner {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.4, 0.2, 0.2, 1);
}

@media (hover: hover) {
    .sg-brands-flip:hover .sg-brands-flip__inner,
    .sg-brands-flip:focus-visible .sg-brands-flip__inner {
        transform: rotateY(180deg);
    }
}

.sg-brands-flip__face {
    position: absolute;
    inset: 0;
    box-sizing: border-box;
    display: flex;
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: 12px;
    background: #131313;
    overflow: hidden;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.sg-brands-flip__front {
    align-items: center;
    justify-content: center;
}

.sg-brands-flip__front .sg-brands__logo {
    width: 68%;
    height: 56%;
}

.sg-brands-flip__back {
    flex-direction: column;
    justify-content: center;
    gap: 10px;
    padding: 20px 24px;
    background: #1a1a1a;
    border-color: rgba(255, 255, 255, 0.12);
    transform: rotateY(180deg);
}

.sg-brands-flip__name {
    font-size: 20px;
    font-weight: 600;
    line-height: 1.15;
    color: #fbfafa;
}

.sg-brands-flip__text {
    display: -webkit-box;
    -webkit-line-clamp: 4;
    -webkit-box-orient: vertical;
    overflow: hidden;
    font-size: 14px;
    font-weight: 400;
    line-height: 1.4;
    color: rgba(251, 250, 250, 0.7);
}

.sg-brands-flip__more {
    margin-top: 2px;
    font-size: 13px;
    font-weight: 500;
    color: #fbfafa;
}

@media (max-width: 1199px) {
    .sg-brands-page__inner {
        padding: 0 var(--sg-container-tablet, 24px);
    }

    .sg-brands-page__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media (max-width: 767px) {
    .sg-brands-page__inner {
        padding: 0 var(--sg-container-mobile, 20px);
    }

    .sg-brands-page__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    body.sg-redesign .sg-brands-flip {
        height: 120px;
    }

    /* на мобильных переворота нет — карточка ведёт сразу на страницу бренда */
    .sg-brands-flip__back {
        display: none;
    }
}


/* ==========================================================================
   ПРАВКИ v2 (Правки v2.pdf)
   ========================================================================== */

/* v2 №1 Главная: кнопка «Открыть энциклопедию» всегда в одну строку.
   Раньше ширина была зафиксирована (339px при padding 40px) - текст не помещался и переносился. */
body.sg-redesign .sg-encyclopedia__btn {
    white-space: nowrap;
}

@media (min-width: 992px) {
    body.sg-redesign .sg-encyclopedia__btn {
        width: auto;
        min-width: 339px;
        flex-shrink: 0;
    }
}

/* v2 №2 Главная, блог: правая колонка по высоте равна левой (по макету).
   Крупная карточка слева = высота сетки; справа две малые карточки делят её пополам
   (метка сверху, заголовок и текст снизу). Только десктоп/планшет-лэндскейп, где сетка в две колонки. */
@media (min-width: 992px) {
    /* высота сетки - не меньше макетной (565px), но растёт, если тексты малых карточек не помещаются */
    .sg-blog__grid,
    .sg-blog__large {
        height: auto;
        min-height: 565px;
    }

    .sg-blog__side {
        display: grid;
        grid-template-rows: minmax(0, 1fr) minmax(0, 1fr);
        gap: 20px;
        min-height: 0;
    }

    .sg-blog__side .sg-blog__small {
        height: auto;
        min-height: 0;
        justify-content: space-between;
        box-sizing: border-box;
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .sg-blog__side .sg-blog__name {
        font-size: 20px;
    }
}

/* v2 №3 О нас: реквизиты - пары строк левой и правой колонок лежат в одном ряду общей сетки,
   поэтому верх и разделительные линии совпадают даже при двухстрочном значении слева. */
dl.sg-about__req-cols {
    margin: 0;
    row-gap: 0;
    align-items: stretch;
}

.sg-about__req-cols .sg-about__req-row {
    align-items: flex-start;
}

.sg-about__req-cols .sg-about__req-row--empty {
    border-bottom: 0;
    padding: 0;
}

@media (max-width: 767px) {
    .sg-about__req-cols .sg-about__req-row {
        order: var(--sg-req-order, 0);
    }

    .sg-about__req-cols .sg-about__req-row--empty {
        display: none;
    }
}

/* v2 №5 Каталог/«С этим покупают»: тип и название - полностью, с переносом строк (без обрезки в 1-2 строки).
   Карточка растёт по содержимому; в ряду сетки все карточки тянутся до самой высокой. */
.sg-catalog__grid > .sg-product-mini {
    height: auto;
    max-height: none;
    min-height: 638px;
}

@media (max-width: 1199px) {
    .sg-catalog__grid > .sg-product-mini {
        min-height: 0;
    }
}

:is(.sg-catalog__grid, .sg-pdp__related-track) .sg-product-mini__title {
    display: block;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    -webkit-box-orient: unset;
    max-height: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: break-word;
    hyphens: manual;
}

:is(.sg-catalog__grid, .sg-pdp__related-track) .sg-product-mini__kind {
    max-height: none;
    overflow: visible;
    text-overflow: clip;
    white-space: normal;
    overflow-wrap: break-word;
    -webkit-line-clamp: unset;
    line-clamp: unset;
    display: block;
}

/* Цена и «в корзину» всегда прижаты к низу карточки, независимо от длины названия */
:is(.sg-catalog__grid, .sg-pdp__related-track) .sg-product-mini__body {
    flex: 1 1 auto;
}

:is(.sg-catalog__grid, .sg-pdp__related-track) .sg-product-mini__info,
:is(.sg-catalog__grid, .sg-pdp__related-track) .sg-product-mini__details {
    flex: 1 1 auto;
}

:is(.sg-catalog__grid, .sg-pdp__related-track) .sg-product-mini__pack {
    margin-top: auto;
}

/* v2 №7 Карточка товара: кликабельна целиком (растянутая ссылка названия),
   название не синеет при наведении/фокусе (глобальное правило темы a:hover - #2112ef). */
.sg-product-mini {
    position: relative;
}

.sg-product-mini__title-link::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* интерактивные элементы остаются поверх растянутой ссылки */
.sg-product-mini__media,
.sg-product-mini__cart-control {
    position: relative;
    z-index: 2;
}

.sg-product-mini__price-row > .sg-product-mini__cart-btn {
    position: relative;
    z-index: 2;
}

body.sg-redesign .sg-product-mini a.sg-product-mini__title-link,
body.sg-redesign .sg-product-mini a.sg-product-mini__title-link:hover,
body.sg-redesign .sg-product-mini a.sg-product-mini__title-link:focus,
body.sg-redesign .sg-product-mini a.sg-product-mini__title-link:active,
body.sg-redesign .sg-product-mini a.sg-product-mini__title-link:visited {
    color: #fbfafa !important;
    text-decoration: none !important;
    opacity: 1;
}

body.sg-redesign .sg-product-mini a.sg-product-mini__title-link:focus-visible::after {
    outline: 2px solid rgba(251, 250, 250, 0.6);
    outline-offset: -2px;
    border-radius: 12px;
}

/* v2 №8 PDP «С этим товаром покупают»: ровно 4 карточки в ряд, остальные - стрелками */
@media (min-width: 1200px) {
    .sg-pdp__related-track {
        grid-auto-columns: calc((100% - 60px) / 4);
    }
}

@media (min-width: 992px) and (max-width: 1199px) {
    .sg-pdp__related-track {
        grid-auto-columns: calc((100% - 40px) / 3);
    }
}

/* v2 №9 PDP: текст панелей - без унаследованных от темы Origami отступов у заголовков/абзацев
   (h*: padding-bottom 21px, p: padding-bottom 9.8px) - иначе «заголовок -> текст» не меньше, чем «абзац -> абзац». */
.sg-pdp__panel-copy :is(h2, h3, h4, h5, h6, p, li) {
    padding-top: 0;
    padding-bottom: 0;
}

.sg-pdp__panel-copy :is(h3, h4, h5) {
    margin: 24px 0 8px;
}

.sg-pdp__panel-copy :is(h3, h4, h5):first-child {
    margin-top: 0;
}

.sg-pdp__panel-copy p {
    margin: 0 0 16px;
}

.sg-pdp__panel-copy p:last-child {
    margin-bottom: 0;
}

/* «Доставка и оплата»: заголовок -> текст 6px, абзац -> следующий подзаголовок 20px */
.sg-pdp__delivery-content :is(h3, h4, p) {
    padding-top: 0;
    padding-bottom: 0;
}

.sg-pdp__delivery-content > div {
    padding: 28px;
}

.sg-pdp__delivery-content h3 {
    margin: 0 0 4px;
    font-size: 20px;
    line-height: 1.2;
}

.sg-pdp__delivery-content section {
    margin-top: 20px;
}

.sg-pdp__delivery-content h3 + section {
    margin-top: 16px;
}

.sg-pdp__delivery-content h4 {
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.2;
}

.sg-pdp__delivery-content p {
    margin: 0;
}

/* v2 №10 PDP «Пищевая ценность»: правая часть (этикетка + состав) начинается на уровне таблицы слева
   (не селектора вкуса) и тянется по высоте таблицы; в «Составе» заголовок -> текст ближе, чем внешний отступ блока.
   Если таблица слева короткая - правая колонка остаётся естественной высоты (align-self: stretch не растягивает выше контента). */
.sg-pdp__nutrition-composition h3,
.sg-pdp__nutrition-composition p {
    padding-top: 0;
    padding-bottom: 0;
}

.sg-pdp__nutrition-composition h3 {
    margin: 0 0 6px;
}

.sg-pdp__nutrition-composition {
    padding: 20px 22px;
    box-sizing: border-box;
}

@media (min-width: 1200px) {
    .sg-pdp__nutrition-grid {
        grid-template-rows: auto auto;
        row-gap: 20px;
        column-gap: 20px;
        align-items: start;
    }

    /* левая колонка «раскладывается» в общую сетку: селектор - в ряд 1, таблица - в ряд 2 */
    .sg-pdp__nutrition-main {
        display: contents;
    }

    .sg-pdp__nutrition-head {
        grid-column: 1;
        grid-row: 1;
    }

    .sg-pdp__nutrition-main > :not(.sg-pdp__nutrition-head) {
        grid-column: 1;
        grid-row: 2;
        align-self: start;
    }

    .sg-pdp__nutrition-side {
        grid-column: 2;
        grid-row: 2;
        align-self: stretch;
    }

    .sg-pdp__nutrition-side .sg-pdp__label-wrap {
        flex: 0 0 auto;
    }

    .sg-pdp__nutrition-side .sg-pdp__nutrition-composition {
        flex: 1 1 auto;
    }
}

@media (max-width: 1199px) {
    .sg-pdp__nutrition-grid {
        grid-template-columns: minmax(0, 1fr);
    }

    .sg-pdp__nutrition-side {
        align-items: stretch;
    }

    .sg-pdp__label-wrap {
        width: 100%;
        max-width: 413px;
    }
}

/* v2 №11 PDP «Характеристики»: две колонки (14 строк -> 7 + 7), порядок по колонкам сверху вниз.
   Число строк в колонке задаёт --sg-specs-rows из разметки. */
@media (min-width: 1200px) {
    .sg-pdp__specs {
        display: grid;
        grid-auto-flow: column;
        grid-template-rows: repeat(var(--sg-specs-rows, 1), auto);
        grid-template-columns: repeat(2, minmax(0, 1fr));
        column-gap: 40px;
        max-width: none;
    }

    .sg-pdp__specs > div {
        grid-template-columns: minmax(120px, 200px) minmax(0, 1fr);
    }
}

/* Мини-карточка на мобильном - Figma Product Card 517:3477 (154×278, Mobile Catalog).
   Применяется в каталоге, бренде, избранном и «С этим товаром покупают». Весь текст выводится целиком
   (перенос строк, без nowrap/ellipsis). Рамка 2px рисуется внутри карточки и перекрывается картинкой
   (как inside-stroke в Figma), поэтому размеры карточки/картинки совпадают с макетом. */
@media (max-width: 767px) {
    .sg-favorites__grid.sg-catalog__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 12px;
    }

    .sg-pdp__related-track {
        grid-auto-columns: 154px;
        gap: 12px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini {
        height: auto;
        min-height: 0;
        max-height: none;
        border: 0;
        border-radius: 10px;
        background: #060606;
        box-shadow: none;
        box-sizing: border-box;
        isolation: isolate;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        border: 2px solid rgba(255, 255, 255, 0.2);
        border-radius: 10px;
        pointer-events: none;
    }

    /* image-area 150 */
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__media {
        height: 150px;
        min-height: 150px;
        flex: 0 0 150px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__labels {
        top: 8px;
        left: 8px;
        gap: 4px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__label {
        min-height: 0;
        padding: 3px 7px;
        border-radius: 4px;
        font-size: 10px;
        font-weight: 500;
        line-height: 1.2;
        white-space: nowrap;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__label--hit {
        background: #060606;
    }

    /* Card Actions: right 8 / top 8, gap 6, кнопки 18×18 (сравнение 20×18), иконки 10px */
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__actions {
        top: 8px;
        right: 8px;
        gap: 6px;
        align-items: flex-start;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__action-btn {
        width: 18px;
        height: 18px;
        padding: 0;
        border: 0;
        border-radius: 4px;
        background: #0a0a0a;
        box-sizing: border-box;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__action-btn:nth-child(2) {
        width: 20px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__action-btn.is-active {
        background: #1f1f1f;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__action-btn .sg-product-mini__action-icon {
        width: 9px;
        height: 9px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__action-btn:nth-child(2) .sg-product-mini__action-icon {
        width: 8px;
        height: 8px;
    }

    /* «избранное» в Figma - иконка с opacity .5, в активном состоянии - полная яркость */
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__action-btn:first-child .sg-product-mini__action-icon {
        opacity: 0.5;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__action-btn.is-active .sg-product-mini__action-icon {
        opacity: 1;
    }

    /* info-area: padding 12/10, gap 10 */
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__body {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        gap: 10px;
        padding: 12px 10px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__info,
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__details {
        flex: 1 1 auto;
        gap: 10px;
        min-width: 0;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__titles {
        gap: 6px;
        min-height: 0;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__pack {
        gap: 4px;
        margin-top: auto;
    }

    /* бренд 11/1.2 Medium, .5 */
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__brand {
        min-height: 0;
        font-size: 11px;
        font-weight: 500;
        line-height: 1.2;
        letter-spacing: 0;
        opacity: 0.5;
        overflow: visible;
        white-space: normal;
        word-break: break-word;
    }

    /* название 13/1.1 SemiBold - полностью, с переносом */
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__title {
        display: block;
        min-height: 0;
        font-size: 13px;
        font-weight: 600;
        line-height: 1.1;
        overflow: visible;
        word-break: break-word;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    /* тип 11/1.1 Regular, .7 */
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__kind {
        display: block;
        min-height: 0;
        font-size: 11px;
        font-weight: 400;
        line-height: 1.1;
        opacity: 0.7;
        overflow: visible;
        white-space: normal;
        text-overflow: clip;
        word-break: break-word;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    /* граммовка/порции и вкус 10/1.3 Regular, .5 - без обрезки */
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__specs {
        min-height: 0;
        font-size: 10px;
        font-weight: 400;
        line-height: 1.3;
        overflow: visible;
        white-space: normal;
        text-overflow: clip;
        word-break: break-word;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__flavor {
        display: flex;
        flex-wrap: wrap;
        align-items: baseline;
        gap: 0 4px;
        min-height: 0;
        font-size: 10px;
        font-weight: 400;
        line-height: 1.3;
        overflow: visible;
        white-space: normal;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__flavor.is-empty {
        display: none;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__flavor-value {
        overflow: visible;
        text-overflow: clip;
        word-break: break-word;
    }

    /* Price Row: цена 16/1.1 SemiBold, кнопка корзины 22×22 */
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__price-row {
        gap: 6px;
        min-height: 22px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__prices {
        gap: 0 6px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__price {
        font-size: 16px;
        font-weight: 600;
        line-height: 1.1;
        white-space: nowrap;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__price-old {
        font-size: 11px;
        line-height: 1.2;
        white-space: nowrap;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__cart-control {
        min-width: 22px;
        height: 22px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__cart-btn {
        width: 22px;
        height: 22px;
        border-radius: 4px;
        box-sizing: border-box;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__cart-btn .sg-product-mini__action-icon {
        width: 10.5px;
        height: 10.5px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__cart-btn__loader::after {
        width: 10px;
        height: 10px;
        border-width: 1.5px;
    }

    /* счётчик после добавления в корзину - тоже в масштабе мобильной карточки */
    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__qty {
        min-width: 0;
        height: 22px;
        gap: 2px;
        padding: 0 3px;
        border-radius: 4px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__qty-btn {
        width: 16px;
        height: 16px;
        font-size: 14px;
    }

    :is(.sg-catalog__grid, .sg-brand-products__grid, .sg-favorites__grid, .sg-pdp__related-track) .sg-product-mini__qty-value {
        min-width: 14px;
        font-size: 11px;
    }
}

/* «Популярные товары» (главная/блог/ингредиенты) на планшете и мобильном: у карточки была жёсткая высота
   (432/479px) и у info-блока фиксированные 233/270px + резервы под 2 строки названия - цена и корзина
   обрезались. Теперь высота по содержимому (минимум - как в макете), текст переносится, а не режется. */
@media (max-width: 991px) {
    body.sg-redesign--home .sg-popular-products {
        height: auto;
    }

    .sg-popular-products__grid {
        height: auto;
        grid-template-rows: none;
        grid-auto-rows: minmax(479px, auto);
    }

    body.sg-redesign .sg-popular-products__grid .sg-product-mini {
        height: auto;
    }

    .sg-popular-products__grid .sg-product-mini__body {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        overflow: visible;
    }

    .sg-popular-products__grid .sg-product-mini__info,
    .sg-popular-products__grid .sg-product-mini__details {
        flex: 1 1 auto;
        min-width: 0;
    }

    .sg-popular-products__grid .sg-product-mini__pack,
    .sg-popular-products__grid .sg-product-mini__price-row {
        margin-top: auto;
    }

    .sg-popular-products__grid .sg-product-mini__titles,
    .sg-popular-products__grid .sg-product-mini__title,
    .sg-popular-products__grid .sg-product-mini__kind {
        min-height: 0;
    }

    .sg-popular-products__grid .sg-product-mini__kind,
    .sg-popular-products__grid .sg-product-mini__specs,
    .sg-popular-products__grid .sg-product-mini__flavor-value {
        overflow: visible;
        white-space: normal;
        text-overflow: clip;
        overflow-wrap: break-word;
    }

    .sg-popular-products__grid .sg-product-mini__flavor.is-empty {
        display: none;
    }
}

@media (max-width: 575px) {
    .sg-popular-products__grid {
        grid-auto-rows: auto;
    }

    body.sg-redesign .sg-popular-products__grid .sg-product-mini {
        flex: 0 0 auto;
    }
}

/* ==========================================================================
   ГЛАВНАЯ — мобильная версия 360 (Figma «Homepage / Mobile · 360», node 416:342)
   Подключается последним, поэтому здесь только точечные правки до пиксель-перфекта.
   Корень проблем: тема Origami даёт h1–h6 / p лишние padding (body h2 {padding: 2rem 0 1.7rem}),
   а desktop-правила без media (новости 180px, блог 340px и т.д.) протекают на мобильный.
   ========================================================================== */

/* вспомогательные элементы: на десктопе/планшете скрыты */
.sg-br-m {
    display: none;
}

.sg-news__date-long {
    display: none;
}

.sg-trust__icon-m {
    display: none;
}

@media (max-width: 575px) {
    .sg-br-m {
        display: inline;
    }

    /* сброс «протечки» стилей Origami (padding у заголовков и абзацев) */
    body.sg-redesign--home .sg-home :is(h1, h2, h3, h4, p),
    body.sg-redesign .sg-footer p {
        padding: 0;
    }

    body.sg-redesign--home :is(.sg-section-head__title, .sg-categories__title, .sg-brands__title, .sg-news__title, .sg-blog__title) {
        margin: 0;
        padding: 0;
    }

    /* --- Hero (429:637): заголовок на 148px от верха слайда, текст без «полей» --- */
    body.sg-redesign--home .sg-hero__content {
        top: 148px;
    }

    body.sg-redesign--home .sg-hero__title {
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    /* --- Популярные товары (429:638): карточка 320×432, обводка 2px внутри --- */
    body.sg-redesign--home .sg-popular-products__mobile-link,
    body.sg-redesign--home .sg-categories__link--bottom {
        display: block;
        height: 19px;
        line-height: 19px;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini {
        position: relative;
        isolation: isolate;
        display: flex;
        flex-direction: column;
        flex: 0 0 auto;
        height: auto;
        min-height: 432px;
        box-sizing: border-box;
        border: 0;
        border-radius: 12px;
        background: #060606;
        overflow: hidden;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini::before {
        content: "";
        position: absolute;
        inset: 0;
        z-index: -1;
        border: 2px solid rgba(255, 255, 255, 0.2);
        border-radius: 12px;
        pointer-events: none;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__media {
        flex: 0 0 219px;
        height: 219px;
        min-height: 219px;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__actions {
        top: 16px;
        right: 8px;
        gap: 8px;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__body {
        flex: 1 1 auto;
        height: auto;
        min-height: 0;
        padding: 24px 16px;
        gap: 20px;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__info {
        flex: 0 0 auto;
        gap: 20px;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__details {
        flex: 0 0 auto;
        gap: 16px;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__titles {
        gap: 12px;
        min-height: 0;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__brand {
        min-height: 0;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.2;
        letter-spacing: 0;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__title {
        min-height: 0;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.1;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__kind {
        min-height: 0;
        font-size: 16px;
        font-weight: 400;
        line-height: 1.1;
        opacity: 1;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__specs {
        min-height: 0;
        margin: 0;
        font-size: 13px;
        font-weight: 400;
        line-height: 1.3;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__price-row {
        width: 296px;
        max-width: none;
        height: 40px;
        min-height: 40px;
        margin-top: auto;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__price {
        font-size: 16px;
        font-weight: 600;
        line-height: 1.1;
        letter-spacing: 0;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__cart-control {
        width: 32px;
        min-width: 32px;
        height: 32px;
    }

    /* --- Категории (430:738): плитки 154×180, без обводки (кроме «Аксессуаров»), без градиента --- */
    body.sg-redesign--home .sg-categories__card {
        border: 0;
    }

    body.sg-redesign--home .sg-categories__card--bordered {
        border: 1px solid rgba(255, 255, 255, 0.06);
    }

    body.sg-redesign--home .sg-categories__overlay {
        display: none;
    }

    body.sg-redesign--home .sg-categories__content,
    body.sg-redesign--home .sg-categories__name,
    body.sg-redesign--home .sg-categories__desc {
        overflow: visible;
    }

    body.sg-redesign--home .sg-categories__name {
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    /* перебиваем container-query размер из «№1 Категории» (на 154px плитке он давал 5px) */
    body.sg-redesign--home .sg-categories__desc {
        font-size: 13px;
        line-height: 1.3;
    }

    body.sg-redesign--home .sg-categories__image[src*="supplements"] {
        object-position: 80% 50%;
    }

    /* --- Бренды (435:1161): логотип занимает всю область 70×70 внутри плитки 98×98 --- */
    body.sg-redesign--home .sg-brands__logo {
        width: 100%;
        height: 100%;
    }

    /* --- Разделители (443:1626…): линия 312px от x=24; после «Trust» и «Блога» отступ 50 сверху / 100 снизу --- */
    body.sg-redesign--home .sg-divider span {
        width: 100%;
    }

    body.sg-redesign--home .sg-divider--md,
    body.sg-redesign--home .sg-blog + .sg-divider {
        padding: 50px 24px 100px;
    }

    /* --- Энциклопедия (435:1373): заголовок → текст → карточки → кнопка --- */
    body.sg-redesign--home .sg-encyclopedia__inner {
        gap: 0;
    }

    body.sg-redesign--home .sg-encyclopedia__left {
        display: contents;
    }

    body.sg-redesign--home .sg-encyclopedia__eyebrow {
        order: 1;
        margin: 0;
        font-size: 18px;
        line-height: 23px;
        letter-spacing: 5px;
    }

    body.sg-redesign--home .sg-encyclopedia__title {
        order: 2;
        margin: 24px 0 0;
        font-size: 28px;
        font-weight: 600;
        line-height: 1.05;
    }

    body.sg-redesign--home .sg-encyclopedia__text {
        order: 3;
        margin: 16px 0 0;
        font-size: 15px;
        line-height: 1.2;
        color: #fbfafa;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    body.sg-redesign--home .sg-encyclopedia__cards {
        order: 4;
        gap: 12px;
        margin-top: 32px;
    }

    body.sg-redesign--home .sg-encyclopedia__card {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 8px;
        height: 74px;
        box-sizing: border-box;
        padding: 0 16px;
        border-radius: 6px;
    }

    body.sg-redesign--home .sg-encyclopedia__card-title {
        font-size: 16px;
        font-weight: 600;
        line-height: 1.1;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    body.sg-redesign--home .sg-encyclopedia__card-text {
        font-size: 16px;
        line-height: 1.1;
        color: #fbfafa;
        opacity: 1;
    }

    body.sg-redesign--home .sg-encyclopedia__btn {
        order: 5;
        align-self: stretch;
        height: 55px;
        margin: 32px 0 0;
        padding: 10px 24px;
        border: 1px solid #fbfafa;
        border-radius: 4px;
        font-size: 16px;
        font-weight: 500;
        line-height: 1.1;
        letter-spacing: 1px;
        white-space: nowrap;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    /* --- Trust bar (435:1391): иконки из Figma, текст 16px, слова ломаются как в макете --- */
    body.sg-redesign--home .sg-trust__item {
        gap: 16px;
        padding: 8px 0;
    }

    body.sg-redesign--home .sg-trust__icon {
        display: flex;
        justify-content: center;
        width: auto;
        height: 30px;
        margin: 0;
    }

    body.sg-redesign--home .sg-trust__icon svg {
        display: none;
    }

    body.sg-redesign--home .sg-trust__icon-m {
        display: block;
        width: auto;
        height: 30px;
    }

    body.sg-redesign--home .sg-trust__texts {
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 8px;
        width: 100%;
    }

    body.sg-redesign--home .sg-trust__title {
        margin: 0;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.1;
        text-align: center;
        overflow-wrap: anywhere;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    body.sg-redesign--home .sg-trust__text {
        margin: 0;
        font-size: 16px;
        font-weight: 400;
        line-height: 1.1;
        color: #fbfafa;
        text-align: center;
        overflow-wrap: anywhere;
    }

    /* --- Новости (435:1414): карточка 320×303, дата словами --- */
    body.sg-redesign--home .sg-news__date-num {
        display: none;
    }

    body.sg-redesign--home .sg-news__date-long {
        display: inline;
    }

    body.sg-redesign--home .sg-news__card {
        border: 0;
        border-radius: 8px;
        background: #131313;
        overflow: hidden;
    }

    body.sg-redesign--home .sg-news__media {
        flex: 0 0 200px;
        height: 200px;
    }

    body.sg-redesign--home .sg-news__info {
        display: flex;
        flex-direction: column;
        gap: 12px;
        height: auto;
        padding: 16px 16px 24px;
    }

    body.sg-redesign--home .sg-news__date {
        margin: 0;
        font-size: 13px;
        line-height: 1.3;
        font-weight: 400;
        letter-spacing: 0;
        text-transform: none;
        color: rgba(251, 250, 250, 0.5);
    }

    body.sg-redesign--home .sg-news__name {
        margin: 0;
        padding: 0;
        font-size: 14px;
        font-weight: 500;
        line-height: 1.2;
        letter-spacing: -0.28px;
    }

    body.sg-redesign--home .sg-news__name a {
        font-size: inherit;
        font-weight: inherit;
        line-height: inherit;
        letter-spacing: inherit;
    }

    /* --- Блог (450:894): карточки по 6px, без рамок; малые — 195 и 149px --- */
    body.sg-redesign--home .sg-blog__grid,
    body.sg-redesign--home .sg-blog__side {
        gap: 20px;
    }

    body.sg-redesign--home :is(.sg-blog__large, .sg-blog__small) {
        border: 0;
        border-radius: 6px;
        background: #131313;
        overflow: hidden;
    }

    body.sg-redesign--home .sg-blog__large-media {
        flex: 0 0 180px;
        height: 180px;
        min-height: 180px;
    }

    body.sg-redesign--home .sg-blog__large-info,
    body.sg-redesign--home .sg-blog__small {
        display: flex;
        flex-direction: column;
        gap: 0;
        padding: 24px 16px;
    }

    body.sg-redesign--home .sg-blog__small:first-child {
        min-height: 195px;
    }

    body.sg-redesign--home .sg-blog__small:last-child {
        min-height: 149px;
        padding: 16px;
    }

    body.sg-redesign--home .sg-blog__tag {
        margin: 0 0 16px;
        font-size: 13px;
        font-weight: 400;
        line-height: 1.3;
        letter-spacing: 0;
        text-transform: none;
        color: rgba(251, 250, 250, 0.5);
    }

    body.sg-redesign--home .sg-blog__small:last-child .sg-blog__tag {
        margin-bottom: 8px;
    }

    body.sg-redesign--home .sg-blog__small-body {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin: 0;
        padding: 0;
    }

    body.sg-redesign--home .sg-blog__small:last-child .sg-blog__small-body {
        gap: 8px;
    }

    body.sg-redesign--home .sg-blog__name {
        margin: 0 0 12px;
        padding: 0;
        font-size: 16px;
        font-weight: 600;
        line-height: 1.1;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    body.sg-redesign--home .sg-blog__small-body .sg-blog__name {
        margin: 0;
    }

    body.sg-redesign--home .sg-blog__name a {
        font-size: inherit;
        font-weight: inherit;
        line-height: inherit;
    }

    body.sg-redesign--home .sg-blog__excerpt {
        margin: 0;
        padding: 0;
        font-size: 16px;
        font-weight: 400;
        line-height: 1.1;
        color: #fbfafa;
    }

    /* --- Подписка (437:1277): блок 320×502, радиус 6, без рамки; чекбокс 14×14 --- */
    body.sg-redesign--home .sg-subscribe__box {
        border: 0;
        border-radius: 6px;
    }

    body.sg-redesign--home .sg-subscribe__title {
        margin: 0 0 16px;
        font-size: 28px;
        line-height: 1.05;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    body.sg-redesign--home .sg-subscribe__text {
        font-size: 16px;
        line-height: 1.1;
        color: #fbfafa;
    }

    body.sg-redesign--home .sg-subscribe__input {
        padding: 0 18px;
        border: 1px solid rgba(95, 93, 93, 0.4);
        background: #131313;
        font-size: 16px;
        line-height: 1.1;
    }

    body.sg-redesign--home .sg-subscribe__input::placeholder {
        color: rgba(251, 250, 250, 0.35);
        opacity: 1;
    }

    body.sg-redesign--home .sg-subscribe__btn {
        padding: 10px 24px;
        font-size: 16px;
        font-weight: 500;
        line-height: 1.1;
        letter-spacing: 1px;
    }

    body.sg-redesign--home .sg-subscribe__check {
        align-items: center;
        gap: 10px;
        font-size: 13px;
        line-height: 1.3;
        color: #fbfafa;
    }

    body.sg-redesign--home .sg-subscribe__check span {
        font-size: 13px;
        line-height: 1.3;
        color: #fbfafa;
    }

    body.sg-redesign--home input.sg-subscribe__checkbox {
        -webkit-appearance: none;
        appearance: none;
        position: static;
        display: block;
        flex: 0 0 14px;
        width: 14px;
        min-width: 14px;
        height: 14px;
        margin: 0;
        padding: 0;
        border: 1px solid #5f5d5d;
        border-radius: 2px;
        background: transparent;
        opacity: 1;
        cursor: pointer;
    }

    body.sg-redesign--home input.sg-subscribe__checkbox:checked {
        border-color: #fbfafa;
        background: #fbfafa url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14' fill='none' stroke='%230a0a0a' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M3 7.2l2.6 2.6L11 4.4'/%3E%3C/svg%3E") center / 100% 100% no-repeat;
    }

    /* --- Footer (437:1289): шаг ссылок 29px, заголовки без «воздуха», контакты по центру --- */
    /* бренд-блок в макете: 316px по центру колонки (на 360 — отступ 2px слева), на любой ширине — по центру */
    body.sg-redesign .sg-footer__brand {
        align-self: center;
        max-width: 100%;
        margin-left: 0;
    }

    body.sg-redesign .sg-footer__tagline {
        max-width: 100%;
    }

    body.sg-redesign .sg-footer__brand-name {
        line-height: 20px;
    }

    body.sg-redesign .sg-footer__tagline,
    body.sg-redesign .sg-footer__copy,
    body.sg-redesign .sg-footer__payments {
        font-size: 13px;
        line-height: 17px;
    }

    body.sg-redesign .sg-footer__title {
        margin: 0 0 14px;
        padding: 0;
        font-size: 13px;
        font-weight: 500;
        line-height: 1.4;
        letter-spacing: 0.91px;
        text-box-trim: trim-both;
        text-box-edge: cap alphabetic;
    }

    body.sg-redesign .sg-footer__col--contacts .sg-footer__title {
        margin-bottom: 12px;
    }

    body.sg-redesign .sg-footer__links {
        display: flex;
        flex-direction: column;
        gap: 12px;
        margin: 0;
        padding: 0;
    }

    body.sg-redesign .sg-footer__links li {
        height: auto;
        min-height: 0;
        margin: 0;
        padding: 0;
        line-height: 1.3;
    }

    body.sg-redesign .sg-footer__links a {
        display: block;
        font-size: 13px;
        line-height: 1.3;
    }

    body.sg-redesign .sg-footer__contacts {
        gap: 10px;
    }

    body.sg-redesign .sg-footer__contacts :is(a, span) {
        font-size: 13px;
        font-weight: 400;
        line-height: 1.3;
    }
}

/* ГЛАВНАЯ — мобильная: резиновая сетка для 361–575px (макет Figma только 360; на 360 значения совпадают с макетом) */
@media (max-width: 575px) {
    body.sg-redesign--home .sg-popular-products__grid .sg-product-mini__price-row {
        width: calc(100% + 8px);
    }

    body.sg-redesign--home .sg-trust__inner {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    body.sg-redesign--home .sg-subscribe__intro,
    body.sg-redesign--home .sg-subscribe__form {
        width: calc(100% - 48px);
    }

    body.sg-redesign--home .sg-subscribe__check,
    body.sg-redesign--home .sg-subscribe__btn {
        width: 100%;
    }
}

@media (min-width: 361px) and (max-width: 575px) {
    body.sg-redesign--home .sg-brands__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        grid-auto-rows: auto;
    }

    body.sg-redesign--home .sg-brands__item {
        width: auto;
        height: auto;
        aspect-ratio: 1;
    }
}