/* Мини-корзина в шапке (frontend/views/blocks/basket.php, _mini_cart.php). Корень сайта — 10px, размеры в rem. */
.mini-cart {
    position: absolute;
    top: 100%;
    right: 0;
    z-index: 11;
    display: none;
    flex-direction: column;
    width: 38rem;
    max-width: calc(100vw - 2rem);
    max-height: calc(100vh - 12rem);
    margin-top: 29px;
    margin-right: 1rem;
    background: #fff;
    border-radius: 0.6rem;
    box-shadow: 0 1rem 3rem rgba(40, 44, 80, 0.18);
    font: 1.4rem/1.35 'Proxima Nova', sans-serif;
    color: #282c50;
    text-align: left;
}

.header .topCart.open .mini-cart {
    display: flex;
}

/* Идёт запрос: повторные клики не уходят, вид не меняется (затемнение на каждый клик мигало). */
.mini-cart.is-busy {
    pointer-events: none;
}

/* Запрос дольше ~250 мс — тонкая полоса загрузки сверху (cart-modal.js: is-loading). */
.mini-cart::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1;
    width: 0;
    height: 3px;
    border-radius: 0.6rem 0.6rem 0 0;
    background: #518dcf;
    opacity: 0;
    pointer-events: none;
}

.mini-cart.is-loading::before {
    opacity: 1;
    animation: mini-cart-progress 1.1s ease-in-out infinite;
}

@keyframes mini-cart-progress {
    0% { left: 0; width: 0; }
    50% { left: 15%; width: 70%; }
    100% { left: 100%; width: 0; }
}

.mini-cart__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 1.4rem 1.6rem;
    border-bottom: 1px solid #eef0f4;
}

.mini-cart__title {
    font-size: 1.5rem;
}

.mini-cart__clear,
.mini-cart__remove,
.mini-cart__step {
    border: 0;
    background: none;
    font: inherit;
    color: inherit;
    cursor: pointer;
}

.mini-cart__clear {
    font-size: 1.3rem;
    color: #8a8fa8;
}

.mini-cart__clear:hover {
    color: #d9534f;
}

.mini-cart__lines {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
}

.mini-cart__empty {
    padding: 3rem 1.6rem;
    text-align: center;
    color: #8a8fa8;
    font-size: 1.3rem;
}

.mini-cart__empty .fas {
    display: block;
    margin-bottom: 1rem;
    font-size: 3.4rem;
    color: #c9c9c9;
}

.mini-cart__empty-title {
    margin-bottom: 0.4rem;
    font-size: 1.5rem;
    color: #282c50;
}

.mini-cart__line {
    display: grid;
    grid-template-columns: 6.4rem 1fr auto;
    gap: 1.2rem;
    padding: 1.4rem 1.6rem;
    border-bottom: 1px solid #eef0f4;
}

.mini-cart__image {
    display: block;
    width: 6.4rem;
    height: 6.4rem;
}

.mini-cart__image img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.mini-cart__info {
    min-width: 0;
}

.mini-cart__name {
    display: block;
    font-weight: 600;
    color: #282c50;
    text-decoration: none;
    overflow-wrap: anywhere;
}

a.mini-cart__name:hover {
    color: #518dcf;
}

.mini-cart__measure {
    margin-top: 0.2rem;
    font-size: 1.2rem;
    color: #8a8fa8;
}

.mini-cart__handlings {
    margin-top: 0.6rem;
}

.mini-cart__handling {
    display: flex;
    align-items: center;
    gap: 0.6rem;
    font-size: 1.2rem;
    cursor: pointer;
}

.mini-cart__qty {
    display: inline-flex;
    align-items: center;
    margin-top: 0.8rem;
    border: 1px solid #dfe2ea;
    border-radius: 2rem;
}

.mini-cart__step {
    width: 3rem;
    height: 3rem;
    font-size: 1.8rem;
    line-height: 1;
}

.mini-cart__step:hover {
    color: #518dcf;
}

.mini-cart__count {
    min-width: 2.4rem;
    text-align: center;
    font-weight: 600;
}

.mini-cart__side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.4rem;
    white-space: nowrap;
}

.mini-cart__remove {
    font-size: 2rem;
    line-height: 1;
    color: #c0c4d2;
}

.mini-cart__remove:hover {
    color: #d9534f;
}

.mini-cart__price {
    font-weight: 600;
}

.mini-cart__foot {
    padding: 1.2rem 1.6rem 1.6rem;
    border-top: 1px solid #eef0f4;
}

.mini-cart__row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0;
}

.mini-cart__row--total {
    margin-top: 0.4rem;
    font-size: 1.7rem;
    font-weight: 700;
}

.mini-cart__row--bonus {
    font-size: 1.3rem;
    color: #3c9a5f;
}

.mini-cart__hint {
    margin-top: 0.8rem;
    padding: 0.8rem 1rem;
    border-radius: 0.4rem;
    background: #f3f7fc;
    font-size: 1.3rem;
}

.mini-cart__checkout,
.mini-cart__to-basket {
    display: block;
    margin-top: 1rem;
    padding: 1.2rem;
    border-radius: 2.4rem;
    text-align: center;
    text-decoration: none;
    font-weight: 600;
}

.mini-cart__checkout {
    background: #518dcf;
    color: #fff;
}

.mini-cart__checkout:hover {
    background: #3f78b8;
    color: #fff;
}

.mini-cart__to-basket {
    margin-top: 0.4rem;
    padding: 0.6rem;
    color: #518dcf;
}

.mini-cart__body,
.mini-cart__checkout-step {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-height: 0;
}

.mini-cart__body[hidden],
.mini-cart__checkout-step[hidden] {
    display: none;
}

.mini-cart__back {
    border: 0;
    background: none;
    font: inherit;
    color: #518dcf;
    cursor: pointer;
}

.mini-cart__checkout-scroll {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    padding: 1.2rem 1.6rem 1.6rem;
}

/* Шаг оформления — панель справа на всю высоту окна: адрес, оплата, итоги не помещаются в выпадающий блок. */
/* У .topCart в теме z-index: 10 и position: relative — свой слой: без подъёма открытая мини-корзина остаётся под
   плавающей кнопкой чата Bitrix24 (z-index 10150). */
.header .topCart.open {
    z-index: 10200;
}

.header .topCart.open .mini-cart.is-checkout {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: 48rem;
    max-width: 100vw;
    max-height: none;
    margin: 0;
    border-radius: 0;
    z-index: 10200;
}

.mini-checkout label,
.mini-checkout .od-label {
    display: block;
    margin-bottom: 0.6rem;
    font: 600 1.3rem/1.3 'Proxima Nova', sans-serif;
    color: #282c50;
}

.mini-checkout select,
.mini-checkout .promoCode input {
    width: 100%;
    height: 4rem;
    padding: 0 1.2rem;
    border: 1px solid #dfe2ea;
    border-radius: 0.6rem;
    background: #fff;
    font: 1.4rem 'Proxima Nova', sans-serif;
    color: #282c50;
}

.mini-checkout .col {
    margin-bottom: 1rem;
}

.mini-checkout .promoCode {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 0.8rem;
    align-items: center;
    margin-bottom: 1rem;
}

.mini-checkout .promoCode label {
    grid-column: 1 / -1;
    margin: 0;
}

.mini-checkout .promoCode .btn_Form {
    height: 4rem;
    padding: 0 1.8rem;
    line-height: 4rem;
}

.mini-checkout .checkbox-bonus {
    margin-top: 1rem;
}

.mini-checkout .bonus-switcher {
    display: flex;
    align-items: center;
    gap: 1rem;
    cursor: pointer;
}

.mini-checkout .bonus-title {
    font-size: 1.4rem;
}

.mini-checkout .od-input--area {
    font-size: 1.4rem;
}

.mini-checkout__section {
    padding-bottom: 1.2rem;
    margin-bottom: 1.2rem;
    border-bottom: 1px solid #eef0f4;
}

.mini-checkout .cartLine {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.3rem 0;
}

.mini-checkout .cartLine.hidden,
.mini-checkout .discount-block.hidden,
.mini-checkout .delivery-line.hidden {
    display: none;
}

.mini-checkout .basket_sum_full {
    font-size: 1.7rem;
    font-weight: 700;
}

.mini-checkout .btn_Form.send {
    width: 100%;
    margin-top: 1rem;
}

.mini-checkout__full {
    display: block;
    margin-top: 0.8rem;
    text-align: center;
    color: #518dcf;
}

@media all and (max-width: 767px) {
    .mini-cart {
        position: fixed;
        top: auto;
        bottom: 0;
        left: 0;
        right: 0;
        width: auto;
        max-width: none;
        max-height: 85vh;
        margin: 0;
        border-radius: 1.2rem 1.2rem 0 0;
        /* Выше плавающей кнопки чата Bitrix24 (z-index 10150): иначе она закрывает «Оформить заказ». */
        z-index: 10200;
    }

    .header .topCart.open .wrapperClick:after {
        display: none;
    }
}

/* Сообщения (ошибки оформления, промокод) — поверх открытой мини-корзины и её шага оформления. */
#growls {
    z-index: 10300;
}
