/* Маркетплейс-кнопки (Ozon + WB). Подключается только для администратора. */
.mp-buttons {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    margin: 8px 0;
}

.mp-buttons .mp-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    background: none;
    line-height: 0;
    text-decoration: none;
    transition: transform .15s ease, opacity .15s ease;
}

.mp-buttons .mp-btn:hover {
    opacity: .88;
    transform: translateY(-1px);
}

.mp-buttons .mp-btn img {
    display: block;
    height: 44px;
    width: auto;
    border-radius: 8px;
}

/* В маленькой карточке избранного — кнопки компактнее и в столбик */
.good_add .mp-buttons {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
}

.good_add .mp-buttons .mp-btn img {
    height: 34px;
}

/* На странице товара кнопки крупнее и по центру */
[data-entity="main-button-container"] {
    text-align: center;
}

[data-entity="main-button-container"] .mp-buttons {
    justify-content: center;
}

[data-entity="main-button-container"] .mp-buttons .mp-btn img {
    height: 52px;
}

/* Каталог: цена и кнопки в одну строку (формируется в mp-buttons.js) */
.mp-price-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 12px;
    /* отступ от названия товара, иначе скидочный бейдж налезает на блок */
    margin-top: 18px;
}

/* При скидке старая цена встаёт над новой в один столбец.
   !important — чтобы перебить мобильные media-запросы темы, у которых
   выше специфичность, и столбик держался на всех разрешениях. */
.mp-price-row [data-entity="price-block"] {
    display: flex !important;
    flex-direction: column !important;
    align-items: center;
    justify-content: center;
    line-height: 1.15;
    margin: 0;
}

.mp-price-row .product-item-price-old,
.mp-price-row .product-item-price-current {
    display: block;
}

/* В карточке каталога пара кнопок в один ряд справа от цены */
.mp-price-row .mp-buttons {
    flex-direction: row;
    flex-wrap: nowrap; /* две кнопки всегда в строку, не сваливаются в столбик */
    align-items: center;
    gap: 6px;
    margin: 0;
}

.mp-price-row .mp-buttons .mp-btn img {
    height: 36px;
}

/* На мобильных (≤575px) держим цену и кнопки в одной строке:
   цена — столбиком и прижата к левому краю, кнопки — в строку, к правому. */
@media (max-width: 575px) {
    .mp-price-row {
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 8px;
    }

    .mp-price-row [data-entity="price-block"] {
        align-items: flex-start;      /* старая/новая цена прижаты влево */
        text-align: left !important;  /* перебиваем .text-center темы */
        flex-shrink: 1;
        min-width: 0;
    }

    .mp-price-row .mp-buttons {
        margin-left: auto;            /* прижимаем кнопки к правому краю */
        flex-shrink: 0;               /* кнопки не сжимаем, место отдаёт цена */
        gap: 4px;
    }
}

/* На самых узких экранах дополнительно уменьшаем кнопки, чтобы влезли в строку. */
@media (max-width: 360px) {
    .mp-price-row .mp-buttons .mp-btn img {
        height: 28px;
    }
}
