/* ============= Глобальные цвета ============= */
:root {
    --color-gold-light: #FFF5BC;      /* используется: текст кнопки, текст бонусов */
    --color-green-dark: #466300;      /* используется: обводка текста, старая цена */
    --color-strike-red: rgba(255, 55, 0, 1);  /* зачеркивание */
    --color-sand-border: #E0AF7D;     /* рамка и тень */
    --color-sand-bg: #F8D49D;         /* фон бонусной карточки */
    --color-brown-stroke: #923B09;    /* обводка текста бонусов */
}

/* ============= Зеленая кнопка с старой ценой ============= */
.greenButton {
    background-image: url("./img/longGreen_buttonWhiteBorder.c3374546b783.png");
    background-repeat: no-repeat;
    background-position: center;
    background-size: 100% 100%;

    width: 100%;
    height: 100%;

    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

    .greenButtonText {
        margin-top: -2px;
        padding-left: 10px;
        position: relative;

        color: var(--color-gold-light);
        font-size: 26px;
        line-height: 25.2px;

        -webkit-text-stroke: 1.19px var(--color-green-dark);
        font-family: 'Domovyata', 'Verdana', sans-serif;
        font-weight: 900;
    }

    .greenButtonOldPrice {
        width: 65px;
        color: var(--color-green-dark);
        font-size: 16px;
        line-height: 100%;
        font-weight: 900;
        position: relative;
        text-decoration: none;
        text-align: center;
        white-space: nowrap
    }

    .greenButtonOldPrice::before {
        content: '';
        width: 65px;
        position: absolute;
        height: 2px;
        background-color: var(--color-strike-red);
        top: 35%;
        left: 0;
        transform: rotate(-9deg);
        border-radius: 30px;
        z-index: 5;
    }
}

/* ============= Кнопка закрытия ============= */
.closeButton {
    width: 39px;
    height: 39px;
    cursor: pointer;
    border: 0;
    margin: 0;
    padding: 0;
    display: block;
    outline: none;
    -webkit-tap-highlight-color: transparent;

    background: transparent url("img/btn_close.865f4ddac015.png") no-repeat center center ;
    background-size: cover;

    position: absolute;
    top: 7px;
    right: 8px;

    img {
        width: 100%;
    }

    .closeButton:active {
        background-color: transparent;
    }
    .closeButton:focus  {
        background-color: transparent;
    }
}

/* ============= Карточка Бустеров ============= */
.salesCardBonusWrapper {
    border: 2px solid var(--color-sand-border);
    background-color: var(--color-sand-bg);
    border-radius: 10px;
    width: 100%;
    height: 89px;
    margin-right: 3px;
    padding: 2px;

    display: flex;
    flex-direction: column;
    justify-content: center;

    -webkit-box-shadow: 0px -2px 0px 0px var(--color-sand-border);
    -moz-box-shadow: 0px -2px 0px 0px var(--color-sand-border);
    box-shadow: 0px -2px 0px 0px var(--color-sand-border);

    /* Если внутри только один .salesCardBonusRow — добавляем padding-top */
    &:has(.salesCardBonusRow:only-child) {
        padding-top: 10px;
    }

    .salesCardBonusRow {
        width: 100%;
        height: 100%;

        display: flex;
        justify-content: space-around;
        align-items: center;
        flex-direction: row; /* по умолчанию строка */

        /* Если есть salesCardBonusTimerWrapper — делаем колонку */
        &:has(.salesCardBonusTimerWrapper) {
            flex-direction: column;
            justify-content: space-between;
        }

        /* Если есть два salesCardBonus — строка (переопределяем на случай, если оба условия) */
        &:has(.salesCardBonus):has(.salesCardBonus):not(:has(.salesCardBonusTimerWrapper)) {
            flex-direction: row;
            gap: 0;
        }

        .salesCardBonus {
            position: relative;

            .salesCardBonusCounts {
                font-size: 17.41px;
                line-height: 16.8px;

                color: var(--color-gold-light);
                -webkit-text-stroke: 1.09px var(--color-brown-stroke);

                position: absolute;
                bottom: 0;
                right: 0;

                background-color: orange;
            }
        }

        .salesCardBonusTimerWrapper {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 5px;

            .salesCardBonusTimer {
                font-size: 17.41px;
                line-height: 16.8px;

                color: var(--color-gold-light);
                -webkit-text-stroke: 1.09px var(--color-brown-stroke);
            }
        }
    }
}

/* Блок с Бустерами для Попапа самобранки  */
.parent {
    width: 167px;
    height: 90px;
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;

    /* Общие стили дочерних блоков: центрирование содержимого */
    .child {
        display: flex;
        align-items: center;
        justify-content: center;

        font-weight: bold;
        font-size: 16px;
    }

    /* 1 блок: на всю ширину и высоту */
    &:has(> .child:only-child) > .child {
        width: 86px;
        height: 75px;
    }

    /* 2 или 3 блока: горизонтально, равная ширина, полная высота */
    &:has(> .child:first-child:nth-last-child(2)),
    &:has(> .child:first-child:nth-last-child(3)) {
        flex-direction: row;
        flex-wrap: nowrap;
        gap: 2px;  /* было 4px */
        padding: 2px;  /* было 4px */
    }

    &:has(> .child:first-child:nth-last-child(2)) > .child {
        width: calc(45% - 1px);
        height: 70px;

        .boosterCountsCommon {
            font-size: 23px;
        }
    }
    &:has(> .child:first-child:nth-last-child(3)) > .child {
        flex: 1;
        height: 54px;

        .boosterCountsCommon {
            font-size: 20px;
            -webkit-text-stroke: 1.42px #891906;
        }
    }

    /* 4 блока: 2 строки, равная ширина и высота */
    &:has(> .child:first-child:nth-last-child(4)) {
        gap: 2px;
        padding: 2px;
        justify-content: center;
        align-items: center;
        flex-wrap: wrap;
    }

    &:has(> .child:first-child:nth-last-child(4)) > .child {
        width: calc(35% - 1px);
        flex: 0 0 auto;
        height: calc(50% - 1px);

        .boosterCountsCommon {
            font-size: 18px;
            -webkit-text-stroke: 1.14px #891906;
        }
    }

    .booster {
        height: 100%;
        width: 100%;

        position: relative;
        display: flex;
        justify-content: center;
        align-items: center;

        .boosterCountsCommon {
            color: #FFF5BC;
            letter-spacing: 0;
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);

            font-size: 32.93px;
            -webkit-text-stroke: 1.55px #891906;
        }
    }
}